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
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to