[Haskell-cafe] Robert Harper on monads and laziness

MigMit miguelimo38 at yandex.ru
Mon May 2 10:19:43 CEST 2011


Yes, I'm following it too, and it seems to me that Harper just allows his dislike for Haskell to take advantage of his judgement. Monads as a way to deal with laziness are a very common misconception.

Отправлено с iPhone

May 2, 2011, в 11:54, Ketil Malde <ketil at malde.org> написал(а):

> 
> I'm following Harper's blog, Existential Type¹, which I find to be an
> enjoyable and entertainingly written tirade about the advantages of
> teaching functional programming - specifically ML - to students.  Of
> course, he tends to be critical of Haskell, but it's nice to get some
> thought provoking opinion from somebody who knows a bit about the
> business.
> 
> Recently, he had a piece on monads, and how to do them in ML, and one
> statement puzzled me:
> 
>  "There is a particular reason why monads had to arise in Haskell,
>   though, which is to defeat the scourge of laziness."
> 
> My own view is/was that monads were so successful in Haskell since it
> allowed writing flexible programs with imperative features, without
> sacrificing referential transparency.  Although people are quick (and
> rightly so) to point out that this flexibility goes way beyond IO, I
> think IO was in many ways the killer application for monads.  Before IO,
> we had very limited functionality (like 'interact' taking a 'String ->
> String' function and converting it into an exectuable program) to build
> real programs from.
> 
> Laziness does require referential transparency (or at least, it is
> easier to get away with the lack of RT in a strict language), so I can
> see that he is indirectly correct, but RT is a goal in itself.  Thus, I
> wonder if there are any other rationale for a statement like that?
> 
> -k
> 
> ¹ http://existentialtype.wordpress.com/
> -- 
> If I haven't seen further, it is by standing in the footprints of giants
> 
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe



More information about the Haskell-Cafe mailing list