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


-- | Constraint-based generics
--   
--   Write short and concise generic instances of type classes. one-liner
--   is particularly useful for writing default implementations of type
--   class methods.
@package one-liner
@version 1.0


module Generics.OneLiner.Classes

-- | A generic function using a <a>GenericRecordProfunctor</a> works on any
--   data type with exactly one constructor, a.k.a. records, with multiple
--   fields (<a>mult</a>) or no fields (<a>unit</a>).
--   
--   <a>GenericRecordProfunctor</a> is similar to <tt>ProductProfuctor</tt>
--   from the product-profunctor package, but using types from
--   GHC.Generics.
class (Profunctor p, GenericUnitProfunctor p, GenericProductProfunctor p) => GenericRecordProfunctor p

-- | A generic function using a <a>GenericNonEmptyProfunctor</a> works on
--   any data type with at least one constructor.
class (GenericRecordProfunctor p, GenericSumProfunctor p) => GenericNonEmptyProfunctor p

-- | A generic function using a <a>GenericProfunctor</a> works on any
--   algebraic data type, including those with no constructors and
--   constants.
class (GenericNonEmptyProfunctor p, GenericEmptyProfunctor p) => GenericProfunctor p
class Profunctor p => GenericUnitProfunctor p
unit :: GenericUnitProfunctor p => p (U1 a) (U1 a')
class Profunctor p => GenericProductProfunctor p
mult :: GenericProductProfunctor p => p (f a) (f' a') -> p (g a) (g' a') -> p ((f :*: g) a) ((f' :*: g') a')
class Profunctor p => GenericSumProfunctor p
plus :: GenericSumProfunctor p => p (f a) (f' a') -> p (g a) (g' a') -> p ((f :+: g) a) ((f' :+: g') a')
class Profunctor p => GenericEmptyProfunctor p
identity :: GenericEmptyProfunctor p => p a a
zero :: GenericEmptyProfunctor p => p (V1 a) (V1 a')
newtype Zip f a b
Zip :: a -> a -> f b -> Zip f a b
[runZip] :: Zip f a b -> a -> a -> f b
absurd :: V1 a -> b
e1 :: (f a -> b) -> (g a -> b) -> (f :+: g) a -> b
fst1 :: (f :*: g) a -> f a
snd1 :: (f :*: g) a -> g a
instance GHC.Base.Functor f => Data.Profunctor.Unsafe.Profunctor (Generics.OneLiner.Classes.Zip f)
instance GHC.Base.Applicative f => Generics.OneLiner.Classes.GenericUnitProfunctor (Generics.OneLiner.Classes.Zip f)
instance GHC.Base.Applicative f => Generics.OneLiner.Classes.GenericProductProfunctor (Generics.OneLiner.Classes.Zip f)
instance GHC.Base.Alternative f => Generics.OneLiner.Classes.GenericSumProfunctor (Generics.OneLiner.Classes.Zip f)
instance GHC.Base.Alternative f => Generics.OneLiner.Classes.GenericEmptyProfunctor (Generics.OneLiner.Classes.Zip f)
instance (Generics.OneLiner.Classes.GenericNonEmptyProfunctor p, Generics.OneLiner.Classes.GenericEmptyProfunctor p) => Generics.OneLiner.Classes.GenericProfunctor p
instance Generics.OneLiner.Classes.GenericEmptyProfunctor (->)
instance GHC.Base.Applicative f => Generics.OneLiner.Classes.GenericEmptyProfunctor (Data.Profunctor.Types.Star f)
instance GHC.Base.Alternative f => Generics.OneLiner.Classes.GenericEmptyProfunctor (Data.Bifunctor.Joker.Joker f)
instance Data.Functor.Contravariant.Divisible.Decidable f => Generics.OneLiner.Classes.GenericEmptyProfunctor (Data.Bifunctor.Clown.Clown f)
instance (Generics.OneLiner.Classes.GenericEmptyProfunctor p, Generics.OneLiner.Classes.GenericEmptyProfunctor q) => Generics.OneLiner.Classes.GenericEmptyProfunctor (Data.Bifunctor.Product.Product p q)
instance (GHC.Base.Applicative f, Generics.OneLiner.Classes.GenericEmptyProfunctor p) => Generics.OneLiner.Classes.GenericEmptyProfunctor (Data.Bifunctor.Tannen.Tannen f p)
instance (Generics.OneLiner.Classes.GenericRecordProfunctor p, Generics.OneLiner.Classes.GenericSumProfunctor p) => Generics.OneLiner.Classes.GenericNonEmptyProfunctor p
instance Generics.OneLiner.Classes.GenericSumProfunctor (->)
instance GHC.Base.Applicative f => Generics.OneLiner.Classes.GenericSumProfunctor (Data.Profunctor.Types.Star f)
instance GHC.Base.Alternative f => Generics.OneLiner.Classes.GenericSumProfunctor (Data.Bifunctor.Joker.Joker f)
instance Data.Functor.Contravariant.Divisible.Decidable f => Generics.OneLiner.Classes.GenericSumProfunctor (Data.Bifunctor.Clown.Clown f)
instance (Generics.OneLiner.Classes.GenericSumProfunctor p, Generics.OneLiner.Classes.GenericSumProfunctor q) => Generics.OneLiner.Classes.GenericSumProfunctor (Data.Bifunctor.Product.Product p q)
instance (GHC.Base.Applicative f, Generics.OneLiner.Classes.GenericSumProfunctor p) => Generics.OneLiner.Classes.GenericSumProfunctor (Data.Bifunctor.Tannen.Tannen f p)
instance (Data.Profunctor.Unsafe.Profunctor p, Generics.OneLiner.Classes.GenericUnitProfunctor p, Generics.OneLiner.Classes.GenericProductProfunctor p) => Generics.OneLiner.Classes.GenericRecordProfunctor p
instance Generics.OneLiner.Classes.GenericProductProfunctor (->)
instance Generics.OneLiner.Classes.GenericProductProfunctor Data.Tagged.Tagged
instance GHC.Base.Applicative f => Generics.OneLiner.Classes.GenericProductProfunctor (Data.Profunctor.Types.Star f)
instance GHC.Base.Functor f => Generics.OneLiner.Classes.GenericProductProfunctor (Data.Profunctor.Types.Costar f)
instance (GHC.Base.Functor f, GHC.Base.Applicative g, Data.Profunctor.Unsafe.Profunctor p, Generics.OneLiner.Classes.GenericProductProfunctor p) => Generics.OneLiner.Classes.GenericProductProfunctor (Data.Bifunctor.Biff.Biff p f g)
instance GHC.Base.Applicative f => Generics.OneLiner.Classes.GenericProductProfunctor (Data.Bifunctor.Joker.Joker f)
instance Data.Functor.Contravariant.Divisible.Divisible f => Generics.OneLiner.Classes.GenericProductProfunctor (Data.Bifunctor.Clown.Clown f)
instance (Generics.OneLiner.Classes.GenericProductProfunctor p, Generics.OneLiner.Classes.GenericProductProfunctor q) => Generics.OneLiner.Classes.GenericProductProfunctor (Data.Bifunctor.Product.Product p q)
instance (GHC.Base.Applicative f, Generics.OneLiner.Classes.GenericProductProfunctor p) => Generics.OneLiner.Classes.GenericProductProfunctor (Data.Bifunctor.Tannen.Tannen f p)
instance Generics.OneLiner.Classes.GenericUnitProfunctor (->)
instance Generics.OneLiner.Classes.GenericUnitProfunctor Data.Tagged.Tagged
instance GHC.Base.Applicative f => Generics.OneLiner.Classes.GenericUnitProfunctor (Data.Profunctor.Types.Star f)
instance GHC.Base.Functor f => Generics.OneLiner.Classes.GenericUnitProfunctor (Data.Profunctor.Types.Costar f)
instance (GHC.Base.Functor f, GHC.Base.Applicative g, Data.Profunctor.Unsafe.Profunctor p, Generics.OneLiner.Classes.GenericUnitProfunctor p) => Generics.OneLiner.Classes.GenericUnitProfunctor (Data.Bifunctor.Biff.Biff p f g)
instance GHC.Base.Applicative f => Generics.OneLiner.Classes.GenericUnitProfunctor (Data.Bifunctor.Joker.Joker f)
instance Data.Functor.Contravariant.Divisible.Divisible f => Generics.OneLiner.Classes.GenericUnitProfunctor (Data.Bifunctor.Clown.Clown f)
instance (Generics.OneLiner.Classes.GenericUnitProfunctor p, Generics.OneLiner.Classes.GenericUnitProfunctor q) => Generics.OneLiner.Classes.GenericUnitProfunctor (Data.Bifunctor.Product.Product p q)
instance (GHC.Base.Applicative f, Generics.OneLiner.Classes.GenericUnitProfunctor p) => Generics.OneLiner.Classes.GenericUnitProfunctor (Data.Bifunctor.Tannen.Tannen f p)


module Generics.OneLiner.Internal
type ADT' = ADT_ Identity Proxy ADTProfunctor
type ADTNonEmpty' = ADT_ Identity Proxy NonEmptyProfunctor
type ADTRecord' = ADT_ Identity Proxy RecordProfunctor
type ADT1' t t' = (ADT_ Identity Identity ADTProfunctor t t', ADT_ Proxy Identity ADTProfunctor t t')
type ADTNonEmpty1' t t' = (ADT_ Identity Identity NonEmptyProfunctor t t', ADT_ Proxy Identity NonEmptyProfunctor t t')
type ADTRecord1' t t' = (ADT_ Identity Identity RecordProfunctor t t', ADT_ Proxy Identity RecordProfunctor t t')
type ADTProfunctor = GenericEmptyProfunctor : NonEmptyProfunctor
type NonEmptyProfunctor = GenericSumProfunctor : RecordProfunctor
type RecordProfunctor = '[GenericProductProfunctor, GenericUnitProfunctor, Profunctor]
class (ks :: [(* -> * -> *) -> Constraint]) |- (k :: (* -> * -> *) -> Constraint)
(|-) :: ((|-) ks k, Satisfies p ks) => proxy0 ks -> proxy1 k -> (k p => p a b) -> p a b
generic' :: forall t t' c p ks a b proxy0 for. (ADT_ Identity Proxy ks t t', Constraints' t t' c AnyType, Satisfies p ks) => proxy0 ks -> for c -> (forall s s'. c s s' => p s s') -> p (t a) (t' b)
generic1' :: forall t t' c1 p ks a b proxy0 for. (ADT_ Proxy Identity ks t t', Constraints' t t' AnyType c1, Satisfies p ks) => proxy0 ks -> for c1 -> (forall s s' d e. c1 s s' => p d e -> p (s d) (s' e)) -> p a b -> p (t a) (t' b)
generic01' :: forall t t' c0 c1 p ks a b proxy0 for for1. (ADT_ Identity Identity ks t t', Constraints' t t' c0 c1, Satisfies p ks) => proxy0 ks -> for c0 -> (forall s s'. c0 s s' => p s s') -> for1 c1 -> (forall s s' d e. c1 s s' => p d e -> p (s d) (s' e)) -> p a b -> p (t a) (t' b)
class ADT_ (nullary :: * -> *) (unary :: * -> *) (ks :: [(* -> * -> *) -> Constraint]) (t :: * -> *) (t' :: * -> *)
generic_ :: (ADT_ nullary unary ks t t', Constraints' t t' c c1, Satisfies p ks) => proxy0 ks -> proxy1 nullary -> for c -> (forall s s'. c s s' => nullary (p s s')) -> for1 c1 -> (forall r1 s1 d e. c1 r1 s1 => unary (p d e -> p (r1 d) (s1 e))) -> unary (p a b) -> p (t a) (t' b)
data Ctor a b
Ctor :: a -> Int -> Int -> Ctor a b
[index] :: Ctor a b -> a -> Int
[count] :: Ctor a b -> Int
record :: forall c p t t'. (ADTRecord t t', Constraints t t' c, GenericRecordProfunctor p) => (forall s s'. c s s' => p s s') -> p t t'
record1 :: forall c p t t' a b. (ADTRecord1 t t', Constraints1 t t' c, GenericRecordProfunctor p) => (forall d e s s'. c s s' => p d e -> p (s d) (s' e)) -> p a b -> p (t a) (t' b)
record01 :: forall c0 c1 p t t' a b. (ADTRecord1 t t', Constraints01 t t' c0 c1, GenericRecordProfunctor p) => (forall s s'. c0 s s' => p s s') -> (forall d e s s'. c1 s s' => p d e -> p (s d) (s' e)) -> p a b -> p (t a) (t' b)
nonEmpty :: forall c p t t'. (ADTNonEmpty t t', Constraints t t' c, GenericNonEmptyProfunctor p) => (forall s s'. c s s' => p s s') -> p t t'
nonEmpty1 :: forall c p t t' a b. (ADTNonEmpty1 t t', Constraints1 t t' c, GenericNonEmptyProfunctor p) => (forall d e s s'. c s s' => p d e -> p (s d) (s' e)) -> p a b -> p (t a) (t' b)
nonEmpty01 :: forall c0 c1 p t t' a b. (ADTNonEmpty1 t t', Constraints01 t t' c0 c1, GenericNonEmptyProfunctor p) => (forall s s'. c0 s s' => p s s') -> (forall d e s s'. c1 s s' => p d e -> p (s d) (s' e)) -> p a b -> p (t a) (t' b)
generic :: forall c p t t'. (ADT t t', Constraints t t' c, GenericProfunctor p) => (forall s s'. c s s' => p s s') -> p t t'
generic1 :: forall c p t t' a b. (ADT1 t t', Constraints1 t t' c, GenericProfunctor p) => (forall d e s s'. c s s' => p d e -> p (s d) (s' e)) -> p a b -> p (t a) (t' b)
generic01 :: forall c0 c1 p t t' a b. (ADT1 t t', Constraints01 t t' c0 c1, GenericProfunctor p) => (forall s s'. c0 s s' => p s s') -> (forall d e s s'. c1 s s' => p d e -> p (s d) (s' e)) -> p a b -> p (t a) (t' b)

-- | <a>Constraints</a> is a constraint type synonym, containing the
--   constraint requirements for an instance for <tt>t</tt> of class
--   <tt>c</tt>. It requires an instance of class <tt>c</tt> for each
--   component of <tt>t</tt>.
type Constraints t t' c = Constraints' (Rep t) (Rep t') c AnyType
type Constraints1 t t' c = Constraints' (Rep1 t) (Rep1 t') AnyType c
type Constraints01 t t' c0 c1 = Constraints' (Rep1 t) (Rep1 t') c0 c1

-- | <a>ADTRecord</a> is a constraint type synonym. An instance is an
--   <a>ADT</a> with *exactly* one constructor.
type ADTRecord t t' = (Generic t, Generic t', ADTRecord' (Rep t) (Rep t'), Constraints t t' AnyType)
type ADTRecord1 t t' = (Generic1 t, Generic1 t', ADTRecord1' (Rep1 t) (Rep1 t'), Constraints1 t t' AnyType)

-- | <a>ADTNonEmpty</a> is a constraint type synonym. An instance is an
--   <a>ADT</a> with *at least* one constructor.
type ADTNonEmpty t t' = (Generic t, Generic t', ADTNonEmpty' (Rep t) (Rep t'), Constraints t t' AnyType)
type ADTNonEmpty1 t t' = (Generic1 t, Generic1 t', ADTNonEmpty1' (Rep1 t) (Rep1 t'), Constraints1 t t' AnyType)

-- | <a>ADT</a> is a constraint type synonym. The <a>Generic</a> instance
--   can be derived, and any generic representation will be an instance of
--   <a>ADT'</a> and <a>AnyType</a>.
type ADT t t' = (Generic t, Generic t', ADT' (Rep t) (Rep t'), Constraints t t' AnyType)
type ADT1 t t' = (Generic1 t, Generic1 t', ADT1' (Rep1 t) (Rep1 t'), Constraints1 t t' AnyType)
class AnyType a b

-- | The result type of a curried function.
--   
--   If <tt>r</tt> is not a function type (i.e., does not unify with `_
--   -&gt; _`):
--   
--   <pre>
--   <a>FunResult</a> (a -&gt; r) ~ r
--   <a>FunResult</a> (a -&gt; b -&gt; r) ~ r
--   <a>FunResult</a> (a -&gt; b -&gt; c -&gt; r) ~ r
--   </pre>

-- | Automatically apply a lifted function to a polymorphic argument as
--   many times as possible.
--   
--   A constraint `FunConstraint c t` is equivalent to the conjunction of
--   constraints `c s` for every argument type of <tt>t</tt>.
--   
--   If <tt>r</tt> is not a function type:
--   
--   <pre>
--   c a :- FunConstraints c (a -&gt; r)
--   (c a, c b) :- FunConstraints c (a -&gt; b -&gt; r)
--   (c a, c b, c d) :- FunConstraints c (a -&gt; b -&gt; d -&gt; r)
--   </pre>
class FunConstraints c t
autoApply :: (FunConstraints c t, Applicative f) => (forall s. c s => f s) -> f t -> f (FunResult t)
data Pair a
Pair :: a -> a -> Pair a
(.:) :: (c -> d) -> (a -> b -> c) -> (a -> b -> d)
infixr 9 .:
instance GHC.Base.Functor Generics.OneLiner.Internal.Pair
instance (c a, Generics.OneLiner.Internal.FunConstraints c b) => Generics.OneLiner.Internal.FunConstraints c (a -> b)
instance (Generics.OneLiner.Internal.FunResult r ~ r) => Generics.OneLiner.Internal.FunConstraints c r
instance forall k1 k2 (a :: k2) (b :: k1). Generics.OneLiner.Internal.AnyType a b
instance Data.Profunctor.Unsafe.Profunctor Generics.OneLiner.Internal.Ctor
instance Generics.OneLiner.Classes.GenericUnitProfunctor Generics.OneLiner.Internal.Ctor
instance Generics.OneLiner.Classes.GenericProductProfunctor Generics.OneLiner.Internal.Ctor
instance Generics.OneLiner.Classes.GenericSumProfunctor Generics.OneLiner.Internal.Ctor
instance Generics.OneLiner.Classes.GenericEmptyProfunctor Generics.OneLiner.Internal.Ctor
instance (ks Generics.OneLiner.Internal.|- Generics.OneLiner.Classes.GenericEmptyProfunctor) => Generics.OneLiner.Internal.ADT_ nullary unary ks GHC.Generics.V1 GHC.Generics.V1
instance (ks Generics.OneLiner.Internal.|- Generics.OneLiner.Classes.GenericUnitProfunctor) => Generics.OneLiner.Internal.ADT_ nullary unary ks GHC.Generics.U1 GHC.Generics.U1
instance (ks Generics.OneLiner.Internal.|- Generics.OneLiner.Classes.GenericSumProfunctor, Generics.OneLiner.Internal.ADT_ nullary unary ks f f', Generics.OneLiner.Internal.ADT_ nullary unary ks g g') => Generics.OneLiner.Internal.ADT_ nullary unary ks (f GHC.Generics.:+: g) (f' GHC.Generics.:+: g')
instance (ks Generics.OneLiner.Internal.|- Generics.OneLiner.Classes.GenericProductProfunctor, Generics.OneLiner.Internal.ADT_ nullary unary ks f f', Generics.OneLiner.Internal.ADT_ nullary unary ks g g') => Generics.OneLiner.Internal.ADT_ nullary unary ks (f GHC.Generics.:*: g) (f' GHC.Generics.:*: g')
instance (ks Generics.OneLiner.Internal.|- Data.Profunctor.Unsafe.Profunctor) => Generics.OneLiner.Internal.ADT_ Data.Functor.Identity.Identity unary ks (GHC.Generics.K1 i v) (GHC.Generics.K1 i' v')
instance (ks Generics.OneLiner.Internal.|- Generics.OneLiner.Classes.GenericEmptyProfunctor) => Generics.OneLiner.Internal.ADT_ Data.Proxy.Proxy unary ks (GHC.Generics.K1 i v) (GHC.Generics.K1 i' v)
instance (ks Generics.OneLiner.Internal.|- Data.Profunctor.Unsafe.Profunctor, Generics.OneLiner.Internal.ADT_ nullary unary ks f f') => Generics.OneLiner.Internal.ADT_ nullary unary ks (GHC.Generics.M1 i c f) (GHC.Generics.M1 i' c' f')
instance (ks Generics.OneLiner.Internal.|- Data.Profunctor.Unsafe.Profunctor, Generics.OneLiner.Internal.ADT_ nullary Data.Functor.Identity.Identity ks g g') => Generics.OneLiner.Internal.ADT_ nullary Data.Functor.Identity.Identity ks (f GHC.Generics.:.: g) (f' GHC.Generics.:.: g')
instance (ks Generics.OneLiner.Internal.|- Data.Profunctor.Unsafe.Profunctor) => Generics.OneLiner.Internal.ADT_ nullary Data.Functor.Identity.Identity ks GHC.Generics.Par1 GHC.Generics.Par1
instance (ks Generics.OneLiner.Internal.|- Data.Profunctor.Unsafe.Profunctor) => Generics.OneLiner.Internal.ADT_ nullary Data.Functor.Identity.Identity ks (GHC.Generics.Rec1 f) (GHC.Generics.Rec1 f')
instance (ks Generics.OneLiner.Internal.|- k) => (_k : ks) Generics.OneLiner.Internal.|- k
instance (k : _ks) Generics.OneLiner.Internal.|- k


-- | These generic functions allow changing the types of the constant
--   leaves. They require type classes with 2 parameters, the first for the
--   input type and the second for the output type.
--   
--   All functions without postfix are for instances of <a>Generic</a>, and
--   functions with postfix <tt>1</tt> are for instances of <a>Generic1</a>
--   (with kind <tt>* -&gt; *</tt>) which get an extra argument to specify
--   how to deal with the parameter. Functions with postfix <tt>01</tt> are
--   also for <a>Generic1</a> but they get yet another argument that, like
--   the <a>Generic</a> functions, allows handling of constant leaves.
module Generics.OneLiner.Binary

-- | Map over a structure, updating each component.
--   
--   <a>gmap</a> is <a>generic</a> specialized to <tt>(-&gt;)</tt>.
gmap :: forall c t t'. (ADT t t', Constraints t t' c) => (forall s s'. c s s' => s -> s') -> t -> t'

-- | Map each component of a structure to an action, evaluate these actions
--   from left to right, and collect the results.
--   
--   <a>gtraverse</a> is <a>generic</a> specialized to <a>Star</a>.
gtraverse :: forall c t t' f. (ADT t t', Constraints t t' c, Applicative f) => (forall s s'. c s s' => s -> f s') -> t -> f t'

-- | <a>gmap1</a> is <a>generic1</a> specialized to <tt>(-&gt;)</tt>.
gmap1 :: forall c t t' a b. (ADT1 t t', Constraints1 t t' c) => (forall d e s s'. c s s' => (d -> e) -> s d -> s' e) -> (a -> b) -> t a -> t' b

-- | <a>gtraverse1</a> is <a>generic1</a> specialized to <a>Star</a>.
gtraverse1 :: forall c t t' f a b. (ADT1 t t', Constraints1 t t' c, Applicative f) => (forall d e s s'. c s s' => (d -> f e) -> s d -> f (s' e)) -> (a -> f b) -> t a -> f (t' b)

-- | Combine two values by combining each component of the structures with
--   the given function, under an applicative effect. Returns <a>empty</a>
--   if the constructors don't match.
--   
--   <a>zipWithA</a> is <a>generic</a> specialized to <a>Zip</a>
zipWithA :: forall c t t' f. (ADT t t', Constraints t t' c, Alternative f) => (forall s s'. c s s' => s -> s -> f s') -> t -> t -> f t'

-- | <a>zipWithA1</a> is <a>generic1</a> specialized to <a>Zip</a>
zipWithA1 :: forall c t t' f a b. (ADT1 t t', Constraints1 t t' c, Alternative f) => (forall d e s s'. c s s' => (d -> d -> f e) -> s d -> s d -> f (s' e)) -> (a -> a -> f b) -> t a -> t a -> f (t' b)

-- | Implement a unary operator by calling the operator on the components.
--   This is here for consistency, it is the same as <a>record</a>.
--   
--   <pre>
--   <a>negate</a> = <a>unaryOp</a> @<a>Num</a> <a>negate</a>
--   </pre>
unaryOp :: forall c t t'. (ADTRecord t t', Constraints t t' c) => (forall s s'. c s s' => s -> s') -> t -> t'

-- | Implement a binary operator by calling the operator on the components.
--   
--   <pre>
--   <a>mappend</a> = <a>binaryOp</a> @<a>Monoid</a> <a>mappend</a>
--   (<a>+</a>) = <a>binaryOp</a> @<a>Num</a> (<a>+</a>)
--   </pre>
--   
--   <a>binaryOp</a> is <a>algebra</a> specialized to pairs.
binaryOp :: forall c t t'. (ADTRecord t t', Constraints t t' c) => (forall s s'. c s s' => s -> s -> s') -> t -> t -> t'

-- | Create an F-algebra, given an F-algebra for each of the components.
--   
--   <pre>
--   <a>binaryOp</a> f l r = <a>algebra</a> @c (\(Pair a b) -&gt; f a b) (Pair l r)
--   </pre>
--   
--   <a>algebra</a> is <a>record</a> specialized to <a>Costar</a>.
algebra :: forall c t t' f. (ADTRecord t t', Constraints t t' c, Functor f) => (forall s s'. c s s' => f s -> s') -> f t -> t'

-- | <a>dialgebra</a> is <a>record</a> specialized to <tt><a>Biff</a>
--   (-&gt;)</tt>.
dialgebra :: forall c t t' f g. (ADTRecord t t', Constraints t t' c, Functor f, Applicative g) => (forall s s'. c s s' => f s -> g s') -> f t -> g t'

-- | <a>gcotraverse1</a> is <a>record1</a> specialized to <a>Costar</a>.
gcotraverse1 :: forall c t t' f a b. (ADTRecord1 t t', Constraints1 t t' c, Functor f) => (forall d e s s'. c s s' => (f d -> e) -> f (s d) -> s' e) -> (f a -> b) -> f (t a) -> t' b
record :: forall c p t t'. (ADTRecord t t', Constraints t t' c, GenericRecordProfunctor p) => (forall s s'. c s s' => p s s') -> p t t'
nonEmpty :: forall c p t t'. (ADTNonEmpty t t', Constraints t t' c, GenericNonEmptyProfunctor p) => (forall s s'. c s s' => p s s') -> p t t'
generic :: forall c p t t'. (ADT t t', Constraints t t' c, GenericProfunctor p) => (forall s s'. c s s' => p s s') -> p t t'
record1 :: forall c p t t' a b. (ADTRecord1 t t', Constraints1 t t' c, GenericRecordProfunctor p) => (forall d e s s'. c s s' => p d e -> p (s d) (s' e)) -> p a b -> p (t a) (t' b)
nonEmpty1 :: forall c p t t' a b. (ADTNonEmpty1 t t', Constraints1 t t' c, GenericNonEmptyProfunctor p) => (forall d e s s'. c s s' => p d e -> p (s d) (s' e)) -> p a b -> p (t a) (t' b)
generic1 :: forall c p t t' a b. (ADT1 t t', Constraints1 t t' c, GenericProfunctor p) => (forall d e s s'. c s s' => p d e -> p (s d) (s' e)) -> p a b -> p (t a) (t' b)
record01 :: forall c0 c1 p t t' a b. (ADTRecord1 t t', Constraints01 t t' c0 c1, GenericRecordProfunctor p) => (forall s s'. c0 s s' => p s s') -> (forall d e s s'. c1 s s' => p d e -> p (s d) (s' e)) -> p a b -> p (t a) (t' b)
nonEmpty01 :: forall c0 c1 p t t' a b. (ADTNonEmpty1 t t', Constraints01 t t' c0 c1, GenericNonEmptyProfunctor p) => (forall s s'. c0 s s' => p s s') -> (forall d e s s'. c1 s s' => p d e -> p (s d) (s' e)) -> p a b -> p (t a) (t' b)
generic01 :: forall c0 c1 p t t' a b. (ADT1 t t', Constraints01 t t' c0 c1, GenericProfunctor p) => (forall s s'. c0 s s' => p s s') -> (forall d e s s'. c1 s s' => p d e -> p (s d) (s' e)) -> p a b -> p (t a) (t' b)

-- | A generic function using a <a>GenericRecordProfunctor</a> works on any
--   data type with exactly one constructor, a.k.a. records, with multiple
--   fields (<a>mult</a>) or no fields (<a>unit</a>).
--   
--   <a>GenericRecordProfunctor</a> is similar to <tt>ProductProfuctor</tt>
--   from the product-profunctor package, but using types from
--   GHC.Generics.
class (Profunctor p, GenericUnitProfunctor p, GenericProductProfunctor p) => GenericRecordProfunctor p

-- | A generic function using a <a>GenericNonEmptyProfunctor</a> works on
--   any data type with at least one constructor.
class (GenericRecordProfunctor p, GenericSumProfunctor p) => GenericNonEmptyProfunctor p

-- | A generic function using a <a>GenericProfunctor</a> works on any
--   algebraic data type, including those with no constructors and
--   constants.
class (GenericNonEmptyProfunctor p, GenericEmptyProfunctor p) => GenericProfunctor p
class Profunctor p => GenericUnitProfunctor p
unit :: GenericUnitProfunctor p => p (U1 a) (U1 a')
class Profunctor p => GenericProductProfunctor p
mult :: GenericProductProfunctor p => p (f a) (f' a') -> p (g a) (g' a') -> p ((f :*: g) a) ((f' :*: g') a')
class Profunctor p => GenericSumProfunctor p
plus :: GenericSumProfunctor p => p (f a) (f' a') -> p (g a) (g' a') -> p ((f :+: g) a) ((f' :+: g') a')
class Profunctor p => GenericEmptyProfunctor p
identity :: GenericEmptyProfunctor p => p a a
zero :: GenericEmptyProfunctor p => p (V1 a) (V1 a')

-- | <a>ADT</a> is a constraint type synonym. The <a>Generic</a> instance
--   can be derived, and any generic representation will be an instance of
--   <a>ADT'</a> and <a>AnyType</a>.
type ADT t t' = (Generic t, Generic t', ADT' (Rep t) (Rep t'), Constraints t t' AnyType)

-- | <a>ADTNonEmpty</a> is a constraint type synonym. An instance is an
--   <a>ADT</a> with *at least* one constructor.
type ADTNonEmpty t t' = (Generic t, Generic t', ADTNonEmpty' (Rep t) (Rep t'), Constraints t t' AnyType)

-- | <a>ADTRecord</a> is a constraint type synonym. An instance is an
--   <a>ADT</a> with *exactly* one constructor.
type ADTRecord t t' = (Generic t, Generic t', ADTRecord' (Rep t) (Rep t'), Constraints t t' AnyType)

-- | <a>Constraints</a> is a constraint type synonym, containing the
--   constraint requirements for an instance for <tt>t</tt> of class
--   <tt>c</tt>. It requires an instance of class <tt>c</tt> for each
--   component of <tt>t</tt>.
type Constraints t t' c = Constraints' (Rep t) (Rep t') c AnyType
type ADT1 t t' = (Generic1 t, Generic1 t', ADT1' (Rep1 t) (Rep1 t'), Constraints1 t t' AnyType)
type ADTNonEmpty1 t t' = (Generic1 t, Generic1 t', ADTNonEmpty1' (Rep1 t) (Rep1 t'), Constraints1 t t' AnyType)
type ADTRecord1 t t' = (Generic1 t, Generic1 t', ADTRecord1' (Rep1 t) (Rep1 t'), Constraints1 t t' AnyType)
type Constraints1 t t' c = Constraints' (Rep1 t) (Rep1 t') AnyType c
type Constraints01 t t' c0 c1 = Constraints' (Rep1 t) (Rep1 t') c0 c1

-- | Automatically apply a lifted function to a polymorphic argument as
--   many times as possible.
--   
--   A constraint `FunConstraint c t` is equivalent to the conjunction of
--   constraints `c s` for every argument type of <tt>t</tt>.
--   
--   If <tt>r</tt> is not a function type:
--   
--   <pre>
--   c a :- FunConstraints c (a -&gt; r)
--   (c a, c b) :- FunConstraints c (a -&gt; b -&gt; r)
--   (c a, c b, c d) :- FunConstraints c (a -&gt; b -&gt; d -&gt; r)
--   </pre>
class FunConstraints c t

-- | The result type of a curried function.
--   
--   If <tt>r</tt> is not a function type (i.e., does not unify with `_
--   -&gt; _`):
--   
--   <pre>
--   <a>FunResult</a> (a -&gt; r) ~ r
--   <a>FunResult</a> (a -&gt; b -&gt; r) ~ r
--   <a>FunResult</a> (a -&gt; b -&gt; c -&gt; r) ~ r
--   </pre>
class AnyType a b


module Generics.OneLiner.Internal.Unary

-- | Type-level <tt>join</tt>, of kind <tt>(k -&gt; k -&gt; k') -&gt; k
--   -&gt; k'</tt>.
type J f a = f a a

-- | Constraint-level <tt>duplicate</tt>, of kind <tt>(k -&gt; Constraint)
--   -&gt; k -&gt; k -&gt; Constraint</tt>.
class (c a, a ~ b) => D (c :: k -> Constraint) a b
type Constraints t c = Constraints t t (D c)
type Constraints1 t c = Constraints1 t t (D c)
type Constraints01 t c0 c1 = Constraints01 t t (D c0) (D c1)
type Constraints' t c c1 = Constraints' t t (D c) (D c1)
type ADTRecord t = (ADTRecord t t, Constraints t AnyType)
type ADTRecord1 t = (ADTRecord1 t t, Constraints1 t AnyType)
type ADTNonEmpty t = (ADTNonEmpty t t, Constraints t AnyType)
type ADTNonEmpty1 t = (ADTNonEmpty1 t t, Constraints1 t AnyType)
type ADT t = (ADT t t, Constraints t AnyType)
type ADT1 t = (ADT1 t t, Constraints1 t AnyType)
record :: forall c p t. (ADTRecord t, Constraints t c, GenericRecordProfunctor p) => (forall s. c s => p s s) -> p t t
record1 :: forall c p t a b. (ADTRecord1 t, Constraints1 t c, GenericRecordProfunctor p) => (forall d e s. c s => p d e -> p (s d) (s e)) -> p a b -> p (t a) (t b)
record01 :: forall c0 c1 p t a b. (ADTRecord1 t, Constraints01 t c0 c1, GenericRecordProfunctor p) => (forall s. c0 s => p s s) -> (forall d e s. c1 s => p d e -> p (s d) (s e)) -> p a b -> p (t a) (t b)
nonEmpty :: forall c p t. (ADTNonEmpty t, Constraints t c, GenericNonEmptyProfunctor p) => (forall s. c s => p s s) -> p t t
nonEmpty1 :: forall c p t a b. (ADTNonEmpty1 t, Constraints1 t c, GenericNonEmptyProfunctor p) => (forall d e s. c s => p d e -> p (s d) (s e)) -> p a b -> p (t a) (t b)
nonEmpty01 :: forall c0 c1 p t a b. (ADTNonEmpty1 t, Constraints01 t c0 c1, GenericNonEmptyProfunctor p) => (forall s. c0 s => p s s) -> (forall d e s. c1 s => p d e -> p (s d) (s e)) -> p a b -> p (t a) (t b)
generic :: forall c p t. (ADT t, Constraints t c, GenericProfunctor p) => (forall s. c s => p s s) -> p t t
generic1 :: forall c p t a b. (ADT1 t, Constraints1 t c, GenericProfunctor p) => (forall d e s. c s => p d e -> p (s d) (s e)) -> p a b -> p (t a) (t b)
generic01 :: forall c0 c1 p t a b. (ADT1 t, Constraints01 t c0 c1, GenericProfunctor p) => (forall s. c0 s => p s s) -> (forall d e s. c1 s => p d e -> p (s d) (s e)) -> p a b -> p (t a) (t b)

-- | Get the index in the lists returned by <tt>create</tt> and
--   <tt>createA</tt> of the constructor of the given value.
--   
--   For example, this is the implementation of <tt>put</tt> that generates
--   the binary data that the above implentation of <tt>get</tt> expects:
--   
--   <pre>
--   <tt>put</tt> t = <tt>putWord8</tt> (<a>toEnum</a> (<a>ctorIndex</a> t)) <a>&lt;&gt;</a> <tt>gfoldMap</tt> @<tt>Binary</tt> <tt>put</tt> t
--   </pre>
ctorIndex :: forall t. ADT t => t -> Int
ctorIndex1 :: forall t a. ADT1 t => t a -> Int

-- | Any type is instance of <a>AnyType</a>, you can use it with
--   <tt>@<a>AnyType</a></tt> if you don't actually need a class
--   constraint.
class AnyType (a :: k)
instance forall k (a :: k). Generics.OneLiner.Internal.Unary.AnyType a
instance forall k (c :: k -> GHC.Types.Constraint) (a :: k) (b :: k). (c a, a ~ b) => Generics.OneLiner.Internal.Unary.D c a b


-- | All functions without postfix are for instances of <tt>Generic</tt>,
--   and functions with postfix <tt>1</tt> are for instances of
--   <tt>Generic1</tt> (with kind <tt>* -&gt; *</tt>) which get an extra
--   argument to specify how to deal with the parameter. Functions with
--   postfix <tt>01</tt> are also for <tt>Generic1</tt> but they get yet
--   another argument that, like the <tt>Generic</tt> functions, allows
--   handling of constant leaves. The function <a>createA_</a> does not
--   require any such instance, but must be given a constructor explicitly.
module Generics.OneLiner

-- | Create a value (one for each constructor), given how to construct the
--   components.
--   
--   <pre>
--   <a>minBound</a> = <a>head</a> <a>$</a> <a>create</a> @<a>Bounded</a> [<a>minBound</a>]
--   <a>maxBound</a> = <a>last</a> <a>$</a> <a>create</a> @<a>Bounded</a> [<a>maxBound</a>]
--   </pre>
--   
--   <a>create</a> is <a>createA</a> specialized to lists.
create :: forall c t. (ADT t, Constraints t c) => (forall s. c s => [s]) -> [t]

-- | Create a value (one for each constructor), given how to construct the
--   components, under an applicative effect.
--   
--   Here's how to implement <tt>get</tt> from the <tt>binary</tt> package,
--   first encoding the constructor in a byte:
--   
--   <pre>
--   get = getWord8 <a>&gt;&gt;=</a> \ix -&gt; <a>getCompose</a> (<a>createA</a> @Binary (<a>Compose</a> [get])) <a>!!</a> <a>fromEnum</a> ix
--   </pre>
--   
--   <a>createA</a> is <a>generic</a> specialized to <a>Joker</a>.
createA :: forall c t f. (ADT t, Constraints t c, Alternative f) => (forall s. c s => f s) -> f t

-- | Get the index in the lists returned by <tt>create</tt> and
--   <tt>createA</tt> of the constructor of the given value.
--   
--   For example, this is the implementation of <tt>put</tt> that generates
--   the binary data that the above implentation of <tt>get</tt> expects:
--   
--   <pre>
--   <tt>put</tt> t = <tt>putWord8</tt> (<a>toEnum</a> (<a>ctorIndex</a> t)) <a>&lt;&gt;</a> <tt>gfoldMap</tt> @<tt>Binary</tt> <tt>put</tt> t
--   </pre>
ctorIndex :: forall t. ADT t => t -> Int

-- | <a>create1</a> is <a>createA1</a> specialized to lists.
create1 :: forall c t a. (ADT1 t, Constraints1 t c) => (forall b s. c s => [b] -> [s b]) -> [a] -> [t a]

-- | <a>createA1</a> is <a>generic1</a> specialized to <a>Joker</a>.
createA1 :: forall c t f a. (ADT1 t, Constraints1 t c, Alternative f) => (forall b s. c s => f b -> f (s b)) -> f a -> f (t a)
ctorIndex1 :: forall t a. ADT1 t => t a -> Int

-- | Create a value, given a constructor (or a function) and how to
--   construct its components, under an applicative effect.
--   
--   For example, this is the implementation of <a>arbitrary</a> for a type
--   with a single constructor (e.g., quadruples <tt>(,,,)</tt>).
--   
--   <pre>
--   arbitrary = <a>createA_</a> @<tt>Arbitrary</tt> arbitrary (,,,)
--   </pre>
createA_ :: forall c t f. (FunConstraints c t, Applicative f) => (forall s. c s => f s) -> t -> f (FunResult t)

-- | Map over a structure, updating each component.
--   
--   <a>gmap</a> is <a>generic</a> specialized to <tt>(-&gt;)</tt>.
gmap :: forall c t. (ADT t, Constraints t c) => (forall s. c s => s -> s) -> t -> t

-- | Map each component of a structure to a monoid, and combine the
--   results.
--   
--   If you have a class <tt>Size</tt>, which measures the size of a
--   structure, then this could be the default implementation:
--   
--   <pre>
--   size = <a>succ</a> <a>.</a> <tt>getSum</tt> <a>.</a> <a>gfoldMap</a> @<tt>Size</tt> (<tt>Sum</tt> <a>.</a> size)
--   </pre>
--   
--   <a>gfoldMap</a> is <a>gtraverse</a> specialized to <a>Const</a>.
gfoldMap :: forall c t m. (ADT t, Constraints t c, Monoid m) => (forall s. c s => s -> m) -> t -> m

-- | Map each component of a structure to an action, evaluate these actions
--   from left to right, and collect the results.
--   
--   <a>gtraverse</a> is <a>generic</a> specialized to <a>Star</a>.
gtraverse :: forall c t f. (ADT t, Constraints t c, Applicative f) => (forall s. c s => s -> f s) -> t -> f t

-- | <pre>
--   fmap = <a>gmap1</a> @<a>Functor</a> <a>fmap</a>
--   </pre>
--   
--   <a>gmap1</a> is <a>generic1</a> specialized to <tt>(-&gt;)</tt>.
gmap1 :: forall c t a b. (ADT1 t, Constraints1 t c) => (forall d e s. c s => (d -> e) -> s d -> s e) -> (a -> b) -> t a -> t b

-- | <pre>
--   foldMap = <a>gfoldMap1</a> @<a>Foldable</a> <a>foldMap</a>
--   </pre>
--   
--   <a>gfoldMap1</a> is <a>gtraverse1</a> specialized to <a>Const</a>.
gfoldMap1 :: forall c t m a. (ADT1 t, Constraints1 t c, Monoid m) => (forall s b. c s => (b -> m) -> s b -> m) -> (a -> m) -> t a -> m

-- | <pre>
--   traverse = <a>gtraverse1</a> @<a>Traversable</a> <a>traverse</a>
--   </pre>
--   
--   <a>gtraverse1</a> is <a>generic1</a> specialized to <a>Star</a>.
gtraverse1 :: forall c t f a b. (ADT1 t, Constraints1 t c, Applicative f) => (forall d e s. c s => (d -> f e) -> s d -> f (s e)) -> (a -> f b) -> t a -> f (t b)

-- | Combine two values by combining each component of the structures to a
--   monoid, and combine the results. Returns <a>mempty</a> if the
--   constructors don't match.
--   
--   <pre>
--   <a>compare</a> s t = <a>compare</a> (<a>ctorIndex</a> s) (<a>ctorIndex</a> t) <a>&lt;&gt;</a> <a>mzipWith</a> @<a>Ord</a> <a>compare</a> s t
--   </pre>
--   
--   <a>mzipWith</a> is <a>zipWithA</a> specialized to <tt><a>Compose</a>
--   <a>Maybe</a> (<a>Const</a> m)</tt>
mzipWith :: forall c t m. (ADT t, Constraints t c, Monoid m) => (forall s. c s => s -> s -> m) -> t -> t -> m

-- | Variant of <a>mzipWith</a> where you can choose the value which is
--   returned when the constructors don't match.
--   
--   <pre>
--   <a>compare</a> s t = <a>mzipWith'</a> @<a>Ord</a> (<a>compare</a> (<a>ctorIndex</a> s) (<a>ctorIndex</a> t)) <a>compare</a> s t
--   </pre>
mzipWith' :: forall c t m. (ADT t, Constraints t c, Monoid m) => m -> (forall s. c s => s -> s -> m) -> t -> t -> m

-- | Combine two values by combining each component of the structures with
--   the given function, under an applicative effect. Returns <a>empty</a>
--   if the constructors don't match.
--   
--   <a>zipWithA</a> is <a>generic</a> specialized to <a>Zip</a>
zipWithA :: forall c t f. (ADT t, Constraints t c, Alternative f) => (forall s. c s => s -> s -> f s) -> t -> t -> f t

-- | <pre>
--   <tt>liftCompare</tt> = <a>mzipWith1</a> @<tt>Ord1</tt> <tt>liftCompare</tt>
--   </pre>
--   
--   <a>mzipWith1</a> is <a>zipWithA1</a> specialized to <tt><a>Compose</a>
--   <a>Maybe</a> (<a>Const</a> m)</tt>
mzipWith1 :: forall c t m a. (ADT1 t, Constraints1 t c, Monoid m) => (forall s b. c s => (b -> b -> m) -> s b -> s b -> m) -> (a -> a -> m) -> t a -> t a -> m

-- | Variant of <a>mzipWith1</a> where you can choose the value which is
--   returned when the constructors don't match.
mzipWith1' :: forall c t m a. (ADT1 t, Constraints1 t c, Monoid m) => m -> (forall s b. c s => (b -> b -> m) -> s b -> s b -> m) -> (a -> a -> m) -> t a -> t a -> m

-- | <a>zipWithA1</a> is <a>generic1</a> specialized to <a>Zip</a>
zipWithA1 :: forall c t f a b. (ADT1 t, Constraints1 t c, Alternative f) => (forall d e s. c s => (d -> d -> f e) -> s d -> s d -> f (s e)) -> (a -> a -> f b) -> t a -> t a -> f (t b)

-- | Generate ways to consume values of type <tt>t</tt>. This is the
--   contravariant version of <a>createA</a>.
--   
--   <a>consume</a> is <a>generic</a> specialized to <a>Clown</a>.
consume :: forall c t f. (ADT t, Constraints t c, Decidable f) => (forall s. c s => f s) -> f t

-- | <a>consume1</a> is <a>generic1</a> specialized to <a>Clown</a>.
consume1 :: forall c t f a. (ADT1 t, Constraints1 t c, Decidable f) => (forall b s. c s => f b -> f (s b)) -> f a -> f (t a)

-- | Implement a nullary operator by calling the operator for each
--   component.
--   
--   <pre>
--   <a>mempty</a> = <a>nullaryOp</a> @<a>Monoid</a> <a>mempty</a>
--   <a>fromInteger</a> i = <a>nullaryOp</a> @<a>Num</a> (<a>fromInteger</a> i)
--   </pre>
--   
--   <a>nullaryOp</a> is <a>record</a> specialized to <a>Tagged</a>.
nullaryOp :: forall c t. (ADTRecord t, Constraints t c) => (forall s. c s => s) -> t

-- | Implement a unary operator by calling the operator on the components.
--   This is here for consistency, it is the same as <a>record</a>.
--   
--   <pre>
--   <a>negate</a> = <a>unaryOp</a> @<a>Num</a> <a>negate</a>
--   </pre>
unaryOp :: forall c t. (ADTRecord t, Constraints t c) => (forall s. c s => s -> s) -> t -> t

-- | Implement a binary operator by calling the operator on the components.
--   
--   <pre>
--   <a>mappend</a> = <a>binaryOp</a> @<a>Monoid</a> <a>mappend</a>
--   (<a>+</a>) = <a>binaryOp</a> @<a>Num</a> (<a>+</a>)
--   </pre>
--   
--   <a>binaryOp</a> is <a>algebra</a> specialized to pairs.
binaryOp :: forall c t. (ADTRecord t, Constraints t c) => (forall s. c s => s -> s -> s) -> t -> t -> t

-- | Create a value of a record type (with exactly one constructor), given
--   how to construct the components, under an applicative effect.
--   
--   Here's how to implement <tt>get</tt> from the <tt>binary</tt> package:
--   
--   <pre>
--   get = <a>createA'</a> (<tt>For</tt> :: <tt>For</tt> Binary) get
--   </pre>
--   
--   <a>createA'</a> is <a>record</a> specialized to <a>Joker</a>.
createA' :: forall c t f. (ADTRecord t, Constraints t c, Applicative f) => (forall s. c s => f s) -> f t

-- | Create an F-algebra, given an F-algebra for each of the components.
--   
--   <pre>
--   <a>binaryOp</a> f l r = <a>algebra</a> @c (\(Pair a b) -&gt; f a b) (Pair l r)
--   </pre>
--   
--   <a>algebra</a> is <a>record</a> specialized to <a>Costar</a>.
algebra :: forall c t f. (ADTRecord t, Constraints t c, Functor f) => (forall s. c s => f s -> s) -> f t -> t

-- | <a>dialgebra</a> is <a>record</a> specialized to <tt><a>Biff</a>
--   (-&gt;)</tt>.
dialgebra :: forall c t f g. (ADTRecord t, Constraints t c, Functor f, Applicative g) => (forall s. c s => f s -> g s) -> f t -> g t

-- | <a>createA1'</a> is <a>record1</a> specialized to <a>Joker</a>.
createA1' :: forall c t f a. (ADTRecord1 t, Constraints1 t c, Applicative f) => (forall b s. c s => f b -> f (s b)) -> f a -> f (t a)

-- | <pre>
--   cotraverse = <a>gcotraverse1</a> @<tt>Distributive</tt> <tt>cotraverse</tt>
--   </pre>
--   
--   <a>gcotraverse1</a> is <a>record1</a> specialized to <a>Costar</a>.
gcotraverse1 :: forall c t f a b. (ADTRecord1 t, Constraints1 t c, Functor f) => (forall d e s. c s => (f d -> e) -> f (s d) -> s e) -> (f a -> b) -> f (t a) -> t b
record :: forall c p t. (ADTRecord t, Constraints t c, GenericRecordProfunctor p) => (forall s. c s => p s s) -> p t t
nonEmpty :: forall c p t. (ADTNonEmpty t, Constraints t c, GenericNonEmptyProfunctor p) => (forall s. c s => p s s) -> p t t
generic :: forall c p t. (ADT t, Constraints t c, GenericProfunctor p) => (forall s. c s => p s s) -> p t t
record1 :: forall c p t a b. (ADTRecord1 t, Constraints1 t c, GenericRecordProfunctor p) => (forall d e s. c s => p d e -> p (s d) (s e)) -> p a b -> p (t a) (t b)
nonEmpty1 :: forall c p t a b. (ADTNonEmpty1 t, Constraints1 t c, GenericNonEmptyProfunctor p) => (forall d e s. c s => p d e -> p (s d) (s e)) -> p a b -> p (t a) (t b)
generic1 :: forall c p t a b. (ADT1 t, Constraints1 t c, GenericProfunctor p) => (forall d e s. c s => p d e -> p (s d) (s e)) -> p a b -> p (t a) (t b)
record01 :: forall c0 c1 p t a b. (ADTRecord1 t, Constraints01 t c0 c1, GenericRecordProfunctor p) => (forall s. c0 s => p s s) -> (forall d e s. c1 s => p d e -> p (s d) (s e)) -> p a b -> p (t a) (t b)
nonEmpty01 :: forall c0 c1 p t a b. (ADTNonEmpty1 t, Constraints01 t c0 c1, GenericNonEmptyProfunctor p) => (forall s. c0 s => p s s) -> (forall d e s. c1 s => p d e -> p (s d) (s e)) -> p a b -> p (t a) (t b)
generic01 :: forall c0 c1 p t a b. (ADT1 t, Constraints01 t c0 c1, GenericProfunctor p) => (forall s. c0 s => p s s) -> (forall d e s. c1 s => p d e -> p (s d) (s e)) -> p a b -> p (t a) (t b)

-- | A generic function using a <a>GenericRecordProfunctor</a> works on any
--   data type with exactly one constructor, a.k.a. records, with multiple
--   fields (<a>mult</a>) or no fields (<a>unit</a>).
--   
--   <a>GenericRecordProfunctor</a> is similar to <tt>ProductProfuctor</tt>
--   from the product-profunctor package, but using types from
--   GHC.Generics.
class (Profunctor p, GenericUnitProfunctor p, GenericProductProfunctor p) => GenericRecordProfunctor p

-- | A generic function using a <a>GenericNonEmptyProfunctor</a> works on
--   any data type with at least one constructor.
class (GenericRecordProfunctor p, GenericSumProfunctor p) => GenericNonEmptyProfunctor p

-- | A generic function using a <a>GenericProfunctor</a> works on any
--   algebraic data type, including those with no constructors and
--   constants.
class (GenericNonEmptyProfunctor p, GenericEmptyProfunctor p) => GenericProfunctor p
class Profunctor p => GenericUnitProfunctor p
unit :: GenericUnitProfunctor p => p (U1 a) (U1 a')
class Profunctor p => GenericProductProfunctor p
mult :: GenericProductProfunctor p => p (f a) (f' a') -> p (g a) (g' a') -> p ((f :*: g) a) ((f' :*: g') a')
class Profunctor p => GenericSumProfunctor p
plus :: GenericSumProfunctor p => p (f a) (f' a') -> p (g a) (g' a') -> p ((f :+: g) a) ((f' :+: g') a')
class Profunctor p => GenericEmptyProfunctor p
identity :: GenericEmptyProfunctor p => p a a
zero :: GenericEmptyProfunctor p => p (V1 a) (V1 a')
type ADT t = (ADT t t, Constraints t AnyType)
type ADTNonEmpty t = (ADTNonEmpty t t, Constraints t AnyType)
type ADTRecord t = (ADTRecord t t, Constraints t AnyType)
type Constraints t c = Constraints t t (D c)
type ADT1 t = (ADT1 t t, Constraints1 t AnyType)
type ADTNonEmpty1 t = (ADTNonEmpty1 t t, Constraints1 t AnyType)
type ADTRecord1 t = (ADTRecord1 t t, Constraints1 t AnyType)
type Constraints1 t c = Constraints1 t t (D c)
type Constraints01 t c0 c1 = Constraints01 t t (D c0) (D c1)

-- | Automatically apply a lifted function to a polymorphic argument as
--   many times as possible.
--   
--   A constraint `FunConstraint c t` is equivalent to the conjunction of
--   constraints `c s` for every argument type of <tt>t</tt>.
--   
--   If <tt>r</tt> is not a function type:
--   
--   <pre>
--   c a :- FunConstraints c (a -&gt; r)
--   (c a, c b) :- FunConstraints c (a -&gt; b -&gt; r)
--   (c a, c b, c d) :- FunConstraints c (a -&gt; b -&gt; d -&gt; r)
--   </pre>
class FunConstraints c t

-- | The result type of a curried function.
--   
--   If <tt>r</tt> is not a function type (i.e., does not unify with `_
--   -&gt; _`):
--   
--   <pre>
--   <a>FunResult</a> (a -&gt; r) ~ r
--   <a>FunResult</a> (a -&gt; b -&gt; r) ~ r
--   <a>FunResult</a> (a -&gt; b -&gt; c -&gt; r) ~ r
--   </pre>

-- | Any type is instance of <a>AnyType</a>, you can use it with
--   <tt>@<a>AnyType</a></tt> if you don't actually need a class
--   constraint.
class AnyType (a :: k)
