[Haskell-cafe] MonadPlus or Alternative or ...?

Mark Wassell mwassell at bigpond.net.au
Sat May 1 20:42:38 EDT 2010


Check the laws that instances of MonadPlus and Alternative should comply 
with to help you make your decision.

Cheers

Mark

Sean Leather wrote:
> I want to generalize a set of functions from lists to some functor 
> type. I require the following three operation types.
>
>   f a
>   a -> f a
>   f a -> f a -> f a
>
> Should I choose MonadPlus and use these?
>
>   mzero
>   return
>   mplus
>
> Or should I choose Alternative and use these?
>
>   empty
>   pure
>   (<|>)
>
> Or should I make my own class? Or is there another option?
>
> Thanks,
> Sean
> ------------------------------------------------------------------------
>
> _______________________________________________
> 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