For sets and bags we have
zero >>= k = zero
m >>= \x -> zero = zero
(m ++ n) >>= k = m >>= k ++ n >>= k
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 the case where m is bottom. I would usually
insist on at least the first and third laws for monad zero and plus,
and in addition that they form a monoid. -- P
- Laws for Monads with zero and plus Koen Claessen
- Re: Laws for Monads with zero and plus Philip Wadler
- Re: Laws for Monads with zero and plus Koen Claessen
- Re: Laws for Monads with zero and plus John C. Peterson
- Re: Laws for Monads with zero and plus Tony Davie
- Re: Laws for Monads with zero and plus reid-alastair
- Re: Laws for Monads with zero and plus Hans Aberg
