[Haskell-cafe] Shouldn't this be lazy???

Olivier Boudry olivier.boudry at gmail.com
Fri Jun 22 13:36:28 EDT 2007

Reading code like the following:

main = do
  s <- getContents
  let r = map processIt (lines s)
  putStr (unlines r)

I was thinking all IO operations were lazy. But in fact it looks like
getContents is lazy by design but not the whole IO stuff.

Thank you all for your helpful answers,


More information about the Haskell-Cafe mailing list