these-1.2: An either-or-both data type.

Safe Haskell | Safe
Language | Haskell2010

Data.Functor.These

# Documentation

data These1 f g a Source #

Constructors

This1 (f a) |
That1 (g a) |
These1 (f a) (g a) |

#### Instances

Instances details

Generic1 (These1 f g :: Type -> Type) Source # |
Instance details Defined in Data.Functor.These Associated Types type Rep1 (These1 f g) :: k -> Type Source # Methods from1 :: forall (a :: k). These1 f g a -> Rep1 (These1 f g) a Source # to1 :: forall (a :: k). Rep1 (These1 f g) a -> These1 f g a Source #
(Foldable f, Foldable g) => Foldable (These1 f g) Source # |

Instance details

Defined in Data.Functor.These

Methods

fold :: Monoid m => These1 f g m -> m Source #

foldMap :: Monoid m => (a -> m) -> These1 f g a -> m Source #

foldMap' :: Monoid m => (a -> m) -> These1 f g a -> m Source #

foldr :: (a -> b -> b) -> b -> These1 f g a -> b Source #

foldr' :: (a -> b -> b) -> b -> These1 f g a -> b Source #

foldl :: (b -> a -> b) -> b -> These1 f g a -> b Source #

foldl' :: (b -> a -> b) -> b -> These1 f g a -> b Source #

foldr1 :: (a -> a -> a) -> These1 f g a -> a Source #

foldl1 :: (a -> a -> a) -> These1 f g a -> a Source #

toList :: These1 f g a -> [a] Source #

null :: These1 f g a -> Bool Source #

length :: These1 f g a -> Int Source #

elem :: Eq a => a -> These1 f g a -> Bool Source #

maximum :: Ord a => These1 f g a -> a Source #

minimum :: Ord a => These1 f g a -> a Source #

sum :: Num a => These1 f g a -> a Source #

product :: Num a => These1 f g a -> a Source #

(Eq1 f, Eq1 g) => Eq1 (These1 f g) Source # |
Instance details Defined in Data.Functor.These Methods liftEq :: (a -> b -> Bool) -> These1 f g a -> These1 f g b -> Bool Source #
(Ord1 f, Ord1 g) => Ord1 (These1 f g) Source # |
Instance details Defined in Data.Functor.These Methods liftCompare :: (a -> b -> Ordering) -> These1 f g a -> These1 f g b -> Ordering Source #
(Read1 f, Read1 g) => Read1 (These1 f g) Source # |
Instance details Defined in Data.Functor.These Methods liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (These1 f g a) Source # liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [These1 f g a] Source # liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (These1 f g a) Source # liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [These1 f g a] Source #
(Show1 f, Show1 g) => Show1 (These1 f g) Source # |
Instance details Defined in Data.Functor.These Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> These1 f g a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [These1 f g a] -> ShowS Source #
(Traversable f, Traversable g) => Traversable (These1 f g) Source # |
Instance details Defined in Data.Functor.These Methods traverse :: Applicative f0 => (a -> f0 b) -> These1 f g a -> f0 (These1 f g b) Source # sequenceA :: Applicative f0 => These1 f g (f0 a) -> f0 (These1 f g a) Source # mapM :: Monad m => (a -> m b) -> These1 f g a -> m (These1 f g b) Source # sequence :: Monad m => These1 f g (m a) -> m (These1 f g a) Source #
(Functor f, Functor g) => Functor (These1 f g) Source # |
Instance details Defined in Data.Functor.These Methods fmap :: (a -> b) -> These1 f g a -> These1 f g b Source # (<$) :: a -> These1 f g b -> These1 f g a Source #
(NFData1 f, NFData1 g) => NFData1 (These1 f g) Source # | This instance is available only with `deepseq >= 1.4.3.0`
Instance details Defined in Data.Functor.These Methods liftRnf :: (a -> ()) -> These1 f g a -> () Source #
(Foldable1 f, Foldable1 g) => Foldable1 (These1 f g) Source # | Since: 1.2

Instance details

Defined in Data.Functor.These

Methods

fold1 :: Semigroup m => These1 f g m -> m Source #

foldMap1 :: Semigroup m => (a -> m) -> These1 f g a -> m Source #

foldMap1' :: Semigroup m => (a -> m) -> These1 f g a -> m Source #

toNonEmpty :: These1 f g a -> NonEmpty a Source #

