The These type represents values with two non-exclusive possibilities.
This can be useful to represent combinations of two values, where the
combination is defined if either input is. Algebraically, the type
These A B represents (A + B + AB), which doesn't factor easily into
sums and products--a type like Either A (B, Maybe A) is unclear and
awkward to use.
These has straightforward instances of Functor, Monad, &c., and behaves like a hybrid error/writer monad, as would be expected.
Instances17Bifoldable, Bifunctor, Bitraversable, Monad, Functor, Applicative, …
Bifoldable TheseDefined in these-skinny-0.7.6 · Data.TheseBifunctor TheseDefined in these-skinny-0.7.6 · Data.TheseBitraversable TheseDefined in these-skinny-0.7.6 · Data.TheseSemigroup a => Monad (These a)Defined in these-skinny-0.7.6 · Data.TheseFunctor (These a)Defined in these-skinny-0.7.6 · Data.TheseSemigroup a => Applicative (These a)Defined in these-skinny-0.7.6 · Data.TheseFoldable (These a)Defined in these-skinny-0.7.6 · Data.TheseTraversable (These a)Defined in these-skinny-0.7.6 · Data.These(Eq a, Eq b) => Eq (These a b)Defined in these-skinny-0.7.6 · Data.These(Data a, Data b) => Data (These a b)Defined in these-skinny-0.7.6 · Data.These(Ord a, Ord b) => Ord (These a b)Defined in these-skinny-0.7.6 · Data.These(Read a, Read b) => Read (These a b)Defined in these-skinny-0.7.6 · Data.These(Show a, Show b) => Show (These a b)Defined in these-skinny-0.7.6 · Data.TheseGeneric (These a b)Defined in these-skinny-0.7.6 · Data.These(Semigroup a, Semigroup b) => Semigroup (These a b)Defined in these-skinny-0.7.6 · Data.These(NFData a, NFData b) => NFData (These a b)Defined in these-skinny-0.7.6 · Data.Thesetype Rep (These a b) = D1 ('MetaDataDefined in these-skinny-0.7.6 · Data.These"These"
"Data.These"
"these-skinny-0.7.6-FLu1Sy6K0CeJFKBs64adWc"
'False) (C1 ('MetaCons"This"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)) :+: (C1 ('MetaCons"That"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 b)) :+: C1 ('MetaCons"These"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 b))))