A value of one of three types, similar to Either.
The Functor, Applicative and Monad instances act on the third type parameter, so First3 and Second3 short-circuit, in the same way Left does for Either.
toConstr (Second3 True :: Either3 String Bool Int)Second3
to (from (Third3 1 :: Either3 String Bool Int)) :: Either3 String Bool IntThird3 1
Instances42Generic1, FoldableWithIndex, FunctorWithIndex, TraversableWithIndex, Bifoldable, Bifunctor, …
Generic1 (Either3 a b)Defined in either-n-0.1.0.0 · Data.Either3.Either3FoldableWithIndex () (Either3 a b)Defined in either-n-0.1.0.0 · Data.Either3.Either3FunctorWithIndex () (Either3 a b)Defined in either-n-0.1.0.0 · Data.Either3.Either3The index is always
(), as for Maybe.Example1 expression imap (\() x -> x + 1) (Third3 1 :: Either3 String Bool Int)Third3 2
TraversableWithIndex () (Either3 a b)Defined in either-n-0.1.0.0 · Data.Either3.Either3Bifoldable (Either3 a)Defined in either-n-0.1.0.0 · Data.Either3.Either3Example1 expression bifoldMap show show (Second3 True :: Either3 String Bool Int)"True"
Example1 expression bifoldMap show show (First3 "x" :: Either3 String Bool Int)""
Bifunctor (Either3 a)Defined in either-n-0.1.0.0 · Data.Either3.Either3Maps the second and third type parameters.
Example1 expression bimap not (+ 1) (Second3 True :: Either3 String Bool Int)Second3 False
Example1 expression bimap not (+ 1) (Third3 1 :: Either3 String Bool Int)Third3 2
Bitraversable (Either3 a)Defined in either-n-0.1.0.0 · Data.Either3.Either3Example1 expression bitraverse (\b -> [b, not b]) (\c -> [c]) (Second3 True :: Either3 String Bool Int)[Second3 True,Second3 False]
Eq a => Eq2 (Either3 a)Defined in either-n-0.1.0.0 · Data.Either3.Either3Example1 expression liftEq2 (==) (==) (Second3 1 :: Either3 String Int Int) (Second3 1)True
Example1 expression liftEq2 (==) (==) (Second3 1 :: Either3 String Int Int) (Third3 1)False
Ord a => Ord2 (Either3 a)Defined in either-n-0.1.0.0 · Data.Either3.Either3Show a => Show2 (Either3 a)Defined in either-n-0.1.0.0 · Data.Either3.Either3Swap (Either3 a)Defined in either-n-0.1.0.0 · Data.Either3.Either3Swaps the second and third type parameters.
Example1 expression swap (Second3 True :: Either3 String Bool Int)Third3 True
Example1 expression swap (First3 "x" :: Either3 String Bool Int)First3 "x"
Monad (Either3 a b)Defined in either-n-0.1.0.0 · Data.Either3.Either3Example1 expression Third3 1 >>= (\x -> if x > 0 then Third3 (x + 1) else Second3 False) :: Either3 String Bool IntThird3 2
Example1 expression Second3 True >>= (\x -> Third3 (x + 1)) :: Either3 String Bool IntSecond3 True
Functor (Either3 a b)Defined in either-n-0.1.0.0 · Data.Either3.Either3Example1 expression fmap (+ 1) (Third3 1 :: Either3 String Bool Int)Third3 2
Example1 expression fmap (+ 1) (Second3 True :: Either3 String Bool Int)Second3 True
Applicative (Either3 a b)Defined in either-n-0.1.0.0 · Data.Either3.Either3Example1 expression pure 1 :: Either3 String Bool IntThird3 1
Example1 expression Third3 (+ 1) <*> Second3 True :: Either3 String Bool IntSecond3 True
Foldable (Either3 a b)Defined in either-n-0.1.0.0 · Data.Either3.Either3Example1 expression sum (Third3 1 :: Either3 String Bool Int)1
Example1 expression length (First3 "x" :: Either3 String Bool Int)0
Traversable (Either3 a b)Defined in either-n-0.1.0.0 · Data.Either3.Either3Example1 expression traverse (\x -> [x, x + 1]) (Third3 1 :: Either3 String Bool Int)[Third3 1,Third3 2]
Example1 expression traverse (\x -> [x, x + 1]) (Second3 True :: Either3 String Bool Int)[Second3 True]
MonadZip (Either3 a b)Defined in either-n-0.1.0.0 · Data.Either3.Either3(Eq a, Eq b) => Eq1 (Either3 a b)Defined in either-n-0.1.0.0 · Data.Either3.Either3Example1 expression liftEq (==) (Third3 1 :: Either3 String Bool Int) (Third3 1)True
(Ord a, Ord b) => Ord1 (Either3 a b)Defined in either-n-0.1.0.0 · Data.Either3.Either3Example1 expression liftCompare compare (Second3 True :: Either3 String Bool Int) (Third3 1)LT
(Show a, Show b) => Show1 (Either3 a b)Defined in either-n-0.1.0.0 · Data.Either3.Either3Alt (Either3 a b)Defined in either-n-0.1.0.0 · Data.Either3.Either3Apply (Either3 a b)Defined in either-n-0.1.0.0 · Data.Either3.Either3Example1 expression Third3 (+ 1) <.> Third3 1 :: Either3 String Bool IntThird3 2
Example1 expression First3 "x" <.> Second3 True :: Either3 String Bool IntFirst3 "x"
Bind (Either3 a b)Defined in either-n-0.1.0.0 · Data.Either3.Either3Example1 expression Third3 1 >>- (\x -> Third3 (x + 1)) :: Either3 String Bool IntThird3 2
Extend (Either3 a b)Defined in either-n-0.1.0.0 · Data.Either3.Either3Example1 expression duplicated (Third3 1 :: Either3 String Bool Int)Third3 (Third3 1)
Example1 expression duplicated (Second3 True :: Either3 String Bool Int)Second3 True
Selective (Either3 a b)Defined in either-n-0.1.0.0 · Data.Either3.Either3Example1 expression select (Third3 (Left 1)) (Third3 (+ 1)) :: Either3 String Bool IntThird3 2
Example1 expression select (Third3 (Right 1)) (Second3 True) :: Either3 String Bool IntThird3 1
(Eq a, Eq b, Eq c) => Eq (Either3 a b c)Defined in either-n-0.1.0.0 · Data.Either3.Either3(Data a, Data b, Data c) => Data (Either3 a b c)Defined in either-n-0.1.0.0 · Data.Either3.Either3(Ord a, Ord b, Ord c) => Ord (Either3 a b c)Defined in either-n-0.1.0.0 · Data.Either3.Either3(Show a, Show b, Show c) => Show (Either3 a b c)Defined in either-n-0.1.0.0 · Data.Either3.Either3Generic (Either3 a b c)Defined in either-n-0.1.0.0 · Data.Either3.Either3Semigroup (Either3 a b c)Defined in either-n-0.1.0.0 · Data.Either3.Either3(NFData a, NFData b, NFData c) => NFData (Either3 a b c)Defined in either-n-0.1.0.0 · Data.Either3.Either3AsEither3 (Either3 a b c) a b cDefined in either-n-0.1.0.0 · Data.Either3.Either3GetEither3 (Either3 a b c) a b cDefined in either-n-0.1.0.0 · Data.Either3.Either3HasEither3 (Either3 a b c) a b cDefined in either-n-0.1.0.0 · Data.Either3.Either3ReviewEither3 (Either3 a b c) a b cDefined in either-n-0.1.0.0 · Data.Either3.Either3Each (Either3 a a a) (Either3 b b b) a bDefined in either-n-0.1.0.0 · Data.Either3.Either3Traverses the single value, like the Each instance for
Either a a.Example1 expression over each (+ 1) (Second3 1 :: Either3 Int Int Int)Second3 2
Example1 expression toListOf each (First3 1 :: Either3 Int Int Int)[1]
Injection1 (Either3 a b c) (Either3 a' b c) a a'Defined in either-n-0.1.0.0 · Data.Either3.Either3Example1 expression (First3 1 :: Either3 Int Bool String) ^? _I1Just 1
Example1 expression over _I1 show (First3 1 :: Either3 Int Bool String)First3 "1"
Injection2 (Either3 a b c) (Either3 a b' c) b b'Defined in either-n-0.1.0.0 · Data.Either3.Either3Example1 expression (Second3 True :: Either3 Int Bool String) ^? _I2Just True
Example1 expression _I2 # True :: Either3 Int Bool StringSecond3 True
Injection3 (Either3 a b c) (Either3 a b c') c c'Defined in either-n-0.1.0.0 · Data.Either3.Either3Example1 expression (Third3 "x" :: Either3 Int Bool String) ^? _I3Just "x"
Example1 expression (First3 1 :: Either3 Int Bool String) ^? _I3Nothing
type Rep (Either3 a b c) = D1 ('MetaDataDefined in either-n-0.1.0.0 · Data.Either3.Either3"Either3"
"Data.Either3.Either3"
"either-n-0.1.0.0-CpOhhAwrwgx6b0mOF5Mcu"
'False) (C1 ('MetaCons"First3"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)) :+: (C1 ('MetaCons"Second3"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 b)) :+: C1 ('MetaCons"Third3"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 c))))type Rep1 (Either3 a b) = D1 ('MetaDataDefined in either-n-0.1.0.0 · Data.Either3.Either3"Either3"
"Data.Either3.Either3"
"either-n-0.1.0.0-CpOhhAwrwgx6b0mOF5Mcu"
'False) (C1 ('MetaCons"First3"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)) :+: (C1 ('MetaCons"Second3"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 b)) :+: C1 ('MetaCons"Third3"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1)))