[Haskell-cafe] What is MonadPlus good for?

Mark Tullsen tullsen at galois.com
Mon Feb 14 15:03:53 EST 2005


Here's an example:  In my paper "First Class Patterns" 
<http://citeseer.ist.psu.edu/tullsen00first.html>,
by defining the pattern combinators using MonadPlus, you get standard 
pattern matching with the Maybe
instance of MonadPlus and you get backtracking pattern matching with 
the [] (list) instance of MonadPlus.

- Mark

On Feb 12, 2005, at 10:08 AM, 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
>
>
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>



More information about the Haskell-Cafe mailing list