<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>… because it’s about time I got a “blog.”</description><title>It's salt</title><generator>Tumblr (3.0; @seliopou)</generator><link>http://seliopou.tumblr.com/</link><item><title>HTTP or WWW</title><description>&lt;p&gt;I don&amp;#8217;t see why the &lt;a href="http://www.chromium.org/"&gt;Chromium&lt;/a&gt; developers decided remove the &amp;#8220;http://&amp;#8221; in the URL bar in favor of &lt;a href="http://code.google.com/p/chromium/issues/detail?id=41467"&gt;a globe icon&lt;/a&gt;. Clearly &lt;i&gt;something&lt;/i&gt; in the URL should be replaced with an image, since images are what people &lt;i&gt;get&lt;/i&gt;. But why the &amp;#8220;http://&amp;#8221;?&lt;/p&gt;

&lt;p&gt;What &lt;i&gt;should&lt;/i&gt; have been replaced with the globe icon is the WWW in URLs. Since WWW, last I checked back in 1996, stood for &lt;b&gt;&lt;i&gt;World&lt;/i&gt; Wide Web&lt;/b&gt;, this would make total sense. Not only that, it also avoids all those &lt;a href="http://code.google.com/p/chromium/issues/detail?id=41489"&gt;copy&lt;/a&gt; &lt;a href="http://code.google.com/p/chromium/issues/detail?id=41490"&gt;and&lt;/a&gt; &lt;a href="http://code.google.com/p/chromium/issues/detail?id=41493"&gt;paste&lt;/a&gt; bugs people are complaining about.&lt;/p&gt;

&lt;p&gt;I think the Chromium developers made a huge mistake.&lt;/p&gt;</description><link>http://seliopou.tumblr.com/post/533280122</link><guid>http://seliopou.tumblr.com/post/533280122</guid><pubDate>Mon, 19 Apr 2010 09:53:00 -0400</pubDate><category>comments</category></item><item><title>Athens convered by snow</title><description>&lt;a href="http://www.odditycentral.com/pics/athens-covered-by-snow.html"&gt;Athens convered by snow&lt;/a&gt;</description><link>http://seliopou.tumblr.com/post/29502816</link><guid>http://seliopou.tumblr.com/post/29502816</guid><pubDate>Fri, 21 Mar 2008 17:08:30 -0400</pubDate></item><item><title>Did you know?</title><description>&lt;iframe width="400" height="300" src="http://www.youtube.com/embed/pMcfrLYDm2U?wmode=transparent&amp;autohide=1&amp;egm=0&amp;hd=1&amp;iv_load_policy=3&amp;modestbranding=1&amp;rel=0&amp;showinfo=0&amp;showsearch=0" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;b&gt;Did you know?&lt;/b&gt;&lt;/p&gt;</description><link>http://seliopou.tumblr.com/post/26568460</link><guid>http://seliopou.tumblr.com/post/26568460</guid><pubDate>Sun, 17 Feb 2008 13:52:26 -0500</pubDate></item><item><title>Backmasking on the Liars track We Live NE of Compton</title><description>&lt;iframe class="tumblr_audio_player tumblr_audio_player_23607617" src="http://seliopou.tumblr.com/post/23607617/audio_player_iframe/seliopou/LbIP7nYgy440kjt64KBycMv4?audio_file=http%3A%2F%2Fwww.tumblr.com%2Faudio_file%2Fseliopou%2F23607617%2FLbIP7nYgy440kjt64KBycMv4" frameborder="0" allowtransparency="true" scrolling="no" width="500" height="85"&gt;&lt;/iframe&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Backmasking on the Liars track We Live NE of Compton&lt;/p&gt;</description><link>http://seliopou.tumblr.com/post/23607617</link><guid>http://seliopou.tumblr.com/post/23607617</guid><pubDate>Sat, 12 Jan 2008 11:05:52 -0500</pubDate><category>now</category></item><item><title>My MacBook Pro Has Outputs I Didn't Know About</title><description>&lt;p&gt;Something I didn&amp;#8217;t know until a few days ago: MacBook Pros come with &lt;a href="http://developer.apple.com/documentation/Hardware/Conceptual/HWTech_Audio/Articles/Audio_concepts.html#//apple_ref/doc/uid/TP40003979-SW4"&gt;combo audio jacks&lt;/a&gt;. That&amp;#8217;s right, both input and output jacks can take an 1/8&amp;#8221; electrical or S/PDIF plug. You&amp;#8217;re probably thinking &amp;#8230;great. I assure you, this a good thing to know in case you&amp;#8217;re ever in the situation I was in a couple days ago.&lt;/p&gt;

