Is there a standard name or implementation of the “purely applicative Either”?
问题 I frequently find use for what I call the "purely applicative Either ", i.e. Either with the Applicative instance available so long as we don't implement a Monad instance as well. newtype AEither e a = AEither { unAEither :: Either e a } deriving Functor -- technically we only need Semigroup instance Monoid e => Applicative (AEither e) where pure a = AEither (pure a) AEither e1 <*> AEither e2 = AEither (combine e1 e2) where combine (Right f) (Right a) = Right (f a) combine (Left m1) (Left m2)