An Either3 inside f.
toConstr (Either3T [Third3 1] :: Either3TList String Bool Int)Either3T
to (from (Either3T [Third3 1] :: Either3TList String Bool Int)) :: Either3TList String Bool IntEither3T [Third3 1]
Instances57MonadRWS, Generic1, MonadError, MonadReader, MonadState, MonadWriter, …
MonadRWS r w s f => MonadRWS r w s (Either3T f a b)Defined in either-n-0.1.0.0 · Data.Either3.Either3TLifts MonadRWS from
f.Functor f => Generic1 (Either3T f a b)Defined in either-n-0.1.0.0 · Data.Either3.Either3TMonadError e f => MonadError e (Either3T f a b)Defined in either-n-0.1.0.0 · Data.Either3.Either3TLifts throwError and catchError from
f, as the instance forMaybeTdoes. First3 and Second3 are values, not errors, so catchError does not catch them.Example1 expression view _Wrapped (throwError "e" `catchError` (\e -> pure (length e)) :: Either3T (Either String) String Bool Int)Right (Third3 1)
Example1 expression view _Wrapped (review reviewEither3 (Second3 True) `catchError` (\_ -> pure 1) :: Either3T (Either String) String Bool Int)Right (Second3 True)
MonadReader r f => MonadReader r (Either3T f a b)Defined in either-n-0.1.0.0 · Data.Either3.Either3TMonadState s f => MonadState s (Either3T f a b)Defined in either-n-0.1.0.0 · Data.Either3.Either3TLifts state from
f.Example1 expression runState (view _Wrapped (modify (+ 1) >> get :: Either3T (State Int) String Bool Int)) 1(Third3 2,2)
MonadWriter w f => MonadWriter w (Either3T f a b)Defined in either-n-0.1.0.0 · Data.Either3.Either3TLifts tell, listen and pass from
f, as the instance forMaybeTdoes.Example1 expression runWriter (view _Wrapped (tell [1] >> listen (tell [2] >> pure 'x') :: Either3T (Writer [Int]) String Bool (Char, [Int])))(Third3 ('x',[2]),[1,2])
Example1 expression runWriter (view _Wrapped (pass (pure ('x', reverse)) <* tell [1, 2] :: Either3T (Writer [Int]) String Bool Char))(Third3 'x',[1,2])
Example1 expression runWriter (view _Wrapped (pass (tell [1, 2] >> pure ('x', reverse)) :: Either3T (Writer [Int]) String Bool Char))(Third3 'x',[2,1])
Foldable f => FoldableWithIndex () (Either3T f a b)Defined in either-n-0.1.0.0 · Data.Either3.Either3TFunctor f => FunctorWithIndex () (Either3T f a b)Defined in either-n-0.1.0.0 · Data.Either3.Either3TThe index is always
(), as for Maybe.Traversable f => TraversableWithIndex () (Either3T f a b)Defined in either-n-0.1.0.0 · Data.Either3.Either3TFoldable f => Bifoldable (Either3T f a)Defined in either-n-0.1.0.0 · Data.Either3.Either3TExample1 expression bifoldMap show show (Either3T [Second3 True, Third3 1] :: Either3TList String Bool Int)"True1"
Functor f => Bifunctor (Either3T f a)Defined in either-n-0.1.0.0 · Data.Either3.Either3TMaps the second and third type parameters.
Example1 expression bimap not (+ 1) (Either3T [Second3 True, Third3 1] :: Either3TList String Bool Int)Either3T [Second3 False,Third3 2]
Traversable f => Bitraversable (Either3T f a)Defined in either-n-0.1.0.0 · Data.Either3.Either3TExample1 expression bitraverse (Just . not) (Just . (+ 1)) (Either3T [Second3 True, Third3 1] :: Either3TList String Bool Int)Just (Either3T [Second3 False,Third3 2])
(Eq1 f, Eq a) => Eq2 (Either3T f a)Defined in either-n-0.1.0.0 · Data.Either3.Either3T(Ord1 f, Ord a) => Ord2 (Either3T f a)Defined in either-n-0.1.0.0 · Data.Either3.Either3T(Show1 f, Show a) => Show2 (Either3T f a)Defined in either-n-0.1.0.0 · Data.Either3.Either3TFunctor f => Swap (Either3T f a)Defined in either-n-0.1.0.0 · Data.Either3.Either3TSwaps the second and third type parameters.
Example1 expression swap (Either3T [Second3 True, Third3 1] :: Either3TList String Bool Int)Either3T [Third3 True,Second3 1]
Monad f => Monad (Either3T f a b)Defined in either-n-0.1.0.0 · Data.Either3.Either3TExample1 expression Either3T [Third3 1, Second3 True] >>= (\x -> Either3T [Third3 x, Third3 (x + 1)]) :: Either3TList String Bool IntEither3T [Third3 1,Third3 2,Second3 True]
Functor f => Functor (Either3T f a b)Defined in either-n-0.1.0.0 · Data.Either3.Either3TExample1 expression fmap (+ 1) (Either3T [Third3 1, Second3 True] :: Either3TList String Bool Int)Either3T [Third3 2,Second3 True]
MonadFail f => MonadFail (Either3T f a b)Defined in either-n-0.1.0.0 · Data.Either3.Either3TLifts fail from
f.Example1 expression fail "x" :: Either3TMaybe String Bool IntEither3T Nothing
Monad f => Applicative (Either3T f a b)Defined in either-n-0.1.0.0 · Data.Either3.Either3TExample1 expression pure 1 :: Either3TList String Bool IntEither3T [Third3 1]
Foldable f => Foldable (Either3T f a b)Defined in either-n-0.1.0.0 · Data.Either3.Either3TExample1 expression sum (Either3T [Third3 1, First3 "x", Third3 2] :: Either3TList String Bool Int)3
Traversable f => Traversable (Either3T f a b)Defined in either-n-0.1.0.0 · Data.Either3.Either3TExample1 expression traverse (\x -> Just (x + 1)) (Either3T [Third3 1, First3 "x"] :: Either3TList String Bool Int)Just (Either3T [Third3 2,First3 "x"])
MonadIO f => MonadIO (Either3T f a b)Defined in either-n-0.1.0.0 · Data.Either3.Either3TLifts liftIO from
f.Example1 expression view _Wrapped (liftIO (pure 1) :: Either3TIO String Bool Int)Third3 1
MonadZip f => MonadZip (Either3T f a b)Defined in either-n-0.1.0.0 · Data.Either3.Either3T(Eq1 f, Eq a, Eq b) => Eq1 (Either3T f a b)Defined in either-n-0.1.0.0 · Data.Either3.Either3T(Ord1 f, Ord a, Ord b) => Ord1 (Either3T f a b)Defined in either-n-0.1.0.0 · Data.Either3.Either3T(Show1 f, Show a, Show b) => Show1 (Either3T f a b)Defined in either-n-0.1.0.0 · Data.Either3.Either3TMonadCont f => MonadCont (Either3T f a b)Defined in either-n-0.1.0.0 · Data.Either3.Either3TLifts callCC from
f, as the instance forMaybeTdoes.Example1 expression runCont (view _Wrapped (callCC (\k -> k 1 >> review reviewEither3 (Second3 True)) :: Either3T (Cont r) String Bool Int)) idThird3 1
Monad f => Alt (Either3T f a b)Defined in either-n-0.1.0.0 · Data.Either3.Either3TThe first value that is Third3 wins, otherwise the second value, like Either.
Example1 expression Either3T [Second3 True] <!> Either3T [Third3 1] :: Either3TList String Bool IntEither3T [Third3 1]
Example1 expression Either3T [Second3 True] <!> Either3T [First3 "x"] :: Either3TList String Bool IntEither3T [First3 "x"]
Monad f => Apply (Either3T f a b)Defined in either-n-0.1.0.0 · Data.Either3.Either3TRuns the effects of the second argument only when the first is Third3.
Example1 expression Either3T [Third3 (+ 1), First3 "x"] <.> Either3T [Third3 1, Third3 2] :: Either3TList String Bool IntEither3T [Third3 2,Third3 3,First3 "x"]
Monad f => Bind (Either3T f a b)Defined in either-n-0.1.0.0 · Data.Either3.Either3TApplicative f => Extend (Either3T f a b)Defined in either-n-0.1.0.0 · Data.Either3.Either3TExample1 expression duplicated (Either3T [Third3 1, First3 "x"] :: Either3TList String Bool Int)Either3T [Third3 (Either3T [Third3 1]),First3 "x"]
Monad f => Selective (Either3T f a b)Defined in either-n-0.1.0.0 · Data.Either3.Either3TExample1 expression select (pure (Left 1)) (pure (+ 1)) :: Either3TList String Bool IntEither3T [Third3 2]
(Eq1 f, Eq a, Eq b, Eq c) => Eq (Either3T f a b c)Defined in either-n-0.1.0.0 · Data.Either3.Either3TExample1 expression Either3T [Third3 1] == (Either3T [Third3 1] :: Either3TList String Bool Int)True
Example1 expression Either3T [Third3 1] == (Either3T [Second3 True] :: Either3TList String Bool Int)False
(Typeable f, Data a, Data b, Data c, Data (f (Either3 a b c))) => Data (Either3T f a b c)Defined in either-n-0.1.0.0 · Data.Either3.Either3T(Ord1 f, Ord a, Ord b, Ord c) => Ord (Either3T f a b c)Defined in either-n-0.1.0.0 · Data.Either3.Either3TExample1 expression compare (Either3T [First3 "x"]) (Either3T [Third3 1] :: Either3TList String Bool Int)LT
(Show1 f, Show a, Show b, Show c) => Show (Either3T f a b c)Defined in either-n-0.1.0.0 · Data.Either3.Either3TExample1 expression Either3T [Third3 1, First3 "x"] :: Either3TList String Bool IntEither3T [Third3 1,First3 "x"]
Example1 expression e3 (Second3 True)Either3T (Identity (Second3 True))
Generic (Either3T f a b c)Defined in either-n-0.1.0.0 · Data.Either3.Either3TMonad f => Semigroup (Either3T f a b c)Defined in either-n-0.1.0.0 · Data.Either3.Either3T(NFData1 f, NFData a, NFData b, NFData c) => NFData (Either3T f a b c)Defined in either-n-0.1.0.0 · Data.Either3.Either3TExample1 expression rnf (Either3T [Third3 1, First3 "x"] :: Either3TList String Bool Int)()
Wrapped (Either3T f a b c)Defined in either-n-0.1.0.0 · Data.Either3.Either3TExample1 expression view _Wrapped (Either3T [Third3 1, First3 "x"] :: Either3TList String Bool Int)[Third3 1,First3 "x"]
Example1 expression review _Wrapped [Second3 True] :: Either3TList String Bool IntEither3T [Second3 True]
t ~ Either3T f' a' b' c' => Rewrapped (Either3T f a b c) tDefined in either-n-0.1.0.0 · Data.Either3.Either3TChanges the type constructor from lists to Maybe:
Example1 expression over _Wrapped (foldr (const . Just) Nothing) (Either3T [Third3 1, Third3 2] :: Either3TList String Bool Int) :: Either3TMaybe String Bool IntEither3T (Just (Third3 1))
AsEither3 (Either3T Identity a b c) a b cDefined in either-n-0.1.0.0 · Data.Either3.Either3TExample1 expression matchEither3 (e3 (Third3 1))Just (Third3 1)
Example1 expression e3 (Third3 1) ^? _Either3Just (Third3 1)
GetEither3 (Either3T Identity a b c) a b cDefined in either-n-0.1.0.0 · Data.Either3.Either3TExample1 expression view getEither3 (e3 (Third3 1))Third3 1
HasEither3 (Either3T Identity a b c) a b cDefined in either-n-0.1.0.0 · Data.Either3.Either3TExample1 expression setEither3 (Second3 True) (e3 (Third3 1))Either3T (Identity (Second3 True))
Applicative f => ReviewEither3 (Either3T f a b c) a b cDefined in either-n-0.1.0.0 · Data.Either3.Either3TAny Either3 can be put in an Applicative
f.Example1 expression review reviewEither3 (Second3 True) :: Either3TMaybe String Bool IntEither3T (Just (Second3 True))
AsEither3T (Either3T f a b c) f a b cDefined in either-n-0.1.0.0 · Data.Either3.Either3TGetEither3T (Either3T f a b c) f a b cDefined in either-n-0.1.0.0 · Data.Either3.Either3THasEither3T (Either3T f a b c) f a b cDefined in either-n-0.1.0.0 · Data.Either3.Either3TReviewEither3T (Either3T f a b c) f a b cDefined in either-n-0.1.0.0 · Data.Either3.Either3TTraversable f => Each (Either3T f a a a) (Either3T f b b b) a bDefined in either-n-0.1.0.0 · Data.Either3.Either3TTraverses every value inside
f.Example1 expression toListOf each (Either3T [First3 1, Second3 2, Third3 3] :: Either3TList Int Int Int)[1,2,3]
Injection1 (Either3T Identity a b c) (Either3T Identity a' b c) a a'Defined in either-n-0.1.0.0 · Data.Either3.Either3TExample1 expression e3 (First3 "x") ^? _I1Just "x"
Injection2 (Either3T Identity a b c) (Either3T Identity a b' c) b b'Defined in either-n-0.1.0.0 · Data.Either3.Either3TExample1 expression e3 (Second3 True) ^? _I2Just True
Injection3 (Either3T Identity a b c) (Either3T Identity a b c') c c'Defined in either-n-0.1.0.0 · Data.Either3.Either3TExample1 expression e3 (Third3 1) ^? _I3Just 1
Example1 expression e3 (First3 "x") ^? _I3Nothing
type Rep (Either3T f a b c) = D1 ('MetaDataDefined in either-n-0.1.0.0 · Data.Either3.Either3T"Either3T"
"Data.Either3.Either3T"
"either-n-0.1.0.0-CpOhhAwrwgx6b0mOF5Mcu"
'True) (C1 ('MetaCons"Either3T"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f (Either3 a b c)))))type Rep1 (Either3T f a b) = D1 ('MetaDataDefined in either-n-0.1.0.0 · Data.Either3.Either3T"Either3T"
"Data.Either3.Either3T"
"either-n-0.1.0.0-CpOhhAwrwgx6b0mOF5Mcu"
'True) (C1 ('MetaCons"Either3T"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (f :.: Rec1 (Either3 a b))))type Unwrapped (Either3T f a b c) = f (Either3 a b c)Defined in either-n-0.1.0.0 · Data.Either3.Either3T