[Haskell] Long live Edison

John Meacham john at repetae.net
Mon Feb 20 19:09:22 EST 2006

On Mon, Feb 20, 2006 at 05:29:16PM -0500, ajb at spamcop.net wrote:
> The problem with MonadPlus is that you don't actually need the Plus
> functionality.  It is usually considered good design to only require
> what you need, and Monad already has "fail".
> There has been some discussion on haskell-prime about resurrecting the
> MonadZero class, for monads with mzero but not mappend.  This would be
> the closest fit, but then, you might want to consider that some people
> would appreciate having the string diagnostic.

I think the problem is that 'mzero' exists, the correct solution seems
to be to get rid of the 'mzero' method of MonadPlus. Since haskell is
lazy, all Monads have at least the zero of _|_ which can be overriden by
'fail' with a more suitable one. MonadPlus should be about extending
monads with an additive operator, there is no need for another concept
of zero and it seems to me that is the real issue. mzero can simply be
defined as 'fail "mzero"'.


John Meacham - ⑆repetae.net⑆john⑈

More information about the Haskell mailing list