[Haskell-cafe] Re:Explaining monads

Jeff Polakow jeff.polakow at db.com
Wed Aug 15 10:59:27 EDT 2007


> Hence the need to perform a "run" operation like runIdentity, 
> evalState or runParser (for Parsec) to get something useful to 
> happen.  Except for lists we don't seem to do this.  I suppose lists
> are so simple that the operators :, ++ and the [] constructor do all
> we ever need with them.  Finally there is no runIO because "main" is
> essentially that function in every real program? - Greg
For lists, head is probably the simplest "run" operation. 

As Brian noted earlier unsafePerformIO is a way to "run" IO computations 
within your code; but doing so breaks the abstraction of IO as being the 
outside world.



This e-mail may contain confidential and/or privileged information. If you 
are not the intended recipient (or have received this e-mail in error) 
please notify the sender immediately and destroy this e-mail. Any 
unauthorized copying, disclosure or distribution of the material in this 
e-mail is strictly forbidden.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20070815/8510cc85/attachment.htm

More information about the Haskell-Cafe mailing list