these-0.8: An either-or-both data type & a generalized 'zip with padding' typeclass

Safe HaskellNone
LanguageHaskell2010

Data.Functor.These

Documentation

data These1 f g a Source #

Constructors

This1 (f a) 
That1 (g a) 
These1 (f a) (g a) 
Instances
Generic1 (These1 f g :: Type -> Type) Source # 
Instance details

Defined in Data.Functor.These

Associated Types

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

Methods

from1 :: These1 f g a -> Rep1 (These1 f g) a #

to1 :: Rep1 (These1 f g) a -> These1 f g a #

(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 #

(<$) :: a -> These1 f g b -> These1 f g a #

(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 #

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

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

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

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

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

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

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

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

null :: These1 f g a -> Bool #

length :: These1 f g a -> Int #

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

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

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

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

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

(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) #

sequenceA :: Applicative f0 => These1 f g (f0 a) -> f0 (These1 f g a) #

mapM :: Monad m => (a -> m b) -> These1 f g a -> m (These1 f g b) #

sequence :: Monad m => These1 f g (m a) -> m (These1 f g a) #

(Arbitrary1 f, Arbitrary1 g) => Arbitrary1 (These1 f g) Source # 
Instance details

Defined in Data.Functor.These

Methods

liftArbitrary :: Gen a -> Gen (These1 f g a) #

liftShrink :: (a -> [a]) -> These1 f g a -> [These1 f g a] #

(ToJSON1 f, ToJSON1 g) => ToJSON1 (These1 f g) Source # 
Instance details

Defined in Data.Functor.These

Methods

liftToJSON :: (a -> Value) -> ([a] -> Value) -> These1 f g a -> Value #

liftToJSONList :: (a -> Value) -> ([a] -> Value) -> [These1 f g a] -> Value #

liftToEncoding :: (a -> Encoding) -> ([a] -> Encoding) -> These1 f g a -> Encoding #

liftToEncodingList :: (a -> Encoding) -> ([a] -> Encoding) -> [These1 f g a] -> Encoding #

(FromJSON1 f, FromJSON1 g) => FromJSON1 (These1 f g) Source # 
Instance details

Defined in Data.Functor.These

Methods

liftParseJSON :: (Value -> Parser a) -> (Value -> Parser [a]) -> Value -> Parser (These1 f g a) #

liftParseJSONList :: (Value -> Parser a) -> (Value -> Parser [a]) -> Value -> Parser [These1 f g a] #

(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 #

(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 #

(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) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [These1 f g a] #

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (These1 f g a) #

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [These1 f g a] #

(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 #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [These1 f g a] -> ShowS #

(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 -> () #

(Eq1 f, Eq1 g, 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 #

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

(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) #

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

toConstr :: These1 f g a -> Constr #

dataTypeOf :: These1 f g a -> DataType #

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

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

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

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

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

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

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

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

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

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

(Ord1 f, Ord1 g, 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 #

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

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

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

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

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

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

(Read1 f, Read1 g, Read a) => Read (These1 f g a) Source # 
Instance details

Defined in Data.Functor.These

Methods

readsPrec :: Int -> ReadS (These1 f g a) #

readList :: ReadS [These1 f g a] #

readPrec :: ReadPrec (These1 f g a) #

readListPrec :: ReadPrec [These1 f g a] #

(Show1 f, Show1 g, Show a) => Show (These1 f g a) Source # 
Instance details

Defined in Data.Functor.These

Methods

showsPrec :: Int -> These1 f g a -> ShowS #

show :: These1 f g a -> String #

showList :: [These1 f g a] -> ShowS #

Generic (These1 f g a) Source # 
Instance details

Defined in Data.Functor.These

Associated Types

type Rep (These1 f g a) :: Type -> Type #

Methods

from :: These1 f g a -> Rep (These1 f g a) x #

to :: Rep (These1 f g a) x -> These1 f g a #

(Arbitrary1 f, Arbitrary1 g, Arbitrary a) => Arbitrary (These1 f g a) Source # 
Instance details

Defined in Data.Functor.These

Methods

arbitrary :: Gen (These1 f g a) #

shrink :: These1 f g a -> [These1 f g a] #

(ToJSON1 f, ToJSON1 g, ToJSON a) => ToJSON (These1 f g a) Source # 
Instance details

Defined in Data.Functor.These

Methods

toJSON :: These1 f g a -> Value #

toEncoding :: These1 f g a -> Encoding #

toJSONList :: [These1 f g a] -> Value #

toEncodingList :: [These1 f g a] -> Encoding #

(FromJSON1 f, FromJSON1 g, FromJSON a) => FromJSON (These1 f g a) Source # 
Instance details

Defined in Data.Functor.These

Methods

parseJSON :: Value -> Parser (These1 f g a) #

parseJSONList :: Value -> Parser [These1 f g a] #

(NFData1 f, NFData1 g, NFData a) => NFData (These1 f g a) Source #

This instance is available only with deepseq >= 1.4.3.0

Instance details

Defined in Data.Functor.These

Methods

rnf :: These1 f g a -> () #

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

Defined in Data.Functor.These

type Rep (These1 f g a) Source # 
Instance details

Defined in Data.Functor.These