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

Sebastian Fischer sebf at informatik.uni-kiel.de
Sun May 2 06:07:30 EDT 2010


On May 2, 2010, at 11:10 AM, Sean Leather wrote:

>
> Or should I make my own class?
>
> Then, there obviously won't be any instances for existing types  
> other than your own (which might be a good or bad thing). You may  
> want to do this, if you don't want to require either (>>=) or (<*>),  
> which may not be supported for reasonable instances of your own class.
>
> I don't really want to do this option, because it increases the  
> understanding overhead needlessly, I think. Everything else that is  
> provided by Applicative/Monad doesn't matter. I require only the  
> three operations above and do not disallow extra operations.

By not making your own class, you prohibit types that do not support  
<*> (or >>=). That's fine, but an additional burden to instance  
writers. By not listing extra operations in your own class you would  
not disallow them. You require them by not making your own class  
without them.

But still, your wish to reuse existing classes may be a fine reason to  
impose an additional burden.

Sebastian

-- 
Underestimating the novelty of the future is a time-honored tradition.
(D.G.)





More information about the Haskell-Cafe mailing list