[Haskell-cafe] Haskell & monads for newbies

Andrew Coppin andrewcoppin at btinternet.com
Sat Jul 14 14:27:09 EDT 2007


Alexis Hazell wrote:
> On Saturday 14 July 2007 05:21, Andrew Coppin wrote:
>
>   
>> Still, while the concept is simple, it's hard to sum up in just a few
>> words what a monad "is". (Especially given that Haskell has so many
>> different ones - and they seem superficially to bear no resemblence to
>> each other.)
>>     
>
> Well, how about this as a starting point (from a post i wrote in my blog):
>
> "[In Haskell,] a monad simply seems to be a computational environment in which 
> one can specify that certain types and methods of computation be performed, 
> and in which the three monad laws are expected to hold."
>
> What do people think?

Hmm... it doesn't leave me with either a strong sense of "oh, that 
sounds simple" or "oh, I understand what that means". I'm only one guy 
of course...

> With regards to the last phrase, i seem to recall that 
> there are monads which nevertheless actually /don't/ follow all three monad 
> laws?
>   

That is my recollection also. (Don't ask me *which* monads, mind you...) 
In the case in point, the law breakage never the less matches 
"intuition"; personally, I ignore the monad laws on the basis that if 
you're doing something "sane", the laws will automatically hold anyway. 
(But maybe I'm just a renegade?)



More information about the Haskell-Cafe mailing list