-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | A library to support the definition of generic functions. Datatypes
--   are viewed in a uniform, structured way: the choice between
--   constructors is represented using an n-ary sum, and the arguments of
--   each constructor are represented using an n-ary product.
--   
--   The module <a>Generics.SOP</a> is the main module of this library and
--   contains more detailed documentation.
--   
--   Since version 0.4.0.0, this package is now based on
--   <tt><a>sop-core</a></tt>. The core package contains all the
--   functionality of n-ary sums and products, whereas this package
--   provides the datatype-generic programming support on top.
--   
--   Examples of using this library are provided by the following packages:
--   
--   <ul>
--   <li><tt><a>basic-sop</a></tt> basic examples,</li>
--   <li><tt><a>pretty-sop</a></tt> generic pretty printing,</li>
--   <li><tt><a>lens-sop</a></tt> generically computed lenses,</li>
--   <li><tt><a>json-sop</a></tt> generic JSON conversions.</li>
--   </ul>
--   
--   A detailed description of the ideas behind this library is provided by
--   the paper:
--   
--   <ul>
--   <li>Edsko de Vries and Andres Löh. <a>True Sums of Products</a>.
--   Workshop on Generic Programming (WGP) 2014.</li>
--   </ul>
@package generics-sop
@version 0.5.1.4

module Generics.SOP.BasicFunctors
mapII :: (a -> b) -> I a -> I b
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
mapIK :: forall {k} a b (c :: k). (a -> b) -> I a -> K b c
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
mapKI :: forall {k} a b (c :: k). (a -> b) -> K a c -> I b
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
mapKK :: forall {k1} {k2} a b (c :: k1) (d :: k2). (a -> b) -> K a c -> K b d
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
unComp :: forall {l} {k} f (g :: k -> l) (p :: k). (f :.: g) p -> f (g p)
unI :: I a -> a
unK :: forall {k} a (b :: k). K a b -> a
newtype ( (f :: l -> Type) :.: (g :: k -> l) ) (p :: k)
Comp :: f (g p) -> (:.:) (f :: l -> Type) (g :: k -> l) (p :: k)
newtype I a
I :: a -> I a
newtype K a (b :: k)
K :: a -> K a (b :: k)

module Generics.SOP.Classes
fn :: forall {k} f (a :: k) f'. (f a -> f' a) -> (f -.-> f') a
fn_2 :: forall {k} f (a :: k) f' f''. (f a -> f' a -> f'' a) -> (f -.-> (f' -.-> f'')) a
fn_3 :: forall {k} f (a :: k) f' f'' f'''. (f a -> f' a -> f'' a -> f''' a) -> (f -.-> (f' -.-> (f'' -.-> f'''))) a
fn_4 :: forall {k} f (a :: k) f' f'' f''' f''''. (f a -> f' a -> f'' a -> f''' a -> f'''' a) -> (f -.-> (f' -.-> (f'' -.-> (f''' -.-> f'''')))) a
hcfoldMap :: forall {k} {l} h c (xs :: l) m proxy f. (HTraverse_ h, AllN h c xs, Monoid m) => proxy c -> (forall (a :: k). c a => f a -> m) -> h f xs -> m
hcfor :: forall {l} h c (xs :: l) g proxy f. (HSequence h, AllN h c xs, Applicative g) => proxy c -> h f xs -> (forall a. c a => f a -> g a) -> g (h I xs)
hcfor_ :: forall {k} {l} h c (xs :: l) g proxy f. (HTraverse_ h, AllN h c xs, Applicative g) => proxy c -> h f xs -> (forall (a :: k). c a => f a -> g ()) -> g ()
hcliftA :: forall {k} {l} h c (xs :: l) proxy f f'. (AllN (Prod h) c xs, HAp h) => proxy c -> (forall (a :: k). c a => f a -> f' a) -> h f xs -> h f' xs
hcliftA2 :: forall {k} {l} h c (xs :: l) proxy f f' f''. (AllN (Prod h) c xs, HAp h, HAp (Prod h)) => proxy c -> (forall (a :: k). c a => f a -> f' a -> f'' a) -> Prod h f xs -> h f' xs -> h f'' xs
hcliftA3 :: forall {k} {l} h c (xs :: l) proxy f f' f'' f'''. (AllN (Prod h) c xs, HAp h, HAp (Prod h)) => proxy c -> (forall (a :: k). c a => f a -> f' a -> f'' a -> f''' a) -> Prod h f xs -> Prod h f' xs -> h f'' xs -> h f''' xs
hcmap :: forall {k} {l} h c (xs :: l) proxy f f'. (AllN (Prod h) c xs, HAp h) => proxy c -> (forall (a :: k). c a => f a -> f' a) -> h f xs -> h f' xs
hctraverse :: forall {l} h c (xs :: l) g proxy f. (HSequence h, AllN h c xs, Applicative g) => proxy c -> (forall a. c a => f a -> g a) -> h f xs -> g (h I xs)
hczipWith :: forall {k} {l} h c (xs :: l) proxy f f' f''. (AllN (Prod h) c xs, HAp h, HAp (Prod h)) => proxy c -> (forall (a :: k). c a => f a -> f' a -> f'' a) -> Prod h f xs -> h f' xs -> h f'' xs
hczipWith3 :: forall {k} {l} h c (xs :: l) proxy f f' f'' f'''. (AllN (Prod h) c xs, HAp h, HAp (Prod h)) => proxy c -> (forall (a :: k). c a => f a -> f' a -> f'' a -> f''' a) -> Prod h f xs -> Prod h f' xs -> h f'' xs -> h f''' xs
hfromI :: forall {l1} {k2} {l2} h1 (f :: k2 -> Type) (xs :: l1) (ys :: l2) h2. (AllZipN (Prod h1) (LiftedCoercible I f) xs ys, HTrans h1 h2) => h1 I xs -> h2 f ys
hliftA :: forall {k} {l} h (xs :: l) f f'. (SListIN (Prod h) xs, HAp h) => (forall (a :: k). () => f a -> f' a) -> h f xs -> h f' xs
hliftA2 :: forall {k} {l} h (xs :: l) f f' f''. (SListIN (Prod h) xs, HAp h, HAp (Prod h)) => (forall (a :: k). () => f a -> f' a -> f'' a) -> Prod h f xs -> h f' xs -> h f'' xs
hliftA3 :: forall {k} {l} h (xs :: l) f f' f'' f'''. (SListIN (Prod h) xs, HAp h, HAp (Prod h)) => (forall (a :: k). () => f a -> f' a -> f'' a -> f''' a) -> Prod h f xs -> Prod h f' xs -> h f'' xs -> h f''' xs
hmap :: forall {k} {l} h (xs :: l) f f'. (SListIN (Prod h) xs, HAp h) => (forall (a :: k). () => f a -> f' a) -> h f xs -> h f' xs
hsequence :: forall {l} h (xs :: l) f. (SListIN h xs, SListIN (Prod h) xs, HSequence h, Applicative f) => h f xs -> f (h I xs)
hsequenceK :: forall {k} {l} h (xs :: l) f a. (SListIN h xs, SListIN (Prod h) xs, Applicative f, HSequence h) => h (K (f a) :: k -> Type) xs -> f (h (K a :: k -> Type) xs)
htoI :: forall {k1} {l1} {l2} h1 (f :: k1 -> Type) (xs :: l1) (ys :: l2) h2. (AllZipN (Prod h1) (LiftedCoercible f I) xs ys, HTrans h1 h2) => h1 f xs -> h2 I ys
hzipWith :: forall {k} {l} h (xs :: l) f f' f''. (SListIN (Prod h) xs, HAp h, HAp (Prod h)) => (forall (a :: k). () => f a -> f' a -> f'' a) -> Prod h f xs -> h f' xs -> h f'' xs
hzipWith3 :: forall {k} {l} h (xs :: l) f f' f'' f'''. (SListIN (Prod h) xs, HAp h, HAp (Prod h)) => (forall (a :: k). () => f a -> f' a -> f'' a -> f''' a) -> Prod h f xs -> Prod h f' xs -> h f'' xs -> h f''' xs
newtype ( (f :: k -> Type) -.-> (g :: k -> Type) ) (a :: k)
Fn :: (f a -> g a) -> (-.->) (f :: k -> Type) (g :: k -> Type) (a :: k)
[apFn] :: (-.->) (f :: k -> Type) (g :: k -> Type) (a :: k) -> f a -> g a
type family CollapseTo (h :: k -> Type -> l -> Type) x
class (Prod Prod h ~ Prod h, HPure Prod h) => HAp (h :: k -> Type -> l -> Type)
hap :: forall (f :: k -> Type) (g :: k -> Type) (xs :: l). HAp h => Prod h (f -.-> g) xs -> h f xs -> h g xs
class UnProd Prod h ~ h => HApInjs (h :: k -> Type -> l -> Type)
hapInjs :: forall (xs :: l) (f :: k -> Type). (HApInjs h, SListIN h xs) => Prod h f xs -> [h f xs]
class HCollapse (h :: k -> Type -> l -> Type)
hcollapse :: forall (xs :: l) a. (HCollapse h, SListIN h xs) => h (K a :: k -> Type) xs -> CollapseTo h a
class HExpand (h :: k -> Type -> l -> Type)
hexpand :: forall (xs :: l) f. (HExpand h, SListIN (Prod h) xs) => (forall (x :: k). () => f x) -> h f xs -> Prod h f xs
hcexpand :: forall c (xs :: l) proxy f. (HExpand h, AllN (Prod h) c xs) => proxy c -> (forall (x :: k). c x => f x) -> h f xs -> Prod h f xs
class HIndex (h :: k -> Type -> l -> Type)
hindex :: forall (f :: k -> Type) (xs :: l). HIndex h => h f xs -> Int
class HPure (h :: k -> Type -> l -> Type)
hpure :: forall (xs :: l) f. (HPure h, SListIN h xs) => (forall (a :: k). () => f a) -> h f xs
hcpure :: forall c (xs :: l) proxy f. (HPure h, AllN h c xs) => proxy c -> (forall (a :: k). c a => f a) -> h f xs
class HAp h => HSequence (h :: k -> Type -> l -> Type)
hsequence' :: forall (xs :: l) f (g :: k -> Type). (HSequence h, SListIN h xs, Applicative f) => h (f :.: g) xs -> f (h g xs)
hctraverse' :: forall c (xs :: l) g proxy f f'. (HSequence h, AllN h c xs, Applicative g) => proxy c -> (forall (a :: k). c a => f a -> g (f' a)) -> h f xs -> g (h f' xs)
htraverse' :: forall (xs :: l) g f f'. (HSequence h, SListIN h xs, Applicative g) => (forall (a :: k). () => f a -> g (f' a)) -> h f xs -> g (h f' xs)
class (Same h1 :: k2 -> Type -> l2 -> Type ~ h2, Same h2 :: k1 -> Type -> l1 -> Type ~ h1) => HTrans (h1 :: k1 -> Type -> l1 -> Type) (h2 :: k2 -> Type -> l2 -> Type)
htrans :: forall c (xs :: l1) (ys :: l2) proxy f g. (HTrans h1 h2, AllZipN (Prod h1) c xs ys) => proxy c -> (forall (x :: k1) (y :: k2). c x y => f x -> g y) -> h1 f xs -> h2 g ys
hcoerce :: forall (f :: k1 -> Type) (g :: k2 -> Type) (xs :: l1) (ys :: l2). (HTrans h1 h2, AllZipN (Prod h1) (LiftedCoercible f g) xs ys) => h1 f xs -> h2 g ys
class HTraverse_ (h :: k -> Type -> l -> Type)
hctraverse_ :: forall c (xs :: l) g proxy f. (HTraverse_ h, AllN h c xs, Applicative g) => proxy c -> (forall (a :: k). c a => f a -> g ()) -> h f xs -> g ()
htraverse_ :: forall (xs :: l) g f. (HTraverse_ h, SListIN h xs, Applicative g) => (forall (a :: k). () => f a -> g ()) -> h f xs -> g ()
type family Prod (h :: k -> Type -> l -> Type) :: k -> Type -> l -> Type
type family Same (h :: k1 -> Type -> l1 -> Type) :: k2 -> Type -> l2 -> Type
type family UnProd (h :: k -> Type -> l -> Type) :: k -> Type -> l -> Type

module Generics.SOP.Constraint
ccase_SList :: forall {a} c (xs :: [a]) proxy r. All c xs => proxy c -> r ('[] :: [a]) -> (forall (y :: a) (ys :: [a]). (c y, All c ys) => r (y ': ys)) -> r xs
class (AllF c xs, SListI xs) => All (c :: k -> Constraint) (xs :: [k])
cpara_SList :: All c xs => proxy c -> r ('[] :: [k]) -> (forall (y :: k) (ys :: [k]). (c y, All c ys) => r ys -> r (y ': ys)) -> r xs
type All2 (c :: k -> Constraint) = All All c
type family AllF (c :: k -> Constraint) (xs :: [k])
type family AllN (h :: k -> Type -> l -> Type) (c :: k -> Constraint) :: l -> Constraint
class (SListI xs, SListI ys, SameShapeAs xs ys, SameShapeAs ys xs, AllZipF c xs ys) => AllZip (c :: a -> b -> Constraint) (xs :: [a]) (ys :: [b])
class (AllZipF AllZip f xss yss, SListI xss, SListI yss, SameShapeAs xss yss, SameShapeAs yss xss) => AllZip2 (f :: a -> b -> Constraint) (xss :: [[a]]) (yss :: [[b]])
type family AllZipF (c :: a -> b -> Constraint) (xs :: [a]) (ys :: [b])
type family AllZipN (h :: k -> Type -> l -> Type) (c :: k1 -> k2 -> Constraint) :: l1 -> l2 -> Constraint
class (f x, g x) => And (f :: k -> Constraint) (g :: k -> Constraint) (x :: k)
class f g x => Compose (f :: k -> Constraint) (g :: k1 -> k) (x :: k1)
type family Head (xs :: [a]) :: a
class Coercible f x g y => LiftedCoercible (f :: k -> k1) (g :: k2 -> k1) (x :: k) (y :: k2)
type SListI = All Top :: k -> Constraint
type SListI2 = All SListI :: [k] -> Constraint
type family SListIN (h :: k -> Type -> l -> Type) :: l -> Constraint
type family SameShapeAs (xs :: [a]) (ys :: [b])
type family Tail (xs :: [a]) :: [a]
class Top (x :: k)
type Constraint = CONSTRAINT LiftedRep

module Generics.SOP.Dict
all2 :: forall {k} (c :: k -> Constraint) (xss :: [[k]]). Dict (All (All c)) xss -> Dict (All2 c) xss
all_NP :: forall {k} (c :: k -> Constraint) (xs :: [k]). NP (Dict c) xs -> Dict (All c) xs
all_POP :: forall {k} (xss :: [[k]]) (c :: k -> Constraint). SListI xss => POP (Dict c) xss -> Dict (All2 c) xss
hdicts :: forall {k} {l} h (c :: k -> Constraint) (xs :: l). (AllN h c xs, HPure h) => h (Dict c) xs
mapAll :: forall {k} (c :: k -> Constraint) (d :: k -> Constraint) (xs :: [k]). (forall (a :: k). () => Dict c a -> Dict d a) -> Dict (All c) xs -> Dict (All d) xs
mapAll2 :: forall {k} (c :: k -> Constraint) (d :: k -> Constraint) (xss :: [[k]]). (forall (a :: k). () => Dict c a -> Dict d a) -> Dict (All2 c) xss -> Dict (All2 d) xss
pureAll :: forall {k} (xs :: [k]). SListI xs => Dict (All (Top :: k -> Constraint)) xs
pureAll2 :: forall {k} (xss :: [[k]]). All (SListI :: [k] -> Constraint) xss => Dict (All2 (Top :: k -> Constraint)) xss
unAll2 :: forall {k} (c :: k -> Constraint) (xss :: [[k]]). Dict (All2 c) xss -> Dict (All (All c)) xss
unAll_NP :: forall {k} (c :: k -> Constraint) (xs :: [k]). Dict (All c) xs -> NP (Dict c) xs
unAll_POP :: forall {k} (c :: k -> Constraint) (xss :: [[k]]). Dict (All2 c) xss -> POP (Dict c) xss
withDict :: forall {k} c (a :: k) r. Dict c a -> (c a => r) -> r
zipAll :: forall {k} (c :: k -> Constraint) (xs :: [k]) (d :: k -> Constraint). Dict (All c) xs -> Dict (All d) xs -> Dict (All (And c d)) xs
zipAll2 :: forall {k} (xss :: [[k]]) (c :: k -> Constraint) (d :: k -> Constraint). All (SListI :: [k] -> Constraint) xss => Dict (All2 c) xss -> Dict (All2 d) xss -> Dict (All2 (And c d)) xss
data Dict (c :: k -> Constraint) (a :: k)
[Dict] :: forall {k} (c :: k -> Constraint) (a :: k). c a => Dict c a

