Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell98 |
- data U1 p :: * -> * = U1
- newtype Par1 p :: * -> * = Par1 {
- unPar1 :: p
- newtype Rec1 f p :: (* -> *) -> * -> * = Rec1 {
- unRec1 :: f p
- newtype K1 i c p :: * -> * -> * -> * = K1 {
- unK1 :: c
- newtype M1 i c f p :: * -> * -> (* -> *) -> * -> * = M1 {
- unM1 :: f p
- data (f :+: g) p :: (* -> *) -> (* -> *) -> * -> *
- data (f :*: g) p :: (* -> *) -> (* -> *) -> * -> * = (f p) :*: (g p)
- newtype (f :.: g) p :: (* -> *) -> (* -> *) -> * -> * = Comp1 {
- unComp1 :: f (g p)
- class Generic a where
- class Generic1 f where
Generic representation types
data U1 p :: * -> *
Unit: used for constructors without arguments
newtype Par1 p :: * -> *
Used for marking occurrences of the parameter
newtype Rec1 f p :: (* -> *) -> * -> *
Recursive calls of kind * -> *
newtype K1 i c p :: * -> * -> * -> *
Constants, additional parameters and recursion of kind *
newtype M1 i c f p :: * -> * -> (* -> *) -> * -> *
Meta-information (constructor names, etc.)
data (f :+: g) p :: (* -> *) -> (* -> *) -> * -> * infixr 5
Sums: encode choice between constructors
(Eq (f p), Eq (g p)) => Eq ((:+:) f g p) | |
(Ord (f p), Ord (g p)) => Ord ((:+:) f g p) | |
(Read (f p), Read (g p)) => Read ((:+:) f g p) | |
(Show (f p), Show (g p)) => Show ((:+:) f g p) | |
Generic ((:+:) f g p) | |
type Rep ((:+:) f g p) = D1 D1:+: ((:+:) (C1 C1_0:+: (S1 NoSelector (Rec0 (f p)))) (C1 C1_1:+: (S1 NoSelector (Rec0 (g p))))) |
data (f :*: g) p :: (* -> *) -> (* -> *) -> * -> * infixr 6
Products: encode multiple arguments to constructors
(f p) :*: (g p) infixr 6 |
(Eq (f p), Eq (g p)) => Eq ((:*:) f g p) | |
(Ord (f p), Ord (g p)) => Ord ((:*:) f g p) | |
(Read (f p), Read (g p)) => Read ((:*:) f g p) | |
(Show (f p), Show (g p)) => Show ((:*:) f g p) | |
Generic ((:*:) f g p) | |
type Rep ((:*:) f g p) = D1 D1:*: (C1 C1_0:*: ((:*:) (S1 NoSelector (Rec0 (f p))) (S1 NoSelector (Rec0 (g p))))) |
newtype (f :.: g) p :: (* -> *) -> (* -> *) -> * -> * infixr 7
Composition of functors
Generic type classes
class Generic a where
Representable types of kind *. This class is derivable in GHC with the DeriveGeneric flag on.
type Rep a :: * -> *
Generic representation type
Convert from the datatype to its representation
Convert from the representation to the datatype
Generic Bool | |
Generic Char | |
Generic Double | |
Generic Float | |
Generic Int | |
Generic Ordering | |
Generic () | |
Generic All | |
Generic Any | |
Generic Arity | |
Generic Fixity | |
Generic Associativity | |
Generic [a] | |
Generic (U1 p) | |
Generic (Par1 p) | |
Generic (ZipList a) | |
Generic (Dual a) | |
Generic (Endo a) | |
Generic (Sum a) | |
Generic (Product a) | |
Generic (First a) | |
Generic (Last a) | |
Generic (Maybe a) | |
Generic (Either a b) | |
Generic (Rec1 f p) | |
Generic (a, b) | |
Generic (Const a b) | |
Generic (WrappedMonad m a) | |
Generic (Proxy * t) | |
Generic (K1 i c p) | |
Generic ((:+:) f g p) | |
Generic ((:*:) f g p) | |
Generic ((:.:) f g p) | |
Generic (a, b, c) | |
Generic (WrappedArrow a b c) | |
Generic (Alt k f a) | |
Generic (M1 i c f p) | |
Generic (a, b, c, d) | |
Generic (a, b, c, d, e) | |
Generic (a, b, c, d, e, f) | |
Generic (a, b, c, d, e, f, g) |
class Generic1 f where
Representable types of kind * -> *. This class is derivable in GHC with the DeriveGeneric flag on.
type Rep1 f :: * -> *
Generic representation type
Convert from the datatype to its representation
Convert from the representation to the datatype
Generic1 [] | |
Generic1 ZipList | |
Generic1 Dual | |
Generic1 Sum | |
Generic1 Product | |
Generic1 First | |
Generic1 Last | |
Generic1 Maybe | |
Generic1 (Either a) | |
Generic1 ((,) a) | |
Generic1 (Const a) | |
Generic1 (WrappedMonad m) | |
Generic1 ((,,) a b) | |
Generic1 (WrappedArrow a b) | |
Generic1 (Alt * f) | |
Generic1 ((,,,) a b c) | |
Generic1 ((,,,,) a b c d) | |
Generic1 ((,,,,,) a b c d e) | |
Generic1 ((,,,,,,) a b c d e f) |