On Fri, 2 Jan 2009, Achim Schneider wrote:

There are no lazy monads. Monads imply explicit sequencing... writing

I think this is an extremely bad thing to say and is a source of misunderstanding about monads and evaluation. Most monads _are_ lazy, and it is important to understand that when trying to understand the run-time properties of your monadic code.

Monads sequence effects, but evaluation is an almost orthogonal issue. Here is a recent thread where I talk about laziness:

http://www.reddit.com/r/haskell/comments/7itbi/mapm_mapm_and_monadic_statements/c06s6pm

(for the short short story, simply try out
take 10 $ execWriter (sequence_ (repeat (tell "x")))
)

Furthermore, the code in my article on recursive do from The.Monad.Reader issue #6 <http://www.haskell.org/sitewiki/images/1/14/TMR-Issue6.pdf> requires the monads to be lazy in order to tie the knot.

--
Russell O'Connor                                      <http://r6.ca/>
``All talk about `theft,''' the general counsel of the American Graphophone
Company wrote, ``is the merest claptrap, for there exists no property in
ideas musical, literary or artistic, except as defined by statute.''
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to