News for hackers. Stuff that matters.
Re:IO Monad Considered Harmful by wyager on Friday January 23, 2015 @01:23AM (#8933647)
Yes.

Here's a function that has type `IO ()` but doesn't obviously use `IO`'s monadic interface.

    foo = print "hello"
`print` may use `IO`'s monadic interface under the hood, I don't know.

Here's some code that has type `IO ()` and does use `IO`'s monadic interface.

   foo = do
       str <- getLine
       print str
which is de-sugared to

    foo = getLine >>= \str -> print str
which you can, if you like concise code, feel free to shorten to

    foo = getLine >>= print
The important part is `>>=` (pronounced "bind"), which is defined in the monad typeclass. (A typeclass is like a Java interface, by the way.)
Re:IO Monad Considered Harmful by JoshTriplett on Friday January 23, 2015 @01:26AM (#8933655)
Or:

    foo = print =<< getLine
which often reads better when trying to build something that looks more like a nested function call and less like a pipeline.