License | BSD-style (see the file LICENSE) |
---|---|
Maintainer | sjoerd@w3future.com |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell98 |
- type family Constraints' (t :: * -> *) (c :: * -> Constraint) (c1 :: (* -> *) -> Constraint) :: Constraint
- 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]
- type family Satisfies (p :: * -> * -> *) (ks :: [(* -> * -> *) -> Constraint]) :: Constraint
- class (ks :: [(* -> * -> *) -> Constraint]) |- (k :: (* -> * -> *) -> Constraint) where
- 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 :: * -> *) where
- 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 where
- class Profunctor p => GenericProductProfunctor p where
- class Profunctor p => GenericSumProfunctor p where
- class Profunctor p => GenericEmptyProfunctor p where
- class (Profunctor p, GenericUnitProfunctor p, GenericProductProfunctor p) => GenericRecordProfunctor p
- class (GenericRecordProfunctor p, GenericSumProfunctor p) => GenericNonEmptyProfunctor p
- class (GenericNonEmptyProfunctor p, GenericEmptyProfunctor p) => GenericProfunctor p
- data Ctor a b = Ctor {}
- 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)
- 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
- type ADTRecord t = (Generic t, ADTRecord' (Rep t), Constraints t AnyType)
- type ADTRecord1 t = (Generic1 t, ADTRecord1' (Rep1 t), Constraints1 t AnyType)
- type ADTNonEmpty t = (Generic t, ADTNonEmpty' (Rep t), Constraints t AnyType)
- type ADTNonEmpty1 t = (Generic1 t, ADTNonEmpty1' (Rep1 t), Constraints1 t AnyType)
- type ADT t = (Generic t, ADT' (Rep t), Constraints t AnyType)
- type ADT1 t = (Generic1 t, ADT1' (Rep1 t), Constraints1 t AnyType)
- ctorIndex :: ADT t => t -> Int
- ctorIndex1 :: ADT1 t => t a -> Int
- class AnyType (a :: k)
- type family FunResult t where ...
- class FunConstraints c t where
Documentation
type family Constraints' (t :: * -> *) (c :: * -> Constraint) (c1 :: (* -> *) -> Constraint) :: Constraint Source #
type Constraints' Par1 c c1 Source # | |
type Constraints' (V1 *) c c1 Source # | |
type Constraints' (U1 *) c c1 Source # | |
type Constraints' (Rec1 * f) c c1 Source # | |
type Constraints' (K1 * i a) c c1 Source # | |
type Constraints' ((:+:) * f g) c c1 Source # | |
type Constraints' ((:*:) * f g) c c1 Source # | |
type Constraints' (M1 * i t f) c c1 Source # | |
type Constraints' ((:.:) * * f g) c c1 Source # | |
type ADTRecord' = ADT_ Identity Proxy RecordProfunctor Source #
type ADT1' t = (ADT_ Identity Identity ADTProfunctor t, ADT_ Proxy Identity ADTProfunctor t) Source #
type ADTNonEmpty1' t = (ADT_ Identity Identity NonEmptyProfunctor t, ADT_ Proxy Identity NonEmptyProfunctor t) Source #
type ADTRecord1' t = (ADT_ Identity Identity RecordProfunctor t, ADT_ Proxy Identity RecordProfunctor t) Source #
type family Satisfies (p :: * -> * -> *) (ks :: [(* -> * -> *) -> Constraint]) :: Constraint Source #
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) Source #
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) Source #
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) Source #
class ADT_ (nullary :: * -> *) (unary :: * -> *) (ks :: [(* -> * -> *) -> Constraint]) (t :: * -> *) where Source #
generic_ :: (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) Source #
(|-) ks Profunctor => ADT_ nullary Identity ks Par1 Source # | |
(|-) ks GenericUnitProfunctor => ADT_ nullary unary ks (U1 *) Source # | |
(|-) ks GenericEmptyProfunctor => ADT_ nullary unary ks (V1 *) Source # | |
(|-) ks Profunctor => ADT_ nullary Identity ks (Rec1 * f) Source # | |
((|-) ks GenericProductProfunctor, ADT_ nullary unary ks f, ADT_ nullary unary ks g) => ADT_ nullary unary ks ((:*:) * f g) Source # | |
((|-) ks GenericSumProfunctor, ADT_ nullary unary ks f, ADT_ nullary unary ks g) => ADT_ nullary unary ks ((:+:) * f g) Source # | |
(|-) ks Profunctor => ADT_ Identity unary ks (K1 * i v) Source # | |
((|-) ks Profunctor, ADT_ nullary Identity ks g) => ADT_ nullary Identity ks ((:.:) * * f g) Source # | |
((|-) ks Profunctor, ADT_ nullary unary ks f) => ADT_ nullary unary ks (M1 * i c f) Source # | |
(|-) ks GenericEmptyProfunctor => ADT_ (Proxy *) unary ks (K1 * i v) Source # | |
class Profunctor p => GenericUnitProfunctor p where Source #
Applicative f => GenericUnitProfunctor (Star f) Source # | |
Functor f => GenericUnitProfunctor (Costar f) Source # | |
GenericUnitProfunctor (Tagged *) Source # | |
GenericUnitProfunctor (Ctor *) Source # | |
Applicative f => GenericUnitProfunctor (Zip f) Source # | |
GenericUnitProfunctor ((->) LiftedRep LiftedRep) Source # | |
Applicative f => GenericUnitProfunctor (Joker * * f) Source # | |
Divisible f => GenericUnitProfunctor (Clown * * f) Source # | |
(GenericUnitProfunctor p, GenericUnitProfunctor q) => GenericUnitProfunctor (Product * * p q) Source # | |
(Applicative f, GenericUnitProfunctor p) => GenericUnitProfunctor (Tannen * * * f p) Source # | |
(Functor f, Applicative g, Profunctor p, GenericUnitProfunctor p) => GenericUnitProfunctor (Biff * * * * p f g) Source # | |
class Profunctor p => GenericProductProfunctor p where Source #
Applicative f => GenericProductProfunctor (Star f) Source # | |
Functor f => GenericProductProfunctor (Costar f) Source # | |
GenericProductProfunctor (Tagged *) Source # | |
GenericProductProfunctor (Ctor *) Source # | |
Applicative f => GenericProductProfunctor (Zip f) Source # | |
GenericProductProfunctor ((->) LiftedRep LiftedRep) Source # | |
Applicative f => GenericProductProfunctor (Joker * * f) Source # | |
Divisible f => GenericProductProfunctor (Clown * * f) Source # | |
(GenericProductProfunctor p, GenericProductProfunctor q) => GenericProductProfunctor (Product * * p q) Source # | |
(Applicative f, GenericProductProfunctor p) => GenericProductProfunctor (Tannen * * * f p) Source # | |
(Functor f, Applicative g, Profunctor p, GenericProductProfunctor p) => GenericProductProfunctor (Biff * * * * p f g) Source # | |
class Profunctor p => GenericSumProfunctor p where Source #
Applicative f => GenericSumProfunctor (Star f) Source # | |
GenericSumProfunctor (Ctor *) Source # | |
Alternative f => GenericSumProfunctor (Zip f) Source # | |
GenericSumProfunctor ((->) LiftedRep LiftedRep) Source # | |
Alternative f => GenericSumProfunctor (Joker * * f) Source # | |
Decidable f => GenericSumProfunctor (Clown * * f) Source # | |
(GenericSumProfunctor p, GenericSumProfunctor q) => GenericSumProfunctor (Product * * p q) Source # | |
(Applicative f, GenericSumProfunctor p) => GenericSumProfunctor (Tannen * * * f p) Source # | |
class Profunctor p => GenericEmptyProfunctor p where Source #
Applicative f => GenericEmptyProfunctor (Star f) Source # | |
GenericEmptyProfunctor (Ctor *) Source # | |
Alternative f => GenericEmptyProfunctor (Zip f) Source # | |
GenericEmptyProfunctor ((->) LiftedRep LiftedRep) Source # | |
Alternative f => GenericEmptyProfunctor (Joker * * f) Source # | |
Decidable f => GenericEmptyProfunctor (Clown * * f) Source # | |
(GenericEmptyProfunctor p, GenericEmptyProfunctor q) => GenericEmptyProfunctor (Product * * p q) Source # | |
(Applicative f, GenericEmptyProfunctor p) => GenericEmptyProfunctor (Tannen * * * f p) Source # | |
class (Profunctor p, GenericUnitProfunctor p, GenericProductProfunctor p) => GenericRecordProfunctor p Source #
A generic function using a GenericRecordProfunctor
works on any data type
with exactly one constructor, a.k.a. records,
with multiple fields (mult
) or no fields (unit
).
GenericRecordProfunctor
is similar to ProductProfuctor
from the
product-profunctor package, but using types from GHC.Generics.
class (GenericRecordProfunctor p, GenericSumProfunctor p) => GenericNonEmptyProfunctor p Source #
A generic function using a GenericNonEmptyProfunctor
works on any data
type with at least one constructor.
class (GenericNonEmptyProfunctor p, GenericEmptyProfunctor p) => GenericProfunctor p Source #
A generic function using a GenericProfunctor
works on any
algebraic data type, including those with no constructors and constants.
record :: forall c p t. (ADTRecord t, Constraints t c, GenericRecordProfunctor p) => (forall s. c s => p s s) -> p t t Source #
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) Source #
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) Source #
nonEmpty :: forall c p t. (ADTNonEmpty t, Constraints t c, GenericNonEmptyProfunctor p) => (forall s. c s => p s s) -> p t t Source #
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) Source #
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) Source #
generic :: forall c p t. (ADT t, Constraints t c, GenericProfunctor p) => (forall s. c s => p s s) -> p t t Source #
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) Source #
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) Source #
type Constraints t c = Constraints' (Rep t) c AnyType Source #
Constraints
is a constraint type synonym, containing the constraint
requirements for an instance for t
of class c
.
It requires an instance of class c
for each component of t
.
type Constraints1 t c = Constraints' (Rep1 t) AnyType c Source #
type Constraints01 t c0 c1 = Constraints' (Rep1 t) c0 c1 Source #
type ADTRecord t = (Generic t, ADTRecord' (Rep t), Constraints t AnyType) Source #
type ADTRecord1 t = (Generic1 t, ADTRecord1' (Rep1 t), Constraints1 t AnyType) Source #
type ADTNonEmpty t = (Generic t, ADTNonEmpty' (Rep t), Constraints t AnyType) Source #
ADTNonEmpty
is a constraint type synonym. An instance is an ADT
with *at least* one constructor.
type ADTNonEmpty1 t = (Generic1 t, ADTNonEmpty1' (Rep1 t), Constraints1 t AnyType) Source #
ctorIndex1 :: ADT1 t => t a -> Int Source #
class FunConstraints c t where Source #
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 t
.
If r
is not a function type:
c a :- FunConstraints c (a -> r) (c a, c b) :- FunConstraints c (a -> b -> r) (c a, c b, c d) :- FunConstraints c (a -> b -> d -> r)
autoApply :: Applicative f => (forall s. c s => f s) -> f t -> f (FunResult t) Source #
(~) * (FunResult r) r => FunConstraints c r Source # | |
(c a, FunConstraints c b) => FunConstraints c (a -> b) Source # | |