&lt;p&gt;I was listening to music on my headphones, when for some reason I decided to unplug them and use my MacBook Pro&amp;#8217;s internal speakers. Instead of aural stimulation, I was greeted with silence. I was trying unsuccessfully to turn the volume up when I noticed the mute icon in the on-screen volume display, even though the volume was maxed.&lt;/p&gt;

&lt;p&gt;Properly confused, I tried plugging in my headphones again, removing them, plugging them in again, ad nauseam. Finally I noticed a light of sanguine hue falling on my finger as I removed my headphones from the audio jack. My first thought was that my audio jack was broken, and this light was some sort of problem indicator. I went to google for confirmation, where I learned that in a way it was, but it really wasn&amp;#8217;t.&lt;/p&gt;

&lt;p&gt;What I was seeing was an enabled S/PDIF output, enabled somehow by a switch (electrical, mechanical, or otherwise) inside the jack. Some people reported having to bring MacBooks with similar symptoms in for repair. Others suggested a fix involving shoving a toothpick into the jack to set the switch causing the malfunction to the proper state. Since I wasn&amp;#8217;t comfortable with either of these solutions, I plugged in my headphones once more, wiggled the jack around something fierce until, eventually, something in there went right and I had the use of my internal speakers back.&lt;/p&gt;

&lt;p&gt;So who knew? You get a two-for-one deal on audio jacks when you buy a MacBook Pro. I&amp;#8217;m glad I paid for features I&amp;#8217;ll never use and, if it wasn&amp;#8217;t for a hardware malfunction, would never have been aware of!&lt;/p&gt;</description><link>http://seliopou.tumblr.com/post/23148815</link><guid>http://seliopou.tumblr.com/post/23148815</guid><pubDate>Sun, 06 Jan 2008 19:59:00 -0500</pubDate><category>comments</category><category>mac</category></item><item><title>Mike: Gorilla by me</title><description>&lt;img src="http://25.media.tumblr.com/LbIP7nYgy3htnnwg9AhjX5QA_500.png"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;b&gt;Mike: Gorilla&lt;/b&gt; by me&lt;/p&gt;</description><link>http://seliopou.tumblr.com/post/22517338</link><guid>http://seliopou.tumblr.com/post/22517338</guid><pubDate>Thu, 27 Dec 2007 23:21:21 -0500</pubDate></item><item><title>Brian the Monkey by me</title><description>&lt;img src="http://25.media.tumblr.com/LbIP7nYgy3hrk1izoymGbpKJ_500.png"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;b&gt;Brian the Monkey&lt;/b&gt; by me&lt;/p&gt;</description><link>http://seliopou.tumblr.com/post/22514862</link><guid>http://seliopou.tumblr.com/post/22514862</guid><pubDate>Thu, 27 Dec 2007 22:22:36 -0500</pubDate></item><item><title>Faces by me.</title><description>&lt;img src="http://25.media.tumblr.com/LbIP7nYgy3hlft9wvBr57Th0_500.png"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;b&gt;Faces&lt;/b&gt; by me.&lt;/p&gt;</description><link>http://seliopou.tumblr.com/post/22507004</link><guid>http://seliopou.tumblr.com/post/22507004</guid><pubDate>Thu, 27 Dec 2007 19:31:21 -0500</pubDate></item><item><title>Dead Christ tended by Angels by Donatello</title><description>&lt;img src="http://24.media.tumblr.com/LbIP7nYgy3gcwpaaKWrR2uGD_400.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;b&gt;Dead Christ tended by Angels&lt;/b&gt; by &lt;a href="http://en.wikipedia.org/wiki/Donatello"&gt;Donatello&lt;/a&gt;&lt;/p&gt;</description><link>http://seliopou.tumblr.com/post/22448611</link><guid>http://seliopou.tumblr.com/post/22448611</guid><pubDate>Wed, 26 Dec 2007 22:44:46 -0500</pubDate></item><item><title>Who's Afraid of the Big Ol' unsafePerformIO?</title><description>&lt;p&gt;
A couple of months ago while in New York I got a call from a friend in need
of some Haskell help. He was working on a project for a Comp. Bio course and he
needed to implement the Knuth Shuffle, but he was having a bit of touble using
Haskell arrays. His problem involved some type error that I couldn&amp;#8217;t tackle
over the phone, so it had to wait until later.
&lt;/p&gt;

&lt;p&gt;
Once I got home, I got onto Wikipedia and looked up &lt;a href="http://en.wikipedia.org/wiki/Knuth_shuffle" title="Knuth Shuffle"&gt;Knuth Shuffle&lt;/a&gt;.
Seeing it was an inherently imperative algorithm, I wasn&amp;#8217;t totally surprised my
friend hit a few bumps while trying to translate it to Haskell. I decided to go 
ahead and implement my own version so I&amp;#8217;d have a better understanding of what he
was doing. I called him later that night to help him fix the problem, but by
that time he had figured it out. 
&lt;/p&gt;

