Philip Wadler wrote:
> class Monad m => MonadPlus m where
> mzero :: m a
> mplus :: m a -> m a -> m a
>
> Why is this here? It doesn't need to be in the prelude. Just
> leave it for the user to define (and then the user may pick
> better names, like Ringad, zero, and <+>). -- P
First, the prelude (or standard libraries) can give instances for [], Maybe and
Error.
More importantly, I believe that monads with plus and zero will appear in many
Haskell programs. Having standard names for them makes programs written by other
people much easier to understand. I'd like to oppose Erik Meijer's statement:
> On the other hand you can easily achieve the
> effect yourself using some hiding and adding a handfull of definitions,
> which is what I will probably end up doing. An extra level of indirection
> can do wonders.
I don't want to read these programs. ;-)
However, I have to admit that I don't like the names mzero and mplus either :-(
Olaf
--
OLAF CHITIL, Lehrstuhl fuer Informatik II, RWTH Aachen, 52056 Aachen, Germany
Tel: (+49/0)241/80-21212; Fax: (+49/0)241/8888-217
URL: http://www-i2.informatik.rwth-aachen.de/~chitil/