This module provides three different datatypes: AEither
is the
applicative version of Either. It does not provide a monad instance, and
mappend
s together error values. MEither
is the monadic version, which
only holds onto the first error value. MEitherT
is a monad transformer.
Also, *Either datatypes and utility functions from Data.Either
are generalized with Neither
type class.
 data AEither a b
 aeither :: (a > c) > (b > c) > AEither a b > c
 data MEither a b
 meither :: (a > c) > (b > c) > MEither a b > c
 newtype MEitherT e m a = MEitherT {
 runMEitherT :: m (MEither e a)
 mapMEitherT :: (m (MEither e a) > n (MEither e' b)) > MEitherT e m a > MEitherT e' n b
 throwMEither :: Monad m => e > MEitherT e m a
 class Neither e where
 mapLeft :: Neither e => (a > c) > e a b > e c b
 mapRight :: Neither e => (b > c) > e a b > e a c
 mapEither :: Neither e => (a > c) > (b > d) > e a b > e c d
 lefts :: (Neither e, MonadPlus m) => m (e a b) > m a
 rights :: (Neither e, MonadPlus m) => m (e a b) > m b
 partitionEithers :: (Neither e, MonadPlus m) => m (e a b) > (m a, m b)
Applicative version
Monadic version
Typeable2 MEither  
Neither MEither  
Failure e (MEither e)  
Monad (MEither a)  
Functor (MEither a)  
Applicative (MEither a)  
(Eq a, Eq b) => Eq (MEither a b)  
(Data a, Data b) => Data (MEither a b)  
(Ord a, Ord b) => Ord (MEither a b)  
(Read a, Read b) => Read (MEither a b)  
(Show a, Show b) => Show (MEither a b) 
Monad transformer
MEitherT  

Monad m => Failure e (MEitherT e m)  
MonadTrans (MEitherT e)  
MonadTrans (MEitherT e)  
Monad m => Monad (MEitherT e m)  
Functor m => Functor (MEitherT e m)  
(Functor m, Monad m) => Applicative (MEitherT e m)  
MonadCatchIO m => MonadCatchIO (MEitherT e m)  
MonadCatchIO m => MonadCatchIO (MEitherT e m)  
MonadIO m => MonadIO (MEitherT e m)  
MonadIO m => MonadIO (MEitherT e m) 
throwMEither :: Monad m => e > MEitherT e m aSource
Neither typeclass
Utility functions
partitionEithers :: (Neither e, MonadPlus m) => m (e a b) > (m a, m b)Source