&lt;p&gt;
The implementation I wrote sat around on my hard drive untouched for a couple
months until I rediscovered it last week. For your viewing
pleasure, here it is:
&lt;/p&gt;

&lt;pre&gt;&lt;span class="keyword"&gt;module&lt;/span&gt; &lt;span class="conid"&gt;Permutation&lt;/span&gt; &lt;span class="layout"&gt;(&lt;/span&gt; &lt;span class="varid"&gt;permute&lt;/span&gt; &lt;span class="layout"&gt;)&lt;/span&gt; &lt;span class="keyword"&gt;where&lt;/span&gt;

&lt;span class="keyword"&gt;import&lt;/span&gt; &lt;span class="conid"&gt;Data&lt;/span&gt;&lt;span class="varop"&gt;.&lt;/span&gt;&lt;span class="conid"&gt;Array&lt;/span&gt;&lt;span class="varop"&gt;.&lt;/span&gt;&lt;span class="conid"&gt;MArray&lt;/span&gt;
&lt;span class="keyword"&gt;import&lt;/span&gt; &lt;span class="conid"&gt;Data&lt;/span&gt;&lt;span class="varop"&gt;.&lt;/span&gt;&lt;span class="conid"&gt;Array&lt;/span&gt;&lt;span class="varop"&gt;.&lt;/span&gt;&lt;span class="conid"&gt;IO&lt;/span&gt;

&lt;span class="keyword"&gt;import&lt;/span&gt; &lt;span class="conid"&gt;System&lt;/span&gt;&lt;span class="varop"&gt;.&lt;/span&gt;&lt;span class="conid"&gt;Random&lt;/span&gt;


&lt;span class="definition"&gt;permute&lt;/span&gt; &lt;span class="keyglyph"&gt;::&lt;/span&gt; &lt;span class="keyglyph"&gt;[&lt;/span&gt;&lt;span class="varid"&gt;a&lt;/span&gt;&lt;span class="keyglyph"&gt;]&lt;/span&gt; &lt;span class="keyglyph"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="conid"&gt;IO&lt;/span&gt; &lt;span class="keyglyph"&gt;[&lt;/span&gt;&lt;span class="varid"&gt;a&lt;/span&gt;&lt;span class="keyglyph"&gt;]&lt;/span&gt;
&lt;span class="definition"&gt;permute&lt;/span&gt; &lt;span class="varid"&gt;xs&lt;/span&gt; &lt;span class="keyglyph"&gt;=&lt;/span&gt;
  &lt;span class="keyword"&gt;let&lt;/span&gt; &lt;span class="varid"&gt;len&lt;/span&gt; &lt;span class="keyglyph"&gt;=&lt;/span&gt; &lt;span class="varid"&gt;length&lt;/span&gt; &lt;span class="varid"&gt;xs&lt;/span&gt; &lt;span class="keyword"&gt;in&lt;/span&gt;
    &lt;span class="keyword"&gt;do&lt;/span&gt; &lt;span class="varid"&gt;a&lt;/span&gt; &lt;span class="keyglyph"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="varid"&gt;newListArray&lt;/span&gt; &lt;span class="layout"&gt;(&lt;/span&gt;&lt;span class="num"&gt;0&lt;/span&gt;&lt;span class="layout"&gt;,&lt;/span&gt; &lt;span class="varid"&gt;len&lt;/span&gt; &lt;span class="comment"&gt;-&lt;/span&gt; &lt;span class="num"&gt;1&lt;/span&gt;&lt;span class="layout"&gt;)&lt;/span&gt; &lt;span class="varid"&gt;xs&lt;/span&gt;
       &lt;span class="varid"&gt;mapM_&lt;/span&gt; &lt;span class="layout"&gt;(&lt;/span&gt;&lt;span class="keyglyph"&gt;\&lt;/span&gt;&lt;span class="varid"&gt;i&lt;/span&gt; &lt;span class="keyglyph"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="varid"&gt;randomRIO&lt;/span&gt; &lt;span class="layout"&gt;(&lt;/span&gt;&lt;span class="varid"&gt;i&lt;/span&gt;&lt;span class="layout"&gt;,&lt;/span&gt; &lt;span class="varid"&gt;len&lt;/span&gt; &lt;span class="comment"&gt;-&lt;/span&gt; &lt;span class="num"&gt;1&lt;/span&gt;&lt;span class="layout"&gt;)&lt;/span&gt; &lt;span class="varop"&gt;&amp;gt;&amp;gt;=&lt;/span&gt; &lt;span class="varid"&gt;swap&lt;/span&gt; &lt;span class="varid"&gt;a&lt;/span&gt; &lt;span class="varid"&gt;i&lt;/span&gt;&lt;span class="layout"&gt;)&lt;/span&gt; &lt;span class="keyglyph"&gt;[&lt;/span&gt;&lt;span class="num"&gt;0&lt;/span&gt;&lt;span class="keyglyph"&gt;..&lt;/span&gt;&lt;span class="varid"&gt;len&lt;/span&gt;&lt;span class="comment"&gt;-&lt;/span&gt;&lt;span class="num"&gt;1&lt;/span&gt;&lt;span class="keyglyph"&gt;]&lt;/span&gt;
       &lt;span class="varid"&gt;getElems&lt;/span&gt; &lt;span class="varid"&gt;a&lt;/span&gt;

