[Haskell-cafe] What is MonadPlus good for?

Remi Turk rturk at science.uva.nl
Sat Feb 12 13:36:14 EST 2005

On Sat, Feb 12, 2005 at 01:08:59PM -0500, Benjamin Pierce wrote:
> I have seen lots of examples that show how it's useful to make some type
> constructor into an instance of Monad.
> Where can I find examples showing why it's good to take the trouble to show
> that something is also a MonadPlus?  (I know there are many examples of
> things that *are* MonadPluses; what I want to know is why this is
> interesting. :-)
> Thanks,
>      - Benjamin

As a start, free access to countless general functions as soon as
you define a MonadPlus instance for your datatype. (Errr, `guard'
and `msum', as long as one stays within the Haskell98 standard
libraries ;)


Nobody can be exactly like me. Even I have trouble doing it.

More information about the Haskell-Cafe mailing list