sop-core-0.5.0.2: True Sums of Products

Safe Haskell | None
Language | Haskell2010

Data.SOP.BasicFunctors

Contents

- Basic functors
- Mapping functions

Description

Basic functors.

Definitions of the type-level equivalents of `const`, `id`, and (`.`), and a definition of the lifted function space.

These datatypes are generally useful, but in this library, they're primarily used as parameters for the `NP`, `NS`, `POP`, and `SOP` types.

We define own variants of `Const`, `Identity` and `Compose` for various reasons.

- `Const` and `Compose` become kind polymorphic only in `base-4.9.0.0` (`transformers-0.5.0.0`).
- Shorter names are convenient, and pattern synonyms aren't (yet) powerful enough, particularly exhaustiveness check doesn't work properly. See https://ghc.haskell.org/trac/ghc/ticket/8779.

Synopsis

- newtype K a (b :: k) = K a
- unK :: forall {k} a (b :: k). K a b -> a
- newtype I a = I a
- unI :: I a -> a
- newtype ((f :: l -> Type) :.: (g :: k -> l)) (p :: k) = Comp (f (g p))
- unComp :: forall {l} {k} f (g :: k -> l) (p :: k). (f :.: g) p -> f (g p)
- mapII :: (a -> b) -> I a -> I b
- mapIK :: forall {k} a b (c :: k). (a -> b) -> I a -> K b c
- mapKI :: forall {k} a b (c :: k). (a -> b) -> K a c -> I b
- mapKK :: forall {k1} {k2} a b (c :: k1) (d :: k2). (a -> b) -> K a c -> K b d
- mapIII :: (a -> b -> c) -> I a -> I b -> I c
- mapIIK :: forall {k} a b c (d :: k). (a -> b -> c) -> I a -> I b -> K c d
- mapIKI :: forall {k} a b c (d :: k). (a -> b -> c) -> I a -> K b d -> I c
- mapIKK :: forall {k1} {k2} a b c (d :: k1) (e :: k2). (a -> b -> c) -> I a -> K b d -> K c e
- mapKII :: forall {k} a b c (d :: k). (a -> b -> c) -> K a d -> I b -> I c
- mapKIK :: forall {k1} {k2} a b c (d :: k1) (e :: k2). (a -> b -> c) -> K a d -> I b -> K c e
- mapKKI :: forall {k1} {k2} a b c (d :: k1) (e :: k2). (a -> b -> c) -> K a d -> K b e -> I c
- mapKKK :: forall {k1} {k2} {k3} a b c (d :: k1) (e :: k2) (f :: k3). (a -> b -> c) -> K a d -> K b e -> K c f

# Basic functors

newtype K a (b :: k) Source #

The constant type functor.

Like `Constant`, but kind-polymorphic in its second argument and with a shorter name.

Constructors

K a |

#### Instances

Instances details

Eq2 (K :: Type -> Type -> Type) Source # | Since: 0.2.4.0
Instance details Defined in Data.SOP.BasicFunctors Methods liftEq2 :: (a -> b -> Bool) -> (c -> d -> Bool) -> K a c -> K b d -> Bool Source #
Ord2 (K :: Type -> Type -> Type) Source # | Since: 0.2.4.0
Instance details Defined in Data.SOP.BasicFunctors Methods liftCompare2 :: (a -> b -> Ordering) -> (c -> d -> Ordering) -> K a c -> K b d -> Ordering Source #
Read2 (K :: Type -> Type -> Type) Source # | Since: 0.2.4.0

Instance details

Defined in Data.SOP.BasicFunctors

Methods

liftReadsPrec2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> Int -> ReadS (K a b) Source #

liftReadList2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> ReadS [K a b] Source #

liftReadPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec (K a b) Source #

liftReadListPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec [K a b] Source #

