
25 May
2010
25 May
'10
9:15 a.m.
On Tue, 25 May 2010, Ross Paterson wrote:
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.
What other sensible instances are there? Nevertheless I think, since the Monad instance for Either exists, there is no choice other than make the Applicative instance compatible to it and it is better than no instance at all, in order to prevent orphan instances in user modules.