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?? |
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. 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: Although interact is currently implemented in the IO monad, I believe it pre-dates monadic IO.
In Section
Seekers of Perl Wisdom
|
|