proposal #4095: add Applicative instance for Either

Ross Paterson ross at soi.city.ac.uk
Tue May 25 08:41:59 EDT 2010


The proposal is to add this instance to Control.Applicative:

    instance Applicative (Either e) where
        pure          = Right
        Left  e <*> _ = Left e
        Right f <*> r = fmap f r

This is not the only possible instance for Either, but this one is
compatible with the usual Monad instance.

Deadline: 15th June 2010


More information about the Libraries mailing list