-- 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 0.9.2


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 = (ADT_ Identity Identity ADTProfunctor t, ADT_ Proxy Identity ADTProfunctor t)
type ADTNonEmpty1' t = (ADT_ Identity Identity NonEmptyProfunctor t, ADT_ Proxy Identity NonEmptyProfunctor t)
type ADTRecord1' t = (ADT_ Identity Identity RecordProfunctor t, ADT_ Proxy Identity RecordProfunctor 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 c p ks a b proxy0 for. (ADT_ Identity Proxy ks t, Constraints' t c AnyType, Satisfies p ks) => proxy0 ks -> for c -> (forall s. c s => p s s) -> p (t a) (t b)
generic1' :: forall t c1 p ks a b proxy0 for. (ADT_ Proxy Identity ks t, Constraints' t AnyType c1, Satisfies p ks) => proxy0 ks -> for c1 -> (forall s d e. c1 s => p d e -> p (s d) (s e)) -> p a b -> p (t a) (t b)
generic01' :: forall t c0 c1 p ks a b proxy0 for for1. (ADT_ Identity Identity ks t, Constraints' t c0 c1, Satisfies p ks) => proxy0 ks -> for c0 -> (forall s. c0 s => p s s) -> for1 c1 -> (forall s d e. c1 s => p d e -> p (s d) (s e)) -> p a b -> p (t a) (t b)
class ADT_ (nullary :: * -> *) (unary :: * -> *) (ks :: [(* -> * -> *) -> Constraint]) (t :: * -> *)
generic_ :: (ADT_ nullary unary ks t, Constraints' t c c1, Satisfies p ks) => proxy0 ks -> proxy1 nullary -> for c -> (forall s. c s => nullary (p s s)) -> for1 c1 -> (forall s1 d e. c1 s1 => unary (p d e -> p (s1 d) (s1 e))) -> unary (p a b) -> p (t a) (t 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
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 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
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. (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)

-- | <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 c = Constraints' (Rep t) c AnyType
type Constraints1 t c = Constraints' (Rep1 t) AnyType c
type Constraints01 t c0 c1 = Constraints' (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 = (Generic t, ADTRecord' (Rep t), Constraints t AnyType)
type ADTRecord1 t = (Generic1 t, ADTRecord1' (Rep1 t), Constraints1 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 = (Generic t, ADTNonEmpty' (Rep t), Constraints t AnyType)
type ADTNonEmpty1 t = (Generic1 t, ADTNonEmpty1' (Rep1 t), Constraints1 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 = (Generic t, ADT' (Rep t), Constraints t AnyType)
type ADT1 t = (Generic1 t, ADT1' (Rep1 t), Constraints1 t AnyType)

-- | 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)) <tt>&lt;&gt;</tt> <tt>gfoldMap</tt> @<tt>Binary</tt> <tt>put</tt> t
--   </pre>
ctorIndex :: ADT t => t -> Int
ctorIndex1 :: 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)

