[Haskell-cafe] Stacking monads

Andrew Coppin andrewcoppin at btinternet.com
Fri Oct 3 16:37:57 EDT 2008


Jake McArthur wrote:
> Andrew Coppin wrote:
>> I was thinking more, why not just delete MonadPlus completely, and 
>> have any function that needs a monad that's also a monoid say so in 
>> its context? (Obviously one of the answers to that is "because it 
>> would break vast amounts of existing code".) 
> Because they are not the same. MonadPlus has more restrictions than 
> Monoid. For an instance of the form "instance MonadPlus m where", m a 
> _must_ be a Monoid for _all_ a, whereas "instance Monoid (m a) where" 
> may be defined for some specific a instead.

OK, fair enough then.



More information about the Haskell-Cafe mailing list