Show2 (K :: Type -> Type -> Type) Source # | Since: 0.2.4.0
Instance details Defined in Data.SOP.BasicFunctors Methods liftShowsPrec2 :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> (Int -> b -> ShowS) -> ([b] -> ShowS) -> Int -> K a b -> ShowS Source # liftShowList2 :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> (Int -> b -> ShowS) -> ([b] -> ShowS) -> [K a b] -> ShowS Source #
NFData2 (K :: Type -> Type -> Type) Source # | Since: 0.2.5.0
Instance details Defined in Data.SOP.BasicFunctors Methods liftRnf2 :: (a -> ()) -> (b -> ()) -> K a b -> () Source #
Eq a => Eq1 (K a :: Type -> Type) Source # | Since: 0.2.4.0
Instance details Defined in Data.SOP.BasicFunctors Methods liftEq :: (a0 -> b -> Bool) -> K a a0 -> K a b -> Bool Source #
Ord a => Ord1 (K a :: Type -> Type) Source # | Since: 0.2.4.0
Instance details Defined in Data.SOP.BasicFunctors Methods liftCompare :: (a0 -> b -> Ordering) -> K a a0 -> K a b -> Ordering Source #
Read a => Read1 (K a :: Type -> Type) Source # | Since: 0.2.4.0
Instance details Defined in Data.SOP.BasicFunctors Methods liftReadsPrec :: (Int -> ReadS a0) -> ReadS [a0] -> Int -> ReadS (K a a0) Source # liftReadList :: (Int -> ReadS a0) -> ReadS [a0] -> ReadS [K a a0] Source # liftReadPrec :: ReadPrec a0 -> ReadPrec [a0] -> ReadPrec (K a a0) Source # liftReadListPrec :: ReadPrec a0 -> ReadPrec [a0] -> ReadPrec [K a a0] Source #
Show a => Show1 (K a :: Type -> Type) Source # | Since: 0.2.4.0
Instance details Defined in Data.SOP.BasicFunctors Methods liftShowsPrec :: (Int -> a0 -> ShowS) -> ([a0] -> ShowS) -> Int -> K a a0 -> ShowS Source # liftShowList :: (Int -> a0 -> ShowS) -> ([a0] -> ShowS) -> [K a a0] -> ShowS Source #
NFData a => NFData1 (K a :: Type -> Type) Source # | Since: 0.2.5.0
Instance details Defined in Data.SOP.BasicFunctors Methods liftRnf :: (a0 -> ()) -> K a a0 -> () Source #
Monoid a => Applicative (K a :: Type -> Type) Source # |
Instance details Defined in Data.SOP.BasicFunctors Methods pure :: a0 -> K a a0 Source # (<*>) :: K a (a0 -> b) -> K a a0 -> K a b Source # liftA2 :: (a0 -> b -> c) -> K a a0 -> K a b -> K a c Source # (*>) :: K a a0 -> K a b -> K a b Source # (<*) :: K a a0 -> K a b -> K a a0 Source #
Functor (K a :: Type -> Type) Source # |
Instance details Defined in Data.SOP.BasicFunctors Methods fmap :: (a0 -> b) -> K a a0 -> K a b Source # (<$) :: a0 -> K a b -> K a a0 Source #
Foldable (K a :: Type -> Type) Source # |

Instance details

Defined in Data.SOP.BasicFunctors

Methods

fold :: Monoid m => K a m -> m Source #

foldMap :: Monoid m => (a0 -> m) -> K a a0 -> m Source #

foldMap' :: Monoid m => (a0 -> m) -> K a a0 -> m Source #

foldr :: (a0 -> b -> b) -> b -> K a a0 -> b Source #

foldr' :: (a0 -> b -> b) -> b -> K a a0 -> b Source #

foldl :: (b -> a0 -> b) -> b -> K a a0 -> b Source #

foldl' :: (b -> a0 -> b) -> b -> K a a0 -> b Source #

foldr1 :: (a0 -> a0 -> a0) -> K a a0 -> a0 Source #

foldl1 :: (a0 -> a0 -> a0) -> K a a0 -> a0 Source #