maximum :: Ord a => These1 f g a -> a Source #

minimum :: Ord a => These1 f g a -> a Source #

head :: These1 f g a -> a Source #

last :: These1 f g a -> a Source #

foldrMap1 :: (a -> b) -> (a -> b -> b) -> These1 f g a -> b Source #

foldlMap1' :: (a -> b) -> (b -> a -> b) -> These1 f g a -> b Source #

foldlMap1 :: (a -> b) -> (b -> a -> b) -> These1 f g a -> b Source #

foldrMap1' :: (a -> b) -> (a -> b -> b) -> These1 f g a -> b Source #

(Typeable f, Typeable g, Typeable a, Data (f a), Data (g a)) => Data (These1 f g a) Source # |

Instance details

Defined in Data.Functor.These

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g0. g0 -> c g0) -> These1 f g a -> c (These1 f g a) Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (These1 f g a) Source #

toConstr :: These1 f g a -> Constr Source #

dataTypeOf :: These1 f g a -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (These1 f g a)) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (These1 f g a)) Source #

gmapT :: (forall b. Data b => b -> b) -> These1 f g a -> These1 f g a Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> These1 f g a -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> These1 f g a -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> These1 f g a -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> These1 f g a -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> These1 f g a -> m (These1 f g a) Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> These1 f g a -> m (These1 f g a) Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> These1 f g a -> m (These1 f g a) Source #

Generic (These1 f g a) Source # |
Instance details Defined in Data.Functor.These Associated Types type Rep (These1 f g a) :: Type -> Type Source # Methods from :: These1 f g a -> Rep (These1 f g a) x Source # to :: Rep (These1 f g a) x -> These1 f g a Source #
(Read (f a), Read (g a), Read a) => Read (These1 f g a) Source # |
Instance details Defined in Data.Functor.These Methods readsPrec :: Int -> ReadS (These1 f g a) Source # readList :: ReadS [These1 f g a] Source # readPrec :: ReadPrec (These1 f g a) Source # readListPrec :: ReadPrec [These1 f g a] Source #
(Show (f a), Show (g a), Show a) => Show (These1 f g a) Source # |
Instance details Defined in Data.Functor.These Methods showsPrec :: Int -> These1 f g a -> ShowS Source # show :: These1 f g a -> String Source # showList :: [These1 f g a] -> ShowS Source #
(NFData (f a), NFData (g a), NFData a) => NFData (These1 f g a) Source # | Available always Since: 1.2
Instance details Defined in Data.Functor.These Methods rnf :: These1 f g a -> () Source #
(Eq (f a), Eq (g a), Eq a) => Eq (These1 f g a) Source # |
Instance details Defined in Data.Functor.These Methods (==) :: These1 f g a -> These1 f g a -> Bool Source # (/=) :: These1 f g a -> These1 f g a -> Bool Source #
(Ord (f a), Ord (g a), Ord a) => Ord (These1 f g a) Source # |

Instance details

Defined in Data.Functor.These

Methods

compare :: These1 f g a -> These1 f g a -> Ordering Source #

(<) :: These1 f g a -> These1 f g a -> Bool Source #

(<=) :: These1 f g a -> These1 f g a -> Bool Source #

(>) :: These1 f g a -> These1 f g a -> Bool Source #

(>=) :: These1 f g a -> These1 f g a -> Bool Source #

max :: These1 f g a -> These1 f g a -> These1 f g a Source #

min :: These1 f g a -> These1 f g a -> These1 f g a Source #

type Rep1 (These1 f g :: Type -> Type) Source # |

Instance details

Defined in Data.Functor.These

type Rep1 (These1 f g :: Type -> Type) = D1 ('MetaData "These1" "Data.Functor.These" "these-1.2-8V7FPuL6yW3JB1qEgOCqdq" 'False) (C1 ('MetaCons "This1" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 f)) :+: (C1 ('MetaCons "That1" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 g)) :+: C1 ('MetaCons "These1" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 f) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 g))))

type Rep (These1 f g a) Source # |

Instance details

Defined in Data.Functor.These

type Rep (These1 f g a) = D1 ('MetaData "These1" "Data.Functor.These" "these-1.2-8V7FPuL6yW3JB1qEgOCqdq" 'False) (C1 ('MetaCons "This1" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f a))) :+: (C1 ('MetaCons "That1" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (g a))) :+: C1 ('MetaCons "These1" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f a)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (g a)))))