[Haskell-cafe] Newbie question on iterating over IO list

Jared Updike jupdike at gmail.com
Tue Jun 20 02:59:25 EDT 2006

> o To output anything, I need to do 'do'.

If you only have one action, you can omit do, e.g.

  main = do { putStrLn "Hello, World!" }

is identical (after de-sguaring) to

  main = putStrLn "Hello, World!"

Essentially, you are correct; to output anything (i.e. to perform I/O
by side effect) your actions will be inside the I/O monad, typically
inside of a 'do' block.

reverse ")-:"

More information about the Haskell-Cafe mailing list