toList :: K a a0 -> [a0] Source #

null :: K a a0 -> Bool Source #

length :: K a a0 -> Int Source #

elem :: Eq a0 => a0 -> K a a0 -> Bool Source #

maximum :: Ord a0 => K a a0 -> a0 Source #

minimum :: Ord a0 => K a a0 -> a0 Source #

sum :: Num a0 => K a a0 -> a0 Source #

product :: Num a0 => K a a0 -> a0 Source #

Traversable (K a :: Type -> Type) Source # |
Instance details Defined in Data.SOP.BasicFunctors Methods traverse :: Applicative f => (a0 -> f b) -> K a a0 -> f (K a b) Source # sequenceA :: Applicative f => K a (f a0) -> f (K a a0) Source # mapM :: Monad m => (a0 -> m b) -> K a a0 -> m (K a b) Source # sequence :: Monad m => K a (m a0) -> m (K a a0) Source #
NFData a => NFData (K a b) Source # | Since: 0.2.5.0
Instance details Defined in Data.SOP.BasicFunctors Methods rnf :: K a b -> () Source #
Monoid a => Monoid (K a b) Source # | Since: 0.4.0.0
Instance details Defined in Data.SOP.BasicFunctors Methods mempty :: K a b Source # mappend :: K a b -> K a b -> K a b Source # mconcat :: [K a b] -> K a b Source #
Semigroup a => Semigroup (K a b) Source # | Since: 0.4.0.0
Instance details Defined in Data.SOP.BasicFunctors Methods (<>) :: K a b -> K a b -> K a b Source # sconcat :: NonEmpty (K a b) -> K a b Source # stimes :: Integral b0 => b0 -> K a b -> K a b Source #
Generic (K a b) Source # |

Instance details

Defined in Data.SOP.BasicFunctors

Associated Types