module Generics.SOP.NP
ana_NP :: forall {k} s f (xs :: [k]). SListI xs => (forall (y :: k) (ys :: [k]). () => s (y ': ys) -> (f y, s ys)) -> s xs -> NP f xs
ap_NP :: forall {k} (f :: k -> Type) (g :: k -> Type) (xs :: [k]). NP (f -.-> g) xs -> NP f xs -> NP g xs
ap_POP :: forall {k} (f :: k -> Type) (g :: k -> Type) (xss :: [[k]]). POP (f -.-> g) xss -> POP f xss -> POP g xss
cana_NP :: forall {k} c proxy s f (xs :: [k]). All c xs => proxy c -> (forall (y :: k) (ys :: [k]). c y => s (y ': ys) -> (f y, s ys)) -> s xs -> NP f xs
cata_NP :: forall {a} r f (xs :: [a]). r ('[] :: [a]) -> (forall (y :: a) (ys :: [a]). () => f y -> r ys -> r (y ': ys)) -> NP f xs -> r xs
ccata_NP :: forall {a} c proxy r f (xs :: [a]). All c xs => proxy c -> r ('[] :: [a]) -> (forall (y :: a) (ys :: [a]). c y => f y -> r ys -> r (y ': ys)) -> NP f xs -> r xs
cfoldMap_NP :: forall {k} c (xs :: [k]) m proxy f. (All c xs, Monoid m) => proxy c -> (forall (a :: k). c a => f a -> m) -> NP f xs -> m
cfoldMap_POP :: forall {k} c (xs :: [[k]]) m proxy f. (All2 c xs, Monoid m) => proxy c -> (forall (a :: k). c a => f a -> m) -> POP f xs -> m
cliftA2'_NP :: forall {k} (c :: k -> Constraint) (xss :: [[k]]) proxy f g h. All2 c xss => proxy c -> (forall (xs :: [k]). All c xs => f xs -> g xs -> h xs) -> NP f xss -> NP g xss -> NP h xss
cliftA2_NP :: forall {k} c (xs :: [k]) proxy f g h. All c xs => proxy c -> (forall (a :: k). c a => f a -> g a -> h a) -> NP f xs -> NP g xs -> NP h xs
cliftA2_POP :: forall {k} c (xss :: [[k]]) proxy f g h. All2 c xss => proxy c -> (forall (a :: k). c a => f a -> g a -> h a) -> POP f xss -> POP g xss -> POP h xss
cliftA3_NP :: forall {k} c (xs :: [k]) proxy f g h i. All c xs => proxy c -> (forall (a :: k). c a => f a -> g a -> h a -> i a) -> NP f xs -> NP g xs -> NP h xs -> NP i xs
cliftA3_POP :: forall {k} c (xss :: [[k]]) proxy f g h i. All2 c xss => proxy c -> (forall (a :: k). c a => f a -> g a -> h a -> i a) -> POP f xss -> POP g xss -> POP h xss -> POP i xss
cliftA_NP :: forall {k} c (xs :: [k]) proxy f g. All c xs => proxy c -> (forall (a :: k). c a => f a -> g a) -> NP f xs -> NP g xs
cliftA_POP :: forall {k} c (xss :: [[k]]) proxy f g. All2 c xss => proxy c -> (forall (a :: k). c a => f a -> g a) -> POP f xss -> POP g xss
cmap_NP :: forall {k} c (xs :: [k]) proxy f g. All c xs => proxy c -> (forall (a :: k). c a => f a -> g a) -> NP f xs -> NP g xs
cmap_POP :: forall {k} c (xss :: [[k]]) proxy f g. All2 c xss => proxy c -> (forall (a :: k). c a => f a -> g a) -> POP f xss -> POP g xss
coerce_NP :: forall {k1} {k2} (f :: k1 -> Type) (g :: k2 -> Type) (xs :: [k1]) (ys :: [k2]). AllZip (LiftedCoercible f g) xs ys => NP f xs -> NP g ys
coerce_POP :: forall {k1} {k2} (f :: k1 -> Type) (g :: k2 -> Type) (xss :: [[k1]]) (yss :: [[k2]]). AllZip2 (LiftedCoercible f g) xss yss => POP f xss -> POP g yss
collapse_NP :: forall {k} a (xs :: [k]). NP (K a :: k -> Type) xs -> [a]
collapse_POP :: forall {k} (xss :: [[k]]) a. SListI xss => POP (K a :: k -> Type) xss -> [[a]]
cpure_NP :: forall {k} c (xs :: [k]) proxy f. All c xs => proxy c -> (forall (a :: k). c a => f a) -> NP f xs
cpure_POP :: forall {k} c (xss :: [[k]]) proxy f. All2 c xss => proxy c -> (forall (a :: k). c a => f a) -> POP f xss
ctraverse'_NP :: forall {k} c proxy (xs :: [k]) f f' g. (All c xs, Applicative g) => proxy c -> (forall (a :: k). c a => f a -> g (f' a)) -> NP f xs -> g (NP f' xs)
ctraverse'_POP :: forall {k} c (xss :: [[k]]) g proxy f f'. (All2 c xss, Applicative g) => proxy c -> (forall (a :: k). c a => f a -> g (f' a)) -> POP f xss -> g (POP f' xss)
ctraverse_NP :: forall c (xs :: [Type]) g proxy f. (All c xs, Applicative g) => proxy c -> (forall a. c a => f a -> g a) -> NP f xs -> g (NP I xs)
ctraverse_POP :: forall c (xs :: [[Type]]) g proxy f. (All2 c xs, Applicative g) => proxy c -> (forall a. c a => f a -> g a) -> POP f xs -> g (POP I xs)
ctraverse__NP :: forall {k} c proxy (xs :: [k]) f g. (All c xs, Applicative g) => proxy c -> (forall (a :: k). c a => f a -> g ()) -> NP f xs -> g ()
ctraverse__POP :: forall {k} c proxy (xss :: [[k]]) f g. (All2 c xss, Applicative g) => proxy c -> (forall (a :: k). c a => f a -> g ()) -> POP f xss -> g ()
czipWith3_NP :: forall {k} c (xs :: [k]) proxy f g h i. All c xs => proxy c -> (forall (a :: k). c a => f a -> g a -> h a -> i a) -> NP f xs -> NP g xs -> NP h xs -> NP i xs
czipWith3_POP :: forall {k} c (xss :: [[k]]) proxy f g h i. All2 c xss => proxy c -> (forall (a :: k). c a => f a -> g a -> h a -> i a) -> POP f xss -> POP g xss -> POP h xss -> POP i xss
czipWith_NP :: forall {k} c (xs :: [k]) proxy f g h. All c xs => proxy c -> (forall (a :: k). c a => f a -> g a -> h a) -> NP f xs -> NP g xs -> NP h xs
czipWith_POP :: forall {k} c (xss :: [[k]]) proxy f g h. All2 c xss => proxy c -> (forall (a :: k). c a => f a -> g a -> h a) -> POP f xss -> POP g xss -> POP h xss
fromI_NP :: forall {k} (f :: k -> Type) (xs :: [Type]) (ys :: [k]). AllZip (LiftedCoercible I f) xs ys => NP I xs -> NP f ys
fromI_POP :: forall {k} (f :: k -> Type) (xss :: [[Type]]) (yss :: [[k]]). AllZip2 (LiftedCoercible I f) xss yss => POP I xss -> POP f yss
fromList :: forall {k} (xs :: [k]) a. SListI xs => [a] -> Maybe (NP (K a :: k -> Type) xs)
hcliftA' :: forall {k} (c :: k -> Constraint) (xss :: [[k]]) h proxy f f'. (All2 c xss, Prod h ~ (NP :: ([k] -> Type) -> [[k]] -> Type), HAp h) => proxy c -> (forall (xs :: [k]). All c xs => f xs -> f' xs) -> h f xss -> h f' xss
hcliftA2' :: forall {k} (c :: k -> Constraint) (xss :: [[k]]) h proxy f f' f''. (All2 c xss, Prod h ~ (NP :: ([k] -> Type) -> [[k]] -> Type), HAp h) => proxy c -> (forall (xs :: [k]). All c xs => f xs -> f' xs -> f'' xs) -> Prod h f xss -> h f' xss -> h f'' xss
hcliftA3' :: forall {k} (c :: k -> Constraint) (xss :: [[k]]) h proxy f f' f'' f'''. (All2 c xss, Prod h ~ (NP :: ([k] -> Type) -> [[k]] -> Type), HAp h) => proxy c -> (forall (xs :: [k]). All c xs => f xs -> f' xs -> f'' xs -> f''' xs) -> Prod h f xss -> Prod h f' xss -> h f'' xss -> h f''' xss
hd :: forall {k} f (x :: k) (xs :: [k]). NP f (x ': xs) -> f x
liftA2_NP :: forall {k} (xs :: [k]) f g h. SListI xs => (forall (a :: k). () => f a -> g a -> h a) -> NP f xs -> NP g xs -> NP h xs
liftA2_POP :: forall {k} (xss :: [[k]]) f g h. All (SListI :: [k] -> Constraint) xss => (forall (a :: k). () => f a -> g a -> h a) -> POP f xss -> POP g xss -> POP h xss
liftA3_NP :: forall {k} (xs :: [k]) f g h i. SListI xs => (forall (a :: k). () => f a -> g a -> h a -> i a) -> NP f xs -> NP g xs -> NP h xs -> NP i xs
liftA3_POP :: forall {k} (xss :: [[k]]) f g h i. All (SListI :: [k] -> Constraint) xss => (forall (a :: k). () => f a -> g a -> h a -> i a) -> POP f xss -> POP g xss -> POP h xss -> POP i xss
liftA_NP :: forall {k} (xs :: [k]) f g. SListI xs => (forall (a :: k). () => f a -> g a) -> NP f xs -> NP g xs
liftA_POP :: forall {k} (xss :: [[k]]) f g. All (SListI :: [k] -> Constraint) xss => (forall (a :: k). () => f a -> g a) -> POP f xss -> POP g xss
map_NP :: forall {k} (xs :: [k]) f g. SListI xs => (forall (a :: k). () => f a -> g a) -> NP f xs -> NP g xs
map_POP :: forall {k} (xss :: [[k]]) f g. All (SListI :: [k] -> Constraint) xss => (forall (a :: k). () => f a -> g a) -> POP f xss -> POP g xss
projections :: forall {k} (xs :: [k]) (f :: k -> Type). SListI xs => NP (Projection f xs) xs
pure_NP :: forall {k} f (xs :: [k]). SListI xs => (forall (a :: k). () => f a) -> NP f xs
pure_POP :: forall {k} (xss :: [[k]]) f. All (SListI :: [k] -> Constraint) xss => (forall (a :: k). () => f a) -> POP f xss
sequence'_NP :: forall {k} f (g :: k -> Type) (xs :: [k]). Applicative f => NP (f :.: g) xs -> f (NP g xs)
sequence'_POP :: forall {k} (xss :: [[k]]) f (g :: k -> Type). (SListI xss, Applicative f) => POP (f :.: g) xss -> f (POP g xss)
sequence_NP :: forall (xs :: [Type]) f. (SListI xs, Applicative f) => NP f xs -> f (NP I xs)
sequence_POP :: forall (xss :: [[Type]]) f. (All (SListI :: [Type] -> Constraint) xss, Applicative f) => POP f xss -> f (POP I xss)
shiftProjection :: forall {a1} (f :: a1 -> Type) (xs :: [a1]) (a2 :: a1) (x :: a1). Projection f xs a2 -> Projection f (x ': xs) a2
tl :: forall {k} (f :: k -> Type) (x :: k) (xs :: [k]). NP f (x ': xs) -> NP f xs
toI_NP :: forall {k} (f :: k -> Type) (xs :: [k]) (ys :: [Type]). AllZip (LiftedCoercible f I) xs ys => NP f xs -> NP I ys
toI_POP :: forall {k} (f :: k -> Type) (xss :: [[k]]) (yss :: [[Type]]). AllZip2 (LiftedCoercible f I) xss yss => POP f xss -> POP I yss
trans_NP :: forall {k1} {k2} c (xs :: [k1]) (ys :: [k2]) proxy f g. AllZip c xs ys => proxy c -> (forall (x :: k1) (y :: k2). c x y => f x -> g y) -> NP f xs -> NP g ys
trans_POP :: forall {k1} {k2} c (xss :: [[k1]]) (yss :: [[k2]]) proxy f g. AllZip2 c xss yss => proxy c -> (forall (x :: k1) (y :: k2). c x y => f x -> g y) -> POP f xss -> POP g yss
traverse'_NP :: forall {k} (xs :: [k]) f f' g. (SListI xs, Applicative g) => (forall (a :: k). () => f a -> g (f' a)) -> NP f xs -> g (NP f' xs)
traverse'_POP :: forall {k} (xss :: [[k]]) g f f'. (SListI2 xss, Applicative g) => (forall (a :: k). () => f a -> g (f' a)) -> POP f xss -> g (POP f' xss)
traverse__NP :: forall {k} (xs :: [k]) f g. (SListI xs, Applicative g) => (forall (a :: k). () => f a -> g ()) -> NP f xs -> g ()
traverse__POP :: forall {k} (xss :: [[k]]) f g. (SListI2 xss, Applicative g) => (forall (a :: k). () => f a -> g ()) -> POP f xss -> g ()
unPOP :: forall {k} (f :: k -> Type) (xss :: [[k]]). POP f xss -> NP (NP f) xss
zipWith3_NP :: forall {k} (xs :: [k]) f g h i. SListI xs => (forall (a :: k). () => f a -> g a -> h a -> i a) -> NP f xs -> NP g xs -> NP h xs -> NP i xs
zipWith3_POP :: forall {k} (xss :: [[k]]) f g h i. All (SListI :: [k] -> Constraint) xss => (forall (a :: k). () => f a -> g a -> h a -> i a) -> POP f xss -> POP g xss -> POP h xss -> POP i xss
zipWith_NP :: forall {k} (xs :: [k]) f g h. SListI xs => (forall (a :: k). () => f a -> g a -> h a) -> NP f xs -> NP g xs -> NP h xs
zipWith_POP :: forall {k} (xss :: [[k]]) f g h. All (SListI :: [k] -> Constraint) xss => (forall (a :: k). () => f a -> g a -> h a) -> POP f xss -> POP g xss -> POP h xss
data NP (a :: k -> Type) (b :: [k])
[Nil] :: forall {k} (a :: k -> Type). NP a ('[] :: [k])
[:*] :: forall {k} (a :: k -> Type) (x :: k) (xs :: [k]). a x -> NP a xs -> NP a (x ': xs)
newtype POP (f :: k -> Type) (xss :: [[k]])
POP :: NP (NP f) xss -> POP (f :: k -> Type) (xss :: [[k]])
type Projection (f :: k -> Type) (xs :: [k]) = K NP f xs :: k -> Type -.-> f


-- | Metadata about what a datatype looks like
--   
--   In <tt>generics-sop</tt>, the metadata is completely independent of
--   the main universe. Many generic functions will use this metadata, but
--   other don't, and yet others might need completely different metadata.
--   
--   This module defines a datatype to represent standard metadata, i.e.,
--   names of the datatype, its constructors, and possibly its record
--   selectors. Metadata descriptions are in general GADTs indexed by the
--   code of the datatype they're associated with, so matching on the
--   metadata will reveal information about the shape of the datatype.
module Generics.SOP.Metadata

-- | The constructor info for a datatype (or newtype).
constructorInfo :: forall (xss :: [[Type]]). DatatypeInfo xss -> NP ConstructorInfo xss

-- | The name of a constructor.
constructorName :: forall (xs :: [Type]). ConstructorInfo xs -> ConstructorName

-- | The name of a datatype (or newtype).
datatypeName :: forall (xss :: [[Type]]). DatatypeInfo xss -> DatatypeName

-- | The name of a field.
fieldName :: FieldInfo a -> FieldName

-- | The module name where a datatype is defined.
moduleName :: forall (xss :: [[Type]]). DatatypeInfo xss -> ModuleName

-- | Metadata for a single constructor.
--   
--   This is indexed by the product structure of the constructor
--   components.
data ConstructorInfo (a :: [Type])
[Constructor] :: forall (a :: [Type]). SListI a => ConstructorName -> ConstructorInfo a
[Infix] :: forall x y. ConstructorName -> Associativity -> Fixity -> ConstructorInfo '[x, y]
[Record] :: forall (a :: [Type]). SListI a => ConstructorName -> NP FieldInfo a -> ConstructorInfo a

-- | The name of a data constructor.
type ConstructorName = String

-- | Metadata for a datatype.
--   
--   A value of type <tt><a>DatatypeInfo</a> c</tt> contains the
--   information about a datatype that is not contained in
--   <tt><tt>Code</tt> c</tt>. This information consists primarily of the
--   names of the datatype, its constructors, and possibly its record
--   selectors.
--   
--   The constructor indicates whether the datatype has been declared using
--   <tt>newtype</tt> or not.
data DatatypeInfo (a :: [[Type]])
[ADT] :: forall (a :: [[Type]]). ModuleName -> DatatypeName -> NP ConstructorInfo a -> POP StrictnessInfo a -> DatatypeInfo a
[Newtype] :: forall x. ModuleName -> DatatypeName -> ConstructorInfo '[x] -> DatatypeInfo '[ '[x]]

-- | The name of a datatype.
type DatatypeName = String

-- | For records, this functor maps the component to its selector name.
data FieldInfo a
[FieldInfo] :: forall a. FieldName -> FieldInfo a

-- | The name of a field / record selector.
type FieldName = String

-- | The fixity of an infix constructor.
type Fixity = Int

-- | The name of a module.
type ModuleName = String

-- | Metadata for strictness information of a field.
--   
--   Indexed by the type of the field.
data StrictnessInfo a
[StrictnessInfo] :: forall a. SourceUnpackedness -> SourceStrictness -> DecidedStrictness -> StrictnessInfo a
data Associativity
LeftAssociative :: Associativity
RightAssociative :: Associativity
NotAssociative :: Associativity
data DecidedStrictness
DecidedLazy :: DecidedStrictness
DecidedStrict :: DecidedStrictness
DecidedUnpack :: DecidedStrictness
data SourceStrictness
NoSourceStrictness :: SourceStrictness
SourceLazy :: SourceStrictness
SourceStrict :: SourceStrictness
data SourceUnpackedness
NoSourceUnpackedness :: SourceUnpackedness
SourceNoUnpack :: SourceUnpackedness
SourceUnpack :: SourceUnpackedness
instance Data.SOP.Constraint.All (Data.SOP.Constraint.Compose GHC.Classes.Eq Generics.SOP.Metadata.FieldInfo) xs => GHC.Classes.Eq (Generics.SOP.Metadata.ConstructorInfo xs)
instance (Data.SOP.Constraint.All (Data.SOP.Constraint.Compose GHC.Classes.Eq Generics.SOP.Metadata.ConstructorInfo) xs, Data.SOP.Constraint.All (Data.SOP.Constraint.Compose GHC.Classes.Eq (Data.SOP.NP.NP Generics.SOP.Metadata.StrictnessInfo)) xs) => GHC.Classes.Eq (Generics.SOP.Metadata.DatatypeInfo xs)
instance GHC.Classes.Eq (Generics.SOP.Metadata.FieldInfo a)
instance GHC.Classes.Eq (Generics.SOP.Metadata.StrictnessInfo a)
instance GHC.Internal.Base.Functor Generics.SOP.Metadata.FieldInfo
instance GHC.Internal.Base.Functor Generics.SOP.Metadata.StrictnessInfo
instance (Data.SOP.Constraint.All (Data.SOP.Constraint.Compose GHC.Classes.Eq Generics.SOP.Metadata.FieldInfo) xs, Data.SOP.Constraint.All (Data.SOP.Constraint.Compose GHC.Classes.Ord Generics.SOP.Metadata.FieldInfo) xs) => GHC.Classes.Ord (Generics.SOP.Metadata.ConstructorInfo xs)
instance (Data.SOP.Constraint.All (Data.SOP.Constraint.Compose GHC.Classes.Eq Generics.SOP.Metadata.ConstructorInfo) xs, Data.SOP.Constraint.All (Data.SOP.Constraint.Compose GHC.Classes.Ord Generics.SOP.Metadata.ConstructorInfo) xs, Data.SOP.Constraint.All (Data.SOP.Constraint.Compose GHC.Classes.Eq (Data.SOP.NP.NP Generics.SOP.Metadata.StrictnessInfo)) xs, Data.SOP.Constraint.All (Data.SOP.Constraint.Compose GHC.Classes.Ord (Data.SOP.NP.NP Generics.SOP.Metadata.StrictnessInfo)) xs) => GHC.Classes.Ord (Generics.SOP.Metadata.DatatypeInfo xs)
instance GHC.Classes.Ord (Generics.SOP.Metadata.FieldInfo a)
instance GHC.Classes.Ord (Generics.SOP.Metadata.StrictnessInfo a)
instance Data.SOP.Constraint.All (Data.SOP.Constraint.Compose GHC.Internal.Show.Show Generics.SOP.Metadata.FieldInfo) xs => GHC.Internal.Show.Show (Generics.SOP.Metadata.ConstructorInfo xs)
instance (Data.SOP.Constraint.All (Data.SOP.Constraint.Compose GHC.Internal.Show.Show Generics.SOP.Metadata.ConstructorInfo) xs, Data.SOP.Constraint.All (Data.SOP.Constraint.Compose GHC.Internal.Show.Show (Data.SOP.NP.NP Generics.SOP.Metadata.StrictnessInfo)) xs) => GHC.Internal.Show.Show (Generics.SOP.Metadata.DatatypeInfo xs)
instance GHC.Internal.Show.Show (Generics.SOP.Metadata.FieldInfo a)
instance GHC.Internal.Show.Show (Generics.SOP.Metadata.StrictnessInfo a)

module Generics.SOP.NS
ana_NS :: forall {k} s f (xs :: [k]). SListI xs => (forall r. () => s ('[] :: [k]) -> r) -> (forall (y :: k) (ys :: [k]). () => s (y ': ys) -> Either (f y) (s ys)) -> s xs -> NS f xs
apInjs'_NP :: forall {k} (xs :: [k]) (f :: k -> Type). SListI xs => NP f xs -> NP (K (NS f xs) :: k -> Type) xs
apInjs'_POP :: forall {k} (xss :: [[k]]) (f :: k -> Type). SListI xss => POP f xss -> NP (K (SOP f xss) :: [k] -> Type) xss
apInjs_NP :: forall {k} (xs :: [k]) (f :: k -> Type). SListI xs => NP f xs -> [NS f xs]
apInjs_POP :: forall {k} (xss :: [[k]]) (f :: k -> Type). SListI xss => POP f xss -> [SOP f xss]
ap_NS :: forall {k} (f :: k -> Type) (g :: k -> Type) (xs :: [k]). NP (f -.-> g) xs -> NS f xs -> NS g xs
ap_SOP :: forall {k} (f :: k -> Type) (g :: k -> Type) (xss :: [[k]]). POP (f -.-> g) xss -> SOP f xss -> SOP g xss
cana_NS :: forall {k} c proxy s f (xs :: [k]). All c xs => proxy c -> (forall r. () => s ('[] :: [k]) -> r) -> (forall (y :: k) (ys :: [k]). c y => s (y ': ys) -> Either (f y) (s ys)) -> s xs -> NS f xs
cata_NS :: forall {k} r f (xs :: [k]). (forall (y :: k) (ys :: [k]). () => f y -> r (y ': ys)) -> (forall (y :: k) (ys :: [k]). () => r ys -> r (y ': ys)) -> NS f xs -> r xs
ccata_NS :: forall {k} c proxy r f (xs :: [k]). All c xs => proxy c -> (forall (y :: k) (ys :: [k]). c y => f y -> r (y ': ys)) -> (forall (y :: k) (ys :: [k]). c y => r ys -> r (y ': ys)) -> NS f xs -> r xs
ccompare_NS :: forall {k} c proxy r f g (xs :: [k]). All c xs => proxy c -> r -> (forall (x :: k). c x => f x -> g x -> r) -> r -> NS f xs -> NS g xs -> r
ccompare_SOP :: forall {k} (c :: k -> Constraint) proxy r (f :: k -> Type) (g :: k -> Type) (xss :: [[k]]). All2 c xss => proxy c -> r -> (forall (xs :: [k]). All c xs => NP f xs -> NP g xs -> r) -> r -> SOP f xss -> SOP g xss -> r
cexpand_NS :: forall {k} c proxy f (xs :: [k]). All c xs => proxy c -> (forall (x :: k). c x => f x) -> NS f xs -> NP f xs
cexpand_SOP :: forall {k} c proxy f (xss :: [[k]]). All2 c xss => proxy c -> (forall (x :: k). c x => f x) -> SOP f xss -> POP f xss
cfoldMap_NS :: forall {k} c proxy f (xs :: [k]) m. All c xs => proxy c -> (forall (a :: k). c a => f a -> m) -> NS f xs -> m
cfoldMap_SOP :: forall {k} c (xs :: [[k]]) m proxy f. (All2 c xs, Monoid m) => proxy c -> (forall (a :: k). c a => f a -> m) -> SOP f xs -> m
cliftA2'_NS :: forall {k} (c :: k -> Constraint) (xss :: [[k]]) proxy f g h. All2 c xss => proxy c -> (forall (xs :: [k]). All c xs => f xs -> g xs -> h xs) -> NP f xss -> NS g xss -> NS h xss
cliftA2_NS :: forall {k} c (xs :: [k]) proxy f g h. All c xs => proxy c -> (forall (a :: k). c a => f a -> g a -> h a) -> NP f xs -> NS g xs -> NS h xs
cliftA2_SOP :: forall {k} c (xss :: [[k]]) proxy f g h. All2 c xss => proxy c -> (forall (a :: k). c a => f a -> g a -> h a) -> POP f xss -> SOP g xss -> SOP h xss
cliftA_NS :: forall {k} c (xs :: [k]) proxy f g. All c xs => proxy c -> (forall (a :: k). c a => f a -> g a) -> NS f xs -> NS g xs
cliftA_SOP :: forall {k} c (xss :: [[k]]) proxy f g. All2 c xss => proxy c -> (forall (a :: k). c a => f a -> g a) -> SOP f xss -> SOP g xss
cmap_NS :: forall {k} c (xs :: [k]) proxy f g. All c xs => proxy c -> (forall (a :: k). c a => f a -> g a) -> NS f xs -> NS g xs
cmap_SOP :: forall {k} c (xss :: [[k]]) proxy f g. All2 c xss => proxy c -> (forall (a :: k). c a => f a -> g a) -> SOP f xss -> SOP g xss
coerce_NS :: forall {k1} {k2} (f :: k1 -> Type) (g :: k2 -> Type) (xs :: [k1]) (ys :: [k2]). AllZip (LiftedCoercible f g) xs ys => NS f xs -> NS g ys
coerce_SOP :: forall {k1} {k2} (f :: k1 -> Type) (g :: k2 -> Type) (xss :: [[k1]]) (yss :: [[k2]]). AllZip2 (LiftedCoercible f g) xss yss => SOP f xss -> SOP g yss
collapse_NS :: forall {k} a (xs :: [k]). NS (K a :: k -> Type) xs -> a
collapse_SOP :: forall {k} (xss :: [[k]]) a. SListI xss => SOP (K a :: k -> Type) xss -> [a]
compare_NS :: forall {k} r f g (xs :: [k]). r -> (forall (x :: k). () => f x -> g x -> r) -> r -> NS f xs -> NS g xs -> r
compare_SOP :: forall {k} r (f :: k -> Type) (g :: k -> Type) (xss :: [[k]]). r -> (forall (xs :: [k]). () => NP f xs -> NP g xs -> r) -> r -> SOP f xss -> SOP g xss -> r
ctraverse'_NS :: forall {k} c proxy (xs :: [k]) f f' g. (All c xs, Functor g) => proxy c -> (forall (a :: k). c a => f a -> g (f' a)) -> NS f xs -> g (NS f' xs)
ctraverse'_SOP :: forall {k} c (xss :: [[k]]) g proxy f f'. (All2 c xss, Applicative g) => proxy c -> (forall (a :: k). c a => f a -> g (f' a)) -> SOP f xss -> g (SOP f' xss)
ctraverse_NS :: forall c (xs :: [Type]) g proxy f. (All c xs, Applicative g) => proxy c -> (forall a. c a => f a -> g a) -> NP f xs -> g (NP I xs)
ctraverse_SOP :: forall c (xs :: [[Type]]) g proxy f. (All2 c xs, Applicative g) => proxy c -> (forall a. c a => f a -> g a) -> POP f xs -> g (POP I xs)
ctraverse__NS :: forall {k} c proxy (xs :: [k]) f g. All c xs => proxy c -> (forall (a :: k). c a => f a -> g ()) -> NS f xs -> g ()
ctraverse__SOP :: forall {k} c proxy (xss :: [[k]]) f g. (All2 c xss, Applicative g) => proxy c -> (forall (a :: k). c a => f a -> g ()) -> SOP f xss -> g ()
ejections :: forall {k} (xs :: [k]) (f :: k -> Type). SListI xs => NP (Ejection f xs) xs
expand_NS :: forall {k} f (xs :: [k]). SListI xs => (forall (x :: k). () => f x) -> NS f xs -> NP f xs
expand_SOP :: forall {k} f (xss :: [[k]]). All (SListI :: [k] -> Constraint) xss => (forall (x :: k). () => f x) -> SOP f xss -> POP f xss
fromI_NS :: forall {k} (f :: k -> Type) (xs :: [Type]) (ys :: [k]). AllZip (LiftedCoercible I f) xs ys => NS I xs -> NS f ys
fromI_SOP :: forall {k} (f :: k -> Type) (xss :: [[Type]]) (yss :: [[k]]). AllZip2 (LiftedCoercible I f) xss yss => SOP I xss -> SOP f yss
index_NS :: forall {k} (f :: k -> Type) (xs :: [k]). NS f xs -> Int
index_SOP :: forall {k} (f :: k -> Type) (xs :: [[k]]). SOP f xs -> Int
injections :: forall {k} (xs :: [k]) (f :: k -> Type). SListI xs => NP (Injection f xs) xs
liftA2_NS :: forall {k} (xs :: [k]) f g h. SListI xs => (forall (a :: k). () => f a -> g a -> h a) -> NP f xs -> NS g xs -> NS h xs
liftA2_SOP :: forall {k} (xss :: [[k]]) f g h. All (SListI :: [k] -> Constraint) xss => (forall (a :: k). () => f a -> g a -> h a) -> POP f xss -> SOP g xss -> SOP h xss
liftA_NS :: forall {k} (xs :: [k]) f g. SListI xs => (forall (a :: k). () => f a -> g a) -> NS f xs -> NS g xs
liftA_SOP :: forall {k} (xss :: [[k]]) f g. All (SListI :: [k] -> Constraint) xss => (forall (a :: k). () => f a -> g a) -> SOP f xss -> SOP g xss
map_NS :: forall {k} (xs :: [k]) f g. SListI xs => (forall (a :: k). () => f a -> g a) -> NS f xs -> NS g xs
map_SOP :: forall {k} (xss :: [[k]]) f g. All (SListI :: [k] -> Constraint) xss => (forall (a :: k). () => f a -> g a) -> SOP f xss -> SOP g xss
sequence'_NS :: forall {k} f (g :: k -> Type) (xs :: [k]). Applicative f => NS (f :.: g) xs -> f (NS g xs)
sequence'_SOP :: forall {k} (xss :: [[k]]) f (g :: k -> Type). (SListI xss, Applicative f) => SOP (f :.: g) xss -> f (SOP g xss)
sequence_NS :: forall (xs :: [Type]) f. (SListI xs, Applicative f) => NS f xs -> f (NS I xs)
sequence_SOP :: forall (xss :: [[Type]]) f. (All (SListI :: [Type] -> Constraint) xss, Applicative f) => SOP f xss -> f (SOP I xss)
shift :: forall {a1} (f :: a1 -> Type) (xs :: [a1]) (a2 :: a1) (x :: a1). Injection f xs a2 -> Injection f (x ': xs) a2
shiftEjection :: forall {a1} (f :: a1 -> Type) (x :: a1) (xs :: [a1]) (a2 :: a1). Ejection f xs a2 -> Ejection f (x ': xs) a2
shiftInjection :: forall {a1} (f :: a1 -> Type) (xs :: [a1]) (a2 :: a1) (x :: a1). Injection f xs a2 -> Injection f (x ': xs) a2
toI_NS :: forall {k} (f :: k -> Type) (xs :: [k]) (ys :: [Type]). AllZip (LiftedCoercible f I) xs ys => NS f xs -> NS I ys
toI_SOP :: forall {k} (f :: k -> Type) (xss :: [[k]]) (yss :: [[Type]]). AllZip2 (LiftedCoercible f I) xss yss => SOP f xss -> SOP I yss
trans_NS :: forall {k1} {k2} c (xs :: [k1]) (ys :: [k2]) proxy f g. AllZip c xs ys => proxy c -> (forall (x :: k1) (y :: k2). c x y => f x -> g y) -> NS f xs -> NS g ys
trans_SOP :: forall {k1} {k2} c (xss :: [[k1]]) (yss :: [[k2]]) proxy f g. AllZip2 c xss yss => proxy c -> (forall (x :: k1) (y :: k2). c x y => f x -> g y) -> SOP f xss -> SOP g yss
traverse'_NS :: forall {k} (xs :: [k]) f f' g. (SListI xs, Functor g) => (forall (a :: k). () => f a -> g (f' a)) -> NS f xs -> g (NS f' xs)
traverse'_SOP :: forall {k} (xss :: [[k]]) g f f'. (SListI2 xss, Applicative g) => (forall (a :: k). () => f a -> g (f' a)) -> SOP f xss -> g (SOP f' xss)
traverse__NS :: forall {k} (xs :: [k]) f g. SListI xs => (forall (a :: k). () => f a -> g ()) -> NS f xs -> g ()
traverse__SOP :: forall {k} (xss :: [[k]]) f g. (SListI2 xss, Applicative g) => (forall (a :: k). () => f a -> g ()) -> SOP f xss -> g ()
unSOP :: forall {k} (f :: k -> Type) (xss :: [[k]]). SOP f xss -> NS (NP f) xss
unZ :: forall {k} f (x :: k). NS f '[x] -> f x
type Ejection (f :: k -> Type) (xs :: [k]) = K NS f xs :: k -> Type -.-> Maybe :.: f
type Injection (f :: k -> Type) (xs :: [k]) = f -.-> K NS f xs :: k -> Type
data NS (a :: k -> Type) (b :: [k])
[Z] :: forall {k} (a :: k -> Type) (x :: k) (xs :: [k]). a x -> NS a (x ': xs)
[S] :: forall {k} (a :: k -> Type) (xs :: [k]) (x :: k). NS a xs -> NS a (x ': xs)
newtype SOP (f :: k -> Type) (xss :: [[k]])
SOP :: NS (NP f) xss -> SOP (f :: k -> Type) (xss :: [[k]])

module Generics.SOP.Sing
case_SList :: forall {a} (xs :: [a]) r. SListI xs => r ('[] :: [a]) -> (forall (y :: a) (ys :: [a]). SListI ys => r (y ': ys)) -> r xs
lengthSList :: forall k (xs :: [k]) proxy. SListI xs => proxy xs -> Int
para_SList :: forall {a} (xs :: [a]) r. SListI xs => r ('[] :: [a]) -> (forall (y :: a) (ys :: [a]). SListI ys => r ys -> r (y ': ys)) -> r xs
sList :: forall {k} (xs :: [k]). SListI xs => SList xs
shape :: forall k (xs :: [k]). SListI xs => Shape xs
type SListI = All Top :: k -> Constraint
data SList (a :: [k])
[SNil] :: forall {k}. SList ('[] :: [k])
[SCons] :: forall {k} (xs :: [k]) (x :: k). SListI xs => SList (x ': xs)
data Shape (a :: [k])
[ShapeNil] :: forall {k}. Shape ('[] :: [k])
[ShapeCons] :: forall {k} (xs :: [k]) (x :: k). SListI xs => Shape xs -> Shape (x ': xs)


-- | Type-level metadata
--   
--   This module provides datatypes (to be used promoted) that can
--   represent the metadata of Haskell datatypes on the type level.
--   
--   We do not reuse the term-level metadata types, because these are GADTs
--   that incorporate additional invariants. We could (at least in GHC 8)
--   impose the same invariants on the type level as well, but some tests
--   have revealed that the resulting type are rather inconvenient to work
--   with.
--   
--   So we use simple datatypes to represent the type-level metadata, even
--   if this means that some invariants are not explicitly captured.
--   
--   We establish a relation between the term- and type-level versions of
--   the metadata by automatically computing the term-level version from
--   the type-level version.
--   
--   As we now have two versions of metadata (term-level and type-level)
--   with very similar, yet slightly different datatype definitions, the
--   names between the modules clash, and this module is recommended to be
--   imported qualified when needed.
--   
--   The interface exported by this module is still somewhat experimental.
module Generics.SOP.Type.Metadata

-- | Metadata for a single constructors (to be used promoted).
data ConstructorInfo

-- | Normal constructor
Constructor :: ConstructorName -> ConstructorInfo

-- | Infix constructor
Infix :: ConstructorName -> Associativity -> Fixity -> ConstructorInfo

-- | Record constructor
Record :: ConstructorName -> [FieldInfo] -> ConstructorInfo

-- | The name of a data constructor.
type ConstructorName = Symbol

-- | Metadata for a datatype (to be used promoted).
--   
--   A type of kind <tt><a>DatatypeInfo</a></tt> contains meta-information
--   about a datatype that is not contained in its code. This information
--   consists primarily of the names of the datatype, its constructors, and
--   possibly its record selectors.
--   
--   The constructor indicates whether the datatype has been declared using
--   <tt>newtype</tt> or not.
data DatatypeInfo

-- | Standard algebraic datatype
ADT :: ModuleName -> DatatypeName -> [ConstructorInfo] -> [[StrictnessInfo]] -> DatatypeInfo

-- | Newtype
Newtype :: ModuleName -> DatatypeName -> ConstructorInfo -> DatatypeInfo

-- | The name of a datatype.
type DatatypeName = Symbol

-- | Class for computing term-level associativity information from
--   type-level associativity information.
class DemoteAssociativity (a :: Associativity)

-- | Given a proxy of some type-level associativity information, return the
--   corresponding term-level information.
demoteAssociativity :: DemoteAssociativity a => proxy a -> Associativity

-- | Class for computing term-level constructor information from type-level
--   constructor information.
class DemoteConstructorInfo (x :: ConstructorInfo) (xs :: [Type])

-- | Given a proxy of some type-level constructor information, return the
--   corresponding term-level information.
demoteConstructorInfo :: DemoteConstructorInfo x xs => proxy x -> ConstructorInfo xs

-- | Class for computing term-level constructor information from type-level
--   constructor information.
class DemoteConstructorInfos (cs :: [ConstructorInfo]) (xss :: [[Type]])

-- | Given a proxy of some type-level constructor information, return the
--   corresponding term-level information as a product.
demoteConstructorInfos :: DemoteConstructorInfos cs xss => proxy cs -> NP ConstructorInfo xss

-- | Class for computing term-level datatype information from type-level
--   datatype information.
class DemoteDatatypeInfo (x :: DatatypeInfo) (xss :: [[Type]])

-- | Given a proxy of some type-level datatype information, return the
--   corresponding term-level information.
demoteDatatypeInfo :: DemoteDatatypeInfo x xss => proxy x -> DatatypeInfo xss

-- | Class for computing term-level decided strictness information from
--   type-level decided strictness information.
class DemoteDecidedStrictness (a :: DecidedStrictness)

-- | Given a proxy of some type-level source strictness information, return
--   the corresponding term-level information.
demoteDecidedStrictness :: DemoteDecidedStrictness a => proxy a -> DecidedStrictness

-- | Class for computing term-level field information from type-level field
--   information.
class DemoteFieldInfo (x :: FieldInfo) a

-- | Given a proxy of some type-level field information, return the
--   corresponding term-level information.
demoteFieldInfo :: DemoteFieldInfo x a => proxy x -> FieldInfo a

-- | Class for computing term-level field information from type-level field
--   information.
class SListI xs => DemoteFieldInfos (fs :: [FieldInfo]) (xs :: [Type])

-- | Given a proxy of some type-level field information, return the
--   corresponding term-level information as a product.
demoteFieldInfos :: DemoteFieldInfos fs xs => proxy fs -> NP FieldInfo xs

-- | Class for computing term-level source strictness information from
--   type-level source strictness information.
class DemoteSourceStrictness (a :: SourceStrictness)

-- | Given a proxy of some type-level source strictness information, return
--   the corresponding term-level information.
demoteSourceStrictness :: DemoteSourceStrictness a => proxy a -> SourceStrictness

-- | Class for computing term-level source unpackedness information from
--   type-level source unpackedness information.
class DemoteSourceUnpackedness (a :: SourceUnpackedness)

-- | Given a proxy of some type-level source unpackedness information,
--   return the corresponding term-level information.
demoteSourceUnpackedness :: DemoteSourceUnpackedness a => proxy a -> SourceUnpackedness
class DemoteStrictnessInfo (s :: StrictnessInfo) x
demoteStrictnessInfo :: DemoteStrictnessInfo s x => proxy s -> StrictnessInfo x
class DemoteStrictnessInfos (ss :: [StrictnessInfo]) (xs :: [Type])
demoteStrictnessInfos :: DemoteStrictnessInfos ss xs => proxy ss -> NP StrictnessInfo xs
class DemoteStrictnessInfoss (sss :: [[StrictnessInfo]]) (xss :: [[Type]])
demoteStrictnessInfoss :: DemoteStrictnessInfoss sss xss => proxy sss -> NP (NP StrictnessInfo) xss

-- | Metadata for a single record field (to be used promoted).
data FieldInfo
FieldInfo :: FieldName -> FieldInfo

-- | The name of a field / record selector.
type FieldName = Symbol

-- | The fixity of an infix constructor.
type Fixity = Nat

-- | The name of a module.
type ModuleName = Symbol

-- | Strictness information for a single field (to be used promoted).
data StrictnessInfo
StrictnessInfo :: SourceUnpackedness -> SourceStrictness -> DecidedStrictness -> StrictnessInfo
data Associativity
LeftAssociative :: Associativity
RightAssociative :: Associativity
NotAssociative :: Associativity
instance Generics.SOP.Type.Metadata.DemoteAssociativity 'GHC.Internal.Generics.LeftAssociative
instance Generics.SOP.Type.Metadata.DemoteAssociativity 'GHC.Internal.Generics.NotAssociative
instance Generics.SOP.Type.Metadata.DemoteAssociativity 'GHC.Internal.Generics.RightAssociative
instance (GHC.Internal.TypeLits.KnownSymbol s, Data.SOP.Constraint.SListI xs) => Generics.SOP.Type.Metadata.DemoteConstructorInfo ('Generics.SOP.Type.Metadata.Constructor s) xs
instance (GHC.Internal.TypeLits.KnownSymbol s, Generics.SOP.Type.Metadata.DemoteAssociativity a, GHC.Internal.TypeNats.KnownNat f) => Generics.SOP.Type.Metadata.DemoteConstructorInfo ('Generics.SOP.Type.Metadata.Infix s a f) '[y, z]
instance (GHC.Internal.TypeLits.KnownSymbol s, Generics.SOP.Type.Metadata.DemoteFieldInfos fs xs) => Generics.SOP.Type.Metadata.DemoteConstructorInfo ('Generics.SOP.Type.Metadata.Record s fs) xs
instance (Generics.SOP.Type.Metadata.DemoteConstructorInfo c xs, Generics.SOP.Type.Metadata.DemoteConstructorInfos cs xss) => Generics.SOP.Type.Metadata.DemoteConstructorInfos (c : cs) (xs : xss)
instance Generics.SOP.Type.Metadata.DemoteConstructorInfos '[] '[]
instance (GHC.Internal.TypeLits.KnownSymbol m, GHC.Internal.TypeLits.KnownSymbol d, Generics.SOP.Type.Metadata.DemoteConstructorInfos cs xss, Generics.SOP.Type.Metadata.DemoteStrictnessInfoss sss xss) => Generics.SOP.Type.Metadata.DemoteDatatypeInfo ('Generics.SOP.Type.Metadata.ADT m d cs sss) xss
instance (GHC.Internal.TypeLits.KnownSymbol m, GHC.Internal.TypeLits.KnownSymbol d, Generics.SOP.Type.Metadata.DemoteConstructorInfo c '[x]) => Generics.SOP.Type.Metadata.DemoteDatatypeInfo ('Generics.SOP.Type.Metadata.Newtype m d c) '[ '[x]]
instance Generics.SOP.Type.Metadata.DemoteDecidedStrictness 'GHC.Internal.Generics.DecidedLazy
instance Generics.SOP.Type.Metadata.DemoteDecidedStrictness 'GHC.Internal.Generics.DecidedStrict
instance Generics.SOP.Type.Metadata.DemoteDecidedStrictness 'GHC.Internal.Generics.DecidedUnpack
instance GHC.Internal.TypeLits.KnownSymbol s => Generics.SOP.Type.Metadata.DemoteFieldInfo ('Generics.SOP.Type.Metadata.FieldInfo s) a
instance (Generics.SOP.Type.Metadata.DemoteFieldInfo f x, Generics.SOP.Type.Metadata.DemoteFieldInfos fs xs) => Generics.SOP.Type.Metadata.DemoteFieldInfos (f : fs) (x : xs)
instance Generics.SOP.Type.Metadata.DemoteFieldInfos '[] '[]
instance Generics.SOP.Type.Metadata.DemoteSourceStrictness 'GHC.Internal.Generics.NoSourceStrictness
instance Generics.SOP.Type.Metadata.DemoteSourceStrictness 'GHC.Internal.Generics.SourceLazy
instance Generics.SOP.Type.Metadata.DemoteSourceStrictness 'GHC.Internal.Generics.SourceStrict
instance Generics.SOP.Type.Metadata.DemoteSourceUnpackedness 'GHC.Internal.Generics.NoSourceUnpackedness
instance Generics.SOP.Type.Metadata.DemoteSourceUnpackedness 'GHC.Internal.Generics.SourceNoUnpack
instance Generics.SOP.Type.Metadata.DemoteSourceUnpackedness 'GHC.Internal.Generics.SourceUnpack
instance (Generics.SOP.Type.Metadata.DemoteSourceUnpackedness su, Generics.SOP.Type.Metadata.DemoteSourceStrictness ss, Generics.SOP.Type.Metadata.DemoteDecidedStrictness ds) => Generics.SOP.Type.Metadata.DemoteStrictnessInfo ('Generics.SOP.Type.Metadata.StrictnessInfo su ss ds) x
instance (Generics.SOP.Type.Metadata.DemoteStrictnessInfo s x, Generics.SOP.Type.Metadata.DemoteStrictnessInfos ss xs) => Generics.SOP.Type.Metadata.DemoteStrictnessInfos (s : ss) (x : xs)
instance Generics.SOP.Type.Metadata.DemoteStrictnessInfos '[] '[]
instance (Generics.SOP.Type.Metadata.DemoteStrictnessInfos ss xs, Generics.SOP.Type.Metadata.DemoteStrictnessInfoss sss xss) => Generics.SOP.Type.Metadata.DemoteStrictnessInfoss (ss : sss) (xs : xss)
instance Generics.SOP.Type.Metadata.DemoteStrictnessInfoss '[] '[]


-- | Derive <tt>generics-sop</tt> boilerplate instances from GHC's
--   <a>Generic</a>.
--   
--   The technique being used here is described in the following paper:
--   
--   <ul>
--   <li>José Pedro Magalhães and Andres Löh. <a>Generic Generic
--   Programming</a>. Practical Aspects of Declarative Languages (PADL)
--   2014.</li>
--   </ul>
module Generics.SOP.GGP

-- | Compute the SOP code of a datatype.
--   
--   This requires that <a>Rep</a> is defined, which in turn requires that
--   the type has a <a>Generic</a> (from module <a>GHC.Generics</a>)
--   instance.
--   
--   This is the default definition for <a>Code</a>. For more info, see
--   <a>Generic</a>.
type GCode a = ToSumCode Rep a '[] :: [[Type]]

-- | Constraint for the class that computes <a>gfrom</a>.
type GFrom a = GSumFrom Rep a

-- | Constraint for the class that computes <a>gto</a>.
type GTo a = GSumTo Rep a

-- | Constraint for the class that computes <a>gdatatypeInfo</a>.
type GDatatypeInfo a = DemoteDatatypeInfo GDatatypeInfoOf a GCode a

-- | Compute the datatype info of a datatype.
type GDatatypeInfoOf a = ToInfo Rep a

-- | An automatically computed version of <a>from</a>.
--   
--   This requires that the type being converted has a <a>Generic</a> (from
--   module <a>GHC.Generics</a>) instance.
--   
--   This is the default definition for <a>from</a>. For more info, see
--   <a>Generic</a>.
gfrom :: (GFrom a, Generic a) => a -> SOP I (GCode a)

-- | An automatically computed version of <a>to</a>.
--   
--   This requires that the type being converted has a <a>Generic</a> (from
--   module <a>GHC.Generics</a>) instance.
--   
--   This is the default definition for <a>to</a>. For more info, see
--   <a>Generic</a>.
gto :: (GTo a, Generic a) => SOP I (GCode a) -> a

-- | An automatically computed version of <a>datatypeInfo</a>.
--   
--   This requires that the type being converted has a <a>Generic</a> (from
--   module <a>GHC.Generics</a>) instance.
--   
--   This is the default definition for <a>datatypeInfo</a>. For more info,
--   see <a>HasDatatypeInfo</a>.
gdatatypeInfo :: forall proxy a. GDatatypeInfo a => proxy a -> DatatypeInfo (GCode a)
instance (Generics.SOP.GGP.GFieldInfos a, Generics.SOP.GGP.GFieldInfos b) => Generics.SOP.GGP.GFieldInfos (a GHC.Internal.Generics.:*: b)
instance GHC.Internal.Generics.Selector c => Generics.SOP.GGP.GFieldInfos (GHC.Internal.Generics.M1 GHC.Internal.Generics.S c a)
instance Generics.SOP.GGP.GFieldInfos GHC.Internal.Generics.U1
instance (Generics.SOP.GGP.GProductFrom a, Generics.SOP.GGP.GProductFrom b) => Generics.SOP.GGP.GProductFrom (a GHC.Internal.Generics.:*: b)
instance Generics.SOP.GGP.GSingleFrom a => Generics.SOP.GGP.GProductFrom (GHC.Internal.Generics.M1 GHC.Internal.Generics.S c a)
instance Generics.SOP.GGP.GProductFrom GHC.Internal.Generics.U1
instance (Generics.SOP.GGP.GProductTo a, Generics.SOP.GGP.GProductTo b) => Generics.SOP.GGP.GProductTo (a GHC.Internal.Generics.:*: b)
instance Generics.SOP.GGP.GSingleTo a => Generics.SOP.GGP.GProductTo (GHC.Internal.Generics.M1 GHC.Internal.Generics.S c a)
instance Generics.SOP.GGP.GProductTo GHC.Internal.Generics.U1
instance Generics.SOP.GGP.GSingleFrom (GHC.Internal.Generics.K1 i a)
instance Generics.SOP.GGP.GSingleTo (GHC.Internal.Generics.K1 i a)
instance (Generics.SOP.GGP.GSumFrom a, Generics.SOP.GGP.GSumFrom b) => Generics.SOP.GGP.GSumFrom (a GHC.Internal.Generics.:+: b)
instance Generics.SOP.GGP.GSumFrom a => Generics.SOP.GGP.GSumFrom (GHC.Internal.Generics.M1 GHC.Internal.Generics.D c a)
instance Generics.SOP.GGP.GProductFrom a => Generics.SOP.GGP.GSumFrom (GHC.Internal.Generics.M1 GHC.Internal.Generics.C c a)
instance Generics.SOP.GGP.GSumFrom GHC.Internal.Generics.V1
instance (Generics.SOP.GGP.GSumTo a, Generics.SOP.GGP.GSumTo b) => Generics.SOP.GGP.GSumTo (a GHC.Internal.Generics.:+: b)
instance Generics.SOP.GGP.GProductTo a => Generics.SOP.GGP.GSumTo (GHC.Internal.Generics.M1 GHC.Internal.Generics.C c a)
instance Generics.SOP.GGP.GSumTo a => Generics.SOP.GGP.GSumTo (GHC.Internal.Generics.M1 GHC.Internal.Generics.D c a)
instance Generics.SOP.GGP.GSumTo GHC.Internal.Generics.V1


-- | Codes and interpretations
module Generics.SOP.Universe

-- | The (generic) representation of a datatype.
--   
--   A datatype is isomorphic to the sum-of-products of its code. The
--   isomorphism is witnessed by <a>from</a> and <a>to</a> from the
--   <a>Generic</a> class.
type Rep a = SOP I Code a

-- | The class of representable datatypes.
--   
--   The SOP approach to generic programming is based on viewing datatypes
--   as a representation (<a>Rep</a>) built from the sum of products of its
--   components. The components of a datatype are specified using the
--   <a>Code</a> type family.
--   
--   The isomorphism between the original Haskell datatype and its
--   representation is witnessed by the methods of this class, <a>from</a>
--   and <a>to</a>. So for instances of this class, the following laws
--   should (in general) hold:
--   
--   <pre>
--   <a>to</a> <a>.</a> <a>from</a> === <a>id</a> :: a -&gt; a
--   <a>from</a> <a>.</a> <a>to</a> === <a>id</a> :: <a>Rep</a> a -&gt; <a>Rep</a> a
--   </pre>
--   
--   You typically don't define instances of this class by hand, but rather
--   derive the class instance automatically.
--   
--   <i>Option 1:</i> Derive via the built-in GHC-generics. For this, you
--   need to use the <tt>DeriveGeneric</tt> extension to first derive an
--   instance of the <a>Generic</a> class from module <a>GHC.Generics</a>.
--   With this, you can then give an empty instance for <a>Generic</a>, and
--   the default definitions will just work. The pattern looks as follows:
--   
--   <pre>
--   import qualified <a>GHC.Generics</a> as GHC
--   import <a>Generics.SOP</a>
--   
--   ...
--   
--   data T = ... deriving (GHC.<a>Generic</a>, ...)
--   
--   instance <a>Generic</a> T -- empty
--   instance <a>HasDatatypeInfo</a> T -- empty, if you want/need metadata
--   </pre>
--   
--   <i>Option 2:</i> Derive via Template Haskell. For this, you need to
--   enable the <tt>TemplateHaskell</tt> extension. You can then use
--   <a>deriveGeneric</a> from module <a>Generics.SOP.TH</a> to have the
--   instance generated for you. The pattern looks as follows:
--   
--   <pre>
--   import <a>Generics.SOP</a>
--   import <a>Generics.SOP.TH</a>
--   
--   ...
--   
--   data T = ...
--   
--   <a>deriveGeneric</a> ''T -- derives <a>HasDatatypeInfo</a> as well
--   </pre>
--   
--   <i>Tradeoffs:</i> Whether to use Option 1 or 2 is mainly a matter of
--   personal taste. The version based on Template Haskell probably has
--   less run-time overhead.
--   
--   <i>Non-standard instances:</i> It is possible to give <a>Generic</a>
--   instances manually that deviate from the standard scheme, as long as
--   at least
--   
--   <pre>
--   <a>to</a> <a>.</a> <a>from</a> === <a>id</a> :: a -&gt; a
--   </pre>
--   
--   still holds.
class All SListI :: [Type] -> Constraint Code a => Generic a where {
    
    -- | The code of a datatype.
    --   
    --   This is a list of lists of its components. The outer list contains one
    --   element per constructor. The inner list contains one element per
    --   constructor argument (field).
    --   
    --   <i>Example:</i> The datatype
    --   
    --   <pre>
    --   data Tree = Leaf Int | Node Tree Tree
    --   </pre>
    --   
    --   is supposed to have the following code:
    --   
    --   <pre>
    --   type instance Code (Tree a) =
    --     '[ '[ Int ]
    --      , '[ Tree, Tree ]
    --      ]
    --   </pre>
    type Code a :: [[Type]];
    type Code a = GCode a;
}

-- | Converts from a value to its structural representation.
from :: Generic a => a -> Rep a
($dmfrom) :: (Generic a, GFrom a, Generic a, Rep a ~ SOP I (GCode a)) => a -> Rep a

-- | Converts from a structural representation back to the original value.
to :: Generic a => Rep a -> a
($dmto) :: (Generic a, GTo a, Generic a, Rep a ~ SOP I (GCode a)) => Rep a -> a

-- | A class of datatypes that have associated metadata.
--   
--   It is possible to use the sum-of-products approach to generic
--   programming without metadata. If you need metadata in a function, an
--   additional constraint on this class is in order.
--   
--   You typically don't define instances of this class by hand, but rather
--   derive the class instance automatically. See the documentation of
--   <a>Generic</a> for the options.
class Generic a => HasDatatypeInfo a where {
    
    -- | Type-level datatype info
    type DatatypeInfoOf a :: DatatypeInfo;
    type DatatypeInfoOf a = GDatatypeInfoOf a;
}

-- | Term-level datatype info; by default, the term-level datatype info is
--   produced from the type-level info.
datatypeInfo :: HasDatatypeInfo a => proxy a -> DatatypeInfo (Code a)
($dmdatatypeInfo) :: (HasDatatypeInfo a, GDatatypeInfo a, GCode a ~ Code a) => proxy a -> DatatypeInfo (Code a)

-- | Constraint that captures that a datatype is a product type, i.e., a
--   type with a single constructor.
--   
--   It also gives access to the code for the arguments of that
--   constructor.
type IsProductType a (xs :: [Type]) = (Generic a, Code a ~ '[xs])

-- | Direct access to the part of the code that is relevant for a product
--   type.
type ProductCode a = Head Code a

-- | Convert from a product type to its product representation.
productTypeFrom :: forall a (xs :: [Type]). IsProductType a xs => a -> NP I xs

-- | Convert a product representation to the original type.
productTypeTo :: forall a (xs :: [Type]). IsProductType a xs => NP I xs -> a

-- | Constraint that captures that a datatype is an enumeration type, i.e.,
--   none of the constructors have any arguments.
type IsEnumType a = (Generic a, All [Type] ~ '[] :: [Type] Code a)

-- | Convert from an enum type to its sum representation.
enumTypeFrom :: IsEnumType a => a -> NS (K () :: [Type] -> Type) (Code a)

-- | Convert a sum representation to ihe original type.
enumTypeTo :: IsEnumType a => NS (K () :: [Type] -> Type) (Code a) -> a

-- | Constraint that captures that a datatype is a single-constructor,
--   single-field datatype. This always holds for newtype-defined types,
--   but it can also be true for data-defined types.
--   
--   The constraint also gives access to the type that is wrapped.
type IsWrappedType a x = (Generic a, Code a ~ '[ '[x]])

-- | Direct access to the part of the code that is relevant for wrapped
--   types and newtypes.
type WrappedCode a = Head Head Code a

-- | Convert from a wrapped type to its inner type.
wrappedTypeFrom :: IsWrappedType a x => a -> x

-- | Convert a type to a wrapped type.
wrappedTypeTo :: IsWrappedType a x => x -> a

-- | Constraint that captures that a datatype is a newtype. This makes use
--   of the fact that newtypes are always coercible to the type they wrap,
--   whereas datatypes are not.
type IsNewtype a x = (IsWrappedType a x, Coercible a x)

-- | Convert a newtype to its inner type.
--   
--   This is a specialised synonym for <a>coerce</a>.
newtypeFrom :: IsNewtype a x => a -> x

-- | Convert a type to a newtype.
--   
--   This is a specialised synonym for <a>coerce</a>.
newtypeTo :: IsNewtype a x => x -> a


-- | Generate <tt>generics-sop</tt> boilerplate instances using Template
--   Haskell.
module Generics.SOP.TH

-- | Generate <tt>generics-sop</tt> boilerplate for the given datatype.
--   
--   This function takes the name of a datatype and generates:
--   
--   <ul>
--   <li>a <a>Code</a> instance</li>
--   <li>a <a>Generic</a> instance</li>
--   <li>a <a>HasDatatypeInfo</a> instance</li>
--   </ul>
--   
--   Note that the generated code will require the <tt>TypeFamilies</tt>
--   and <tt>DataKinds</tt> extensions to be enabled for the module.
--   
--   <i>Example:</i> If you have the datatype
--   
--   <pre>
--   data Tree = Leaf Int | Node Tree Tree
--   </pre>
--   
--   and say
--   
--   <pre>
--   deriveGeneric ''Tree
--   </pre>
--   
--   then you get code that is equivalent to:
--   
--   <pre>
--   instance Generic Tree where
--   
--     type Code Tree = '[ '[Int], '[Tree, Tree] ]
--   
--     from (Leaf x)   = SOP (   Z (I x :* Nil))
--     from (Node l r) = SOP (S (Z (I l :* I r :* Nil)))
--   
--     to (SOP    (Z (I x :* Nil)))         = Leaf x
--     to (SOP (S (Z (I l :* I r :* Nil)))) = Node l r
--     to (SOP (S (S x)))                   = x `seq` error "inaccessible"
--   
--   instance HasDatatypeInfo Tree where
--     type DatatypeInfoOf Tree =
--       T.ADT "Main" "Tree"
--         '[ T.Constructor "Leaf", T.Constructor "Node" ]
--   
--     datatypeInfo _ =
--       T.demoteDatatypeInfo (Proxy :: Proxy (DatatypeInfoOf Tree))
--   </pre>
--   
--   <i>Limitations:</i> Generation does not work for GADTs, for datatypes
--   that involve existential quantification, for datatypes with unboxed
--   fields.
deriveGeneric :: Name -> Q [Dec]

-- | Like <a>deriveGeneric</a>, but omit the <a>HasDatatypeInfo</a>
--   instance.
deriveGenericOnly :: Name -> Q [Dec]

-- | Variant of <a>deriveGeneric</a> that allows to restrict the type
--   parameters.
--   
--   Experimental function, exposed primarily for benchmarking.
deriveGenericSubst :: Name -> (Name -> Q Type) -> Q [Dec]

-- | Variant of <a>deriveGenericOnly</a> that allows to restrict the type
--   parameters.
--   
--   Experimental function, exposed primarily for benchmarking.
deriveGenericOnlySubst :: Name -> (Name -> Q Type) -> Q [Dec]

-- | Like <a>deriveGenericOnly</a>, but don't derive class instance, only
--   functions.
--   
--   <i>Example:</i> If you say
--   
--   <pre>
--   deriveGenericFunctions ''Tree "TreeCode" "fromTree" "toTree"
--   </pre>
--   
--   then you get code that is equivalent to:
--   
--   <pre>
--   type TreeCode = '[ '[Int], '[Tree, Tree] ]
--   
--   fromTree :: Tree -&gt; SOP I TreeCode
--   fromTree (Leaf x)   = SOP (   Z (I x :* Nil))
--   fromTree (Node l r) = SOP (S (Z (I l :* I r :* Nil)))
--   
--   toTree :: SOP I TreeCode -&gt; Tree
--   toTree (SOP    (Z (I x :* Nil)))         = Leaf x
--   toTree (SOP (S (Z (I l :* I r :* Nil)))) = Node l r
--   toTree (SOP (S (S x)))                   = x `seq` error "inaccessible"
--   </pre>
deriveGenericFunctions :: Name -> String -> String -> String -> Q [Dec]

-- | Derive <tt>DatatypeInfo</tt> value for the type.
--   
--   <i>Example:</i> If you say
--   
--   <pre>
--   deriveMetadataValue ''Tree "TreeCode" "treeDatatypeInfo"
--   </pre>
--   
--   then you get code that is equivalent to:
--   
--   <pre>
--   treeDatatypeInfo :: DatatypeInfo TreeCode
--   treeDatatypeInfo = ADT "Main" "Tree"
--       (Constructor "Leaf" :* Constructor "Node" :* Nil)
--   </pre>
--   
--   <i>Note:</i> CodeType needs to be derived with
--   <a>deriveGenericFunctions</a>.

-- | <i>Deprecated: Use <a>deriveMetadataType</a> and
--   <tt>demoteDatatypeInfo</tt> instead.</i>
deriveMetadataValue :: Name -> String -> String -> Q [Dec]

-- | Derive <tt>DatatypeInfo</tt> type for the type.
--   
--   <i>Example:</i> If you say
--   
--   <pre>
--   deriveMetadataType ''Tree "TreeDatatypeInfo"
--   </pre>
--   
--   then you get code that is equivalent to:
--   
--   <pre>
--   type TreeDatatypeInfo =
--     T.ADT "Main" "Tree"
--       [ T.Constructor "Leaf", T.Constructor "Node" ]
--   </pre>
deriveMetadataType :: Name -> String -> Q [Dec]


-- | Instances for <tt>Generic</tt> and <tt>HasMetadata</tt>.
--   
--   We define instances for datatypes from <tt>generics-sop</tt> and
--   <tt>base</tt> that are supported.
--   
--   (There are only instances defined in this module, so the documentation
--   is empty.)
module Generics.SOP.Instances
instance Generics.SOP.Universe.Generic ((Data.SOP.Classes.-.->) f g a)
instance Generics.SOP.Universe.Generic ((GHC.Internal.Generics.:*:) f g p)
instance Generics.SOP.Universe.Generic ((GHC.Internal.Generics.:+:) f g p)
instance Generics.SOP.Universe.Generic ((Data.SOP.BasicFunctors.:.:) f g p)
instance Generics.SOP.Universe.Generic ((GHC.Internal.Generics.:.:) f g p)
instance Generics.SOP.Universe.Generic GHC.Internal.Data.Semigroup.Internal.All
instance Generics.SOP.Universe.Generic GHC.Internal.IO.Exception.AllocationLimitExceeded
instance Generics.SOP.Universe.Generic (GHC.Internal.Data.Semigroup.Internal.Alt f a)
instance Generics.SOP.Universe.Generic GHC.Internal.Data.Semigroup.Internal.Any
instance Generics.SOP.Universe.Generic (Data.Semigroup.Arg a b)
instance Generics.SOP.Universe.Generic (System.Console.GetOpt.ArgDescr a)
instance Generics.SOP.Universe.Generic (System.Console.GetOpt.ArgOrder a)
instance Generics.SOP.Universe.Generic GHC.Internal.Exception.Type.ArithException
instance Generics.SOP.Universe.Generic GHC.Internal.IO.Exception.ArrayException
instance Generics.SOP.Universe.Generic GHC.Internal.IO.Exception.AssertionFailed
instance Generics.SOP.Universe.Generic GHC.Internal.Generics.Associativity
instance Generics.SOP.Universe.Generic GHC.Internal.IO.Exception.AsyncException
instance Generics.SOP.Universe.Generic GHC.Internal.Conc.Sync.BlockReason
instance Generics.SOP.Universe.Generic GHC.Internal.IO.Exception.BlockedIndefinitelyOnMVar
instance Generics.SOP.Universe.Generic GHC.Internal.IO.Exception.BlockedIndefinitelyOnSTM
instance Generics.SOP.Universe.Generic GHC.Types.Bool
instance Generics.SOP.Universe.Generic (GHC.Internal.IO.Buffer.Buffer e)
instance Generics.SOP.Universe.Generic (GHC.Internal.IO.Encoding.Types.BufferCodec from to state)
instance Generics.SOP.Universe.Generic GHC.Internal.IO.Handle.Types.BufferMode
instance Generics.SOP.Universe.Generic GHC.Internal.IO.Buffer.BufferState
instance Generics.SOP.Universe.Generic GHC.Internal.ByteOrder.ByteOrder
instance Generics.SOP.Universe.Generic GHC.Internal.Generics.C
instance Generics.SOP.Universe.Generic GHC.Internal.RTS.Flags.CCFlags
instance Generics.SOP.Universe.Generic GHC.Internal.Foreign.C.Types.CChar
instance Generics.SOP.Universe.Generic GHC.Internal.Foreign.C.Types.CClock
instance Generics.SOP.Universe.Generic GHC.Internal.Foreign.C.Types.CDouble
instance Generics.SOP.Universe.Generic GHC.Internal.Foreign.C.Types.CFloat
instance Generics.SOP.Universe.Generic GHC.Internal.Foreign.C.Types.CInt
instance Generics.SOP.Universe.Generic GHC.Internal.Foreign.C.Types.CIntMax
instance Generics.SOP.Universe.Generic GHC.Internal.Foreign.C.Types.CIntPtr
instance Generics.SOP.Universe.Generic GHC.Internal.Foreign.C.Types.CLLong
instance Generics.SOP.Universe.Generic GHC.Internal.Foreign.C.Types.CLong
instance Generics.SOP.Universe.Generic GHC.Internal.Foreign.C.Types.CPtrdiff
instance Generics.SOP.Universe.Generic GHC.Internal.Foreign.C.Types.CSChar
instance Generics.SOP.Universe.Generic GHC.Internal.Foreign.C.Types.CSUSeconds
instance Generics.SOP.Universe.Generic GHC.Internal.Foreign.C.Types.CShort
instance Generics.SOP.Universe.Generic GHC.Internal.Foreign.C.Types.CSigAtomic
instance Generics.SOP.Universe.Generic GHC.Internal.Foreign.C.Types.CSize
instance Generics.SOP.Universe.Generic GHC.Internal.Foreign.C.Types.CTime
instance Generics.SOP.Universe.Generic GHC.Internal.Foreign.C.Types.CUChar
instance Generics.SOP.Universe.Generic GHC.Internal.Foreign.C.Types.CUInt
instance Generics.SOP.Universe.Generic GHC.Internal.Foreign.C.Types.CUIntMax
instance Generics.SOP.Universe.Generic GHC.Internal.Foreign.C.Types.CUIntPtr
instance Generics.SOP.Universe.Generic GHC.Internal.Foreign.C.Types.CULLong
instance Generics.SOP.Universe.Generic GHC.Internal.Foreign.C.Types.CULong
instance Generics.SOP.Universe.Generic GHC.Internal.Foreign.C.Types.CUSeconds
instance Generics.SOP.Universe.Generic GHC.Internal.Foreign.C.Types.CUShort
instance Generics.SOP.Universe.Generic GHC.Internal.Foreign.C.Types.CWchar
instance Generics.SOP.Universe.Generic GHC.Internal.Stack.Types.CallStack
instance Generics.SOP.Universe.Generic GHC.Internal.IO.Encoding.Failure.CodingFailureMode
instance Generics.SOP.Universe.Generic GHC.Internal.IO.Encoding.Types.CodingProgress
instance Generics.SOP.Universe.Generic (Data.Complex.Complex a)
instance Generics.SOP.Universe.Generic (Data.Functor.Compose.Compose f g a)
instance Generics.SOP.Universe.Generic GHC.Internal.RTS.Flags.ConcFlags
instance Generics.SOP.Universe.Generic (GHC.Internal.Data.Functor.Const.Const a b)
instance Generics.SOP.Universe.Generic GHC.Internal.Data.Data.ConstrRep
instance Generics.SOP.Universe.Generic GHC.Internal.Generics.D
instance Generics.SOP.Universe.Generic GHC.Internal.Data.Data.DataRep
instance Generics.SOP.Universe.Generic GHC.Internal.IO.Exception.Deadlock
instance Generics.SOP.Universe.Generic GHC.Internal.RTS.Flags.DebugFlags
instance Generics.SOP.Universe.Generic GHC.Internal.Generics.DecidedStrictness
instance Generics.SOP.Universe.Generic GHC.Internal.RTS.Flags.DoCostCentres
instance Generics.SOP.Universe.Generic GHC.Internal.RTS.Flags.DoHeapProfile
instance Generics.SOP.Universe.Generic GHC.Internal.RTS.Flags.DoTrace
instance Generics.SOP.Universe.Generic (GHC.Internal.Data.Ord.Down a)
instance Generics.SOP.Universe.Generic (GHC.Internal.Data.Semigroup.Internal.Dual a)
instance Generics.SOP.Universe.Generic Data.Fixed.E0
instance Generics.SOP.Universe.Generic Data.Fixed.E1
instance Generics.SOP.Universe.Generic Data.Fixed.E12
instance Generics.SOP.Universe.Generic Data.Fixed.E2
instance Generics.SOP.Universe.Generic Data.Fixed.E3
instance Generics.SOP.Universe.Generic Data.Fixed.E6
instance Generics.SOP.Universe.Generic Data.Fixed.E9
instance Generics.SOP.Universe.Generic (GHC.Internal.Data.Either.Either a b)
instance Generics.SOP.Universe.Generic (GHC.Internal.Data.Semigroup.Internal.Endo a)
instance Generics.SOP.Universe.Generic GHC.Internal.Foreign.C.Error.Errno
instance Generics.SOP.Universe.Generic GHC.Internal.Exception.ErrorCall
instance Generics.SOP.Universe.Generic GHC.Internal.IO.Exception.ExitCode
instance Generics.SOP.Universe.Generic GHC.Internal.Float.FFFormat
instance Generics.SOP.Universe.Generic Text.Printf.FieldFormat
instance Generics.SOP.Universe.Generic GHC.Internal.Fingerprint.Type.Fingerprint
instance Generics.SOP.Universe.Generic (GHC.Internal.Data.Monoid.First a)
instance Generics.SOP.Universe.Generic (Data.Semigroup.First a)
instance Generics.SOP.Universe.Generic GHC.Internal.IO.Exception.FixIOException
instance Generics.SOP.Universe.Generic (Data.Fixed.Fixed a)
instance Generics.SOP.Universe.Generic GHC.Internal.Data.Data.Fixity
instance Generics.SOP.Universe.Generic GHC.Internal.Generics.Fixity
instance Generics.SOP.Universe.Generic Text.Printf.FormatAdjustment
instance Generics.SOP.Universe.Generic Text.Printf.FormatParse
instance Generics.SOP.Universe.Generic Text.Printf.FormatSign
instance Generics.SOP.Universe.Generic GHC.Internal.Stats.GCDetails
instance Generics.SOP.Universe.Generic GHC.Internal.RTS.Flags.GCFlags
instance Generics.SOP.Universe.Generic GHC.Internal.Unicode.GeneralCategory
instance Generics.SOP.Universe.Generic GHC.Internal.RTS.Flags.GiveGCStats
instance Generics.SOP.Universe.Generic GHC.Internal.IO.Handle.HandlePosn
instance Generics.SOP.Universe.Generic (Data.SOP.BasicFunctors.I a)
instance Generics.SOP.Universe.Generic GHC.Internal.IO.Device.IODeviceType
instance Generics.SOP.Universe.Generic GHC.Internal.IO.Exception.IOErrorType
instance Generics.SOP.Universe.Generic GHC.Internal.IO.Exception.IOException
instance Generics.SOP.Universe.Generic GHC.Internal.IO.IOMode.IOMode
instance Generics.SOP.Universe.Generic (GHC.Internal.Data.Functor.Identity.Identity a)
instance Generics.SOP.Universe.Generic (Data.SOP.BasicFunctors.K a b)
instance Generics.SOP.Universe.Generic (GHC.Internal.Generics.K1 i c p)
instance Generics.SOP.Universe.Generic (GHC.Internal.Data.Monoid.Last a)
instance Generics.SOP.Universe.Generic (Data.Semigroup.Last a)
instance Generics.SOP.Universe.Generic GHC.Internal.Text.Read.Lex.Lexeme
instance Generics.SOP.Universe.Generic [a]
instance Generics.SOP.Universe.Generic GHC.Internal.ExecutionStack.Internal.Location
instance Generics.SOP.Universe.Generic GHC.Internal.IO.Handle.Lock.Common.LockMode
instance Generics.SOP.Universe.Generic (GHC.Internal.Generics.M1 i c f p)
instance Generics.SOP.Universe.Generic GHC.Internal.IO.MaskingState
instance Generics.SOP.Universe.Generic (Data.Semigroup.Max a)
instance Generics.SOP.Universe.Generic (GHC.Internal.Maybe.Maybe a)
instance Generics.SOP.Universe.Generic (Data.Semigroup.Min a)
instance Generics.SOP.Universe.Generic GHC.Internal.RTS.Flags.MiscFlags
instance Generics.SOP.Universe.Generic GHC.Internal.Control.Exception.Base.NestedAtomically
instance Generics.SOP.Universe.Generic GHC.Internal.IO.Handle.Types.Newline
instance Generics.SOP.Universe.Generic GHC.Internal.IO.Handle.Types.NewlineMode
instance Generics.SOP.Universe.Generic GHC.Internal.Control.Exception.Base.NoMethodError
instance Generics.SOP.Universe.Generic (GHC.Internal.Base.NonEmpty a)
instance Generics.SOP.Universe.Generic GHC.Internal.Control.Exception.Base.NonTermination
instance Generics.SOP.Universe.Generic GHC.Internal.Text.Read.Lex.Number
instance Generics.SOP.Universe.Generic (System.Console.GetOpt.OptDescr a)
instance Generics.SOP.Universe.Generic GHC.Types.Ordering
instance Generics.SOP.Universe.Generic (GHC.Internal.Generics.Par1 p)
instance Generics.SOP.Universe.Generic GHC.Internal.RTS.Flags.ParFlags
instance Generics.SOP.Universe.Generic GHC.Internal.Control.Exception.Base.PatternMatchFail
instance Generics.SOP.Universe.Generic (Data.Functor.Product.Product f g a)
instance Generics.SOP.Universe.Generic (GHC.Internal.Data.Semigroup.Internal.Product a)
instance Generics.SOP.Universe.Generic GHC.Internal.RTS.Flags.ProfFlags
instance Generics.SOP.Universe.Generic (GHC.Internal.Data.Proxy.Proxy t)
instance Generics.SOP.Universe.Generic GHC.Internal.Generics.R
instance Generics.SOP.Universe.Generic GHC.Internal.RTS.Flags.RTSFlags
instance Generics.SOP.Universe.Generic GHC.Internal.Stats.RTSStats
instance Generics.SOP.Universe.Generic GHC.Internal.Control.Exception.Base.RecConError
instance Generics.SOP.Universe.Generic GHC.Internal.Control.Exception.Base.RecSelError
instance Generics.SOP.Universe.Generic GHC.Internal.Control.Exception.Base.RecUpdError
instance Generics.SOP.Universe.Generic GHC.Types.RuntimeRep
instance Generics.SOP.Universe.Generic GHC.Internal.Generics.S
instance Generics.SOP.Universe.Generic GHC.Internal.IO.Device.SeekMode
instance Generics.SOP.Universe.Generic GHC.Internal.Generics.SourceStrictness
instance Generics.SOP.Universe.Generic GHC.Internal.Generics.SourceUnpackedness
instance Generics.SOP.Universe.Generic GHC.Internal.ExecutionStack.Internal.SrcLoc
instance Generics.SOP.Universe.Generic GHC.Internal.Stack.Types.SrcLoc
instance Generics.SOP.Universe.Generic GHC.Internal.StaticPtr.StaticPtrInfo
instance Generics.SOP.Universe.Generic (Data.Functor.Sum.Sum f g a)
instance Generics.SOP.Universe.Generic (GHC.Internal.Data.Semigroup.Internal.Sum a)
instance Generics.SOP.Universe.Generic GHC.Internal.Conc.Sync.ThreadStatus
instance Generics.SOP.Universe.Generic GHC.Internal.RTS.Flags.TickyFlags
instance Generics.SOP.Universe.Generic GHC.Internal.RTS.Flags.TraceFlags
instance Generics.SOP.Universe.Generic (a, b, c, d, e, f, g, h, i, j)
instance Generics.SOP.Universe.Generic (a, b, c, d, e, f, g, h, i, j, k)
instance Generics.SOP.Universe.Generic (a, b, c, d, e, f, g, h, i, j, k, l)
instance Generics.SOP.Universe.Generic (a, b, c, d, e, f, g, h, i, j, k, l, m)
instance Generics.SOP.Universe.Generic (a, b, c, d, e, f, g, h, i, j, k, l, m, n)
instance Generics.SOP.Universe.Generic (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)
instance Generics.SOP.Universe.Generic (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p)
instance Generics.SOP.Universe.Generic (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q)
instance Generics.SOP.Universe.Generic (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r)
instance Generics.SOP.Universe.Generic (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s)
instance Generics.SOP.Universe.Generic (a, b)
instance Generics.SOP.Universe.Generic (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t)
instance Generics.SOP.Universe.Generic (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u)
instance Generics.SOP.Universe.Generic (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v)
instance Generics.SOP.Universe.Generic (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w)
instance Generics.SOP.Universe.Generic (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x)
instance Generics.SOP.Universe.Generic (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y)
instance Generics.SOP.Universe.Generic (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z)
instance Generics.SOP.Universe.Generic (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, t26)
instance Generics.SOP.Universe.Generic (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, t26, t27)
instance Generics.SOP.Universe.Generic (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, t26, t27, t28)
instance Generics.SOP.Universe.Generic (a, b, c)
instance Generics.SOP.Universe.Generic (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, t26, t27, t28, t29)
instance Generics.SOP.Universe.Generic (a, b, c, d)
instance Generics.SOP.Universe.Generic (a, b, c, d, e)
instance Generics.SOP.Universe.Generic (a, b, c, d, e, f)
instance Generics.SOP.Universe.Generic (a, b, c, d, e, f, g)
instance Generics.SOP.Universe.Generic (a, b, c, d, e, f, g, h)
instance Generics.SOP.Universe.Generic (a, b, c, d, e, f, g, h, i)
instance Generics.SOP.Universe.Generic GHC.Internal.Control.Exception.Base.TypeError
instance Generics.SOP.Universe.Generic (GHC.Internal.Generics.U1 p)
instance Generics.SOP.Universe.Generic ()
instance Generics.SOP.Universe.Generic (GHC.Internal.Generics.V1 p)
instance Generics.SOP.Universe.Generic GHC.Types.VecCount
instance Generics.SOP.Universe.Generic GHC.Types.VecElem
instance Generics.SOP.Universe.Generic GHC.Internal.Data.Version.Version
instance Generics.SOP.Universe.Generic GHC.Internal.Base.Void
instance Generics.SOP.Universe.Generic (Data.Semigroup.WrappedMonoid m)
instance Generics.SOP.Universe.HasDatatypeInfo ((Data.SOP.Classes.-.->) f g a)
instance Generics.SOP.Universe.HasDatatypeInfo ((GHC.Internal.Generics.:*:) f g p)
instance Generics.SOP.Universe.HasDatatypeInfo ((GHC.Internal.Generics.:+:) f g p)
instance Generics.SOP.Universe.HasDatatypeInfo ((Data.SOP.BasicFunctors.:.:) f g p)
instance Generics.SOP.Universe.HasDatatypeInfo ((GHC.Internal.Generics.:.:) f g p)
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Data.Semigroup.Internal.All
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.IO.Exception.AllocationLimitExceeded
instance Generics.SOP.Universe.HasDatatypeInfo (GHC.Internal.Data.Semigroup.Internal.Alt f a)
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Data.Semigroup.Internal.Any
instance Generics.SOP.Universe.HasDatatypeInfo (Data.Semigroup.Arg a b)
instance Generics.SOP.Universe.HasDatatypeInfo (System.Console.GetOpt.ArgDescr a)
instance Generics.SOP.Universe.HasDatatypeInfo (System.Console.GetOpt.ArgOrder a)
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Exception.Type.ArithException
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.IO.Exception.ArrayException
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.IO.Exception.AssertionFailed
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Generics.Associativity
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.IO.Exception.AsyncException
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Conc.Sync.BlockReason
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.IO.Exception.BlockedIndefinitelyOnMVar
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.IO.Exception.BlockedIndefinitelyOnSTM
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Types.Bool
instance Generics.SOP.Universe.HasDatatypeInfo (GHC.Internal.IO.Buffer.Buffer e)
instance Generics.SOP.Universe.HasDatatypeInfo (GHC.Internal.IO.Encoding.Types.BufferCodec from to state)
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.IO.Handle.Types.BufferMode
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.IO.Buffer.BufferState
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.ByteOrder.ByteOrder
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Generics.C
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.RTS.Flags.CCFlags
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Foreign.C.Types.CChar
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Foreign.C.Types.CClock
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Foreign.C.Types.CDouble
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Foreign.C.Types.CFloat
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Foreign.C.Types.CInt
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Foreign.C.Types.CIntMax
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Foreign.C.Types.CIntPtr
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Foreign.C.Types.CLLong
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Foreign.C.Types.CLong
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Foreign.C.Types.CPtrdiff
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Foreign.C.Types.CSChar
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Foreign.C.Types.CSUSeconds
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Foreign.C.Types.CShort
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Foreign.C.Types.CSigAtomic
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Foreign.C.Types.CSize
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Foreign.C.Types.CTime
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Foreign.C.Types.CUChar
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Foreign.C.Types.CUInt
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Foreign.C.Types.CUIntMax
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Foreign.C.Types.CUIntPtr
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Foreign.C.Types.CULLong
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Foreign.C.Types.CULong
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Foreign.C.Types.CUSeconds
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Foreign.C.Types.CUShort
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Foreign.C.Types.CWchar
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Stack.Types.CallStack
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.IO.Encoding.Failure.CodingFailureMode
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.IO.Encoding.Types.CodingProgress
instance Generics.SOP.Universe.HasDatatypeInfo (Data.Complex.Complex a)
instance Generics.SOP.Universe.HasDatatypeInfo (Data.Functor.Compose.Compose f g a)
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.RTS.Flags.ConcFlags
instance Generics.SOP.Universe.HasDatatypeInfo (GHC.Internal.Data.Functor.Const.Const a b)
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Data.Data.ConstrRep
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Generics.D
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Data.Data.DataRep
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.IO.Exception.Deadlock
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.RTS.Flags.DebugFlags
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Generics.DecidedStrictness
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.RTS.Flags.DoCostCentres
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.RTS.Flags.DoHeapProfile
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.RTS.Flags.DoTrace
instance Generics.SOP.Universe.HasDatatypeInfo (GHC.Internal.Data.Ord.Down a)
instance Generics.SOP.Universe.HasDatatypeInfo (GHC.Internal.Data.Semigroup.Internal.Dual a)
instance Generics.SOP.Universe.HasDatatypeInfo Data.Fixed.E0
instance Generics.SOP.Universe.HasDatatypeInfo Data.Fixed.E1
instance Generics.SOP.Universe.HasDatatypeInfo Data.Fixed.E12
instance Generics.SOP.Universe.HasDatatypeInfo Data.Fixed.E2
instance Generics.SOP.Universe.HasDatatypeInfo Data.Fixed.E3
instance Generics.SOP.Universe.HasDatatypeInfo Data.Fixed.E6
instance Generics.SOP.Universe.HasDatatypeInfo Data.Fixed.E9
instance Generics.SOP.Universe.HasDatatypeInfo (GHC.Internal.Data.Either.Either a b)
instance Generics.SOP.Universe.HasDatatypeInfo (GHC.Internal.Data.Semigroup.Internal.Endo a)
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Foreign.C.Error.Errno
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Exception.ErrorCall
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.IO.Exception.ExitCode
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Float.FFFormat
instance Generics.SOP.Universe.HasDatatypeInfo Text.Printf.FieldFormat
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Fingerprint.Type.Fingerprint
instance Generics.SOP.Universe.HasDatatypeInfo (GHC.Internal.Data.Monoid.First a)
instance Generics.SOP.Universe.HasDatatypeInfo (Data.Semigroup.First a)
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.IO.Exception.FixIOException
instance Generics.SOP.Universe.HasDatatypeInfo (Data.Fixed.Fixed a)
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Data.Data.Fixity
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Generics.Fixity
instance Generics.SOP.Universe.HasDatatypeInfo Text.Printf.FormatAdjustment
instance Generics.SOP.Universe.HasDatatypeInfo Text.Printf.FormatParse
instance Generics.SOP.Universe.HasDatatypeInfo Text.Printf.FormatSign
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Stats.GCDetails
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.RTS.Flags.GCFlags
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Unicode.GeneralCategory
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.RTS.Flags.GiveGCStats
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.IO.Handle.HandlePosn
instance Generics.SOP.Universe.HasDatatypeInfo (Data.SOP.BasicFunctors.I a)
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.IO.Device.IODeviceType
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.IO.Exception.IOErrorType
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.IO.Exception.IOException
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.IO.IOMode.IOMode
instance Generics.SOP.Universe.HasDatatypeInfo (GHC.Internal.Data.Functor.Identity.Identity a)
instance Generics.SOP.Universe.HasDatatypeInfo (Data.SOP.BasicFunctors.K a b)
instance Generics.SOP.Universe.HasDatatypeInfo (GHC.Internal.Generics.K1 i c p)
instance Generics.SOP.Universe.HasDatatypeInfo (GHC.Internal.Data.Monoid.Last a)
instance Generics.SOP.Universe.HasDatatypeInfo (Data.Semigroup.Last a)
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Text.Read.Lex.Lexeme
instance Generics.SOP.Universe.HasDatatypeInfo [a]
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.ExecutionStack.Internal.Location
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.IO.Handle.Lock.Common.LockMode
instance Generics.SOP.Universe.HasDatatypeInfo (GHC.Internal.Generics.M1 i c f p)
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.IO.MaskingState
instance Generics.SOP.Universe.HasDatatypeInfo (Data.Semigroup.Max a)
instance Generics.SOP.Universe.HasDatatypeInfo (GHC.Internal.Maybe.Maybe a)
instance Generics.SOP.Universe.HasDatatypeInfo (Data.Semigroup.Min a)
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.RTS.Flags.MiscFlags
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Control.Exception.Base.NestedAtomically
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.IO.Handle.Types.Newline
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.IO.Handle.Types.NewlineMode
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Control.Exception.Base.NoMethodError
instance Generics.SOP.Universe.HasDatatypeInfo (GHC.Internal.Base.NonEmpty a)
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Control.Exception.Base.NonTermination
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Text.Read.Lex.Number
instance Generics.SOP.Universe.HasDatatypeInfo (System.Console.GetOpt.OptDescr a)
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Types.Ordering
instance Generics.SOP.Universe.HasDatatypeInfo (GHC.Internal.Generics.Par1 p)
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.RTS.Flags.ParFlags
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Control.Exception.Base.PatternMatchFail
instance Generics.SOP.Universe.HasDatatypeInfo (Data.Functor.Product.Product f g a)
instance Generics.SOP.Universe.HasDatatypeInfo (GHC.Internal.Data.Semigroup.Internal.Product a)
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.RTS.Flags.ProfFlags
instance Generics.SOP.Universe.HasDatatypeInfo (GHC.Internal.Data.Proxy.Proxy t)
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Generics.R
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.RTS.Flags.RTSFlags
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Stats.RTSStats
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Control.Exception.Base.RecConError
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Control.Exception.Base.RecSelError
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Control.Exception.Base.RecUpdError
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Types.RuntimeRep
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Generics.S
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.IO.Device.SeekMode
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Generics.SourceStrictness
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Generics.SourceUnpackedness
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.ExecutionStack.Internal.SrcLoc
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Stack.Types.SrcLoc
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.StaticPtr.StaticPtrInfo
instance Generics.SOP.Universe.HasDatatypeInfo (Data.Functor.Sum.Sum f g a)
instance Generics.SOP.Universe.HasDatatypeInfo (GHC.Internal.Data.Semigroup.Internal.Sum a)
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Conc.Sync.ThreadStatus
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.RTS.Flags.TickyFlags
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.RTS.Flags.TraceFlags
instance Generics.SOP.Universe.HasDatatypeInfo (a, b, c, d, e, f, g, h, i, j)
instance Generics.SOP.Universe.HasDatatypeInfo (a, b, c, d, e, f, g, h, i, j, k)
instance Generics.SOP.Universe.HasDatatypeInfo (a, b, c, d, e, f, g, h, i, j, k, l)
instance Generics.SOP.Universe.HasDatatypeInfo (a, b, c, d, e, f, g, h, i, j, k, l, m)
instance Generics.SOP.Universe.HasDatatypeInfo (a, b, c, d, e, f, g, h, i, j, k, l, m, n)
instance Generics.SOP.Universe.HasDatatypeInfo (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)
instance Generics.SOP.Universe.HasDatatypeInfo (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p)
instance Generics.SOP.Universe.HasDatatypeInfo (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q)
instance Generics.SOP.Universe.HasDatatypeInfo (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r)
instance Generics.SOP.Universe.HasDatatypeInfo (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s)
instance Generics.SOP.Universe.HasDatatypeInfo (a, b)
instance Generics.SOP.Universe.HasDatatypeInfo (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t)
instance Generics.SOP.Universe.HasDatatypeInfo (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u)
instance Generics.SOP.Universe.HasDatatypeInfo (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v)
instance Generics.SOP.Universe.HasDatatypeInfo (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w)
instance Generics.SOP.Universe.HasDatatypeInfo (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x)
instance Generics.SOP.Universe.HasDatatypeInfo (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y)
instance Generics.SOP.Universe.HasDatatypeInfo (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z)
instance Generics.SOP.Universe.HasDatatypeInfo (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, t26)
instance Generics.SOP.Universe.HasDatatypeInfo (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, t26, t27)
instance Generics.SOP.Universe.HasDatatypeInfo (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, t26, t27, t28)
instance Generics.SOP.Universe.HasDatatypeInfo (a, b, c)
instance Generics.SOP.Universe.HasDatatypeInfo (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, t26, t27, t28, t29)
instance Generics.SOP.Universe.HasDatatypeInfo (a, b, c, d)
instance Generics.SOP.Universe.HasDatatypeInfo (a, b, c, d, e)
instance Generics.SOP.Universe.HasDatatypeInfo (a, b, c, d, e, f)
instance Generics.SOP.Universe.HasDatatypeInfo (a, b, c, d, e, f, g)
instance Generics.SOP.Universe.HasDatatypeInfo (a, b, c, d, e, f, g, h)
instance Generics.SOP.Universe.HasDatatypeInfo (a, b, c, d, e, f, g, h, i)
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Control.Exception.Base.TypeError
instance Generics.SOP.Universe.HasDatatypeInfo (GHC.Internal.Generics.U1 p)
instance Generics.SOP.Universe.HasDatatypeInfo ()
instance Generics.SOP.Universe.HasDatatypeInfo (GHC.Internal.Generics.V1 p)
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Types.VecCount
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Types.VecElem
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Data.Version.Version
instance Generics.SOP.Universe.HasDatatypeInfo GHC.Internal.Base.Void
instance Generics.SOP.Universe.HasDatatypeInfo (Data.Semigroup.WrappedMonoid m)


-- | Main module of <tt>generics-sop</tt>
--   
--   In most cases, you will probably want to import just this module, and
--   possibly <a>Generics.SOP.TH</a> if you want to use Template Haskell to
--   generate <a>Generic</a> instances for you.
--   
--   <h1>Generic programming with sums of products</h1>
--   
--   You need this library if you want to define your own generic functions
--   in the sum-of-products SOP style. Generic programming in the SOP style
--   follows the following idea:
--   
--   <ol>
--   <li>A large class of datatypes can be viewed in a uniform, structured
--   way: the choice between constructors is represented using an n-ary sum
--   (called <a>NS</a>), and the arguments of each constructor are
--   represented using an n-ary product (called <a>NP</a>).</li>
--   <li>The library captures the notion of a datatype being representable
--   in the following way. There is a class <a>Generic</a>, which for a
--   given datatype <tt>A</tt>, associates the isomorphic SOP
--   representation with the original type under the name <tt><a>Rep</a>
--   A</tt>. The class also provides functions <a>from</a> and <a>to</a>
--   that convert between <tt>A</tt> and <tt><a>Rep</a> A</tt> and witness
--   the isomorphism.</li>
--   <li>Since all <a>Rep</a> types are sums of products, you can define
--   functions over them by performing induction on the structure, or by
--   using predefined combinators that the library provides. Such functions
--   then work for all <a>Rep</a> types.</li>
--   <li>By combining the conversion functions <a>from</a> and <a>to</a>
--   with the function that works on <a>Rep</a> types, we obtain a function
--   that works on all types that are in the <a>Generic</a> class.</li>
--   <li>Most types can very easily be made an instance of <a>Generic</a>.
--   For example, if the datatype can be represented using GHC's built-in
--   approach to generic programming and has an instance for the
--   <a>Generic</a> class from module <a>GHC.Generics</a>, then an instance
--   of the SOP <a>Generic</a> can automatically be derived. There is also
--   Template Haskell code in <a>Generics.SOP.TH</a> that allows to
--   auto-generate an instance of <a>Generic</a> for most types.</li>
--   </ol>
--   
--   <h1>Example</h1>
--   
--   <h2>Instantiating a datatype for use with SOP generics</h2>
--   
--   Let's assume we have the datatypes:
--   
--   <pre>
--   data A   = C Bool | D A Int | E (B ())
--   data B a = F | G a Char Bool
--   </pre>
--   
--   To create <a>Generic</a> instances for <tt>A</tt> and <tt>B</tt> via
--   <a>GHC.Generics</a>, we say
--   
--   <pre>
--   {-# LANGUAGE DeriveGeneric #-}
--   
--   import qualified GHC.Generics as GHC
--   import Generics.SOP
--   
--   data A   = C Bool | D A Int | E (B ())
--     deriving (Show, GHC.Generic)
--   data B a = F | G a Char Bool
--     deriving (Show, GHC.Generic)
--   
--   instance Generic A     -- empty
--   instance Generic (B a) -- empty
--   </pre>
--   
--   Now we can convert between <tt>A</tt> and <tt><a>Rep</a> A</tt> (and
--   between <tt>B</tt> and <tt><a>Rep</a> B</tt>). For example,
--   
--   <pre>
--   &gt;&gt;&gt; from (D (C True) 3) :: Rep A
--   SOP (S (Z (I (C True) :* I 3 :* Nil)))
--   
--   &gt;&gt;&gt; to it :: A
--   D (C True) 3
--   </pre>
--   
--   Note that the transformation is shallow: In <tt>D (C True) 3</tt>, the
--   inner value <tt>C True</tt> of type <tt>A</tt> is not affected by the
--   transformation.
--   
--   For more details about <tt><a>Rep</a> A</tt>, have a look at the
--   <a>Generics.SOP.Universe</a> module.
--   
--   <h2>Defining a generic function</h2>
--   
--   As an example of a generic function, let us define a generic version
--   of <a>rnf</a> from the <tt>deepseq</tt> package.
--   
--   The type of <a>rnf</a> is
--   
--   <pre>
--   NFData a =&gt; a -&gt; ()
--   </pre>
--   
--   and the idea is that for a term <tt>x</tt> of type <tt>a</tt> in the
--   <a>NFData</a> class, <tt>rnf x</tt> forces complete evaluation of
--   <tt>x</tt> (i.e., evaluation to <i>normal form</i>), and returns
--   <tt>()</tt>.
--   
--   We call the generic version of this function <tt>grnf</tt>. A direct
--   definition in SOP style, making use of structural recursion on the
--   sums and products, looks as follows:
--   
--   <pre>
--   grnf :: (<a>Generic</a> a, <a>All2</a> NFData (<a>Code</a> a)) =&gt; a -&gt; ()
--   grnf x = grnfS (<a>from</a> x)
--   
--   grnfS :: (<a>All2</a> NFData xss) =&gt; <a>SOP</a> <a>I</a> xss -&gt; ()
--   grnfS (<a>SOP</a> (<a>Z</a> xs))  = grnfP xs
--   grnfS (<a>SOP</a> (<a>S</a> xss)) = grnfS (<a>SOP</a> xss)
--   
--   grnfP :: (<a>All</a> NFData xs) =&gt; <a>NP</a> <a>I</a> xs -&gt; ()
--   grnfP <a>Nil</a>         = ()
--   grnfP (<a>I</a> x <a>:*</a> xs) = x `deepseq` (grnfP xs)
--   </pre>
--   
--   The <tt>grnf</tt> function performs the conversion between <tt>a</tt>
--   and <tt><a>Rep</a> a</tt> by applying <a>from</a> and then applies
--   <tt>grnfS</tt>. The type of <tt>grnf</tt> indicates that <tt>a</tt>
--   must be in the <a>Generic</a> class so that we can apply <a>from</a>,
--   and that all the components of <tt>a</tt> (i.e., all the types that
--   occur as constructor arguments) must be in the <tt>NFData</tt> class
--   (<a>All2</a>).
--   
--   The function <tt>grnfS</tt> traverses the outer sum structure of the
--   sum of products (note that <tt><a>Rep</a> a = <a>SOP</a> <a>I</a>
--   (<a>Code</a> a)</tt>). It encodes which constructor was used to
--   construct the original argument of type <tt>a</tt>. Once we've found
--   the constructor in question (<a>Z</a>), we traverse the arguments of
--   that constructor using <tt>grnfP</tt>.
--   
--   The function <tt>grnfP</tt> traverses the product structure of the
--   constructor arguments. Each argument is evaluated using the
--   <a>deepseq</a> function from the <a>NFData</a> class. This requires
--   that all components of the product must be in the <tt>NFData</tt>
--   class (<a>All</a>) and triggers the corresponding constraints on the
--   other functions. Once the end of the product is reached (<a>Nil</a>),
--   we return <tt>()</tt>.
--   
--   <h2>Defining a generic function using combinators</h2>
--   
--   In many cases, generic functions can be written in a much more concise
--   way by avoiding the explicit structural recursion and resorting to the
--   powerful combinators provided by this library instead.
--   
--   For example, the <tt>grnf</tt> function can also be defined as a
--   one-liner as follows:
--   
--   <pre>
--   grnf :: (<a>Generic</a> a, <a>All2</a> NFData (<a>Code</a> a)) =&gt; a -&gt; ()
--   grnf = <tt>rnf</tt> . <a>hcollapse</a> . <a>hcmap</a> (<a>Proxy</a> :: <a>Proxy</a> NFData) (<a>mapIK</a> rnf) . <a>from</a>
--   </pre>
--   
--   <a>mapIK</a> and friends (<a>mapII</a>, <a>mapKI</a>, etc.) are small
--   helpers for working with <a>I</a> and <a>K</a> functors, for example
--   <a>mapIK</a> is defined as <tt><a>mapIK</a> f = \ (<a>I</a> x) -&gt;
--   <a>K</a> (f x)</tt>
--   
--   The following interaction should provide an idea of the individual
--   transformation steps:
--   
--   <pre>
--   &gt;&gt;&gt; let x = G 2.5 'A' False :: B Double
--   
--   &gt;&gt;&gt; from x
--   SOP (S (Z (I 2.5 :* I 'A' :* I False :* Nil)))
--   
--   &gt;&gt;&gt; hcmap (Proxy :: Proxy NFData) (mapIK rnf) it
--   SOP (S (Z (K () :* K () :* K () :* Nil)))
--   
--   &gt;&gt;&gt; hcollapse it
--   [(),(),()]
--   
--   &gt;&gt;&gt; rnf it
--   ()
--   </pre>
--   
--   The <a>from</a> call converts into the structural representation. Via
--   <a>hcmap</a>, we apply <tt>rnf</tt> to all the components. The result
--   is a sum of products of the same shape, but the components are no
--   longer heterogeneous (<a>I</a>), but homogeneous (<tt><a>K</a>
--   ()</tt>). A homogeneous structure can be collapsed (<a>hcollapse</a>)
--   into a normal Haskell list. Finally, <tt>rnf</tt> actually forces
--   evaluation of this list (and thereby actually drives the evaluation of
--   all the previous steps) and produces the final result.
--   
--   <h2>Using a generic function</h2>
--   
--   We can directly invoke <tt>grnf</tt> on any type that is an instance
--   of class <a>Generic</a>.
--   
--   <pre>
--   &gt;&gt;&gt; grnf (G 2.5 'A' False)
--   ()
--   
--   &gt;&gt;&gt; grnf (G 2.5 undefined False)
--   *** Exception: Prelude.undefined
--   ...
--   </pre>
--   
--   Note that the type of <tt>grnf</tt> requires that all components of
--   the type are in the <a>NFData</a> class. For a recursive datatype such
--   as <tt>B</tt>, this means that we have to make <tt>A</tt> (and in this
--   case, also <tt>B</tt>) an instance of <a>NFData</a> in order to be
--   able to use the <tt>grnf</tt> function. But we can use <tt>grnf</tt>
--   to supply the instance definitions:
--   
--   <pre>
--   instance NFData A where rnf = grnf
--   instance NFData a =&gt; NFData (B a) where rnf = grnf
--   </pre>
--   
--   <h1>More examples</h1>
--   
--   The best way to learn about how to define generic functions in the SOP
--   style is to look at a few simple examples. Examples are provided by
--   the following packages:
--   
--   <ul>
--   <li><tt><a>basic-sop</a></tt> basic examples,</li>
--   <li><tt><a>pretty-sop</a></tt> generic pretty printing,</li>
--   <li><tt><a>lens-sop</a></tt> generically computed lenses,</li>
--   <li><tt><a>json-sop</a></tt> generic JSON conversions.</li>
--   </ul>
--   
--   The generic functions in these packages use a wide variety of the
--   combinators that are offered by the library.
--   
--   <h1>Paper</h1>
--   
--   A detailed description of the ideas behind this library is provided by
--   the paper:
--   
--   <ul>
--   <li>Edsko de Vries and Andres Löh. <a>True Sums of Products</a>.
--   Workshop on Generic Programming (WGP) 2014.</li>
--   </ul>
module Generics.SOP

-- | The class of representable datatypes.
--   
--   The SOP approach to generic programming is based on viewing datatypes
--   as a representation (<a>Rep</a>) built from the sum of products of its
--   components. The components of a datatype are specified using the
--   <a>Code</a> type family.
--   
--   The isomorphism between the original Haskell datatype and its
--   representation is witnessed by the methods of this class, <a>from</a>
--   and <a>to</a>. So for instances of this class, the following laws
--   should (in general) hold:
--   
--   <pre>
--   <a>to</a> <a>.</a> <a>from</a> === <a>id</a> :: a -&gt; a
--   <a>from</a> <a>.</a> <a>to</a> === <a>id</a> :: <a>Rep</a> a -&gt; <a>Rep</a> a
--   </pre>
--   
--   You typically don't define instances of this class by hand, but rather
--   derive the class instance automatically.
--   
--   <i>Option 1:</i> Derive via the built-in GHC-generics. For this, you
--   need to use the <tt>DeriveGeneric</tt> extension to first derive an
--   instance of the <a>Generic</a> class from module <a>GHC.Generics</a>.
--   With this, you can then give an empty instance for <a>Generic</a>, and
--   the default definitions will just work. The pattern looks as follows:
--   
--   <pre>
--   import qualified <a>GHC.Generics</a> as GHC
--   import <a>Generics.SOP</a>
--   
--   ...
--   
--   data T = ... deriving (GHC.<a>Generic</a>, ...)
--   
--   instance <a>Generic</a> T -- empty
--   instance <a>HasDatatypeInfo</a> T -- empty, if you want/need metadata
--   </pre>
--   
--   <i>Option 2:</i> Derive via Template Haskell. For this, you need to
--   enable the <tt>TemplateHaskell</tt> extension. You can then use
--   <a>deriveGeneric</a> from module <a>Generics.SOP.TH</a> to have the
--   instance generated for you. The pattern looks as follows:
--   
--   <pre>
--   import <a>Generics.SOP</a>
--   import <a>Generics.SOP.TH</a>
--   
--   ...
--   
--   data T = ...
--   
--   <a>deriveGeneric</a> ''T -- derives <a>HasDatatypeInfo</a> as well
--   </pre>
--   
--   <i>Tradeoffs:</i> Whether to use Option 1 or 2 is mainly a matter of
--   personal taste. The version based on Template Haskell probably has
--   less run-time overhead.
--   
--   <i>Non-standard instances:</i> It is possible to give <a>Generic</a>
--   instances manually that deviate from the standard scheme, as long as
--   at least
--   
--   <pre>
--   <a>to</a> <a>.</a> <a>from</a> === <a>id</a> :: a -&gt; a
--   </pre>
--   
--   still holds.
class All SListI :: [Type] -> Constraint Code a => Generic a where {
    
    -- | The code of a datatype.
    --   
    --   This is a list of lists of its components. The outer list contains one
    --   element per constructor. The inner list contains one element per
    --   constructor argument (field).
    --   
    --   <i>Example:</i> The datatype
    --   
    --   <pre>
    --   data Tree = Leaf Int | Node Tree Tree
    --   </pre>
    --   
    --   is supposed to have the following code:
    --   
    --   <pre>
    --   type instance Code (Tree a) =
    --     '[ '[ Int ]
    --      , '[ Tree, Tree ]
    --      ]
    --   </pre>
    type Code a :: [[Type]];
    type Code a = GCode a;
}

-- | Converts from a value to its structural representation.
from :: Generic a => a -> Rep a
($dmfrom) :: (Generic a, GFrom a, Generic a, Rep a ~ SOP I (GCode a)) => a -> Rep a

-- | Converts from a structural representation back to the original value.
to :: Generic a => Rep a -> a
($dmto) :: (Generic a, GTo a, Generic a, Rep a ~ SOP I (GCode a)) => Rep a -> a

-- | The (generic) representation of a datatype.
--   
--   A datatype is isomorphic to the sum-of-products of its code. The
--   isomorphism is witnessed by <a>from</a> and <a>to</a> from the
--   <a>Generic</a> class.
type Rep a = SOP I Code a

-- | Constraint that captures that a datatype is a product type, i.e., a
--   type with a single constructor.
--   
--   It also gives access to the code for the arguments of that
--   constructor.
type IsProductType a (xs :: [Type]) = (Generic a, Code a ~ '[xs])

-- | Direct access to the part of the code that is relevant for a product
--   type.
type ProductCode a = Head Code a

-- | Convert from a product type to its product representation.
productTypeFrom :: forall a (xs :: [Type]). IsProductType a xs => a -> NP I xs

-- | Convert a product representation to the original type.
productTypeTo :: forall a (xs :: [Type]). IsProductType a xs => NP I xs -> a

-- | Constraint that captures that a datatype is an enumeration type, i.e.,
--   none of the constructors have any arguments.
type IsEnumType a = (Generic a, All [Type] ~ '[] :: [Type] Code a)

-- | Convert from an enum type to its sum representation.
enumTypeFrom :: IsEnumType a => a -> NS (K () :: [Type] -> Type) (Code a)

-- | Convert a sum representation to ihe original type.
enumTypeTo :: IsEnumType a => NS (K () :: [Type] -> Type) (Code a) -> a

-- | Constraint that captures that a datatype is a single-constructor,
--   single-field datatype. This always holds for newtype-defined types,
--   but it can also be true for data-defined types.
--   
--   The constraint also gives access to the type that is wrapped.
type IsWrappedType a x = (Generic a, Code a ~ '[ '[x]])

-- | Direct access to the part of the code that is relevant for wrapped
--   types and newtypes.
type WrappedCode a = Head Head Code a

-- | Convert from a wrapped type to its inner type.
wrappedTypeFrom :: IsWrappedType a x => a -> x

-- | Convert a type to a wrapped type.
wrappedTypeTo :: IsWrappedType a x => x -> a

-- | Constraint that captures that a datatype is a newtype. This makes use
--   of the fact that newtypes are always coercible to the type they wrap,
--   whereas datatypes are not.
type IsNewtype a x = (IsWrappedType a x, Coercible a x)

-- | Convert a newtype to its inner type.
--   
--   This is a specialised synonym for <a>coerce</a>.
newtypeFrom :: IsNewtype a x => a -> x

-- | Convert a type to a newtype.
--   
--   This is a specialised synonym for <a>coerce</a>.
newtypeTo :: IsNewtype a x => x -> a
data NP (a :: k -> Type) (b :: [k])
[Nil] :: forall {k} (a :: k -> Type). NP a ('[] :: [k])
[:*] :: forall {k} (a :: k -> Type) (x :: k) (xs :: [k]). a x -> NP a xs -> NP a (x ': xs)
data NS (a :: k -> Type) (b :: [k])
[Z] :: forall {k} (a :: k -> Type) (x :: k) (xs :: [k]). a x -> NS a (x ': xs)
[S] :: forall {k} (a :: k -> Type) (xs :: [k]) (x :: k). NS a xs -> NS a (x ': xs)
newtype SOP (f :: k -> Type) (xss :: [[k]])
SOP :: NS (NP f) xss -> SOP (f :: k -> Type) (xss :: [[k]])
unSOP :: forall {k} (f :: k -> Type) (xss :: [[k]]). SOP f xss -> NS (NP f) xss
newtype POP (f :: k -> Type) (xss :: [[k]])
POP :: NP (NP f) xss -> POP (f :: k -> Type) (xss :: [[k]])
unPOP :: forall {k} (f :: k -> Type) (xss :: [[k]]). POP f xss -> NP (NP f) xss

-- | Metadata for a datatype.
--   
--   A value of type <tt><a>DatatypeInfo</a> c</tt> contains the
--   information about a datatype that is not contained in
--   <tt><tt>Code</tt> c</tt>. This information consists primarily of the
--   names of the datatype, its constructors, and possibly its record
--   selectors.
--   
--   The constructor indicates whether the datatype has been declared using
--   <tt>newtype</tt> or not.
data DatatypeInfo (a :: [[Type]])
[ADT] :: forall (a :: [[Type]]). ModuleName -> DatatypeName -> NP ConstructorInfo a -> POP StrictnessInfo a -> DatatypeInfo a
[Newtype] :: forall x. ModuleName -> DatatypeName -> ConstructorInfo '[x] -> DatatypeInfo '[ '[x]]

-- | The module name where a datatype is defined.
moduleName :: forall (xss :: [[Type]]). DatatypeInfo xss -> ModuleName

-- | The name of a datatype (or newtype).
datatypeName :: forall (xss :: [[Type]]). DatatypeInfo xss -> DatatypeName

-- | The constructor info for a datatype (or newtype).
constructorInfo :: forall (xss :: [[Type]]). DatatypeInfo xss -> NP ConstructorInfo xss

-- | Metadata for a single constructor.
--   
--   This is indexed by the product structure of the constructor
--   components.
data ConstructorInfo (a :: [Type])
[Constructor] :: forall (a :: [Type]). SListI a => ConstructorName -> ConstructorInfo a
[Infix] :: forall x y. ConstructorName -> Associativity -> Fixity -> ConstructorInfo '[x, y]
[Record] :: forall (a :: [Type]). SListI a => ConstructorName -> NP FieldInfo a -> ConstructorInfo a

-- | The name of a constructor.
constructorName :: forall (xs :: [Type]). ConstructorInfo xs -> ConstructorName

-- | For records, this functor maps the component to its selector name.
data FieldInfo a
[FieldInfo] :: forall a. FieldName -> FieldInfo a

-- | The name of a field.
fieldName :: FieldInfo a -> FieldName

-- | A class of datatypes that have associated metadata.
--   
--   It is possible to use the sum-of-products approach to generic
--   programming without metadata. If you need metadata in a function, an
--   additional constraint on this class is in order.
--   
--   You typically don't define instances of this class by hand, but rather
--   derive the class instance automatically. See the documentation of
--   <a>Generic</a> for the options.
class Generic a => HasDatatypeInfo a where {
    
    -- | Type-level datatype info
    type DatatypeInfoOf a :: DatatypeInfo;
    type DatatypeInfoOf a = GDatatypeInfoOf a;
}

-- | Term-level datatype info; by default, the term-level datatype info is
--   produced from the type-level info.
datatypeInfo :: HasDatatypeInfo a => proxy a -> DatatypeInfo (Code a)
($dmdatatypeInfo) :: (HasDatatypeInfo a, GDatatypeInfo a, GCode a ~ Code a) => proxy a -> DatatypeInfo (Code a)

-- | The name of a datatype.
type DatatypeName = String

-- | The name of a module.
type ModuleName = String

-- | The name of a data constructor.
type ConstructorName = String

-- | The name of a field / record selector.
type FieldName = String
data Associativity
LeftAssociative :: Associativity
RightAssociative :: Associativity
NotAssociative :: Associativity

-- | The fixity of an infix constructor.
type Fixity = Int
class HPure (h :: k -> Type -> l -> Type)
hpure :: forall (xs :: l) f. (HPure h, SListIN h xs) => (forall (a :: k). () => f a) -> h f xs
hcpure :: forall c (xs :: l) proxy f. (HPure h, AllN h c xs) => proxy c -> (forall (a :: k). c a => f a) -> h f xs
hd :: forall {k} f (x :: k) (xs :: [k]). NP f (x ': xs) -> f x
tl :: forall {k} (f :: k -> Type) (x :: k) (xs :: [k]). NP f (x ': xs) -> NP f xs
type Projection (f :: k -> Type) (xs :: [k]) = K NP f xs :: k -> Type -.-> f
projections :: forall {k} (xs :: [k]) (f :: k -> Type). SListI xs => NP (Projection f xs) xs
shiftProjection :: forall {a1} (f :: a1 -> Type) (xs :: [a1]) (a2 :: a1) (x :: a1). Projection f xs a2 -> Projection f (x ': xs) a2
newtype ( (f :: k -> Type) -.-> (g :: k -> Type) ) (a :: k)
Fn :: (f a -> g a) -> (-.->) (f :: k -> Type) (g :: k -> Type) (a :: k)
[apFn] :: (-.->) (f :: k -> Type) (g :: k -> Type) (a :: k) -> f a -> g a
fn :: forall {k} f (a :: k) f'. (f a -> f' a) -> (f -.-> f') a
fn_2 :: forall {k} f (a :: k) f' f''. (f a -> f' a -> f'' a) -> (f -.-> (f' -.-> f'')) a
fn_3 :: forall {k} f (a :: k) f' f'' f'''. (f a -> f' a -> f'' a -> f''' a) -> (f -.-> (f' -.-> (f'' -.-> f'''))) a
fn_4 :: forall {k} f (a :: k) f' f'' f''' f''''. (f a -> f' a -> f'' a -> f''' a -> f'''' a) -> (f -.-> (f' -.-> (f'' -.-> (f''' -.-> f'''')))) a
type family Prod (h :: k -> Type -> l -> Type) :: k -> Type -> l -> Type
class (Prod Prod h ~ Prod h, HPure Prod h) => HAp (h :: k -> Type -> l -> Type)
hap :: forall (f :: k -> Type) (g :: k -> Type) (xs :: l). HAp h => Prod h (f -.-> g) xs -> h f xs -> h g xs
hliftA :: forall {k} {l} h (xs :: l) f f'. (SListIN (Prod h) xs, HAp h) => (forall (a :: k). () => f a -> f' a) -> h f xs -> h f' xs
hliftA2 :: forall {k} {l} h (xs :: l) f f' f''. (SListIN (Prod h) xs, HAp h, HAp (Prod h)) => (forall (a :: k). () => f a -> f' a -> f'' a) -> Prod h f xs -> h f' xs -> h f'' xs
hliftA3 :: forall {k} {l} h (xs :: l) f f' f'' f'''. (SListIN (Prod h) xs, HAp h, HAp (Prod h)) => (forall (a :: k). () => f a -> f' a -> f'' a -> f''' a) -> Prod h f xs -> Prod h f' xs -> h f'' xs -> h f''' xs
hcliftA :: forall {k} {l} h c (xs :: l) proxy f f'. (AllN (Prod h) c xs, HAp h) => proxy c -> (forall (a :: k). c a => f a -> f' a) -> h f xs -> h f' xs
hcliftA2 :: forall {k} {l} h c (xs :: l) proxy f f' f''. (AllN (Prod h) c xs, HAp h, HAp (Prod h)) => proxy c -> (forall (a :: k). c a => f a -> f' a -> f'' a) -> Prod h f xs -> h f' xs -> h f'' xs
hcliftA3 :: forall {k} {l} h c (xs :: l) proxy f f' f'' f'''. (AllN (Prod h) c xs, HAp h, HAp (Prod h)) => proxy c -> (forall (a :: k). c a => f a -> f' a -> f'' a -> f''' a) -> Prod h f xs -> Prod h f' xs -> h f'' xs -> h f''' xs
hmap :: forall {k} {l} h (xs :: l) f f'. (SListIN (Prod h) xs, HAp h) => (forall (a :: k). () => f a -> f' a) -> h f xs -> h f' xs
hzipWith :: forall {k} {l} h (xs :: l) f f' f''. (SListIN (Prod h) xs, HAp h, HAp (Prod h)) => (forall (a :: k). () => f a -> f' a -> f'' a) -> Prod h f xs -> h f' xs -> h f'' xs
hzipWith3 :: forall {k} {l} h (xs :: l) f f' f'' f'''. (SListIN (Prod h) xs, HAp h, HAp (Prod h)) => (forall (a :: k). () => f a -> f' a -> f'' a -> f''' a) -> Prod h f xs -> Prod h f' xs -> h f'' xs -> h f''' xs
hcmap :: forall {k} {l} h c (xs :: l) proxy f f'. (AllN (Prod h) c xs, HAp h) => proxy c -> (forall (a :: k). c a => f a -> f' a) -> h f xs -> h f' xs
hczipWith :: forall {k} {l} h c (xs :: l) proxy f f' f''. (AllN (Prod h) c xs, HAp h, HAp (Prod h)) => proxy c -> (forall (a :: k). c a => f a -> f' a -> f'' a) -> Prod h f xs -> h f' xs -> h f'' xs
hczipWith3 :: forall {k} {l} h c (xs :: l) proxy f f' f'' f'''. (AllN (Prod h) c xs, HAp h, HAp (Prod h)) => proxy c -> (forall (a :: k). c a => f a -> f' a -> f'' a -> f''' a) -> Prod h f xs -> Prod h f' xs -> h f'' xs -> h f''' xs
type Injection (f :: k -> Type) (xs :: [k]) = f -.-> K NS f xs :: k -> Type
injections :: forall {k} (xs :: [k]) (f :: k -> Type). SListI xs => NP (Injection f xs) xs
shift :: forall {a1} (f :: a1 -> Type) (xs :: [a1]) (a2 :: a1) (x :: a1). Injection f xs a2 -> Injection f (x ': xs) a2
shiftInjection :: forall {a1} (f :: a1 -> Type) (xs :: [a1]) (a2 :: a1) (x :: a1). Injection f xs a2 -> Injection f (x ': xs) a2
type family UnProd (h :: k -> Type -> l -> Type) :: k -> Type -> l -> Type
class UnProd Prod h ~ h => HApInjs (h :: k -> Type -> l -> Type)
hapInjs :: forall (xs :: l) (f :: k -> Type). (HApInjs h, SListIN h xs) => Prod h f xs -> [h f xs]
apInjs_NP :: forall {k} (xs :: [k]) (f :: k -> Type). SListI xs => NP f xs -> [NS f xs]
apInjs_POP :: forall {k} (xss :: [[k]]) (f :: k -> Type). SListI xss => POP f xss -> [SOP f xss]
unZ :: forall {k} f (x :: k). NS f '[x] -> f x
class HIndex (h :: k -> Type -> l -> Type)
hindex :: forall (f :: k -> Type) (xs :: l). HIndex h => h f xs -> Int
type Ejection (f :: k -> Type) (xs :: [k]) = K NS f xs :: k -> Type -.-> Maybe :.: f
ejections :: forall {k} (xs :: [k]) (f :: k -> Type). SListI xs => NP (Ejection f xs) xs
shiftEjection :: forall {a1} (f :: a1 -> Type) (x :: a1) (xs :: [a1]) (a2 :: a1). Ejection f xs a2 -> Ejection f (x ': xs) a2
hcliftA' :: forall {k} (c :: k -> Constraint) (xss :: [[k]]) h proxy f f'. (All2 c xss, Prod h ~ (NP :: ([k] -> Type) -> [[k]] -> Type), HAp h) => proxy c -> (forall (xs :: [k]). All c xs => f xs -> f' xs) -> h f xss -> h f' xss
hcliftA2' :: forall {k} (c :: k -> Constraint) (xss :: [[k]]) h proxy f f' f''. (All2 c xss, Prod h ~ (NP :: ([k] -> Type) -> [[k]] -> Type), HAp h) => proxy c -> (forall (xs :: [k]). All c xs => f xs -> f' xs -> f'' xs) -> Prod h f xss -> h f' xss -> h f'' xss
hcliftA3' :: forall {k} (c :: k -> Constraint) (xss :: [[k]]) h proxy f f' f'' f'''. (All2 c xss, Prod h ~ (NP :: ([k] -> Type) -> [[k]] -> Type), HAp h) => proxy c -> (forall (xs :: [k]). All c xs => f xs -> f' xs -> f'' xs -> f''' xs) -> Prod h f xss -> Prod h f' xss -> h f'' xss -> h f''' xss
compare_NS :: forall {k} r f g (xs :: [k]). r -> (forall (x :: k). () => f x -> g x -> r) -> r -> NS f xs -> NS g xs -> r
ccompare_NS :: forall {k} c proxy r f g (xs :: [k]). All c xs => proxy c -> r -> (forall (x :: k). c x => f x -> g x -> r) -> r -> NS f xs -> NS g xs -> r
compare_SOP :: forall {k} r (f :: k -> Type) (g :: k -> Type) (xss :: [[k]]). r -> (forall (xs :: [k]). () => NP f xs -> NP g xs -> r) -> r -> SOP f xss -> SOP g xss -> r
ccompare_SOP :: forall {k} (c :: k -> Constraint) proxy r (f :: k -> Type) (g :: k -> Type) (xss :: [[k]]). All2 c xss => proxy c -> r -> (forall (xs :: [k]). All c xs => NP f xs -> NP g xs -> r) -> r -> SOP f xss -> SOP g xss -> r
type family CollapseTo (h :: k -> Type -> l -> Type) x
class HCollapse (h :: k -> Type -> l -> Type)
hcollapse :: forall (xs :: l) a. (HCollapse h, SListIN h xs) => h (K a :: k -> Type) xs -> CollapseTo h a
class HTraverse_ (h :: k -> Type -> l -> Type)
hctraverse_ :: forall c (xs :: l) g proxy f. (HTraverse_ h, AllN h c xs, Applicative g) => proxy c -> (forall (a :: k). c a => f a -> g ()) -> h f xs -> g ()
htraverse_ :: forall (xs :: l) g f. (HTraverse_ h, SListIN h xs, Applicative g) => (forall (a :: k). () => f a -> g ()) -> h f xs -> g ()
hcfoldMap :: forall {k} {l} h c (xs :: l) m proxy f. (HTraverse_ h, AllN h c xs, Monoid m) => proxy c -> (forall (a :: k). c a => f a -> m) -> h f xs -> m
hcfor_ :: forall {k} {l} h c (xs :: l) g proxy f. (HTraverse_ h, AllN h c xs, Applicative g) => proxy c -> h f xs -> (forall (a :: k). c a => f a -> g ()) -> g ()
class HAp h => HSequence (h :: k -> Type -> l -> Type)
hsequence' :: forall (xs :: l) f (g :: k -> Type). (HSequence h, SListIN h xs, Applicative f) => h (f :.: g) xs -> f (h g xs)
hctraverse' :: forall c (xs :: l) g proxy f f'. (HSequence h, AllN h c xs, Applicative g) => proxy c -> (forall (a :: k). c a => f a -> g (f' a)) -> h f xs -> g (h f' xs)
htraverse' :: forall (xs :: l) g f f'. (HSequence h, SListIN h xs, Applicative g) => (forall (a :: k). () => f a -> g (f' a)) -> h f xs -> g (h f' xs)
hsequence :: forall {l} h (xs :: l) f. (SListIN h xs, SListIN (Prod h) xs, HSequence h, Applicative f) => h f xs -> f (h I xs)
hsequenceK :: forall {k} {l} h (xs :: l) f a. (SListIN h xs, SListIN (Prod h) xs, Applicative f, HSequence h) => h (K (f a) :: k -> Type) xs -> f (h (K a :: k -> Type) xs)
hctraverse :: forall {l} h c (xs :: l) g proxy f. (HSequence h, AllN h c xs, Applicative g) => proxy c -> (forall a. c a => f a -> g a) -> h f xs -> g (h I xs)
hcfor :: forall {l} h c (xs :: l) g proxy f. (HSequence h, AllN h c xs, Applicative g) => proxy c -> h f xs -> (forall a. c a => f a -> g a) -> g (h I xs)
class HExpand (h :: k -> Type -> l -> Type)
hexpand :: forall (xs :: l) f. (HExpand h, SListIN (Prod h) xs) => (forall (x :: k). () => f x) -> h f xs -> Prod h f xs
hcexpand :: forall c (xs :: l) proxy f. (HExpand h, AllN (Prod h) c xs) => proxy c -> (forall (x :: k). c x => f x) -> h f xs -> Prod h f xs
class (Same h1 :: k2 -> Type -> l2 -> Type ~ h2, Same h2 :: k1 -> Type -> l1 -> Type ~ h1) => HTrans (h1 :: k1 -> Type -> l1 -> Type) (h2 :: k2 -> Type -> l2 -> Type)
htrans :: forall c (xs :: l1) (ys :: l2) proxy f g. (HTrans h1 h2, AllZipN (Prod h1) c xs ys) => proxy c -> (forall (x :: k1) (y :: k2). c x y => f x -> g y) -> h1 f xs -> h2 g ys
hcoerce :: forall (f :: k1 -> Type) (g :: k2 -> Type) (xs :: l1) (ys :: l2). (HTrans h1 h2, AllZipN (Prod h1) (LiftedCoercible f g) xs ys) => h1 f xs -> h2 g ys
hfromI :: forall {l1} {k2} {l2} h1 (f :: k2 -> Type) (xs :: l1) (ys :: l2) h2. (AllZipN (Prod h1) (LiftedCoercible I f) xs ys, HTrans h1 h2) => h1 I xs -> h2 f ys
htoI :: forall {k1} {l1} {l2} h1 (f :: k1 -> Type) (xs :: l1) (ys :: l2) h2. (AllZipN (Prod h1) (LiftedCoercible f I) xs ys, HTrans h1 h2) => h1 f xs -> h2 I ys
fromList :: forall {k} (xs :: [k]) a. SListI xs => [a] -> Maybe (NP (K a :: k -> Type) xs)
newtype K a (b :: k)
K :: a -> K a (b :: k)
unK :: forall {k} a (b :: k). K a b -> a
newtype I a
I :: a -> I a
unI :: I a -> a
newtype ( (f :: l -> Type) :.: (g :: k -> l) ) (p :: k)
Comp :: f (g p) -> (:.:) (f :: l -> Type) (g :: k -> l) (p :: k)
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
class (AllF c xs, SListI xs) => All (c :: k -> Constraint) (xs :: [k])
type All2 (c :: k -> Constraint) = All All c
cpara_SList :: All c xs => proxy c -> r ('[] :: [k]) -> (forall (y :: k) (ys :: [k]). (c y, All c ys) => r ys -> r (y ': ys)) -> r xs
ccase_SList :: forall {a} c (xs :: [a]) proxy r. All c xs => proxy c -> r ('[] :: [a]) -> (forall (y :: a) (ys :: [a]). (c y, All c ys) => r (y ': ys)) -> r xs
class (SListI xs, SListI ys, SameShapeAs xs ys, SameShapeAs ys xs, AllZipF c xs ys) => AllZip (c :: a -> b -> Constraint) (xs :: [a]) (ys :: [b])
class (AllZipF AllZip f xss yss, SListI xss, SListI yss, SameShapeAs xss yss, SameShapeAs yss xss) => AllZip2 (f :: a -> b -> Constraint) (xss :: [[a]]) (yss :: [[b]])
type family AllN (h :: k -> Type -> l -> Type) (c :: k -> Constraint) :: l -> Constraint
type family AllZipN (h :: k -> Type -> l -> Type) (c :: k1 -> k2 -> Constraint) :: l1 -> l2 -> Constraint
class f g x => Compose (f :: k -> Constraint) (g :: k1 -> k) (x :: k1)
class (f x, g x) => And (f :: k -> Constraint) (g :: k -> Constraint) (x :: k)
class Top (x :: k)
class Coercible f x g y => LiftedCoercible (f :: k -> k1) (g :: k2 -> k1) (x :: k) (y :: k2)
type family SameShapeAs (xs :: [a]) (ys :: [b])
data SList (a :: [k])
[SNil] :: forall {k}. SList ('[] :: [k])
[SCons] :: forall {k} (xs :: [k]) (x :: k). SListI xs => SList (x ': xs)
type SListI = All Top :: k -> Constraint
type SListI2 = All SListI :: [k] -> Constraint
sList :: forall {k} (xs :: [k]). SListI xs => SList xs
para_SList :: forall {a} (xs :: [a]) r. SListI xs => r ('[] :: [a]) -> (forall (y :: a) (ys :: [a]). SListI ys => r ys -> r (y ': ys)) -> r xs
case_SList :: forall {a} (xs :: [a]) r. SListI xs => r ('[] :: [a]) -> (forall (y :: a) (ys :: [a]). SListI ys => r (y ': ys)) -> r xs
data Shape (a :: [k])
[ShapeNil] :: forall {k}. Shape ('[] :: [k])
[ShapeCons] :: forall {k} (xs :: [k]) (x :: k). SListI xs => Shape xs -> Shape (x ': xs)
shape :: forall k (xs :: [k]). SListI xs => Shape xs
lengthSList :: forall k (xs :: [k]) proxy. SListI xs => proxy xs -> Int
data Proxy (t :: k)
Proxy :: Proxy (t :: k)
