[Haskell] MonadPlus

Jacques Carette carette at mcmaster.ca
Sat Apr 30 09:51:59 EDT 2005

Ashley Yakeley <ashley at semantic.org> wrote:
> I've added a bit more to <http://haskell.org/hawiki/MonadPlus>.
> I highly recommend people read it before they start claiming in papers 
> that such-and-such a type "may thus be an instance of MonadPlus".

Very nice.

One of the problems I have encountered with MonadPlus is that too many people try to force it to be a Monoid, when it 
doesn't always want to be.  Your suggestion of separating out the identity operation from the binary operation makes 
it much clearer that these various Monads are actually instances of Magma(s)
than necessarily a Monoid.  On the above Wikipedia article, there is a useful ontology of identities that can be 
useful to describe various Magmas.


PS: your discussion of the laws of MonadPlus reinforces to me the real need for being able to declare the laws that a 
typeclass should satisfy, not just the signature.

More information about the Haskell mailing list