&lt;span class="definition"&gt;swap&lt;/span&gt; &lt;span class="keyglyph"&gt;::&lt;/span&gt; &lt;span class="layout"&gt;(&lt;/span&gt;&lt;span class="conid"&gt;Ix&lt;/span&gt; &lt;span class="varid"&gt;i&lt;/span&gt;&lt;span class="layout"&gt;)&lt;/span&gt; &lt;span class="keyglyph"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="conid"&gt;IOArray&lt;/span&gt; &lt;span class="varid"&gt;i&lt;/span&gt; &lt;span class="varid"&gt;a&lt;/span&gt; &lt;span class="keyglyph"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="varid"&gt;i&lt;/span&gt; &lt;span class="keyglyph"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="varid"&gt;i&lt;/span&gt; &lt;span class="keyglyph"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="conid"&gt;IO&lt;/span&gt; &lt;span class="conid"&gt;()&lt;/span&gt;
&lt;span class="definition"&gt;swap&lt;/span&gt; &lt;span class="varid"&gt;a&lt;/span&gt; &lt;span class="varid"&gt;i&lt;/span&gt; &lt;span class="varid"&gt;j&lt;/span&gt; &lt;span class="keyglyph"&gt;=&lt;/span&gt; &lt;span class="keyword"&gt;do&lt;/span&gt; &lt;span class="varid"&gt;e1&lt;/span&gt; &lt;span class="keyglyph"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="varid"&gt;readArray&lt;/span&gt; &lt;span class="varid"&gt;a&lt;/span&gt; &lt;span class="varid"&gt;j&lt;/span&gt;
                &lt;span class="varid"&gt;e2&lt;/span&gt; &lt;span class="keyglyph"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="varid"&gt;readArray&lt;/span&gt; &lt;span class="varid"&gt;a&lt;/span&gt; &lt;span class="varid"&gt;i&lt;/span&gt;
                &lt;span class="varid"&gt;writeArray&lt;/span&gt; &lt;span class="varid"&gt;a&lt;/span&gt; &lt;span class="varid"&gt;i&lt;/span&gt; &lt;span class="varid"&gt;e1&lt;/span&gt;
                &lt;span class="varid"&gt;writeArray&lt;/span&gt; &lt;span class="varid"&gt;a&lt;/span&gt; &lt;span class="varid"&gt;j&lt;/span&gt; &lt;span class="varid"&gt;e2&lt;/span&gt;
&lt;/pre&gt;

&lt;p&gt;
Looking this code over, a question came to mind: can I pull the 
&lt;code&gt;permute&lt;/code&gt; function out of the &lt;code&gt;IO&lt;/code&gt; monad by using 
&lt;code&gt;unsafePerformIO&lt;/code&gt;? The &lt;a href="http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO-Unsafe.html#v%3AunsafePerformIO"&gt;documentation&lt;/a&gt;
page for &lt;code&gt;unsafePerformIO&lt;/code&gt; lays down some cursory guidelines for its
use:
&lt;/p&gt;

&lt;p style="font-size: 14px"&gt;This is the &amp;#8220;back door&amp;#8221; into the &lt;code&gt;IO&lt;/code&gt; monad, allowing
&lt;code&gt;IO&lt;/code&gt; computation to be performed at any time. For this to be safe,
the &lt;code&gt;IO&lt;/code&gt; computation should be free of side effects and independent
of its environment.
&lt;/p&gt;
&lt;p style="font-size: 14px"&gt;
If the I/O computation wrapped in &lt;code&gt;unsafePerformIO&lt;/code&gt; performs side
effects, then the relative order in which those side effects take place
(relative to the main I/O trunk, or other calls to unsafePerformIO) is
indeterminate.
&lt;/p&gt;