-- | 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)
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 k (a :: k). Generics.OneLiner.Internal.AnyType a
instance Data.Profunctor.Unsafe.Profunctor Generics.OneLiner.Internal.Ctor
instance Generics.OneLiner.Internal.GenericUnitProfunctor Generics.OneLiner.Internal.Ctor
instance Generics.OneLiner.Internal.GenericProductProfunctor Generics.OneLiner.Internal.Ctor
instance Generics.OneLiner.Internal.GenericSumProfunctor Generics.OneLiner.Internal.Ctor
instance Generics.OneLiner.Internal.GenericEmptyProfunctor Generics.OneLiner.Internal.Ctor
instance (Generics.OneLiner.Internal.GenericNonEmptyProfunctor p, Generics.OneLiner.Internal.GenericEmptyProfunctor p) => Generics.OneLiner.Internal.GenericProfunctor p
instance (Generics.OneLiner.Internal.GenericRecordProfunctor p, Generics.OneLiner.Internal.GenericSumProfunctor p) => Generics.OneLiner.Internal.GenericNonEmptyProfunctor p
instance (Data.Profunctor.Unsafe.Profunctor p, Generics.OneLiner.Internal.GenericUnitProfunctor p, Generics.OneLiner.Internal.GenericProductProfunctor p) => Generics.OneLiner.Internal.GenericRecordProfunctor p
instance (ks Generics.OneLiner.Internal.|- Generics.OneLiner.Internal.GenericEmptyProfunctor) => Generics.OneLiner.Internal.ADT_ nullary unary ks GHC.Generics.V1
instance (ks Generics.OneLiner.Internal.|- Generics.OneLiner.Internal.GenericEmptyProfunctor) => Generics.OneLiner.Internal.ADT_ Data.Proxy.Proxy unary ks (GHC.Generics.K1 i v)
instance Generics.OneLiner.Internal.GenericEmptyProfunctor (->)
instance GHC.Base.Applicative f => Generics.OneLiner.Internal.GenericEmptyProfunctor (Data.Profunctor.Types.Star f)
instance GHC.Base.Alternative f => Generics.OneLiner.Internal.GenericEmptyProfunctor (Data.Bifunctor.Joker.Joker f)
instance Data.Functor.Contravariant.Divisible.Decidable f => Generics.OneLiner.Internal.GenericEmptyProfunctor (Data.Bifunctor.Clown.Clown f)
instance (Generics.OneLiner.Internal.GenericEmptyProfunctor p, Generics.OneLiner.Internal.GenericEmptyProfunctor q) => Generics.OneLiner.Internal.GenericEmptyProfunctor (Data.Bifunctor.Product.Product p q)
instance (GHC.Base.Applicative f, Generics.OneLiner.Internal.GenericEmptyProfunctor p) => Generics.OneLiner.Internal.GenericEmptyProfunctor (Data.Bifunctor.Tannen.Tannen f p)
instance (ks Generics.OneLiner.Internal.|- Generics.OneLiner.Internal.GenericSumProfunctor, Generics.OneLiner.Internal.ADT_ nullary unary ks f, Generics.OneLiner.Internal.ADT_ nullary unary ks g) => Generics.OneLiner.Internal.ADT_ nullary unary ks (f GHC.Generics.:+: g)
instance Generics.OneLiner.Internal.GenericSumProfunctor (->)
instance GHC.Base.Applicative f => Generics.OneLiner.Internal.GenericSumProfunctor (Data.Profunctor.Types.Star f)
instance GHC.Base.Alternative f => Generics.OneLiner.Internal.GenericSumProfunctor (Data.Bifunctor.Joker.Joker f)
instance Data.Functor.Contravariant.Divisible.Decidable f => Generics.OneLiner.Internal.GenericSumProfunctor (Data.Bifunctor.Clown.Clown f)
instance (Generics.OneLiner.Internal.GenericSumProfunctor p, Generics.OneLiner.Internal.GenericSumProfunctor q) => Generics.OneLiner.Internal.GenericSumProfunctor (Data.Bifunctor.Product.Product p q)
instance (GHC.Base.Applicative f, Generics.OneLiner.Internal.GenericSumProfunctor p) => Generics.OneLiner.Internal.GenericSumProfunctor (Data.Bifunctor.Tannen.Tannen f p)
instance (ks Generics.OneLiner.Internal.|- Generics.OneLiner.Internal.GenericProductProfunctor, Generics.OneLiner.Internal.ADT_ nullary unary ks f, Generics.OneLiner.Internal.ADT_ nullary unary ks g) => Generics.OneLiner.Internal.ADT_ nullary unary ks (f GHC.Generics.:*: g)
instance Generics.OneLiner.Internal.GenericProductProfunctor (->)
instance Generics.OneLiner.Internal.GenericProductProfunctor Data.Tagged.Tagged
instance GHC.Base.Applicative f => Generics.OneLiner.Internal.GenericProductProfunctor (Data.Profunctor.Types.Star f)
instance GHC.Base.Functor f => Generics.OneLiner.Internal.GenericProductProfunctor (Data.Profunctor.Types.Costar f)
instance (GHC.Base.Functor f, GHC.Base.Applicative g, Data.Profunctor.Unsafe.Profunctor p, Generics.OneLiner.Internal.GenericProductProfunctor p) => Generics.OneLiner.Internal.GenericProductProfunctor (Data.Bifunctor.Biff.Biff p f g)
instance GHC.Base.Applicative f => Generics.OneLiner.Internal.GenericProductProfunctor (Data.Bifunctor.Joker.Joker f)
instance Data.Functor.Contravariant.Divisible.Divisible f => Generics.OneLiner.Internal.GenericProductProfunctor (Data.Bifunctor.Clown.Clown f)
instance (Generics.OneLiner.Internal.GenericProductProfunctor p, Generics.OneLiner.Internal.GenericProductProfunctor q) => Generics.OneLiner.Internal.GenericProductProfunctor (Data.Bifunctor.Product.Product p q)
instance (GHC.Base.Applicative f, Generics.OneLiner.Internal.GenericProductProfunctor p) => Generics.OneLiner.Internal.GenericProductProfunctor (Data.Bifunctor.Tannen.Tannen f p)
instance (ks Generics.OneLiner.Internal.|- Generics.OneLiner.Internal.GenericUnitProfunctor) => Generics.OneLiner.Internal.ADT_ nullary unary ks GHC.Generics.U1
instance Generics.OneLiner.Internal.GenericUnitProfunctor (->)
instance Generics.OneLiner.Internal.GenericUnitProfunctor Data.Tagged.Tagged
instance GHC.Base.Applicative f => Generics.OneLiner.Internal.GenericUnitProfunctor (Data.Profunctor.Types.Star f)
instance GHC.Base.Functor f => Generics.OneLiner.Internal.GenericUnitProfunctor (Data.Profunctor.Types.Costar f)
instance (GHC.Base.Functor f, GHC.Base.Applicative g, Data.Profunctor.Unsafe.Profunctor p, Generics.OneLiner.Internal.GenericUnitProfunctor p) => Generics.OneLiner.Internal.GenericUnitProfunctor (Data.Bifunctor.Biff.Biff p f g)
instance GHC.Base.Applicative f => Generics.OneLiner.Internal.GenericUnitProfunctor (Data.Bifunctor.Joker.Joker f)
instance Data.Functor.Contravariant.Divisible.Divisible f => Generics.OneLiner.Internal.GenericUnitProfunctor (Data.Bifunctor.Clown.Clown f)
instance (Generics.OneLiner.Internal.GenericUnitProfunctor p, Generics.OneLiner.Internal.GenericUnitProfunctor q) => Generics.OneLiner.Internal.GenericUnitProfunctor (Data.Bifunctor.Product.Product p q)
instance (GHC.Base.Applicative f, Generics.OneLiner.Internal.GenericUnitProfunctor p) => Generics.OneLiner.Internal.GenericUnitProfunctor (Data.Bifunctor.Tannen.Tannen f p)
instance (ks Generics.OneLiner.Internal.|- Data.Profunctor.Unsafe.Profunctor) => Generics.OneLiner.Internal.ADT_ Data.Functor.Identity.Identity unary ks (GHC.Generics.K1 i v)
instance (ks Generics.OneLiner.Internal.|- Data.Profunctor.Unsafe.Profunctor, Generics.OneLiner.Internal.ADT_ nullary unary ks f) => Generics.OneLiner.Internal.ADT_ nullary unary ks (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) => Generics.OneLiner.Internal.ADT_ nullary Data.Functor.Identity.Identity ks (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
instance (ks Generics.OneLiner.Internal.|- Data.Profunctor.Unsafe.Profunctor) => Generics.OneLiner.Internal.ADT_ nullary Data.Functor.Identity.Identity ks (GHC.Generics.Rec1 f)
instance (ks Generics.OneLiner.Internal.|- k) => (_k : ks) Generics.OneLiner.Internal.|- k
instance (k : _ks) Generics.OneLiner.Internal.|- k


-- | 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. 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)) <tt>&lt;&gt;</tt> <tt>gfoldMap</tt> @<tt>Binary</tt> <tt>put</tt> t
--   </pre>
ctorIndex :: 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 :: 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) <tt>&lt;&gt;</tt> <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)
newtype Zip f a b
Zip :: (a -> a -> f b) -> Zip f a b
[runZip] :: Zip f a b -> a -> a -> f 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')

