Portability | non-portable |
---|---|
Stability | experimental |
Maintainer | generics@haskell.org |
This module is the base of the multirec library. It defines the view of a family of datatypes: All the datatypes of the family 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 family, 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.
- data I xi r ix = I {
- unI :: r xi
- data K a r ix = K {
- unK :: a
- data U r ix = U
- data (f :+: g) r ix
- data (f :*: g) r ix = (f r ix) :*: (g r ix)
- data f :>: ix where
- unTag :: (f :>: ix) r ix -> f r ix
- data C c f r ix where
- unC :: C c f r ix -> f r ix
- module Generics.MultiRec.Constructor
- newtype I0 a = I0 {
- unI0 :: a
- newtype K0 a b = K0 {
- unK0 :: a
- type family PF phi :: (* -> *) -> * -> *
- class El phi ix where
- proof :: phi ix
- class Fam phi where
- index :: El phi ix => phi ix
- module Generics.MultiRec.TEq
- class EqS phi where
Structure types
Represents recursive positions. The first argument indicates which type to recurse on.
Represents constant types that do not belong to the family.
Represents constructors without fields.
Represents sums (choices between constructors).
Represents products (sequences of fields of a constructor).
(f r ix) :*: (g r ix) |
Is used to indicate the type that a particular constructor injects to.
Represents constructors.
Constructor information
Unlifted variants
Indexed families
type family PF phi :: (* -> *) -> * -> *Source
Type family describing the pattern functor of a family.
Class that contains the shallow conversion functions for a family.
Equality for indexed families
module Generics.MultiRec.TEq