&lt;p&gt;
The second part of this disclaimer points out the essential problem with
allowing mutation in a lazy language: without any guarantee of when an
expression will be evaluated, one does not know when or in what order side
effects will take place. Hence the &lt;code&gt;IO&lt;/code&gt; monad, which requires the
programmer sequence computations that may produce side effects or may depend on some mutable state.
&lt;/p&gt;

&lt;p&gt;
But what if you don&amp;#8217;t care when a side effect takes place? What if you don&amp;#8217;t
care when a computation is performed relative to other side effects? 
&lt;code&gt;unsafePerformIO&lt;/code&gt; in essence allows you to say exactly that about
a computation; it removes that computation from the &lt;code&gt;IO&lt;/code&gt; monad, thus
absolving the programmer of the task of specifying when, relative to other
computations, the computation should be performed. However the documentation
for this function tells us it is only &amp;#8220;safe&amp;#8221; if, i.e., it is necessary that,
&amp;#8220;the &lt;code&gt;IO&lt;/code&gt; computation &amp;#8230; be free of side effects and independent of
its environment&amp;#8221;. This certainly seems like a sufficient condition; if I can say
that about a computation, then it certainly doesn&amp;#8217;t matter when or in what
relative order the computation is performed. Is it necessary? No, and I
belive the &lt;code&gt;permute&lt;/code&gt; function above proves it.
&lt;/p&gt;

&lt;p&gt;
&lt;code&gt;permute&lt;/code&gt; does mutate global state: the state of Haskell&amp;#8217;s random
number generator (stored in &lt;code&gt;theStdGen&lt;/code&gt;) is modified by each call
to &lt;code&gt;randomRIO&lt;/code&gt;. It is dependent on its environment: the value in 
&lt;code&gt;theStdGen&lt;/code&gt; determines the values produced each time
&lt;code&gt;randomRIO&lt;/code&gt; is called. Despite this it would be absurd to claim
the state of Haskell&amp;#8217;s random number generator matters to me each time I want
to permute a list, or that it matters when I modify the state of the random
number generator relative to other computations. Therefore, I can define
&lt;code&gt;permute&lt;/code&gt; as follows:
&lt;/p&gt;

&lt;pre&gt;
&lt;span class="definition"&gt;permute&lt;/span&gt; &lt;span class="keyglyph"&gt;::&lt;/span&gt; &lt;span class="keyglyph"&gt;[&lt;/span&gt;&lt;span class="varid"&gt;a&lt;/span&gt;&lt;span class="keyglyph"&gt;]&lt;/span&gt; &lt;span class="keyglyph"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="keyglyph"&gt;[&lt;/span&gt;&lt;span class="varid"&gt;a&lt;/span&gt;&lt;span class="keyglyph"&gt;]&lt;/span&gt;
&lt;span class="definition"&gt;permute&lt;/span&gt; &lt;span class="varid"&gt;l&lt;/span&gt; &lt;span class="keyglyph"&gt;=&lt;/span&gt; &lt;span class="varid"&gt;unsafePerformIO&lt;/span&gt; &lt;span class="varop"&gt;$&lt;/span&gt;
  &lt;span class="keyword"&gt;let&lt;/span&gt; &lt;span class="varid"&gt;len&lt;/span&gt; &lt;span class="keyglyph"&gt;=&lt;/span&gt; &lt;span class="varid"&gt;length&lt;/span&gt; &lt;span class="varid"&gt;l&lt;/span&gt; &lt;span class="keyword"&gt;in&lt;/span&gt;
    &lt;span class="keyword"&gt;do&lt;/span&gt; &lt;span class="varid"&gt;a&lt;/span&gt; &lt;span class="keyglyph"&gt;&amp;lt;-&lt;/span&gt; &lt;span class="varid"&gt;newListArray&lt;/span&gt; &lt;span class="layout"&gt;(&lt;/span&gt;&lt;span class="num"&gt;0&lt;/span&gt;&lt;span class="layout"&gt;,&lt;/span&gt; &lt;span class="varid"&gt;len&lt;/span&gt; &lt;span class="comment"&gt;-&lt;/span&gt; &lt;span class="num"&gt;1&lt;/span&gt;&lt;span class="layout"&gt;)&lt;/span&gt; &lt;span class="varid"&gt;l&lt;/span&gt;
       &lt;span class="varid"&gt;mapM_&lt;/span&gt; &lt;span class="layout"&gt;(&lt;/span&gt;&lt;span class="keyglyph"&gt;\&lt;/span&gt;&lt;span class="varid"&gt;i&lt;/span&gt; &lt;span class="keyglyph"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="varid"&gt;randomRIO&lt;/span&gt; &lt;span class="layout"&gt;(&lt;/span&gt;&lt;span class="varid"&gt;i&lt;/span&gt;&lt;span class="layout"&gt;,&lt;/span&gt; &lt;span class="varid"&gt;len&lt;/span&gt; &lt;span class="comment"&gt;-&lt;/span&gt; &lt;span class="num"&gt;1&lt;/span&gt;&lt;span class="layout"&gt;)&lt;/span&gt; &lt;span class="varop"&gt;&amp;gt;&amp;gt;=&lt;/span&gt; &lt;span class="varid"&gt;swap&lt;/span&gt; &lt;span class="varid"&gt;a&lt;/span&gt; &lt;span class="varid"&gt;i&lt;/span&gt;&lt;span class="layout"&gt;)&lt;/span&gt; &lt;span class="keyglyph"&gt;[&lt;/span&gt;&lt;span class="num"&gt;0&lt;/span&gt;&lt;span class="keyglyph"&gt;..&lt;/span&gt;&lt;span class="varid"&gt;len&lt;/span&gt;&lt;span class="comment"&gt;-&lt;/span&gt;&lt;span class="num"&gt;1&lt;/span&gt;&lt;span class="keyglyph"&gt;]&lt;/span&gt;
       &lt;span class="varid"&gt;getElems&lt;/span&gt; &lt;span class="varid"&gt;a&lt;/span&gt;
