|
Generics.MultiRec.Base | Portability | non-portable | Stability | experimental | Maintainer | generics@haskell.org |
|
|
|
|
|
Description |
This module is the base of the multirec library. It defines the view of a
system of datatypes: All the datatypes of the system are represented as
indexed functors that are built up from the structure types defined in this
module. Furthermore, in order to use the library for a system, conversion
functions have to be defined between the original datatypes and their
representation. The type class that holds these conversion functions are
also defined here.
|
|
Synopsis |
|
data I where | I :: Ix s xi => r xi -> I xi s r ix |
|
| | unI :: I xi s r ix -> r xi | | data K a s r ix = K {} | | data (f :+: g) s r ix | = L (f s r ix) | | R (g s r ix) |
|
| | data (f :*: g) s r ix = (f s r ix) :*: (g s r ix) | | data :>: where | Tag :: f s r ix -> (f :>: ix) s r ix |
|
| | unTag :: (f :>: ix) s r ix -> f s r ix | | newtype I0 a = I0 {} | | newtype K0 a b = K0 {} | | type family PF s :: (* -> *) -> (* -> *) -> * -> * | | type Str s ix = PF s s I0 ix | | class Ix s ix where | |
|
|
|
Structure types
|
|
|
Represents recursive positions. The first argument indicates
which type (within the system) to recurse on.
| Constructors | I :: Ix s xi => r xi -> I xi s r ix | |
| Instances | |
|
|
|
Destructor for I.
|
|
|
Represents constant types that do not belong to the system.
| Constructors | | Instances | |
|
|
|
Represents sums (choices between constructors).
| Constructors | | Instances | |
|
|
|
Represents products (sequences of fields of a constructor).
| Constructors | (f s r ix) :*: (g s r ix) | |
| Instances | |
|
|
|
Is used to indicate the type (within the system) that a
particular constructor injects to.
| Constructors | Tag :: f s r ix -> (f :>: ix) s r ix | |
| Instances | |
|
|
|
Destructor for '(:>:)'.
|
|
Unlifted variants
|
|
|
Unlifted version of I.
| Constructors | | Instances | |
|
|
|
Unlifted version of K.
| Constructors | |
|
|
Indexed systems
|
|
type family PF s :: (* -> *) -> (* -> *) -> * -> * | Source |
|
Type family describing the pattern functor of a system.
|
|
|
|
|
|
| Methods | | | | | | Some functions need to have their types desugared in order to make programs
that use them typable. Desugaring consists in transforming `inline' type
family applications into equality constraints. This is a strangeness in current
versions of GHC that hopefully will be fixed sometime in the future.
| | | | |
|
|
|
Produced by Haddock version 2.4.2 |