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) :: Constraint
- class ADT' t where
- class ADTNonEmpty' t where
- class ADTRecord' t where
- type family Constraints1' (t :: * -> *) (c :: (* -> *) -> Constraint) :: Constraint
- class ADT1' t where
- class ADTNonEmpty1' t where
- class ADTRecord1' 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 => GenericRecordProfunctor p where
- class GenericRecordProfunctor p => GenericNonEmptyProfunctor p where
- class GenericNonEmptyProfunctor p => GenericProfunctor p where
- data Ctor a b = Ctor {}
- record :: (ADTRecord t, Constraints t c, GenericRecordProfunctor p) => for c -> (forall s. c s => p s s) -> p t t
- record1 :: (ADTRecord1 t, Constraints1 t c, GenericRecordProfunctor p) => for c -> (forall d e s. c s => p d e -> p (s d) (s e)) -> p a b -> p (t a) (t b)
- nonEmpty :: (ADTNonEmpty t, Constraints t c, GenericNonEmptyProfunctor p) => for c -> (forall s. c s => p s s) -> p t t
- nonEmpty1 :: (ADTNonEmpty1 t, Constraints1 t c, GenericNonEmptyProfunctor p) => for c -> (forall d e s. c s => p d e -> p (s d) (s e)) -> p a b -> p (t a) (t b)
- generic :: (ADT t, Constraints t c, GenericProfunctor p) => for c -> (forall s. c s => p s s) -> p t t
- generic1 :: (ADT1 t, Constraints1 t c, GenericProfunctor p) => for c -> (forall d e s. c 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
- type Constraints1 t c = Constraints1' (Rep1 t) c
- 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)
- data For c = For
- ctorIndex :: ADT t => t -> Int
- ctorIndex1 :: ADT1 t => t a -> Int
- class AnyType a
Documentation
type family Constraints' (t :: * -> *) (c :: * -> Constraint) :: Constraint Source #
type Constraints' V1 c Source # | |
type Constraints' U1 c Source # | |
type Constraints' (K1 i a) c Source # | |
type Constraints' ((:+:) f g) c Source # | |
type Constraints' ((:*:) f g) c Source # | |
type Constraints' (M1 i t f) c Source # | |
generic' :: (Constraints' t c, GenericProfunctor p) => for c -> (forall s. c s => p s s) -> p (t x) (t x) Source #
class ADTNonEmpty' t where Source #
nonEmpty' :: (Constraints' t c, GenericNonEmptyProfunctor p) => for c -> (forall s. c s => p s s) -> p (t x) (t x) Source #
ADTNonEmpty' U1 Source # | |
ADTNonEmpty' (K1 i v) Source # | |
(ADTNonEmpty' f, ADTNonEmpty' g) => ADTNonEmpty' ((:+:) f g) Source # | |
(ADTNonEmpty' f, ADTNonEmpty' g) => ADTNonEmpty' ((:*:) f g) Source # | |
ADTNonEmpty' f => ADTNonEmpty' (M1 i t f) Source # | |
class ADTRecord' t where Source #
record' :: (Constraints' t c, GenericRecordProfunctor p) => for c -> (forall s. c s => p s s) -> p (t x) (t x) Source #
ADTRecord' U1 Source # | |
ADTRecord' (K1 i v) Source # | |
(ADTRecord' f, ADTRecord' g) => ADTRecord' ((:*:) f g) Source # | |
ADTRecord' f => ADTRecord' (M1 i t f) Source # | |
type family Constraints1' (t :: * -> *) (c :: (* -> *) -> Constraint) :: Constraint Source #
type Constraints1' V1 c Source # | |
type Constraints1' U1 c Source # | |
type Constraints1' Par1 c Source # | |
type Constraints1' (Rec1 f) c Source # | |
type Constraints1' (K1 i v) c Source # | |
type Constraints1' ((:+:) f g) c Source # | |
type Constraints1' ((:*:) f g) c Source # | |
type Constraints1' ((:.:) f g) c Source # | |
type Constraints1' (M1 i t f) c Source # | |
generic1' :: (Constraints1' t c, GenericProfunctor p) => for c -> (forall d e s. c s => p d e -> p (s d) (s e)) -> p a b -> p (t a) (t b) Source #
class ADTNonEmpty1' t where Source #
nonEmpty1' :: (Constraints1' t c, GenericNonEmptyProfunctor p) => for c -> (forall d e s. c s => p d e -> p (s d) (s e)) -> p a b -> p (t a) (t b) Source #
ADTNonEmpty1' U1 Source # | |
ADTNonEmpty1' Par1 Source # | |
ADTNonEmpty1' (Rec1 f) Source # | |
(ADTNonEmpty1' f, ADTNonEmpty1' g) => ADTNonEmpty1' ((:+:) f g) Source # | |
(ADTNonEmpty1' f, ADTNonEmpty1' g) => ADTNonEmpty1' ((:*:) f g) Source # | |
ADTNonEmpty1' g => ADTNonEmpty1' ((:.:) f g) Source # | |
ADTNonEmpty1' f => ADTNonEmpty1' (M1 i t f) Source # | |
class ADTRecord1' t where Source #
record1' :: (Constraints1' t c, GenericRecordProfunctor p) => for c -> (forall d e s. c s => p d e -> p (s d) (s e)) -> p a b -> p (t a) (t b) Source #
ADTRecord1' U1 Source # | |
ADTRecord1' Par1 Source # | |
ADTRecord1' (Rec1 f) Source # | |
(ADTRecord1' f, ADTRecord1' g) => ADTRecord1' ((:*:) f g) Source # | |
ADTRecord1' g => ADTRecord1' ((:.:) f g) Source # | |
ADTRecord1' f => ADTRecord1' (M1 i t f) Source # | |
class Profunctor p => GenericRecordProfunctor p where 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.
unit :: p (U1 a) (U1 a') Source #
mult :: p (f a) (f' a') -> p (g a) (g' a') -> p ((f :*: g) a) ((f' :*: g') a') Source #
GenericRecordProfunctor (->) Source # | |
Applicative f => GenericRecordProfunctor (Star f) Source # | |
Functor f => GenericRecordProfunctor (Costar f) Source # | |
GenericRecordProfunctor (Tagged *) Source # | |
GenericRecordProfunctor (Ctor *) Source # | |
Applicative f => GenericRecordProfunctor (Joker * * f) Source # | |
Divisible f => GenericRecordProfunctor (Clown * * f) Source # | |
(GenericRecordProfunctor p, GenericRecordProfunctor q) => GenericRecordProfunctor (Product * * p q) Source # | |
(Applicative f, GenericRecordProfunctor p) => GenericRecordProfunctor (Tannen * * * f p) Source # | |
(Functor f, Applicative g) => GenericRecordProfunctor (Biff * * * * (->) f g) Source # | |
class GenericRecordProfunctor p => GenericNonEmptyProfunctor p where Source #
A generic function using a GenericNonEmptyProfunctor
works on any data
type with at least one constructor.
GenericNonEmptyProfunctor (->) Source # | |
Applicative f => GenericNonEmptyProfunctor (Star f) Source # | |
GenericNonEmptyProfunctor (Ctor *) Source # | |
Alternative f => GenericNonEmptyProfunctor (Joker * * f) Source # | |
Decidable f => GenericNonEmptyProfunctor (Clown * * f) Source # | |
(GenericNonEmptyProfunctor p, GenericNonEmptyProfunctor q) => GenericNonEmptyProfunctor (Product * * p q) Source # | |
(Applicative f, GenericNonEmptyProfunctor p) => GenericNonEmptyProfunctor (Tannen * * * f p) Source # | |
class GenericNonEmptyProfunctor p => GenericProfunctor p where Source #
A generic function using a GenericProfunctor
works on any
algebraic data type, including those with no constructors and constants.
GenericProfunctor (->) Source # | |
Applicative f => GenericProfunctor (Star f) Source # | |
GenericProfunctor (Ctor *) Source # | |
Alternative f => GenericProfunctor (Joker * * f) Source # | |
Decidable f => GenericProfunctor (Clown * * f) Source # | |
(GenericProfunctor p, GenericProfunctor q) => GenericProfunctor (Product * * p q) Source # | |
(Applicative f, GenericProfunctor p) => GenericProfunctor (Tannen * * * f p) Source # | |
record :: (ADTRecord t, Constraints t c, GenericRecordProfunctor p) => for c -> (forall s. c s => p s s) -> p t t Source #
record1 :: (ADTRecord1 t, Constraints1 t c, GenericRecordProfunctor p) => for c -> (forall d e s. c s => p d e -> p (s d) (s e)) -> p a b -> p (t a) (t b) Source #
nonEmpty :: (ADTNonEmpty t, Constraints t c, GenericNonEmptyProfunctor p) => for c -> (forall s. c s => p s s) -> p t t Source #
nonEmpty1 :: (ADTNonEmpty1 t, Constraints1 t c, GenericNonEmptyProfunctor p) => for c -> (forall d e s. c s => p d e -> p (s d) (s e)) -> p a b -> p (t a) (t b) Source #
generic :: (ADT t, Constraints t c, GenericProfunctor p) => for c -> (forall s. c s => p s s) -> p t t Source #
generic1 :: (ADT1 t, Constraints1 t c, GenericProfunctor p) => for c -> (forall d e s. c 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 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 = Constraints1' (Rep1 t) c 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 #
Tell the compiler which class we want to use in the traversal. Should be used like this:
(For :: For Show)
Where Show
can be any class.
ctorIndex1 :: ADT1 t => t a -> Int Source #