&lt;/pre&gt;

&lt;p&gt;
A few more issues need to be addressed. The documentation page for 
&lt;code&gt;unsafePerformIO&lt;/code&gt; mentions three precautions one must take when
compiling a module using this function. All of them address unintended behavior
that arises due to optimizations performed by GHC (under the assumption of referential transparency).The &lt;code&gt;NOINLINE&lt;/code&gt;
pragma is essential. It doesn&amp;#8217;t seem as though common subexpression elimination
or let-lifting will be an issue in the module. However, uses of permute could
fall victim to either of these optimizations. As an example, consider the
following expression:
&lt;/p&gt;

&lt;pre&gt;&lt;span class="keyglyph"&gt;[&lt;/span&gt;&lt;span class="varid"&gt;permute&lt;/span&gt; &lt;span class="keyglyph"&gt;[&lt;/span&gt;&lt;span class="num"&gt;1&lt;/span&gt;&lt;span class="keyglyph"&gt;..&lt;/span&gt;&lt;span class="num"&gt;4&lt;/span&gt;&lt;span class="keyglyph"&gt;]&lt;/span&gt;&lt;span class="layout"&gt;,&lt;/span&gt; &lt;span class="varid"&gt;permute&lt;/span&gt; &lt;span class="keyglyph"&gt;[&lt;/span&gt;&lt;span class="num"&gt;1&lt;/span&gt;&lt;span class="keyglyph"&gt;..&lt;/span&gt;&lt;span class="num"&gt;4&lt;/span&gt;&lt;span class="keyglyph"&gt;]&lt;/span&gt;&lt;span class="keyglyph"&gt;]&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
If this expression is in some compiled module, GHC could potentially (almost
certainly) identify the common subexpressions and transform the expression
it into the following:
&lt;/p&gt;

&lt;pre&gt;&lt;span class="keyword"&gt;let&lt;/span&gt; &lt;span class="varid"&gt;e&lt;/span&gt; &lt;span class="keyglyph"&gt;=&lt;/span&gt; &lt;span class="varid"&gt;permute&lt;/span&gt; &lt;span class="keyglyph"&gt;[&lt;/span&gt;&lt;span class="num"&gt;1&lt;/span&gt;&lt;span class="keyglyph"&gt;..&lt;/span&gt;&lt;span class="num"&gt;4&lt;/span&gt;&lt;span class="keyglyph"&gt;]&lt;/span&gt; &lt;span class="keyword"&gt;in&lt;/span&gt; &lt;span class="keyglyph"&gt;[&lt;/span&gt;&lt;span class="varid"&gt;e&lt;/span&gt;&lt;span class="layout"&gt;,&lt;/span&gt; &lt;span class="varid"&gt;e&lt;/span&gt;&lt;span class="keyglyph"&gt;]&lt;/span&gt;
&lt;/pre&gt;

&lt;p&gt;
Obviously, this wouldn&amp;#8217;t be a good thing, since instead of getting two (likely)
distinct permutations, one would &lt;i&gt;always&lt;/i&gt; get the same permutation. To
avoid this, use the &lt;code&gt;-fno-cse&lt;/code&gt; option
when compiling such a module.
&lt;/p&gt;

