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, is unclear and
awkward to use.Maybe A)
These has straightforward instances of Functor, Monad, &c., and behaves like a hybrid error/writer monad, as would be expected.
For zipping and unzipping of structures with These values, see
Data.Align.
Instances36Bifoldable, Bifoldable1, Bifunctor, Bitraversable, Eq2, Ord2, …
Bifoldable TheseDefined in these-1.2.1 · Data.TheseBifoldable1 TheseDefined in these-1.2.1 · Data.TheseBifunctor TheseDefined in these-1.2.1 · Data.TheseBitraversable TheseDefined in these-1.2.1 · Data.TheseEq2 TheseDefined in these-1.2.1 · Data.TheseOrd2 TheseDefined in these-1.2.1 · Data.TheseRead2 TheseDefined in these-1.2.1 · Data.TheseShow2 TheseDefined in these-1.2.1 · Data.TheseNFData2 TheseDefined in these-1.2.1 · Data.TheseHashable2 TheseDefined in these-1.2.1 · Data.TheseAssoc TheseDefined in these-1.2.1 · Data.TheseSwap TheseDefined in these-1.2.1 · Data.TheseGeneric1 (These a)Defined in these-1.2.1 · Data.TheseSemigroup a => Monad (These a)Defined in these-1.2.1 · Data.TheseFunctor (These a)Defined in these-1.2.1 · Data.TheseSemigroup a => Applicative (These a)Defined in these-1.2.1 · Data.TheseFoldable (These a)Defined in these-1.2.1 · Data.TheseTraversable (These a)Defined in these-1.2.1 · Data.TheseEq a => Eq1 (These a)Defined in these-1.2.1 · Data.TheseOrd a => Ord1 (These a)Defined in these-1.2.1 · Data.TheseRead a => Read1 (These a)Defined in these-1.2.1 · Data.TheseShow a => Show1 (These a)Defined in these-1.2.1 · Data.TheseNFData a => NFData1 (These a)Defined in these-1.2.1 · Data.TheseHashable a => Hashable1 (These a)Defined in these-1.2.1 · Data.These(Eq a, Eq b) => Eq (These a b)Defined in these-1.2.1 · Data.These(Data a, Data b) => Data (These a b)Defined in these-1.2.1 · Data.These(Ord a, Ord b) => Ord (These a b)Defined in these-1.2.1 · Data.These(Read a, Read b) => Read (These a b)Defined in these-1.2.1 · Data.These(Show a, Show b) => Show (These a b)Defined in these-1.2.1 · Data.TheseGeneric (These a b)Defined in these-1.2.1 · Data.These(Semigroup a, Semigroup b) => Semigroup (These a b)Defined in these-1.2.1 · Data.These(NFData a, NFData b) => NFData (These a b)Defined in these-1.2.1 · Data.These(Binary a, Binary b) => Binary (These a b)Defined in these-1.2.1 · Data.These(Hashable a, Hashable b) => Hashable (These a b)Defined in these-1.2.1 · Data.Thesetype Rep (These a b) = D1 ('MetaDataDefined in these-1.2.1 · Data.These"These"
"Data.These"
"these-1.2.1-G6ENQNNUC7y1I0pgW1csHe"
'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))))type Rep1 (These a) = D1 ('MetaDataDefined in these-1.2.1 · Data.These"These"
"Data.These"
"these-1.2.1-G6ENQNNUC7y1I0pgW1csHe"
'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) Par1) :+: C1 ('MetaCons"These"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1)))