| Safe Haskell | Safe-Inferred |
|---|
Generics.Deriving.Base
- data V1 p
- 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)
- type Rec0 = K1 R
- type Par0 = K1 P
- data R
- data P
- type D1 = M1 D
- type C1 = M1 C
- type S1 = M1 S
- data D
- data C
- data S
- class Datatype d where
- datatypeName :: t d f a -> [Char]
- moduleName :: t d f a -> [Char]
- class Constructor c where
- class Selector s where
- data NoSelector
- data Fixity
- = Prefix
- | Infix Associativity Int
- data Associativity
- data Arity
- prec :: Fixity -> Int
- class Generic a where
- class Generic1 f where
Generic representation types
data V1 p
Void: used for datatypes without constructors
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.)
Instances
| ConNames f => ConNames (D1 c f) | |
| Constructor c => ConNames (C1 c f) | |
| GEq' a => GEq' (M1 i c a) | |
| Enum' f => Enum' (M1 i c f) | |
| GFunctor' f => GFunctor' (M1 i c f) | |
| GShow' a => GShow' (M1 D d a) | |
| (GShow' a, Constructor c) => GShow' (M1 C c a) | |
| (Selector s, GShow' a) => GShow' (M1 S s a) | |
| GFoldable' f => GFoldable' (M1 i c f) | |
| GTraversable' f => GTraversable' (M1 i c f) | |
| Uniplate' f b => Uniplate' (M1 i c f) b |
data (f :+: g) p
Sums: encode choice between constructors
Instances
| (ConNames f, ConNames g) => ConNames (:+: f g) | |
| (GEq' a, GEq' b) => GEq' (:+: a b) | |
| (Enum' f, Enum' g) => Enum' (:+: f g) | |
| (GFunctor' f, GFunctor' g) => GFunctor' (:+: f g) | |
| (GShow' a, GShow' b) => GShow' (:+: a b) | |
| (GFoldable' f, GFoldable' g) => GFoldable' (:+: f g) | |
| (GTraversable' f, GTraversable' g) => GTraversable' (:+: f g) | |
| (Uniplate' f b, Uniplate' g b) => Uniplate' (:+: f g) b |
data (f :*: g) p
Products: encode multiple arguments to constructors
Constructors
| (f p) :*: (g p) |
Instances
| (GEq' a, GEq' b) => GEq' (:*: a b) | |
| (Enum' f, Enum' g) => Enum' (:*: f g) | |
| (GFunctor' f, GFunctor' g) => GFunctor' (:*: f g) | |
| (GShow' a, GShow' b) => GShow' (:*: a b) | |
| (GFoldable' f, GFoldable' g) => GFoldable' (:*: f g) | |
| (GTraversable' f, GTraversable' g) => GTraversable' (:*: f g) | |
| (Uniplate' f b, Uniplate' g b) => Uniplate' (:*: f g) b |
newtype (f :.: g) p
Composition of functors
Synonyms for convenience
data R
Tag for K1: recursion (of kind *)
data P
Tag for K1: parameters (other than the last)
data C
Tag for M1: constructor
Instances
| Constructor c => ConNames (C1 c f) | |
| (GShow' a, Constructor c) => GShow' (M1 C c a) |
Meta-information
class Datatype d where
Class for datatypes that represent datatypes
Methods
datatypeName :: t d f a -> [Char]
The name of the datatype (unqualified)
moduleName :: t d f a -> [Char]
The fully-qualified name of the module where the type is declared
class Constructor c where
Class for datatypes that represent data constructors
Methods
The name of the constructor
conFixity :: t c f a -> Fixity
The fixity of the constructor
conIsRecord :: t c f a -> Bool
Marks if this constructor is a record
Instances
| Constructor C_Int | |
| Constructor C_Float | |
| Constructor C_Double | |
| Constructor C_Char | |
| Constructor C1_1[] | |
| Constructor C1_0[] | |
| Constructor C1_2Ordering | |
| Constructor C1_1Ordering | |
| Constructor C1_0Ordering | |
| Constructor C1_1Maybe | |
| Constructor C1_0Maybe | |
| Constructor C1_1Either | |
| Constructor C1_0Either | |
| Constructor C1_1Bool | |
| Constructor C1_0Bool | |
| Constructor C1_0(,,,,,,) | |
| Constructor C1_0(,,,,,) | |
| Constructor C1_0(,,,,) | |
| Constructor C1_0(,,,) | |
| Constructor C1_0(,,) | |
| Constructor C1_0(,) | |
| Constructor C1_0() |
data Fixity
Datatype to represent the fixity of a constructor. An infix
| declaration directly corresponds to an application of Infix.
Constructors
| Prefix | |
| Infix Associativity Int |
data Associativity
Datatype to represent the associativity of a constructor
Constructors
| LeftAssociative | |
| RightAssociative | |
| NotAssociative |
data Arity
Datatype to represent the arity of a tuple.
Generic type classes
class Generic a where
Representable types of kind *. This class is derivable in GHC with the DeriveGeneric flag on.
Methods
Convert from the datatype to its representation
Convert from the representation to the datatype
class Generic1 f where
Representable types of kind * -> * (not yet derivable)
Methods
Convert from the datatype to its representation
Convert from the representation to the datatype