[Haskell-cafe] Guess what ... Tutorial uploaded! :)

Ben Rudiak-Gould Benjamin.Rudiak-Gould at cl.cam.ac.uk
Mon Jan 23 19:46:53 EST 2006


Dmitry Astapov wrote:
> http://www.haskell.org/hawiki/HitchhickersGuideToTheHaskell

I like the approach too, but the section on IO actions, which I'm reading 
now, is not correct. It's not true that "a <- someAction" has the effect of 
associating a with someAction, with the actual work deferred until later. 
All of the IO associated with someAction happens at the program point where 
"a <- someAction" appears, whether or not it's needed later. getContents is 
a rare exception to this rule. It works by using unsafeInterleaveIO behind 
the scenes, which muddies Haskell's generally clean semantics and leads to 
odd impure behavior. I wish getContents were a good example of nonstrictness 
or laziness, but I don't think it is.

-- Ben


More information about the Haskell-Cafe mailing list