Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Documentation
The EitherS
type represents values with two possibilities:
a value of type EitherS
a b
is either LeftS
a
or RightS
b
.
The EitherS
type is sometimes used to represent a value which is either correct or an error;
by convention, the LeftS
constructor is used to hold an error value and the RightS
constructor
is used to hold a correct value (mnemonic: "right" also means "correct").
This type differs from Either
in the Semigroup
instance, requiring
the LeftS
type to be a Semigroup
in the first place.
Instances
Bifoldable EitherS Source # | |
Bifoldable1 EitherS Source # | |
Defined in Data.Either.Semigroup | |
Bifunctor EitherS Source # | |
Bitraversable EitherS Source # | |
Defined in Data.Either.Semigroup bitraverse :: Applicative f => (a -> f c) -> (b -> f d) -> EitherS a b -> f (EitherS c d) # | |
Eq2 EitherS Source # | |
Ord2 EitherS Source # | |
Defined in Data.Either.Semigroup | |
Generic1 (EitherS l :: Type -> Type) Source # | |
Monoid l => MonadFix (EitherS l) Source # | |
Defined in Data.Either.Semigroup | |
Foldable (EitherS l) Source # | |
Defined in Data.Either.Semigroup fold :: Monoid m => EitherS l m -> m # foldMap :: Monoid m => (a -> m) -> EitherS l a -> m # foldMap' :: Monoid m => (a -> m) -> EitherS l a -> m # foldr :: (a -> b -> b) -> b -> EitherS l a -> b # foldr' :: (a -> b -> b) -> b -> EitherS l a -> b # foldl :: (b -> a -> b) -> b -> EitherS l a -> b # foldl' :: (b -> a -> b) -> b -> EitherS l a -> b # foldr1 :: (a -> a -> a) -> EitherS l a -> a # foldl1 :: (a -> a -> a) -> EitherS l a -> a # toList :: EitherS l a -> [a] # length :: EitherS l a -> Int # elem :: Eq a => a -> EitherS l a -> Bool # maximum :: Ord a => EitherS l a -> a # minimum :: Ord a => EitherS l a -> a # | |
Eq l => Eq1 (EitherS l) Source # | |
Ord l => Ord1 (EitherS l) Source # | |
Defined in Data.Either.Semigroup | |
Traversable (EitherS l) Source # | |
Monoid l => Applicative (EitherS l) Source # | |
Functor (EitherS l) Source # | |
Monoid l => Monad (EitherS l) Source # | |
(Data l, Data r) => Data (EitherS l r) Source # | |
Defined in Data.Either.Semigroup gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> EitherS l r -> c (EitherS l r) # gunfold :: (forall b r0. Data b => c (b -> r0) -> c r0) -> (forall r1. r1 -> c r1) -> Constr -> c (EitherS l r) # toConstr :: EitherS l r -> Constr # dataTypeOf :: EitherS l r -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (EitherS l r)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (EitherS l r)) # gmapT :: (forall b. Data b => b -> b) -> EitherS l r -> EitherS l r # gmapQl :: (r0 -> r' -> r0) -> r0 -> (forall d. Data d => d -> r') -> EitherS l r -> r0 # gmapQr :: forall r0 r'. (r' -> r0 -> r0) -> r0 -> (forall d. Data d => d -> r') -> EitherS l r -> r0 # gmapQ :: (forall d. Data d => d -> u) -> EitherS l r -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> EitherS l r -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> EitherS l r -> m (EitherS l r) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> EitherS l r -> m (EitherS l r) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> EitherS l r -> m (EitherS l r) # | |
Monoid l => Monoid (EitherS l r) Source # | |
Semigroup l => Semigroup (EitherS l r) Source # | |
Generic (EitherS l r) Source # | |
(Read l, Read r) => Read (EitherS l r) Source # | |
(Show l, Show r) => Show (EitherS l r) Source # | |
(Eq l, Eq r) => Eq (EitherS l r) Source # | |
(Ord l, Ord r) => Ord (EitherS l r) Source # | |
Defined in Data.Either.Semigroup | |
type Rep1 (EitherS l :: Type -> Type) Source # | |
Defined in Data.Either.Semigroup type Rep1 (EitherS l :: Type -> Type) = D1 ('MetaData "EitherS" "Data.Either.Semigroup" "either-semigroup-0.0.0-5WwuG8pZdMj2XWe6dQdloY" 'False) (C1 ('MetaCons "LeftS" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 l)) :+: C1 ('MetaCons "RightS" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1)) | |
type Rep (EitherS l r) Source # | |
Defined in Data.Either.Semigroup type Rep (EitherS l r) = D1 ('MetaData "EitherS" "Data.Either.Semigroup" "either-semigroup-0.0.0-5WwuG8pZdMj2XWe6dQdloY" 'False) (C1 ('MetaCons "LeftS" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 l)) :+: C1 ('MetaCons "RightS" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 r))) |