type Rep (K a b) |
Instance details Defined in Data.SOP.BasicFunctors type Rep (K a b) = D1 ('MetaData "K" "Data.SOP.BasicFunctors" "sop-core-0.5.0.2-C7SUNoN29CWAtvRET7K2zW" 'True) (C1 ('MetaCons "K" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))

Methods

from :: K a b -> Rep (K a b) x Source #

to :: Rep (K a b) x -> K a b Source #

Read a => Read (K a b) Source # |
Instance details Defined in Data.SOP.BasicFunctors Methods readsPrec :: Int -> ReadS (K a b) Source # readList :: ReadS [K a b] Source # readPrec :: ReadPrec (K a b) Source # readListPrec :: ReadPrec [K a b] Source #
Show a => Show (K a b) Source # |
Instance details Defined in Data.SOP.BasicFunctors Methods showsPrec :: Int -> K a b -> ShowS Source # show :: K a b -> String Source # showList :: [K a b] -> ShowS Source #
Eq a => Eq (K a b) Source # |
Instance details Defined in Data.SOP.BasicFunctors Methods (==) :: K a b -> K a b -> Bool Source # (/=) :: K a b -> K a b -> Bool Source #
Ord a => Ord (K a b) Source # |
Instance details Defined in Data.SOP.BasicFunctors Methods compare :: K a b -> K a b -> Ordering Source # (<) :: K a b -> K a b -> Bool Source # (<=) :: K a b -> K a b -> Bool Source # (>) :: K a b -> K a b -> Bool Source # (>=) :: K a b -> K a b -> Bool Source # max :: K a b -> K a b -> K a b Source # min :: K a b -> K a b -> K a b Source #
type Rep (K a b) Source # |
Instance details Defined in Data.SOP.BasicFunctors type Rep (K a b) = D1 ('MetaData "K" "Data.SOP.BasicFunctors" "sop-core-0.5.0.2-C7SUNoN29CWAtvRET7K2zW" 'True) (C1 ('MetaCons "K" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))

unK :: forall {k} a (b :: k). K a b -> a Source #

Extract the contents of a `K` value.

newtype I a Source #

The identity type functor.

Like `Identity`, but with a shorter name.

Constructors

I a |

#### Instances

Instances details

Eq1 I Source # | Since: 0.2.4.0
Instance details Defined in Data.SOP.BasicFunctors Methods liftEq :: (a -> b -> Bool) -> I a -> I b -> Bool Source #
Ord1 I Source # | Since: 0.2.4.0
Instance details Defined in Data.SOP.BasicFunctors Methods liftCompare :: (a -> b -> Ordering) -> I a -> I b -> Ordering Source #
Read1 I Source # | Since: 0.2.4.0
Instance details Defined in Data.SOP.BasicFunctors Methods liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (I a) Source # liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [I a] Source # liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (I a) Source # liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [I a] Source #
Show1 I Source # | Since: 0.2.4.0
Instance details Defined in Data.SOP.BasicFunctors Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> I a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [I a] -> ShowS Source #
NFData1 I Source # | Since: 0.2.5.0
Instance details Defined in Data.SOP.BasicFunctors Methods liftRnf :: (a -> ()) -> I a -> () Source #
Applicative I Source # |
Instance details Defined in Data.SOP.BasicFunctors Methods pure :: a -> I a Source # (<*>) :: I (a -> b) -> I a -> I b Source # liftA2 :: (a -> b -> c) -> I a -> I b -> I c Source # (*>) :: I a -> I b -> I b Source # (<*) :: I a -> I b -> I a Source #
Functor I Source # |
Instance details Defined in Data.SOP.BasicFunctors Methods fmap :: (a -> b) -> I a -> I b Source # (<$) :: a -> I b -> I a Source #
Monad I Source # |
Instance details Defined in Data.SOP.BasicFunctors Methods (>>=) :: I a -> (a -> I b) -> I b Source # (>>) :: I a -> I b -> I b Source # return :: a -> I a Source #
Foldable I Source # |

Instance details

Defined in Data.SOP.BasicFunctors

Methods

fold :: Monoid m => I m -> m Source #

foldMap :: Monoid m => (a -> m) -> I a -> m Source #

foldMap' :: Monoid m => (a -> m) -> I a -> m Source #

foldr :: (a -> b -> b) -> b -> I a -> b Source #

foldr' :: (a -> b -> b) -> b -> I a -> b Source #

foldl :: (b -> a -> b) -> b -> I a -> b Source #

foldl' :: (b -> a -> b) -> b -> I a -> b Source #

foldr1 :: (a -> a -> a) -> I a -> a Source #

foldl1 :: (a -> a -> a) -> I a -> a Source #

toList :: I a -> [a] Source #

null :: I a -> Bool Source #

length :: I a -> Int Source #

elem :: Eq a => a -> I a -> Bool Source #

maximum :: Ord a => I a -> a Source #

minimum :: Ord a => I a -> a Source #

sum :: Num a => I a -> a Source #

product :: Num a => I a -> a Source #

Traversable I Source # |
Instance details Defined in Data.SOP.BasicFunctors Methods traverse :: Applicative f => (a -> f b) -> I a -> f (I b) Source # sequenceA :: Applicative f => I (f a) -> f (I a) Source # mapM :: Monad m => (a -> m b) -> I a -> m (I b) Source # sequence :: Monad m => I (m a) -> m (I a) Source #
NFData a => NFData (I a) Source # | Since: 0.2.5.0
Instance details Defined in Data.SOP.BasicFunctors Methods rnf :: I a -> () Source #
Monoid a => Monoid (I a) Source # | Since: 0.4.0.0
Instance details Defined in Data.SOP.BasicFunctors Methods mempty :: I a Source # mappend :: I a -> I a -> I a Source # mconcat :: [I a] -> I a Source #
Semigroup a => Semigroup (I a) Source # | Since: 0.4.0.0
Instance details Defined in Data.SOP.BasicFunctors Methods (<>) :: I a -> I a -> I a Source # sconcat :: NonEmpty (I a) -> I a Source # stimes :: Integral b => b -> I a -> I a Source #
Generic (I a) Source # |

Instance details

Defined in Data.SOP.BasicFunctors

Associated Types

type Rep (I a) |
Instance details Defined in Data.SOP.BasicFunctors type Rep (I a) = D1 ('MetaData "I" "Data.SOP.BasicFunctors" "sop-core-0.5.0.2-C7SUNoN29CWAtvRET7K2zW" 'True) (C1 ('MetaCons "I" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))

Methods

from :: I a -> Rep (I a) x Source #

to :: Rep (I a) x -> I a Source #

Read a => Read (I a) Source # |
Instance details Defined in Data.SOP.BasicFunctors Methods readsPrec :: Int -> ReadS (I a) Source # readList :: ReadS [I a] Source # readPrec :: ReadPrec (I a) Source # readListPrec :: ReadPrec [I a] Source #
Show a => Show (I a) Source # |
Instance details Defined in Data.SOP.BasicFunctors Methods showsPrec :: Int -> I a -> ShowS Source # show :: I a -> String Source # showList :: [I a] -> ShowS Source #
Eq a => Eq (I a) Source # |
Instance details Defined in Data.SOP.BasicFunctors Methods (==) :: I a -> I a -> Bool Source # (/=) :: I a -> I a -> Bool Source #
Ord a => Ord (I a) Source # |
Instance details Defined in Data.SOP.BasicFunctors Methods compare :: I a -> I a -> Ordering Source # (<) :: I a -> I a -> Bool Source # (<=) :: I a -> I a -> Bool Source # (>) :: I a -> I a -> Bool Source # (>=) :: I a -> I a -> Bool Source # max :: I a -> I a -> I a Source # min :: I a -> I a -> I a Source #
type Rep (I a) Source # |
Instance details Defined in Data.SOP.BasicFunctors type Rep (I a) = D1 ('MetaData "I" "Data.SOP.BasicFunctors" "sop-core-0.5.0.2-C7SUNoN29CWAtvRET7K2zW" 'True) (C1 ('MetaCons "I" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))

unI :: I a -> a Source #

Extract the contents of an `I` value.

newtype ((f :: l -> Type) :.: (g :: k -> l)) (p :: k) infixr 7 Source #

Composition of functors.

Like `Compose`, but kind-polymorphic and with a shorter name.

Constructors

Comp (f (g p)) |

#### Instances

Instances details

(Eq1 f, Eq1 g) => Eq1 (f :.: g) Source # | Since: 0.2.4.0
Instance details Defined in Data.SOP.BasicFunctors Methods liftEq :: (a -> b -> Bool) -> (f :.: g) a -> (f :.: g) b -> Bool Source #
(Ord1 f, Ord1 g) => Ord1 (f :.: g) Source # | Since: 0.2.4.0
Instance details Defined in Data.SOP.BasicFunctors Methods liftCompare :: (a -> b -> Ordering) -> (f :.: g) a -> (f :.: g) b -> Ordering Source #
(Read1 f, Read1 g) => Read1 (f :.: g) Source # | Since: 0.2.4.0
Instance details Defined in Data.SOP.BasicFunctors Methods liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS ((f :.: g) a) Source # liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [(f :.: g) a] Source # liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec ((f :.: g) a) Source # liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [(f :.: g) a] Source #
(Show1 f, Show1 g) => Show1 (f :.: g) Source # | Since: 0.2.4.0
Instance details Defined in Data.SOP.BasicFunctors Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> (f :.: g) a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [(f :.: g) a] -> ShowS Source #
(NFData1 f, NFData1 g) => NFData1 (f :.: g) Source # | Since: 0.2.5.0
Instance details Defined in Data.SOP.BasicFunctors Methods liftRnf :: (a -> ()) -> (f :.: g) a -> () Source #
(Applicative f, Applicative g) => Applicative (f :.: g) Source # | Since: 0.2.5.0
Instance details Defined in Data.SOP.BasicFunctors Methods pure :: a -> (f :.: g) a Source # (<*>) :: (f :.: g) (a -> b) -> (f :.: g) a -> (f :.: g) b Source # liftA2 :: (a -> b -> c) -> (f :.: g) a -> (f :.: g) b -> (f :.: g) c Source # (*>) :: (f :.: g) a -> (f :.: g) b -> (f :.: g) b Source # (<*) :: (f :.: g) a -> (f :.: g) b -> (f :.: g) a Source #
(Functor f, Functor g) => Functor (f :.: g) Source # |
Instance details Defined in Data.SOP.BasicFunctors Methods fmap :: (a -> b) -> (f :.: g) a -> (f :.: g) b Source # (<$) :: a -> (f :.: g) b -> (f :.: g) a Source #
(Foldable f, Foldable g) => Foldable (f :.: g) Source # | Since: 0.2.5.0

Instance details

Defined in Data.SOP.BasicFunctors

Methods

fold :: Monoid m => (f :.: g) m -> m Source #

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

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

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

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

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

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

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

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

toList :: (f :.: g) a -> [a] Source #

null :: (f :.: g) a -> Bool Source #

length :: (f :.: g) a -> Int Source #

elem :: Eq a => a -> (f :.: g) a -> Bool Source #

maximum :: Ord a => (f :.: g) a -> a Source #

minimum :: Ord a => (f :.: g) a -> a Source #

sum :: Num a => (f :.: g) a -> a Source #

product :: Num a => (f :.: g) a -> a Source #

(Traversable f, Traversable g) => Traversable (f :.: g) Source # | Since: 0.2.5.0
Instance details Defined in Data.SOP.BasicFunctors Methods traverse :: Applicative f0 => (a -> f0 b) -> (f :.: g) a -> f0 ((f :.: g) b) Source # sequenceA :: Applicative f0 => (f :.: g) (f0 a) -> f0 ((f :.: g) a) Source # mapM :: Monad m => (a -> m b) -> (f :.: g) a -> m ((f :.: g) b) Source # sequence :: Monad m => (f :.: g) (m a) -> m ((f :.: g) a) Source #
NFData (f (g a)) => NFData ((f :.: g) a) Source # | Since: 0.2.5.0
Instance details Defined in Data.SOP.BasicFunctors Methods rnf :: (f :.: g) a -> () Source #
Monoid (f (g x)) => Monoid ((f :.: g) x) Source # | Since: 0.4.0.0
Instance details Defined in Data.SOP.BasicFunctors Methods mempty :: (f :.: g) x Source # mappend :: (f :.: g) x -> (f :.: g) x -> (f :.: g) x Source # mconcat :: [(f :.: g) x] -> (f :.: g) x Source #
Semigroup (f (g x)) => Semigroup ((f :.: g) x) Source # | Since: 0.4.0.0
Instance details Defined in Data.SOP.BasicFunctors Methods (<>) :: (f :.: g) x -> (f :.: g) x -> (f :.: g) x Source # sconcat :: NonEmpty ((f :.: g) x) -> (f :.: g) x Source # stimes :: Integral b => b -> (f :.: g) x -> (f :.: g) x Source #
Generic ((f :.: g) p) Source # |

Instance details

Defined in Data.SOP.BasicFunctors

Associated Types

type Rep ((f :.: g) p) |
Instance details Defined in Data.SOP.BasicFunctors type Rep ((f :.: g) p) = D1 ('MetaData ":.:" "Data.SOP.BasicFunctors" "sop-core-0.5.0.2-C7SUNoN29CWAtvRET7K2zW" 'True) (C1 ('MetaCons "Comp" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f (g p)))))

Methods

from :: (f :.: g) p -> Rep ((f :.: g) p) x Source #

to :: Rep ((f :.: g) p) x -> (f :.: g) p Source #

(Read1 f, Read1 g, Read a) => Read ((f :.: g) a) Source # |
Instance details Defined in Data.SOP.BasicFunctors Methods readsPrec :: Int -> ReadS ((f :.: g) a) Source # readList :: ReadS [(f :.: g) a] Source # readPrec :: ReadPrec ((f :.: g) a) Source # readListPrec :: ReadPrec [(f :.: g) a] Source #
(Show1 f, Show1 g, Show a) => Show ((f :.: g) a) Source # |
Instance details Defined in Data.SOP.BasicFunctors Methods showsPrec :: Int -> (f :.: g) a -> ShowS Source # show :: (f :.: g) a -> String Source # showList :: [(f :.: g) a] -> ShowS Source #
(Eq1 f, Eq1 g, Eq a) => Eq ((f :.: g) a) Source # |
Instance details Defined in Data.SOP.BasicFunctors Methods (==) :: (f :.: g) a -> (f :.: g) a -> Bool Source # (/=) :: (f :.: g) a -> (f :.: g) a -> Bool Source #
(Ord1 f, Ord1 g, Ord a) => Ord ((f :.: g) a) Source # |

Instance details

Defined in Data.SOP.BasicFunctors

Methods

compare :: (f :.: g) a -> (f :.: g) a -> Ordering Source #

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

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

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

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

max :: (f :.: g) a -> (f :.: g) a -> (f :.: g) a Source #

min :: (f :.: g) a -> (f :.: g) a -> (f :.: g) a Source #

type Rep ((f :.: g) p) Source # |
Instance details Defined in Data.SOP.BasicFunctors type Rep ((f :.: g) p) = D1 ('MetaData ":.:" "Data.SOP.BasicFunctors" "sop-core-0.5.0.2-C7SUNoN29CWAtvRET7K2zW" 'True) (C1 ('MetaCons "Comp" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f (g p)))))

unComp :: forall {l} {k} f (g :: k -> l) (p :: k). (f :.: g) p -> f (g p) Source #

Extract the contents of a `Comp` value.

# Mapping functions

mapII :: (a -> b) -> I a -> I b Source #

Lift the given function.

Since: 0.2.5.0

mapIK :: forall {k} a b (c :: k). (a -> b) -> I a -> K b c Source #

Lift the given function.

Since: 0.2.5.0

mapKI :: forall {k} a b (c :: k). (a -> b) -> K a c -> I b Source #

Lift the given function.

Since: 0.2.5.0

mapKK :: forall {k1} {k2} a b (c :: k1) (d :: k2). (a -> b) -> K a c -> K b d Source #

Lift the given function.

Since: 0.2.5.0

mapIII :: (a -> b -> c) -> I a -> I b -> I c Source #

Lift the given function.

Since: 0.2.5.0

mapIIK :: forall {k} a b c (d :: k). (a -> b -> c) -> I a -> I b -> K c d Source #

Lift the given function.

Since: 0.2.5.0

mapIKI :: forall {k} a b c (d :: k). (a -> b -> c) -> I a -> K b d -> I c Source #

Lift the given function.

Since: 0.2.5.0

mapIKK :: forall {k1} {k2} a b c (d :: k1) (e :: k2). (a -> b -> c) -> I a -> K b d -> K c e Source #

Lift the given function.

Since: 0.2.5.0

mapKII :: forall {k} a b c (d :: k). (a -> b -> c) -> K a d -> I b -> I c Source #

Lift the given function.

Since: 0.2.5.0

mapKIK :: forall {k1} {k2} a b c (d :: k1) (e :: k2). (a -> b -> c) -> K a d -> I b -> K c e Source #

Lift the given function.

Since: 0.2.5.0

mapKKI :: forall {k1} {k2} a b c (d :: k1) (e :: k2). (a -> b -> c) -> K a d -> K b e -> I c Source #

Lift the given function.

Since: 0.2.5.0

mapKKK :: forall {k1} {k2} {k3} a b c (d :: k1) (e :: k2) (f :: k3). (a -> b -> c) -> K a d -> K b e -> K c f Source #

Lift the given function.

Since: 0.2.5.0