    {-# LANGUAGE PolyKinds, DeriveGeneric #-}
    -- | 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 'Control.Applicative.Const',
    -- 'Data.Functor.Identity.Identity' and 'Data.Functor.Compose.Compose' for
    -- various reasons.
    --
    -- * 'Control.Applicative.Const' and 'Data.Functor.Compose.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>.
    --
    module Data.SOP.BasicFunctors
      ( -- * Basic functors
        K(..)
      , unK
      , I(..)
      , unI
      , (:.:)(..)
      , unComp
        -- * Mapping functions
      , mapII
      , mapIK
      , mapKI
      , mapKK
      , mapIII
      , mapIIK
      , mapIKI
      , mapIKK
      , mapKII
      , mapKIK
      , mapKKI
      , mapKKK
      ) where

    #if !MIN_VERSION_base(4,11,0)
    import Data.Semigroup (Semigroup (..))
    #endif
    import Data.Kind (Type)
    import qualified GHC.Generics as GHC

    import Data.Functor.Classes

    import Control.DeepSeq (NFData(..))
    #if MIN_VERSION_deepseq(1,4,3)
    import Control.DeepSeq (NFData1(..), NFData2(..))
    #endif

    import Data.Coerce (coerce)

    -- * Basic functors

    -- | The constant type functor.
    --
    -- Like 'Data.Functor.Constant.Constant', but kind-polymorphic
    -- in its second argument and with a shorter name.
    --
    newtype K (a :: Type) (b :: k) = K a
      deriving ((forall a b. (a -> b) -> K a a -> K a b)
    -> (forall a b. a -> K a b -> K a a) -> Functor (K a)
    forall a b. a -> K a b -> K a a
    forall a b. (a -> b) -> K a a -> K a b
    forall a a b. a -> K a b -> K a a
    forall a a b. (a -> b) -> K a a -> K a b
    forall (f :: * -> *).
    (forall a b. (a -> b) -> f a -> f b)
    -> (forall a b. a -> f b -> f a) -> Functor f
    $cfmap :: forall a a b. (a -> b) -> K a a -> K a b
    fmap :: forall a b. (a -> b) -> K a a -> K a b
    $c<$ :: forall a a b. a -> K a b -> K a a
    <$ :: forall a b. a -> K a b -> K a a
    Functor, (forall m. Monoid m => K a m -> m)
    -> (forall m a. Monoid m => (a -> m) -> K a a -> m)
    -> (forall m a. Monoid m => (a -> m) -> K a a -> m)
    -> (forall a b. (a -> b -> b) -> b -> K a a -> b)
    -> (forall a b. (a -> b -> b) -> b -> K a a -> b)
    -> (forall b a. (b -> a -> b) -> b -> K a a -> b)
    -> (forall b a. (b -> a -> b) -> b -> K a a -> b)
    -> (forall a. (a -> a -> a) -> K a a -> a)
    -> (forall a. (a -> a -> a) -> K a a -> a)
    -> (forall a. K a a -> [a])
    -> (forall a. K a a -> Bool)
    -> (forall a. K a a -> Int)
    -> (forall a. Eq a => a -> K a a -> Bool)
    -> (forall a. Ord a => K a a -> a)
    -> (forall a. Ord a => K a a -> a)
    -> (forall a. Num a => K a a -> a)
    -> (forall a. Num a => K a a -> a)
    -> Foldable (K a)
    forall a. Eq a => a -> K a a -> Bool
    forall a. Num a => K a a -> a
    forall a. Ord a => K a a -> a
    forall m. Monoid m => K a m -> m
    forall a. K a a -> Bool
    forall a. K a a -> Int
    forall a. K a a -> [a]
    forall a. (a -> a -> a) -> K a a -> a
    forall a a. Eq a => a -> K a a -> Bool
    forall a a. Num a => K a a -> a
    forall a a. Ord a => K a a -> a
    forall a m. Monoid m => K a m -> m
    forall m a. Monoid m => (a -> m) -> K a a -> m
    forall a a. K a a -> Bool
    forall a a. K a a -> Int
    forall a a. K a a -> [a]
    forall b a. (b -> a -> b) -> b -> K a a -> b
    forall a b. (a -> b -> b) -> b -> K a a -> b
    forall a a. (a -> a -> a) -> K a a -> a
    forall a m a. Monoid m => (a -> m) -> K a a -> m
    forall a b a. (b -> a -> b) -> b -> K a a -> b
    forall a a b. (a -> b -> b) -> b -> K a a -> b
    forall (t :: * -> *).
    (forall m. Monoid m => t m -> m)
    -> (forall m a. Monoid m => (a -> m) -> t a -> m)
    -> (forall m a. Monoid m => (a -> m) -> t a -> m)
    -> (forall a b. (a -> b -> b) -> b -> t a -> b)
    -> (forall a b. (a -> b -> b) -> b -> t a -> b)
    -> (forall b a. (b -> a -> b) -> b -> t a -> b)
    -> (forall b a. (b -> a -> b) -> b -> t a -> b)
    -> (forall a. (a -> a -> a) -> t a -> a)
    -> (forall a. (a -> a -> a) -> t a -> a)
    -> (forall a. t a -> [a])
    -> (forall a. t a -> Bool)
    -> (forall a. t a -> Int)
    -> (forall a. Eq a => a -> t a -> Bool)
    -> (forall a. Ord a => t a -> a)
    -> (forall a. Ord a => t a -> a)
    -> (forall a. Num a => t a -> a)
    -> (forall a. Num a => t a -> a)
    -> Foldable t
    $cfold :: forall a m. Monoid m => K a m -> m
    fold :: forall m. Monoid m => K a m -> m
    $cfoldMap :: forall a m a. Monoid m => (a -> m) -> K a a -> m
    foldMap :: forall m a. Monoid m => (a -> m) -> K a a -> m
    $cfoldMap' :: forall a m a. Monoid m => (a -> m) -> K a a -> m
    foldMap' :: forall m a. Monoid m => (a -> m) -> K a a -> m
    $cfoldr :: forall a a b. (a -> b -> b) -> b -> K a a -> b
    foldr :: forall a b. (a -> b -> b) -> b -> K a a -> b
    $cfoldr' :: forall a a b. (a -> b -> b) -> b -> K a a -> b
    foldr' :: forall a b. (a -> b -> b) -> b -> K a a -> b
    $cfoldl :: forall a b a. (b -> a -> b) -> b -> K a a -> b
    foldl :: forall b a. (b -> a -> b) -> b -> K a a -> b
    $cfoldl' :: forall a b a. (b -> a -> b) -> b -> K a a -> b
    foldl' :: forall b a. (b -> a -> b) -> b -> K a a -> b
    $cfoldr1 :: forall a a. (a -> a -> a) -> K a a -> a
    foldr1 :: forall a. (a -> a -> a) -> K a a -> a
    $cfoldl1 :: forall a a. (a -> a -> a) -> K a a -> a
    foldl1 :: forall a. (a -> a -> a) -> K a a -> a
    $ctoList :: forall a a. K a a -> [a]
    toList :: forall a. K a a -> [a]
    $cnull :: forall a a. K a a -> Bool
    null :: forall a. K a a -> Bool
    $clength :: forall a a. K a a -> Int
    length :: forall a. K a a -> Int
    $celem :: forall a a. Eq a => a -> K a a -> Bool
    elem :: forall a. Eq a => a -> K a a -> Bool
    $cmaximum :: forall a a. Ord a => K a a -> a
    maximum :: forall a. Ord a => K a a -> a
    $cminimum :: forall a a. Ord a => K a a -> a
    minimum :: forall a. Ord a => K a a -> a
    $csum :: forall a a. Num a => K a a -> a
    sum :: forall a. Num a => K a a -> a
    $cproduct :: forall a a. Num a => K a a -> a
    product :: forall a. Num a => K a a -> a
    Foldable, Functor (K a)
    Foldable (K a)
    (Functor (K a), Foldable (K a)) =>
    (forall (f :: * -> *) a b.
     Applicative f =>
     (a -> f b) -> K a a -> f (K a b))
    -> (forall (f :: * -> *) a.
        Applicative f =>
        K a (f a) -> f (K a a))
    -> (forall (m :: * -> *) a b.
        Monad m =>
        (a -> m b) -> K a a -> m (K a b))
    -> (forall (m :: * -> *) a. Monad m => K a (m a) -> m (K a a))
    -> Traversable (K a)
    forall a. Functor (K a)
    forall a. Foldable (K a)
    forall a (m :: * -> *) a. Monad m => K a (m a) -> m (K a a)
    forall a (f :: * -> *) a. Applicative f => K a (f a) -> f (K a a)
    forall a (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> K a a -> m (K a b)
    forall a (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> K a a -> f (K a b)
    forall (t :: * -> *).
    (Functor t, Foldable t) =>
    (forall (f :: * -> *) a b.
     Applicative f =>
     (a -> f b) -> t a -> f (t b))
    -> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
    -> (forall (m :: * -> *) a b.
        Monad m =>
        (a -> m b) -> t a -> m (t b))
    -> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
    -> Traversable t
    forall (m :: * -> *) a. Monad m => K a (m a) -> m (K a a)
    forall (f :: * -> *) a. Applicative f => K a (f a) -> f (K a a)
    forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> K a a -> m (K a b)
    forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> K a a -> f (K a b)
    $ctraverse :: forall a (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> K a a -> f (K a b)
    traverse :: forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> K a a -> f (K a b)
    $csequenceA :: forall a (f :: * -> *) a. Applicative f => K a (f a) -> f (K a a)
    sequenceA :: forall (f :: * -> *) a. Applicative f => K a (f a) -> f (K a a)
    $cmapM :: forall a (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> K a a -> m (K a b)
    mapM :: forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> K a a -> m (K a b)
    $csequence :: forall a (m :: * -> *) a. Monad m => K a (m a) -> m (K a a)
    sequence :: forall (m :: * -> *) a. Monad m => K a (m a) -> m (K a a)
    Traversable, (forall x. K a b -> Rep (K a b) x)
    -> (forall x. Rep (K a b) x -> K a b) -> Generic (K a b)
    forall x. Rep (K a b) x -> K a b
    forall x. K a b -> Rep (K a b) x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    forall a k (b :: k) x. Rep (K a b) x -> K a b
    forall a k (b :: k) x. K a b -> Rep (K a b) x
    $cfrom :: forall a k (b :: k) x. K a b -> Rep (K a b) x
    from :: forall x. K a b -> Rep (K a b) x
    $cto :: forall a k (b :: k) x. Rep (K a b) x -> K a b
    to :: forall x. Rep (K a b) x -> K a b
    GHC.Generic)

    -- | @since 0.2.4.0
    instance Eq2 K where
        liftEq2 :: forall a b c d.
    (a -> b -> Bool) -> (c -> d -> Bool) -> K a c -> K b d -> Bool
    liftEq2 a -> b -> Bool
    eq c -> d -> Bool
    _ (K a
    x) (K b
    y) = a -> b -> Bool
    eq a
    x b
    y
    -- | @since 0.2.4.0
    instance Ord2 K where
        liftCompare2 :: forall a b c d.
    (a -> b -> Ordering)
    -> (c -> d -> Ordering) -> K a c -> K b d -> Ordering
    liftCompare2 a -> b -> Ordering
    comp c -> d -> Ordering
    _ (K a
    x) (K b
    y) = a -> b -> Ordering
    comp a
    x b
    y
    -- | @since 0.2.4.0
    instance Read2 K where
        liftReadsPrec2 :: forall a b.
    (Int -> ReadS a)
    -> ReadS [a]
    -> (Int -> ReadS b)
    -> ReadS [b]
    -> Int
    -> ReadS (K a b)
    liftReadsPrec2 Int -> ReadS a
    rp ReadS [a]
    _ Int -> ReadS b
    _ ReadS [b]
    _ = (String -> ReadS (K a b)) -> Int -> ReadS (K a b)
    forall a. (String -> ReadS a) -> Int -> ReadS a
    readsData ((String -> ReadS (K a b)) -> Int -> ReadS (K a b))
    -> (String -> ReadS (K a b)) -> Int -> ReadS (K a b)
    forall a b. (a -> b) -> a -> b
    $
             (Int -> ReadS a)
    -> String -> (a -> K a b) -> String -> ReadS (K a b)
    forall a t.
    (Int -> ReadS a) -> String -> (a -> t) -> String -> ReadS t
    readsUnaryWith Int -> ReadS a
    rp String
    "K" a -> K a b
    forall k a (b :: k). a -> K a b
    K
    -- | @since 0.2.4.0
    instance Show2 K where
        liftShowsPrec2 :: forall a b.
    (Int -> a -> ShowS)
    -> ([a] -> ShowS)
    -> (Int -> b -> ShowS)
    -> ([b] -> ShowS)
    -> Int
    -> K a b
    -> ShowS
    liftShowsPrec2 Int -> a -> ShowS
    sp [a] -> ShowS
    _ Int -> b -> ShowS
    _ [b] -> ShowS
    _ Int
    d (K a
    x) = (Int -> a -> ShowS) -> String -> Int -> a -> ShowS
    forall a. (Int -> a -> ShowS) -> String -> Int -> a -> ShowS
    showsUnaryWith Int -> a -> ShowS
    sp String
    "K" Int
    d a
    x

    -- | @since 0.2.4.0
    instance (Eq a) => Eq1 (K a) where
        liftEq :: forall a b. (a -> b -> Bool) -> K a a -> K a b -> Bool
    liftEq = (a -> a -> Bool) -> (a -> b -> Bool) -> K a a -> K a b -> Bool
    forall a b c d.
    (a -> b -> Bool) -> (c -> d -> Bool) -> K a c -> K b d -> Bool
    forall (f :: * -> * -> *) a b c d.
    Eq2 f =>
    (a -> b -> Bool) -> (c -> d -> Bool) -> f a c -> f b d -> Bool
    liftEq2 a -> a -> Bool
    forall a. Eq a => a -> a -> Bool
    (==)
    -- | @since 0.2.4.0
    instance (Ord a) => Ord1 (K a) where
        liftCompare :: forall a b. (a -> b -> Ordering) -> K a a -> K a b -> Ordering
    liftCompare = (a -> a -> Ordering)
    -> (a -> b -> Ordering) -> K a a -> K a b -> Ordering
    forall a b c d.
    (a -> b -> Ordering)
    -> (c -> d -> Ordering) -> K a c -> K b d -> Ordering
    forall (f :: * -> * -> *) a b c d.
    Ord2 f =>
    (a -> b -> Ordering)
    -> (c -> d -> Ordering) -> f a c -> f b d -> Ordering
    liftCompare2 a -> a -> Ordering
    forall a. Ord a => a -> a -> Ordering
    compare
    -- | @since 0.2.4.0
    instance (Read a) => Read1 (K a) where
        liftReadsPrec :: forall a. (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (K a a)
    liftReadsPrec = (Int -> ReadS a)
    -> ReadS [a]
    -> (Int -> ReadS a)
    -> ReadS [a]
    -> Int
    -> ReadS (K a a)
    forall a b.
    (Int -> ReadS a)
    -> ReadS [a]
    -> (Int -> ReadS b)
    -> ReadS [b]
    -> Int
    -> ReadS (K a b)
    forall (f :: * -> * -> *) a b.
    Read2 f =>
    (Int -> ReadS a)
    -> ReadS [a]
    -> (Int -> ReadS b)
    -> ReadS [b]
    -> Int
    -> ReadS (f a b)
    liftReadsPrec2 Int -> ReadS a
    forall a. Read a => Int -> ReadS a
    readsPrec ReadS [a]
    forall a. Read a => ReadS [a]
    readList
    -- | @since 0.2.4.0
    instance (Show a) => Show1 (K a) where
        liftShowsPrec :: forall a.
    (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> K a a -> ShowS
    liftShowsPrec = (Int -> a -> ShowS)
    -> ([a] -> ShowS)
    -> (Int -> a -> ShowS)
    -> ([a] -> ShowS)
    -> Int
    -> K a a
    -> ShowS
    forall a b.
    (Int -> a -> ShowS)
    -> ([a] -> ShowS)
    -> (Int -> b -> ShowS)
    -> ([b] -> ShowS)
    -> Int
    -> K a b
    -> ShowS
    forall (f :: * -> * -> *) a b.
    Show2 f =>
    (Int -> a -> ShowS)
    -> ([a] -> ShowS)
    -> (Int -> b -> ShowS)
    -> ([b] -> ShowS)
    -> Int
    -> f a b
    -> ShowS
    liftShowsPrec2 Int -> a -> ShowS
    forall a. Show a => Int -> a -> ShowS
    showsPrec [a] -> ShowS
    forall a. Show a => [a] -> ShowS
    showList

    -- This have to be implemented manually, K is polykinded.
    instance (Eq a) => Eq (K a b) where
        K a
    x == :: K a b -> K a b -> Bool
    == K a
    y = a
    x a -> a -> Bool
    forall a. Eq a => a -> a -> Bool
    == a
    y
    instance (Ord a) => Ord (K a b) where
        compare :: K a b -> K a b -> Ordering
    compare (K a
    x) (K a
    y) = a -> a -> Ordering
    forall a. Ord a => a -> a -> Ordering
    compare a
    x a
    y
    instance (Read a) => Read (K a b) where
        readsPrec :: Int -> ReadS (K a b)
    readsPrec = (String -> ReadS (K a b)) -> Int -> ReadS (K a b)
    forall a. (String -> ReadS a) -> Int -> ReadS a
    readsData ((String -> ReadS (K a b)) -> Int -> ReadS (K a b))
    -> (String -> ReadS (K a b)) -> Int -> ReadS (K a b)
    forall a b. (a -> b) -> a -> b
    $ (Int -> ReadS a)
    -> String -> (a -> K a b) -> String -> ReadS (K a b)
    forall a t.
    (Int -> ReadS a) -> String -> (a -> t) -> String -> ReadS t
    readsUnaryWith Int -> ReadS a
    forall a. Read a => Int -> ReadS a
    readsPrec String
    "K" a -> K a b
    forall k a (b :: k). a -> K a b
    K
    instance (Show a) => Show (K a b) where
        showsPrec :: Int -> K a b -> ShowS
    showsPrec Int
    d (K a
    x) = (Int -> a -> ShowS) -> String -> Int -> a -> ShowS
    forall a. (Int -> a -> ShowS) -> String -> Int -> a -> ShowS
    showsUnaryWith Int -> a -> ShowS
    forall a. Show a => Int -> a -> ShowS
    showsPrec String
    "K" Int
    d a
    x

    -- | @since 0.4.0.0
    instance Semigroup a => Semigroup (K a b) where
      K a
    x <> :: K a b -> K a b -> K a b
    <> K a
    y = a -> K a b
    forall k a (b :: k). a -> K a b
    K (a
    x a -> a -> a
    forall a. Semigroup a => a -> a -> a
    <> a
    y)

    -- | @since 0.4.0.0
    instance Monoid a => Monoid (K a b) where
      mempty :: K a b
    mempty              = a -> K a b
    forall k a (b :: k). a -> K a b
    K a
    forall a. Monoid a => a
    mempty
    #if !MIN_VERSION_base(4,11,0)
      mappend (K x) (K y) = K (mappend x y)
    #endif

    instance Monoid a => Applicative (K a) where
      pure :: forall a. a -> K a a
    pure a
    _      = a -> K a a
    forall k a (b :: k). a -> K a b
    K a
    forall a. Monoid a => a
    mempty
      K a
    x <*> :: forall a b. K a (a -> b) -> K a a -> K a b
    <*> K a
    y = a -> K a b
    forall k a (b :: k). a -> K a b
    K (a -> a -> a
    forall a. Monoid a => a -> a -> a
    mappend a
    x a
    y)

    -- | Extract the contents of a 'K' value.
    unK :: K a b -> a
    unK :: forall {k} a (b :: k). K a b -> a
    unK (K a
    x) = a
    x

    -- | The identity type functor.
    --
    -- Like 'Data.Functor.Identity.Identity', but with a shorter name.
    --
    newtype I (a :: Type) = I a
      deriving ((forall a b. (a -> b) -> I a -> I b)
    -> (forall a b. a -> I b -> I a) -> Functor I
    forall a b. a -> I b -> I a
    forall a b. (a -> b) -> I a -> I b
    forall (f :: * -> *).
    (forall a b. (a -> b) -> f a -> f b)
    -> (forall a b. a -> f b -> f a) -> Functor f
    $cfmap :: forall a b. (a -> b) -> I a -> I b
    fmap :: forall a b. (a -> b) -> I a -> I b
    $c<$ :: forall a b. a -> I b -> I a
    <$ :: forall a b. a -> I b -> I a
    Functor, (forall m. Monoid m => I m -> m)
    -> (forall m a. Monoid m => (a -> m) -> I a -> m)
    -> (forall m a. Monoid m => (a -> m) -> I a -> m)
    -> (forall a b. (a -> b -> b) -> b -> I a -> b)
    -> (forall a b. (a -> b -> b) -> b -> I a -> b)
    -> (forall b a. (b -> a -> b) -> b -> I a -> b)
    -> (forall b a. (b -> a -> b) -> b -> I a -> b)
    -> (forall a. (a -> a -> a) -> I a -> a)
    -> (forall a. (a -> a -> a) -> I a -> a)
    -> (forall a. I a -> [a])
    -> (forall a. I a -> Bool)
    -> (forall a. I a -> Int)
    -> (forall a. Eq a => a -> I a -> Bool)
    -> (forall a. Ord a => I a -> a)
    -> (forall a. Ord a => I a -> a)
    -> (forall a. Num a => I a -> a)
    -> (forall a. Num a => I a -> a)
    -> Foldable I
    forall a. Eq a => a -> I a -> Bool
    forall a. Num a => I a -> a
    forall a. Ord a => I a -> a
    forall m. Monoid m => I m -> m
    forall a. I a -> Bool
    forall a. I a -> Int
    forall a. I a -> [a]
    forall a. (a -> a -> a) -> I a -> a
    forall m a. Monoid m => (a -> m) -> I a -> m
    forall b a. (b -> a -> b) -> b -> I a -> b
    forall a b. (a -> b -> b) -> b -> I a -> b
    forall (t :: * -> *).
    (forall m. Monoid m => t m -> m)
    -> (forall m a. Monoid m => (a -> m) -> t a -> m)
    -> (forall m a. Monoid m => (a -> m) -> t a -> m)
    -> (forall a b. (a -> b -> b) -> b -> t a -> b)
    -> (forall a b. (a -> b -> b) -> b -> t a -> b)
    -> (forall b a. (b -> a -> b) -> b -> t a -> b)
    -> (forall b a. (b -> a -> b) -> b -> t a -> b)
    -> (forall a. (a -> a -> a) -> t a -> a)
    -> (forall a. (a -> a -> a) -> t a -> a)
    -> (forall a. t a -> [a])
    -> (forall a. t a -> Bool)
    -> (forall a. t a -> Int)
    -> (forall a. Eq a => a -> t a -> Bool)
    -> (forall a. Ord a => t a -> a)
    -> (forall a. Ord a => t a -> a)
    -> (forall a. Num a => t a -> a)
    -> (forall a. Num a => t a -> a)
    -> Foldable t
    $cfold :: forall m. Monoid m => I m -> m
    fold :: forall m. Monoid m => I m -> m
    $cfoldMap :: forall m a. Monoid m => (a -> m) -> I a -> m
    foldMap :: forall m a. Monoid m => (a -> m) -> I a -> m
    $cfoldMap' :: forall m a. Monoid m => (a -> m) -> I a -> m
    foldMap' :: forall m a. Monoid m => (a -> m) -> I a -> m
    $cfoldr :: forall a b. (a -> b -> b) -> b -> I a -> b
    foldr :: forall a b. (a -> b -> b) -> b -> I a -> b
    $cfoldr' :: forall a b. (a -> b -> b) -> b -> I a -> b
    foldr' :: forall a b. (a -> b -> b) -> b -> I a -> b
    $cfoldl :: forall b a. (b -> a -> b) -> b -> I a -> b
    foldl :: forall b a. (b -> a -> b) -> b -> I a -> b
    $cfoldl' :: forall b a. (b -> a -> b) -> b -> I a -> b
    foldl' :: forall b a. (b -> a -> b) -> b -> I a -> b
    $cfoldr1 :: forall a. (a -> a -> a) -> I a -> a
    foldr1 :: forall a. (a -> a -> a) -> I a -> a
    $cfoldl1 :: forall a. (a -> a -> a) -> I a -> a
    foldl1 :: forall a. (a -> a -> a) -> I a -> a
    $ctoList :: forall a. I a -> [a]
    toList :: forall a. I a -> [a]
    $cnull :: forall a. I a -> Bool
    null :: forall a. I a -> Bool
    $clength :: forall a. I a -> Int
    length :: forall a. I a -> Int
    $celem :: forall a. Eq a => a -> I a -> Bool
    elem :: forall a. Eq a => a -> I a -> Bool
    $cmaximum :: forall a. Ord a => I a -> a
    maximum :: forall a. Ord a => I a -> a
    $cminimum :: forall a. Ord a => I a -> a
    minimum :: forall a. Ord a => I a -> a
    $csum :: forall a. Num a => I a -> a
    sum :: forall a. Num a => I a -> a
    $cproduct :: forall a. Num a => I a -> a
    product :: forall a. Num a => I a -> a
    Foldable, Functor I
    Foldable I
    (Functor I, Foldable I) =>
    (forall (f :: * -> *) a b.
     Applicative f =>
     (a -> f b) -> I a -> f (I b))
    -> (forall (f :: * -> *) a. Applicative f => I (f a) -> f (I a))
    -> (forall (m :: * -> *) a b.
        Monad m =>
        (a -> m b) -> I a -> m (I b))
    -> (forall (m :: * -> *) a. Monad m => I (m a) -> m (I a))
    -> Traversable I
    forall (t :: * -> *).
    (Functor t, Foldable t) =>
    (forall (f :: * -> *) a b.
     Applicative f =>
     (a -> f b) -> t a -> f (t b))
    -> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
    -> (forall (m :: * -> *) a b.
        Monad m =>
        (a -> m b) -> t a -> m (t b))
    -> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
    -> Traversable t
    forall (m :: * -> *) a. Monad m => I (m a) -> m (I a)
    forall (f :: * -> *) a. Applicative f => I (f a) -> f (I a)
    forall (m :: * -> *) a b. Monad m => (a -> m b) -> I a -> m (I b)
    forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> I a -> f (I b)
    $ctraverse :: forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> I a -> f (I b)
    traverse :: forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> I a -> f (I b)
    $csequenceA :: forall (f :: * -> *) a. Applicative f => I (f a) -> f (I a)
    sequenceA :: forall (f :: * -> *) a. Applicative f => I (f a) -> f (I a)
    $cmapM :: forall (m :: * -> *) a b. Monad m => (a -> m b) -> I a -> m (I b)
    mapM :: forall (m :: * -> *) a b. Monad m => (a -> m b) -> I a -> m (I b)
    $csequence :: forall (m :: * -> *) a. Monad m => I (m a) -> m (I a)
    sequence :: forall (m :: * -> *) a. Monad m => I (m a) -> m (I a)
    Traversable, (forall x. I a -> Rep (I a) x)
    -> (forall x. Rep (I a) x -> I a) -> Generic (I a)
    forall x. Rep (I a) x -> I a
    forall x. I a -> Rep (I a) x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    forall a x. Rep (I a) x -> I a
    forall a x. I a -> Rep (I a) x
    $cfrom :: forall a x. I a -> Rep (I a) x
    from :: forall x. I a -> Rep (I a) x
    $cto :: forall a x. Rep (I a) x -> I a
    to :: forall x. Rep (I a) x -> I a
    GHC.Generic)

    -- | @since 0.4.0.0
    instance Semigroup a => Semigroup (I a) where
      I a
    x <> :: I a -> I a -> I a
    <> I a
    y = a -> I a
    forall a. a -> I a
    I (a
    x a -> a -> a
    forall a. Semigroup a => a -> a -> a
    <> a
    y)

    -- | @since 0.4.0.0
    instance Monoid a => Monoid (I a) where
      mempty :: I a
    mempty              = a -> I a
    forall a. a -> I a
    I a
    forall a. Monoid a => a
    mempty
    #if !MIN_VERSION_base(4,11,0)
      mappend (I x) (I y) = I (mappend x y)
    #endif

    instance Applicative I where
      pure :: forall a. a -> I a
    pure = a -> I a
    forall a. a -> I a
    I
      I a -> b
    f <*> :: forall a b. I (a -> b) -> I a -> I b
    <*> I a
    x = b -> I b
    forall a. a -> I a
    I (a -> b
    f a
    x)

    instance Monad I where
      I a
    x >>= :: forall a b. I a -> (a -> I b) -> I b
    >>= a -> I b
    f = a -> I b
    f a
    x

    -- | @since 0.2.4.0
    instance Eq1 I where
        liftEq :: forall a b. (a -> b -> Bool) -> I a -> I b -> Bool
    liftEq a -> b -> Bool
    eq (I a
    x) (I b
    y) = a -> b -> Bool
    eq a
    x b
    y
    -- | @since 0.2.4.0
    instance Ord1 I where
        liftCompare :: forall a b. (a -> b -> Ordering) -> I a -> I b -> Ordering
    liftCompare a -> b -> Ordering
    comp (I a
    x) (I b
    y) = a -> b -> Ordering
    comp a
    x b
    y
    -- | @since 0.2.4.0
    instance Read1 I where
        liftReadsPrec :: forall a. (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (I a)
    liftReadsPrec Int -> ReadS a
    rp ReadS [a]
    _ = (String -> ReadS (I a)) -> Int -> ReadS (I a)
    forall a. (String -> ReadS a) -> Int -> ReadS a
    readsData ((String -> ReadS (I a)) -> Int -> ReadS (I a))
    -> (String -> ReadS (I a)) -> Int -> ReadS (I a)
    forall a b. (a -> b) -> a -> b
    $
             (Int -> ReadS a) -> String -> (a -> I a) -> String -> ReadS (I a)
    forall a t.
    (Int -> ReadS a) -> String -> (a -> t) -> String -> ReadS t
    readsUnaryWith Int -> ReadS a
    rp String
    "I" a -> I a
    forall a. a -> I a
    I
    -- | @since 0.2.4.0
    instance Show1 I where
        liftShowsPrec :: forall a.
    (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> I a -> ShowS
    liftShowsPrec Int -> a -> ShowS
    sp [a] -> ShowS
    _ Int
    d (I a
    x) = (Int -> a -> ShowS) -> String -> Int -> a -> ShowS
    forall a. (Int -> a -> ShowS) -> String -> Int -> a -> ShowS
    showsUnaryWith Int -> a -> ShowS
    sp String
    "I" Int
    d a
    x

    instance (Eq a) => Eq (I a) where == :: I a -> I a -> Bool
    (==) = I a -> I a -> Bool
    forall (f :: * -> *) a. (Eq1 f, Eq a) => f a -> f a -> Bool
    eq1
    instance (Ord a) => Ord (I a) where compare :: I a -> I a -> Ordering
    compare = I a -> I a -> Ordering
    forall (f :: * -> *) a. (Ord1 f, Ord a) => f a -> f a -> Ordering
    compare1
    instance (Read a) => Read (I a) where readsPrec :: Int -> ReadS (I a)
    readsPrec = Int -> ReadS (I a)
    forall (f :: * -> *) a. (Read1 f, Read a) => Int -> ReadS (f a)
    readsPrec1
    instance (Show a) => Show (I a) where showsPrec :: Int -> I a -> ShowS
    showsPrec = Int -> I a -> ShowS
    forall (f :: * -> *) a. (Show1 f, Show a) => Int -> f a -> ShowS
    showsPrec1

    -- | Extract the contents of an 'I' value.
    unI :: I a -> a
    unI :: forall a. I a -> a
    unI (I a
    x) = a
    x

    -- | Composition of functors.
    --
    -- Like 'Data.Functor.Compose.Compose', but kind-polymorphic
    -- and with a shorter name.
    --
    newtype (:.:) (f :: l -> Type) (g :: k -> l) (p :: k) = Comp (f (g p))
      deriving ((forall x. (:.:) f g p -> Rep ((:.:) f g p) x)
    -> (forall x. Rep ((:.:) f g p) x -> (:.:) f g p)
    -> Generic ((:.:) f g p)
    forall x. Rep ((:.:) f g p) x -> (:.:) f g p
    forall x. (:.:) f g p -> Rep ((:.:) f g p) x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    forall l (f :: l -> *) k (g :: k -> l) (p :: k) x.
    Rep ((:.:) f g p) x -> (:.:) f g p
    forall l (f :: l -> *) k (g :: k -> l) (p :: k) x.
    (:.:) f g p -> Rep ((:.:) f g p) x
    $cfrom :: forall l (f :: l -> *) k (g :: k -> l) (p :: k) x.
    (:.:) f g p -> Rep ((:.:) f g p) x
    from :: forall x. (:.:) f g p -> Rep ((:.:) f g p) x
    $cto :: forall l (f :: l -> *) k (g :: k -> l) (p :: k) x.
    Rep ((:.:) f g p) x -> (:.:) f g p
    to :: forall x. Rep ((:.:) f g p) x -> (:.:) f g p
    GHC.Generic)

    infixr 7 :.:

    -- | @since 0.4.0.0
    instance (Semigroup (f (g x))) => Semigroup ((f :.: g) x) where
      Comp f (g x)
    x <> :: (:.:) f g x -> (:.:) f g x -> (:.:) f g x
    <> Comp f (g x)
    y = f (g x) -> (:.:) f g x
    forall l k (f :: l -> *) (g :: k -> l) (p :: k).
    f (g p) -> (:.:) f g p
    Comp (f (g x)
    x f (g x) -> f (g x) -> f (g x)
    forall a. Semigroup a => a -> a -> a
    <> f (g x)
    y)

    -- | @since 0.4.0.0
    instance (Monoid (f (g x))) => Monoid ((f :.: g) x) where
      mempty :: (:.:) f g x
    mempty                    = f (g x) -> (:.:) f g x
    forall l k (f :: l -> *) (g :: k -> l) (p :: k).
    f (g p) -> (:.:) f g p
    Comp f (g x)
    forall a. Monoid a => a
    mempty
    #if !MIN_VERSION_base(4,11,0)
      mappend (Comp x) (Comp y) = Comp (mappend x y)
    #endif

    instance (Functor f, Functor g) => Functor (f :.: g) where
      fmap :: forall a b. (a -> b) -> (:.:) f g a -> (:.:) f g b
    fmap a -> b
    f (Comp f (g a)
    x) = f (g b) -> (:.:) f g b
    forall l k (f :: l -> *) (g :: k -> l) (p :: k).
    f (g p) -> (:.:) f g p
    Comp ((g a -> g b) -> f (g a) -> f (g b)
    forall a b. (a -> b) -> f a -> f b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap ((a -> b) -> g a -> g b
    forall a b. (a -> b) -> g a -> g b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap a -> b
    f) f (g a)
    x)

    -- | @since 0.2.5.0
    instance (Applicative f, Applicative g) => Applicative (f :.: g) where
      pure :: forall a. a -> (:.:) f g a
    pure a
    x = f (g a) -> (:.:) f g a
    forall l k (f :: l -> *) (g :: k -> l) (p :: k).
    f (g p) -> (:.:) f g p
    Comp (g a -> f (g a)
    forall a. a -> f a
    forall (f :: * -> *) a. Applicative f => a -> f a
    pure (a -> g a
    forall a. a -> g a
    forall (f :: * -> *) a. Applicative f => a -> f a
    pure a
    x))
      Comp f (g (a -> b))
    f <*> :: forall a b. (:.:) f g (a -> b) -> (:.:) f g a -> (:.:) f g b
    <*> Comp f (g a)
    x = f (g b) -> (:.:) f g b
    forall l k (f :: l -> *) (g :: k -> l) (p :: k).
    f (g p) -> (:.:) f g p
    Comp (g (a -> b) -> g a -> g b
    forall a b. g (a -> b) -> g a -> g b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    (<*>) (g (a -> b) -> g a -> g b) -> f (g (a -> b)) -> f (g a -> g b)
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> f (g (a -> b))
    f f (g a -> g b) -> f (g a) -> f (g b)
    forall a b. f (a -> b) -> f a -> f b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> f (g a)
    x)

    -- | @since 0.2.5.0
    instance (Foldable f, Foldable g) => Foldable (f :.: g) where
      foldMap :: forall m a. Monoid m => (a -> m) -> (:.:) f g a -> m
    foldMap a -> m
    f (Comp f (g a)
    t) = (g a -> m) -> f (g a) -> m
    forall m a. Monoid m => (a -> m) -> f a -> m
    forall (t :: * -> *) m a.
    (Foldable t, Monoid m) =>
    (a -> m) -> t a -> m
    foldMap ((a -> m) -> g a -> m
    forall m a. Monoid m => (a -> m) -> g a -> m
    forall (t :: * -> *) m a.
    (Foldable t, Monoid m) =>
    (a -> m) -> t a -> m
    foldMap a -> m
    f) f (g a)
    t

    -- | @since 0.2.5.0
    instance (Traversable f, Traversable g) => Traversable (f :.: g) where
      traverse :: forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> (:.:) f g a -> f ((:.:) f g b)
    traverse a -> f b
    f (Comp f (g a)
    t) = f (g b) -> (:.:) f g b
    forall l k (f :: l -> *) (g :: k -> l) (p :: k).
    f (g p) -> (:.:) f g p
    Comp (f (g b) -> (:.:) f g b) -> f (f (g b)) -> f ((:.:) f g b)
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> (g a -> f (g b)) -> f (g a) -> f (f (g b))
    forall (t :: * -> *) (f :: * -> *) a b.
    (Traversable t, Applicative f) =>
    (a -> f b) -> t a -> f (t b)
    forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> f a -> f (f b)
    traverse ((a -> f b) -> g a -> f (g b)
    forall (t :: * -> *) (f :: * -> *) a b.
    (Traversable t, Applicative f) =>
    (a -> f b) -> t a -> f (t b)
    forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> g a -> f (g b)
    traverse a -> f b
    f) f (g a)
    t

    -- Instances of lifted Prelude classes

    -- | @since 0.2.4.0
    instance (Eq1 f, Eq1 g) => Eq1 (f :.: g) where
        liftEq :: forall a b. (a -> b -> Bool) -> (:.:) f g a -> (:.:) f g b -> Bool
    liftEq a -> b -> Bool
    eq (Comp f (g a)
    x) (Comp f (g b)
    y) = (g a -> g b -> Bool) -> f (g a) -> f (g b) -> Bool
    forall a b. (a -> b -> Bool) -> f a -> f b -> Bool
    forall (f :: * -> *) a b.
    Eq1 f =>
    (a -> b -> Bool) -> f a -> f b -> Bool
    liftEq ((a -> b -> Bool) -> g a -> g b -> Bool
    forall a b. (a -> b -> Bool) -> g a -> g b -> Bool
    forall (f :: * -> *) a b.
    Eq1 f =>
    (a -> b -> Bool) -> f a -> f b -> Bool
    liftEq a -> b -> Bool
    eq) f (g a)
    x f (g b)
    y

    -- | @since 0.2.4.0
    instance (Ord1 f, Ord1 g) => Ord1 (f :.: g) where
        liftCompare :: forall a b.
    (a -> b -> Ordering) -> (:.:) f g a -> (:.:) f g b -> Ordering
    liftCompare a -> b -> Ordering
    comp (Comp f (g a)
    x) (Comp f (g b)
    y) =
            (g a -> g b -> Ordering) -> f (g a) -> f (g b) -> Ordering
    forall a b. (a -> b -> Ordering) -> f a -> f b -> Ordering
    forall (f :: * -> *) a b.
    Ord1 f =>
    (a -> b -> Ordering) -> f a -> f b -> Ordering
    liftCompare ((a -> b -> Ordering) -> g a -> g b -> Ordering
    forall a b. (a -> b -> Ordering) -> g a -> g b -> Ordering
    forall (f :: * -> *) a b.
    Ord1 f =>
    (a -> b -> Ordering) -> f a -> f b -> Ordering
    liftCompare a -> b -> Ordering
    comp) f (g a)
    x f (g b)
    y

    -- | @since 0.2.4.0
    instance (Read1 f, Read1 g) => Read1 (f :.: g) where
        liftReadsPrec :: forall a.
    (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS ((:.:) f g a)
    liftReadsPrec Int -> ReadS a
    rp ReadS [a]
    rl = (String -> ReadS ((:.:) f g a)) -> Int -> ReadS ((:.:) f g a)
    forall a. (String -> ReadS a) -> Int -> ReadS a
    readsData ((String -> ReadS ((:.:) f g a)) -> Int -> ReadS ((:.:) f g a))
    -> (String -> ReadS ((:.:) f g a)) -> Int -> ReadS ((:.:) f g a)
    forall a b. (a -> b) -> a -> b
    $
            (Int -> ReadS (f (g a)))
    -> String
    -> (f (g a) -> (:.:) f g a)
    -> String
    -> ReadS ((:.:) f g a)
    forall a t.
    (Int -> ReadS a) -> String -> (a -> t) -> String -> ReadS t
    readsUnaryWith ((Int -> ReadS (g a)) -> ReadS [g a] -> Int -> ReadS (f (g a))
    forall a. (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (f a)
    forall (f :: * -> *) a.
    Read1 f =>
    (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (f a)
    liftReadsPrec Int -> ReadS (g a)
    rp' ReadS [g a]
    rl') String
    "Comp" f (g a) -> (:.:) f g a
    forall l k (f :: l -> *) (g :: k -> l) (p :: k).
    f (g p) -> (:.:) f g p
    Comp
          where
            rp' :: Int -> ReadS (g a)
    rp' = (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (g a)
    forall a. (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (g a)
    forall (f :: * -> *) a.
    Read1 f =>
    (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (f a)
    liftReadsPrec Int -> ReadS a
    rp ReadS [a]
    rl
            rl' :: ReadS [g a]
    rl' = (Int -> ReadS a) -> ReadS [a] -> ReadS [g a]
    forall a. (Int -> ReadS a) -> ReadS [a] -> ReadS [g a]
    forall (f :: * -> *) a.
    Read1 f =>
    (Int -> ReadS a) -> ReadS [a] -> ReadS [f a]
    liftReadList Int -> ReadS a
    rp ReadS [a]
    rl

    -- | @since 0.2.4.0
    instance (Show1 f, Show1 g) => Show1 (f :.: g) where
        liftShowsPrec :: forall a.
    (Int -> a -> ShowS)
    -> ([a] -> ShowS) -> Int -> (:.:) f g a -> ShowS
    liftShowsPrec Int -> a -> ShowS
    sp [a] -> ShowS
    sl Int
    d (Comp f (g a)
    x) =
            (Int -> f (g a) -> ShowS) -> String -> Int -> f (g a) -> ShowS
    forall a. (Int -> a -> ShowS) -> String -> Int -> a -> ShowS
    showsUnaryWith ((Int -> g a -> ShowS)
    -> ([g a] -> ShowS) -> Int -> f (g a) -> ShowS
    forall a.
    (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> f a -> ShowS
    forall (f :: * -> *) a.
    Show1 f =>
    (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> f a -> ShowS
    liftShowsPrec Int -> g a -> ShowS
    sp' [g a] -> ShowS
    sl') String
    "Comp" Int
    d f (g a)
    x
          where
            sp' :: Int -> g a -> ShowS
    sp' = (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> g a -> ShowS
    forall a.
    (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> g a -> ShowS
    forall (f :: * -> *) a.
    Show1 f =>
    (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> f a -> ShowS
    liftShowsPrec Int -> a -> ShowS
    sp [a] -> ShowS
    sl
            sl' :: [g a] -> ShowS
    sl' = (Int -> a -> ShowS) -> ([a] -> ShowS) -> [g a] -> ShowS
    forall a. (Int -> a -> ShowS) -> ([a] -> ShowS) -> [g a] -> ShowS
    forall (f :: * -> *) a.
    Show1 f =>
    (Int -> a -> ShowS) -> ([a] -> ShowS) -> [f a] -> ShowS
    liftShowList Int -> a -> ShowS
    sp [a] -> ShowS
    sl

    instance (Eq1 f, Eq1 g, Eq a) => Eq ((f :.: g) a) where == :: (:.:) f g a -> (:.:) f g a -> Bool
    (==) = (:.:) f g a -> (:.:) f g a -> Bool
    forall (f :: * -> *) a. (Eq1 f, Eq a) => f a -> f a -> Bool
    eq1
    instance (Ord1 f, Ord1 g, Ord a) => Ord ((f :.: g) a) where compare :: (:.:) f g a -> (:.:) f g a -> Ordering
    compare = (:.:) f g a -> (:.:) f g a -> Ordering
    forall (f :: * -> *) a. (Ord1 f, Ord a) => f a -> f a -> Ordering
    compare1
    instance (Read1 f, Read1 g, Read a) => Read ((f :.: g) a) where readsPrec :: Int -> ReadS ((:.:) f g a)
    readsPrec = Int -> ReadS ((:.:) f g a)
    forall (f :: * -> *) a. (Read1 f, Read a) => Int -> ReadS (f a)
    readsPrec1
    instance (Show1 f, Show1 g, Show a) => Show ((f :.: g) a) where showsPrec :: Int -> (:.:) f g a -> ShowS
    showsPrec = Int -> (:.:) f g a -> ShowS
    forall (f :: * -> *) a. (Show1 f, Show a) => Int -> f a -> ShowS
    showsPrec1

    -- NFData Instances

    -- | @since 0.2.5.0
    instance NFData a => NFData (I a) where
        rnf :: I a -> ()
    rnf (I a
    x) = a -> ()
    forall a. NFData a => a -> ()
    rnf a
    x

    -- | @since 0.2.5.0
    instance NFData a => NFData (K a b) where
        rnf :: K a b -> ()
    rnf (K a
    x) = a -> ()
    forall a. NFData a => a -> ()
    rnf a
    x

    -- | @since 0.2.5.0
    instance NFData (f (g a)) => NFData ((f :.: g)  a) where
        rnf :: (:.:) f g a -> ()
    rnf (Comp f (g a)
    x) = f (g a) -> ()
    forall a. NFData a => a -> ()
    rnf f (g a)
    x

    #if MIN_VERSION_deepseq(1,4,3)
    -- | @since 0.2.5.0
    instance NFData1 I where
        liftRnf :: forall a. (a -> ()) -> I a -> ()
    liftRnf a -> ()
    r (I a
    x) = a -> ()
    r a
    x

    -- | @since 0.2.5.0
    instance NFData a => NFData1 (K a) where
        liftRnf :: forall a. (a -> ()) -> K a a -> ()
    liftRnf a -> ()
    _ (K a
    x) = a -> ()
    forall a. NFData a => a -> ()
    rnf a
    x

    -- | @since 0.2.5.0
    instance NFData2 K where
        liftRnf2 :: forall a b. (a -> ()) -> (b -> ()) -> K a b -> ()
    liftRnf2 a -> ()
    r b -> ()
    _ (K a
    x) = a -> ()
    r a
    x

    -- | @since 0.2.5.0
    instance (NFData1 f, NFData1 g) => NFData1 (f :.: g) where
        liftRnf :: forall a. (a -> ()) -> (:.:) f g a -> ()
    liftRnf a -> ()
    r (Comp f (g a)
    x) = (g a -> ()) -> f (g a) -> ()
    forall a. (a -> ()) -> f a -> ()
    forall (f :: * -> *) a. NFData1 f => (a -> ()) -> f a -> ()
    liftRnf ((a -> ()) -> g a -> ()
    forall a. (a -> ()) -> g a -> ()
    forall (f :: * -> *) a. NFData1 f => (a -> ()) -> f a -> ()
    liftRnf a -> ()
    r) f (g a)
    x
    #endif

    -- | Extract the contents of a 'Comp' value.
    unComp :: (f :.: g) p -> f (g p)
    unComp :: forall {l} {k} (f :: l -> *) (g :: k -> l) (p :: k).
    (:.:) f g p -> f (g p)
    unComp (Comp f (g p)
    x) = f (g p)
    x

    -- * Mapping functions

    -- | Lift the given function.
    --
    -- @since 0.2.5.0
    --
    mapII :: (a -> b) -> I a -> I b
    mapII :: forall a b. (a -> b) -> I a -> I b
    mapII = (a -> b) -> I a -> I b
    forall a b. Coercible a b => a -> b
    coerce
    {-# INLINE mapII #-}

    -- | Lift the given function.
    --
    -- @since 0.2.5.0
    --
    mapIK :: (a -> b) -> I a -> K b c
    mapIK :: forall {k} a b (c :: k). (a -> b) -> I a -> K b c
    mapIK = (a -> b) -> I a -> K b c
    forall a b. Coercible a b => a -> b
    coerce
    {-# INLINE mapIK #-}

    -- | Lift the given function.
    --
    -- @since 0.2.5.0
    --
    mapKI :: (a -> b) -> K a c -> I b
    mapKI :: forall {k} a b (c :: k). (a -> b) -> K a c -> I b
    mapKI = (a -> b) -> K a c -> I b
    forall a b. Coercible a b => a -> b
    coerce
    {-# INLINE mapKI #-}

    -- | Lift the given function.
    --
    -- @since 0.2.5.0
    --
    mapKK :: (a -> b) -> K a c -> K b d
    mapKK :: forall {k} {k} a b (c :: k) (d :: k). (a -> b) -> K a c -> K b d
    mapKK = (a -> b) -> K a c -> K b d
    forall a b. Coercible a b => a -> b
    coerce
    {-# INLINE mapKK #-}

    -- | Lift the given function.
    --
    -- @since 0.2.5.0
    --
    mapIII :: (a -> b -> c) -> I a -> I b -> I c
    mapIII :: forall a b c. (a -> b -> c) -> I a -> I b -> I c
    mapIII = (a -> b -> c) -> I a -> I b -> I c
    forall a b. Coercible a b => a -> b
    coerce
    {-# INLINE mapIII #-}

    -- | Lift the given function.
    --
    -- @since 0.2.5.0
    --
    mapIIK :: (a -> b -> c) -> I a -> I b -> K c d
    mapIIK :: forall {k} a b c (d :: k). (a -> b -> c) -> I a -> I b -> K c d
    mapIIK = (a -> b -> c) -> I a -> I b -> K c d
    forall a b. Coercible a b => a -> b
    coerce
    {-# INLINE mapIIK #-}

    -- | Lift the given function.
    --
    -- @since 0.2.5.0
    --
    mapIKI :: (a -> b -> c) -> I a -> K b d -> I c
    mapIKI :: forall {k} a b c (d :: k). (a -> b -> c) -> I a -> K b d -> I c
    mapIKI = (a -> b -> c) -> I a -> K b d -> I c
    forall a b. Coercible a b => a -> b
    coerce
    {-# INLINE mapIKI #-}

    -- | Lift the given function.
    --
    -- @since 0.2.5.0
    --
    mapIKK :: (a -> b -> c) -> I a -> K b d -> K c e
    mapIKK :: forall {k} {k} a b c (d :: k) (e :: k).
    (a -> b -> c) -> I a -> K b d -> K c e
    mapIKK = (a -> b -> c) -> I a -> K b d -> K c e
    forall a b. Coercible a b => a -> b
    coerce
    {-# INLINE mapIKK #-}

    -- | Lift the given function.
    --
    -- @since 0.2.5.0
    --
    mapKII :: (a -> b -> c) -> K a d -> I b -> I c
    mapKII :: forall {k} a b c (d :: k). (a -> b -> c) -> K a d -> I b -> I c
    mapKII = (a -> b -> c) -> K a d -> I b -> I c
    forall a b. Coercible a b => a -> b
    coerce
    {-# INLINE mapKII #-}

    -- | Lift the given function.
    --
    -- @since 0.2.5.0
    --
    mapKIK :: (a -> b -> c) -> K a d -> I b -> K c e
    mapKIK :: forall {k} {k} a b c (d :: k) (e :: k).
    (a -> b -> c) -> K a d -> I b -> K c e
    mapKIK = (a -> b -> c) -> K a d -> I b -> K c e
    forall a b. Coercible a b => a -> b
    coerce
    {-# INLINE mapKIK #-}

    -- | Lift the given function.
    --
    -- @since 0.2.5.0
    --
    mapKKI :: (a -> b -> c) -> K a d -> K b e -> I c
    mapKKI :: forall {k} {k} a b c (d :: k) (e :: k).
    (a -> b -> c) -> K a d -> K b e -> I c
    mapKKI = (a -> b -> c) -> K a d -> K b e -> I c
    forall a b. Coercible a b => a -> b
    coerce
    {-# INLINE mapKKI #-}

    -- | Lift the given function.
    --
    -- @since 0.2.5.0
    --
    mapKKK :: (a -> b -> c) -> K a d -> K b e -> K c f
    mapKKK :: forall {k} {k} {k} a b c (d :: k) (e :: k) (f :: k).
    (a -> b -> c) -> K a d -> K b e -> K c f
    mapKKK = (a -> b -> c) -> K a d -> K b e -> K c f
    forall a b. Coercible a b => a -> b
    coerce
    {-# INLINE mapKKK #-}