in reply to Re^3: Is it worth using Monads in Perl ? and what the Monads are ?
in thread Is it worth using Monads in Perl ? and what the Monads are ?

On the page I linked to, in the top-right hand corner, there are links to the paper in several different formats.

The paper includes a bunch of examples. As far as I know, there is no fundamental reason why those libraries could not be used with a modern version of GHC.

A simple experiment you can do to see what non-monad I/O is like is to use the interact function.

main = interact yourFunction
yourFunction is a pure function which takes a lazy list of Strings (which are gathered from stdin), and returns a lazy list of strings (which are written to stdout).

For some examples, (such as interactive questions using stdin/stdout) check out this page:
http://cod3po37ry.blogspot.com/2007/02/more-on-haskell-io-and-interact.html

Although interact is currently implemented in the IO monad, I believe it pre-dates monadic IO.

  • Comment on Re^4: Is it worth using Monads in Perl ? and what the Monads are ?
  • Download Code