&lt;h3&gt;The exception&lt;/h3&gt;
&lt;p&gt;
A possible objection one might raise to all of this is that it is possible to 
set the state of Haskell&amp;#8217;s random number generator by using the function
&lt;code&gt;setStdGen&lt;/code&gt;. After the state of the generator is set, the generator
ceases to be &amp;#8220;random&amp;#8221; and becomes observably deterministic and so it would 
matter when this action is performed relative to calls to &lt;code&gt;permute&lt;/code&gt;.
Such an objection I belive is right, or at least tenable. So don&amp;#8217;t do it!
&lt;/p&gt;</description><link>http://seliopou.tumblr.com/post/22392354</link><guid>http://seliopou.tumblr.com/post/22392354</guid><pubDate>Wed, 26 Dec 2007 01:17:00 -0500</pubDate><category>comments</category><category>haskell</category></item><item><title>Second Version of Triptych by Francis Bacon Panel 1 Panel 2...</title><description>&lt;img src="http://25.media.tumblr.com/LbIP7nYgy3d7u52qZNZqgeYa_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;b&gt;Second Version of Triptych&lt;/b&gt; by &lt;a href="http://en.wikipedia.org/wiki/Francis_Bacon_%28painter%29" title="Francis Bacon"&gt;Francis Bacon&lt;/a&gt;&lt;/p&gt;&lt;p&gt; &lt;a href="http://www.ibiblio.org/wm/paint/auth/bacon/1944/1944tri1.jpg" title="Panel 1"&gt;Panel 1&lt;/a&gt; &lt;a href="http://www.ibiblio.org/wm/paint/auth/bacon/1944/1944tri2.jpg" title="Panel 2"&gt;Panel 2&lt;/a&gt; &lt;a href="http://www.ibiblio.org/wm/paint/auth/bacon/1944/1944tri3.jpg" title="Panel 3"&gt;Panel 3&lt;/a&gt;&lt;/p&gt;&lt;a href="http://en.wikipedia.org/wiki/Francis_Bacon_%28painter%29" title="Francis Bacon"&gt;&lt;/a&gt;</description><link>http://seliopou.tumblr.com/post/22321529</link><guid>http://seliopou.tumblr.com/post/22321529</guid><pubDate>Mon, 24 Dec 2007 17:59:00 -0500</pubDate></item><item><title>Backmasking on the MSI track Backmask </title><description>&lt;iframe class="tumblr_audio_player tumblr_audio_player_22313021" src="http://seliopou.tumblr.com/post/22313021/audio_player_iframe/seliopou/LbIP7nYgy3czlag518qhfY5I?audio_file=http%3A%2F%2Fwww.tumblr.com%2Faudio_file%2Fseliopou%2F22313021%2FLbIP7nYgy3czlag518qhfY5I" frameborder="0" allowtransparency="true" scrolling="no" width="500" height="85"&gt;&lt;/iframe&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;a href="http://en.wikipedia.org/wiki/Backmasking" title="Backmasking"&gt;Backmasking&lt;/a&gt; on the MSI track &lt;b&gt;Backmask&lt;/b&gt; &lt;/p&gt;</description><link>http://seliopou.tumblr.com/post/22313021</link><guid>http://seliopou.tumblr.com/post/22313021</guid><pubDate>Mon, 24 Dec 2007 14:08:40 -0500</pubDate></item><item><title>Lyrics for the end of a song</title><description>&lt;p&gt;battery&amp;#8217;s almost dead &lt;br/&gt; time to go to bed &lt;/p&gt;</description><link>http://seliopou.tumblr.com/post/22278334</link><guid>http://seliopou.tumblr.com/post/22278334</guid><pubDate>Mon, 24 Dec 2007 00:53:07 -0500</pubDate></item><item><title>Pisces by Man Ray</title><description>&lt;img src="http://24.media.tumblr.com/LbIP7nYgy396oaiegzUTjcQe_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;b&gt;Pisces&lt;/b&gt; by &lt;a href="http://en.wikipedia.org/wiki/Man_Ray" title="Man Ray"&gt;Man Ray&lt;/a&gt;&lt;a href="http://www.tate.org.uk/collection/T/T00/T00324_9.jpg" title="Man Ray"&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://seliopou.tumblr.com/post/22159359</link><guid>http://seliopou.tumblr.com/post/22159359</guid><pubDate>Fri, 21 Dec 2007 22:15:00 -0500</pubDate></item><item><title>A trip to Lame Duck Books</title><description>&lt;p&gt;I was out for a jaunt in Cambridge with Emily today. We stopped by a peculiar but alluring book store: Lame Duck Books on Arrow Street. While I was looking for some &lt;a href="http://en.wikipedia.org/wiki/Ludwig_Wittgenstein" title="Wittgenstein"&gt;Wittgenstein&lt;/a&gt;, I ran across &lt;b&gt;Eight Lectures on the I Ching&lt;/b&gt; by &lt;a href="http://en.wikipedia.org/wiki/Hellmut_Wilhelm" title="Hellmut Wilhelm"&gt;Hellmut Wilhelm&lt;/a&gt;. I was intrigued by it, as my only familiarity with the I Ching comes from reading &lt;a href="http://en.wikipedia.org/wiki/The_man_in_the_high_castle" title="The Man in the High Castle"&gt;The Man in the High Castle&lt;/a&gt;, so I bought it.&lt;/p&gt;&lt;p&gt;While I was there, Emily and I got to talking with someone who seemed to be the proprietor, and were subsequently taken on a tour of the various curiosities in the shop: a number of books from Rawls&amp;#8217; library, annotated by the same; several books by Nozick inscribed to Quine, Rawls, et al.; a first edition of Kant&amp;#8217;s first critique; etc.&lt;/p&gt;&lt;p&gt;But the one I appreciated seeing the most was one of the original reproductions of Wittgenstein&amp;#8217;s Brown Book &amp;#8212; something I thought I would never see in my life.&lt;/p&gt;</description><link>http://seliopou.tumblr.com/post/22158984</link><guid>http://seliopou.tumblr.com/post/22158984</guid><pubDate>Fri, 21 Dec 2007 22:05:00 -0500</pubDate></item><item><title>Portrait of a Man (Self Portrait?) by Jan van Eyck </title><description>&lt;img src="http://24.media.tumblr.com/LbIP7nYgy37s6r56FMmVP1Ku_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;b&gt;Portrait of a Man (Self Portrait?) &lt;/b&gt;by &lt;a href="http://en.wikipedia.org/wiki/Jan_van_Eyck" title="Jan van Eyck"&gt;Jan van Eyck&lt;/a&gt; &lt;/p&gt;</description><link>http://seliopou.tumblr.com/post/22088742</link><guid>http://seliopou.tumblr.com/post/22088742</guid><pubDate>Thu, 20 Dec 2007 22:42:32 -0500</pubDate></item><item><title>A Grotesque Old Woman by Quentin Massys</title><description>&lt;img src="http://25.media.tumblr.com/LbIP7nYgy36bk55rDdu9vTVO_400.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;b&gt;A Grotesque Old Woman&lt;/b&gt; by &lt;a href="http://en.wikipedia.org/wiki/Quinten_Massys" title="Quentin Matsys"&gt;Quentin Massys&lt;/a&gt;&lt;/p&gt;</description><link>http://seliopou.tumblr.com/post/22007960</link><guid>http://seliopou.tumblr.com/post/22007960</guid><pubDate>Wed, 19 Dec 2007 22:09:00 -0500</pubDate></item><item><title>Google Notebook</title><description>&lt;a href="http://google.com/notebook"&gt;Google Notebook&lt;/a&gt;: &lt;p&gt;Ever heard of it?&lt;br/&gt;&lt;/p&gt;</description><link>http://seliopou.tumblr.com/post/21989042</link><guid>http://seliopou.tumblr.com/post/21989042</guid><pubDate>Wed, 19 Dec 2007 16:12:00 -0500</pubDate></item><item><title>A Question</title><description>&lt;p&gt;What is it about scotch that makes you love everybody &lt;i&gt;so much&lt;/i&gt;? — &lt;a href="http://paulhope.tumblr.com/"&gt;paulhope&lt;/a&gt;&lt;/p&gt;&lt;p&gt; Malted barley, which is then fermented.&lt;br/&gt;&lt;/p&gt;</description><link>http://seliopou.tumblr.com/post/21934382</link><guid>http://seliopou.tumblr.com/post/21934382</guid><pubDate>Wed, 19 Dec 2007 00:08:00 -0500</pubDate></item><item><title>Whistlejacket by George Stubbs </title><description>&lt;img src="http://25.media.tumblr.com/LbIP7nYgy34vszhxAlzuyjY9_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;b&gt;Whistlejacket&lt;/b&gt; by &lt;a href="http://en.wikipedia.org/wiki/George_Stubbs" title="George Stubbs"&gt;George Stubbs&lt;/a&gt; &lt;/p&gt;</description><link>http://seliopou.tumblr.com/post/21928016</link><guid>http://seliopou.tumblr.com/post/21928016</guid><pubDate>Tue, 18 Dec 2007 22:00:18 -0500</pubDate></item></channel></rss>
