[Haskell-cafe] Monad laws

Richard Eisenberg eir at cis.upenn.edu
Wed Jun 25 23:30:37 UTC 2014


On Jun 25, 2014, at 3:31 PM, Alexander Solla <alex.solla at gmail.com> wrote:

> > If the monad in question upholds the associativity law, then the chunks evaluate to the same result, but they're still distinct.
> 
> Distinct with respect to what equivalence relation?

I was thinking of syntactic equality (modulo renaming) on desugared programs. Another way of witnessing that the chunks are distinct is that the sequence of memory states they induce will be different -- even an associative member of the Monad class may have efficiency differences depending on the precise association.

> 
> Also, an object isn't a monad if it isn't associative. 

You're right, of course. I meant a member of Haskell's Monad class, which may or may not be a monad.

Richard


More information about the Haskell-Cafe mailing list