Portability | non-portable |
---|---|
Stability | experimental |
Maintainer | sweirich@cis.upenn.edu |
Basic data structure and class for representation types
- data R a where
- data Con r a = forall l . Con (Emb l a) (MTup r l)
- data Emb l a = Emb {}
- data Fixity
- data DT = forall l . DT String (MTup R l)
- data Nil = Nil
- data a :*: l = a :*: l
- data Ex f = forall a . Rep a => Ex (f a)
- data MTup r l where
- class Rep a where
- rUnitEmb :: Emb Nil ()
- rUnit :: R ()
- rTup2 :: forall a b. (Rep a, Rep b) => R (a, b)
- rPairEmb :: Emb (a :*: (b :*: Nil)) (a, b)
- rList :: forall a. Rep a => R [a]
- rNilEmb :: Emb Nil [a]
- rConsEmb :: Emb (a :*: ([a] :*: Nil)) [a]
Documentation
A value of type R a
is a representation of a type a
.
Representation of a data constructor includes an embedding between the datatype and a list of other types as well as the representation of that list of other types.
An embedding between a list of types l
and
a datatype a
, based on a particular data constructor.
The to function is a wrapper for the constructor, the
from function pattern matches on the constructor.
Information about a datatype, including its fully qualified name and representation of its type arguments.
A heterogeneous list
A Class of representatble types
Rep Bool | |
Rep Char | |
Rep Double | |
Rep Float | |
Rep Int | |
Rep Integer | |
Rep Ordering | |
Rep Rational | |
Rep () | |
Rep IOError | |
Rep a => Rep [a] | |
Rep a => Rep (IO a) | |
Rep a[a1zn] => Rep (Maybe a[a1zn]) | |
(Rep a, Rep b) => Rep (a -> b) | |
(Rep a[a9NH], Rep b[a9NG]) => Rep (Either a[a9NH] b[a9NG]) | |
(Rep a, Rep b) => Rep (a, b) | |
(Rep a[12], Rep b[13], Rep c[14]) => Rep (a[12], b[13], c[14]) | |
(Rep a[12], Rep b[13], Rep c[14], Rep d[15]) => Rep (a[12], b[13], c[14], d[15]) | |
(Rep a[12], Rep b[13], Rep c[14], Rep d[15], Rep e[16]) => Rep (a[12], b[13], c[14], d[15], e[16]) | |
(Rep a[12], Rep b[13], Rep c[14], Rep d[15], Rep e[16], Rep f[17]) => Rep (a[12], b[13], c[14], d[15], e[16], f[17]) | |
(Rep a[12], Rep b[13], Rep c[14], Rep d[15], Rep e[16], Rep f[17], Rep g[18]) => Rep (a[12], b[13], c[14], d[15], e[16], f[17], g[18]) |