-- | <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 = (Generic t, ADT' (Rep t), Constraints 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 = (Generic t, ADTNonEmpty' (Rep t), Constraints t AnyType)

-- | <a>ADTRecord</a> is a constraint type synonym. An instance is an
--   <a>ADT</a> with *exactly* one constructor.
type ADTRecord t = (Generic t, ADTRecord' (Rep t), Constraints 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 c = Constraints' (Rep t) c AnyType
type ADT1 t = (Generic1 t, ADT1' (Rep1 t), Constraints1 t AnyType)
type ADTNonEmpty1 t = (Generic1 t, ADTNonEmpty1' (Rep1 t), Constraints1 t AnyType)
type ADTRecord1 t = (Generic1 t, ADTRecord1' (Rep1 t), Constraints1 t AnyType)
type Constraints1 t c = Constraints' (Rep1 t) AnyType c
type Constraints01 t c0 c1 = Constraints' (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>

-- | 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 GHC.Base.Functor Generics.OneLiner.Pair
instance GHC.Base.Functor f => Data.Profunctor.Unsafe.Profunctor (Generics.OneLiner.Zip f)
instance GHC.Base.Applicative f => Generics.OneLiner.Internal.GenericUnitProfunctor (Generics.OneLiner.Zip f)
instance GHC.Base.Applicative f => Generics.OneLiner.Internal.GenericProductProfunctor (Generics.OneLiner.Zip f)
instance GHC.Base.Alternative f => Generics.OneLiner.Internal.GenericSumProfunctor (Generics.OneLiner.Zip f)
instance GHC.Base.Alternative f => Generics.OneLiner.Internal.GenericEmptyProfunctor (Generics.OneLiner.Zip f)
