|
Many functions perform the same operation on the non-structural cases (as
well as Unit). The cases for constant datatypes (Int, Integer,
Float, Double, Char, and Unit) have a default implementation of
rconstant3, thus a generic function may only override rconstant3 if
desired. Note that there is no default implementation for rconstant3
itself.
The class context represents the intersection set of supported type
classes.
|
|
|
Case for the primitive type Int. (Default implementation:
rconstant3.)
|
|
|
Case for the primitive type Integer. (Default implementation:
rconstant3.)
|
|
|
Case for the primitive type Float. (Default implementation:
rconstant3.)
|
|
|
Case for the primitive type Double. (Default implementation:
rconstant3.)
|
|
|
Case for the primitive type Char. (Default implementation:
rconstant3.)
|
|
|
Case for the structural representation type Unit. It is used to
represent a constructor with no arguments. (Default implementation:
rconstant3.)
|
|
rsum3 :: g a1 a2 a3 -> g b1 b2 b3 -> g (a1 :+: b1) (a2 :+: b2) (a3 :+: b3) | Source |
|
Case for the structural representation type '(:+:)', called "sum". It
is used to represent alternative choices between constructors. (No
default implementation.)
|
|
rprod3 :: g a1 a2 a3 -> g b1 b2 b3 -> g (a1 :*: b1) (a2 :*: b2) (a3 :*: b3) | Source |
|
Case for the structural representation type '(:*:)', called "product".
It is used to represent multiple arguments to a constructor. (No
default implementation.)
|
|
|
Case for constructors. It is used to hold the meta-information about a
constructor (ConDescr), e.g. name, arity, fixity, etc. (Since most
generic functions do not use rcon and simply pass the value through, the
default implementation is const id.)
|
|
rtype3 :: EP a2 a1 -> EP b2 b1 -> EP c2 c1 -> g a1 b1 c1 -> g a2 b2 c2 | Source |
|
Case for datatypes. This method is used to define the structural
representation of an arbitrary Haskell datatype. The first three arguments
are the embedding-projection pairs, necessary for establishing the
isomorphisms between datatype and representation of the four generic types.
The fourth argument is the run-time representation using the methods of
Generic3. (No default implementation.)
|