proposal #4095: add Applicative instance for Either

Ross Paterson ross at
Tue May 25 18:34:11 EDT 2010

On Tue, May 25, 2010 at 04:55:09PM -0400, Edward Kmett wrote:
> In my perfect world the next version of transformers would provide an entry in
> Control.Monad.Instances for:
> instance Applicative (Either m)
> instance Alternative (Either m)
> instance Monad (Either m)
> instance MonadPlus (Either m)

What definition of empty/mzero do you have in mind?

> But there are quite possibly too many moving parts to make such a big
> jump, and then you have the other bikeshedding issue of there being
> yet another definition for Either that makes sense to default to:
> instance Monoid m => Applicative (Either m)
> instance Monoid m => Alternative (Either m)
> instance Monoid m => Monad (Either m)
> instance Monoid m => MonadPlus (Either m)

I can't think of a Monad instance that uses the Monoid constraint.
What is the instance you mean?

More information about the Libraries mailing list