Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^4: Is it worth using Monads in Perl ? and what the Monads are ?

by Anonymous Monk
on Jun 12, 2007 at 00:02 UTC ( [id://620595]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://620595]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2024-04-19 10:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found