David Menendez wrote:
I would like to know what category MonadPlus represents... A Monad is a categoryPhilip Wadler listed those as the laws he "would usually insist on" in a 1997 message[1].
[1] <http://www.dcs.gla.ac.uk/mail-www/haskell/msg00057.html>
He also mentions two other possible, but problematic, laws:
m >>= \x -> mzero == mzero m >>= \x -> k x `mplus` h x == m >>= k `mplus` m >>= h
The first doesn't hold when m is bottom. The second doesn't hold for
lists.
where the objects are functors and the operators are id and product both of which
are natural transformations... Presumably the 'laws' for a monad can be derived from this
statement.
I cannot find any reference to MonadPlus in category theory. At a guess I would say that
it was the same as a Monad except the operators are id and co-product (or sum)... That would mean the 'laws' would be exactly the same as a Monad, just with (0,+) instead of (1,*)...
Keean.
_______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
