[prev in list] [next in list] [prev in thread] [next in thread] 

List:       haskell-cafe
Subject:    Re: [Haskell-cafe] Re: what is inverse of mzero and return?
From:       Jan-Willem Maessen <jmaessen () alum ! mit ! edu>
Date:       2005-01-25 2:25:54
Message-ID: 7031AC1D-6E78-11D9-83BF-000D935ADE0A () alum ! mit ! edu
[Download RAW message or body]

On Jan 24, 2005, at 8:53 PM, Jorge Adriano Aires wrote:
> And it would say nothing about things like:
> return 4 >> return 5  ==?== return 5
> I can live with it.

I feel obliged to point out (because the repeated references to the 
question are driving me up the wall) that this simple equality holds in 
every monad:

return 4 >> return 5

=== (definition of >>)

return 4 >>= \_ -> return 5

=== (monad laws)

(\_ -> return 5) 4

=== (beta reduction)

return 5

We don't need to know anything about the semantics, etc. of any other 
actions the monad might happen to define.

-Jan-Willem Maessen


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic