Re: Laws for Monads with zero and plus

1997-05-20 Thread Hans Aberg
At 13:18 97/05/16, [EMAIL PROTECTED] wrote: I'm the one responsible for adding the Monad laws to the Haskell report [library] - so perhaps I should explain why I wanted to add them. I had a look at these library monad laws, and, actually, it turns out that the liftM :: (Monad m) = (a

Re: Laws for Monads with zero and plus

1997-05-16 Thread reid-alastair
I'm the one responsible for adding the Monad laws to the Haskell report - so perhaps I should explain why I wanted to add them. The main reason I wanted to add them was so that I could (informally) appeal to them when documenting code or optimising code. For example, the Monad library

Re: Laws for Monads with zero and plus

1997-05-14 Thread Koen Claessen
Philip Wadler wrote: | 1. zero = k = zero | 2. m = \x - zero= zero | 3. (m ++ n) = k = m = k ++ n = k | 4. m = \x - k x ++ h x = m = k ++ n = k. | | But the fourth law does not hold for lists, and the second law does | not hold if we consider