rewriting-0.1: Generic rewriting library for regular datatypes.Source codeContentsIndex
Generics.Regular.Rewriting.Representations
Portabilitynon-portable
Stabilityexperimental
Maintainergenerics@haskell.org
Contents
Functorial structural representation types.
Fixed-point type.
Type class capturing the structural representation of a type and the
Description
Summary: Types for structural representation.
Synopsis
data K a r = K a
data Id r = Id r
data Unit r = Unit
data (f :+: g) r
= L (f r)
| R (g r)
data (f :*: g) r = (f r) :*: (g r)
data Con f r = Con String (f r)
newtype Fix f = In (f (Fix f))
class Functor (PF a) => Regular a where
type PF a :: * -> *
from :: a -> PF a a
to :: PF a a -> a
Functorial structural representation types.
data K a r Source
Structure type for constant values.
Constructors
K a
show/hide Instances
Functor (K a)
LRBase a => LR (K a)
Show a => GShow (K a)
Eq a => Zip (K a)
Crush (K a)
GMap (K a)
data Id r Source
Structure type for recursive values.
Constructors
Id r
show/hide Instances
data Unit r Source
Structure type for empty constructors.
Constructors
Unit
show/hide Instances
data (f :+: g) r Source
Structure type for alternatives in a type.
Constructors
L (f r)
R (g r)
show/hide Instances
(Functor f, Functor g) => Functor (f :+: g)
(LR f, LR g) => LR (f :+: g)
(GShow f, GShow g) => GShow (f :+: g)
(Zip f, Zip g) => Zip (f :+: g)
(Crush f, Crush g) => Crush (f :+: g)
(GMap f, GMap g) => GMap (f :+: g)
data (f :*: g) r Source
Structure type for fields of a constructor.
Constructors
(f r) :*: (g r)
show/hide Instances
(Functor f, Functor g) => Functor (f :*: g)
(LR f, LR g) => LR (f :*: g)
(GShow f, GShow g) => GShow (f :*: g)
(Zip f, Zip g) => Zip (f :*: g)
(Crush f, Crush g) => Crush (f :*: g)
(GMap f, GMap g) => GMap (f :*: g)
data Con f r Source
Structure type to store the name of a constructor.
Constructors
Con String (f r)
show/hide Instances
Functor f => Functor (Con f)
LR f => LR (Con f)
GShow f => GShow (Con f)
Zip f => Zip (Con f)
Crush f => Crush (Con f)
GMap f => GMap (Con f)
Fixed-point type.
newtype Fix f Source
The well-known fixed-point type.
Constructors
In (f (Fix f))
Type class capturing the structural representation of a type and the
corresponding embedding-projection pairs.
class Functor (PF a) => Regular a whereSource

corresponding embedding-projection pairs.

The type class Regular captures the structural representation of a type and the corresponding embedding-projection pairs.

To be able to use the rewriting functions, the user is required to provide an instance of this type class.

Associated Types
type PF a :: * -> *Source
Methods
from :: a -> PF a aSource
to :: PF a a -> aSource
Produced by Haddock version 2.4.2