- 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 -> String
- moduleName :: t d (f :: * -> *) a -> String
- class Constructor c where
- conName :: t c (f :: * -> *) a -> String
- conFixity :: t c (f :: * -> *) a -> Fixity
- conIsRecord :: t c (f :: * -> *) a -> Bool
- conIsTuple :: t c (f :: * -> *) a -> Arity
- class Selector s where
- data NoSelector
- data Fixity
- = Prefix
- | Infix Associativity Int
- data Associativity
- data Arity
- prec :: Fixity -> Int
- class Representable0 a rep where
- class Representable1 f rep where
Generic representation types
Unit: used for constructors without arguments
Recursive calls of kind * -> *
Constants, additional parameters and recursion of kind *
Meta-information (constructor names, etc.)
Datatype d => Typeable0' (M1 D d a) | |
GEq' a => GEq' (M1 i c a) | |
Enum' f => Enum' (M1 i c f) | |
GFunctor' f => GFunctor' (M1 i c f) | |
(Selector s, GShow' a) => GShow' (M1 S s a) | |
(GShow' a, Constructor c) => GShow' (M1 C c a) | |
GShow' a => GShow' (M1 D d a) | |
(Typeable a, Datatype d) => Typeable1' (M1 D d f) a | |
Uniplate' f b => Uniplate' (M1 i c f) b |
Sums: encode choice between constructors
Products: encode multiple arguments to constructors
(f p) :*: (g p) |
Composition of functors
Synonyms for convenience
Tag for M1: datatype
Meta-information
Class for datatypes that represent datatypes
datatypeName :: t d (f :: * -> *) a -> StringSource
The name of the datatype, fully qualified
moduleName :: t d (f :: * -> *) a -> StringSource
class Constructor c whereSource
Class for datatypes that represent data constructors
conName :: t c (f :: * -> *) a -> StringSource
The name of the constructor
conFixity :: t c (f :: * -> *) a -> FixitySource
The fixity of the constructor
conIsRecord :: t c (f :: * -> *) a -> BoolSource
Marks if this constructor is a record
conIsTuple :: t c (f :: * -> *) a -> AritySource
Marks if this constructor is a tuple, returning arity >=0 if so, <0 if not
Constructor Cons__ | |
Constructor Nil__ | |
Constructor Just_ | |
Constructor Nothing_ |
Class for datatypes that represent records
Datatype to represent the fixity of a constructor. An infix
| declaration directly corresponds to an application of Infix
.
data Associativity Source
Datatype to represent the associativy of a constructor
Datatype to represent the arity of a tuple.
Representable type classes
class Representable0 a rep whereSource
Representable types of kind *
Convert from the datatype to its representation
Convert from the representation to the datatype
class Representable1 f rep whereSource
Representable types of kind * -> *
Convert from the datatype to its representation
Convert from the representation to the datatype