|
| Data.Generics.Fixplate.Base |
|
|
|
|
| Description |
| The core types of Fixplate.
|
|
| Synopsis |
|
|
|
| Documentation |
|
|
| The fixed-point type.
| | Constructors | | Instances | |
|
|
|
| We call a tree "atomic" if it has no subtrees.
|
|
| Annotations
|
|
|
| Type of annotations
| | Constructors | | Ann | | | attr :: a | the annotation
| | unAnn :: f b | the original functor
|
|
| Instances | |
|
|
|
| Annotated fixed-point type. Equivalent to CoFree f a
|
|
|
| Lifting natural transformations to annotations.
|
|
| Co-annotations
|
|
|
| Categorical dual of Ann.
| | Constructors | | Instances | |
|
|
|
| Categorical dual of Attr. Equivalent to Free f a
|
|
|
| Lifting natural transformations to annotations.
|
|
| Annotated trees
|
|
|
| The attribute of the root node.
|
|
|
| A function forgetting all the attributes from an annotated tree.
|
|
| Holes
|
|
|
This a data type defined to be a place-holder for childs.
It is used in tree drawing, hashing, and Shape.
It is deliberately not made an instance of Show, so that
you can choose your preferred style. For example, an acceptable choice is
instance Show Hole where show _ = "_"
| | Constructors | | Instances | |
|
|
| Higher-order type classes
|
|
|
"Functorised" versions of standard type classes.
If you have your a structure functor, for example
Expr e
= Kst Int
| Var String
| Add e e
deriving (Eq,Ord,Read,Show,Functor,Foldable,Traversable)
you should make it an instance of these, so that the
fixed-point type Mu Expr can be an instance of
Eq, Ord and Show. Doing so is very easy:
instance EqF Expr where equalF = (==)
instance OrdF Expr where compareF = compare
instance ShowF Expr where showsPrecF = showsPrec
The Read instance depends on whether we are using GHC or not.
The Haskell98 version is
instance ReadF Expr where readsPrecF = readsPrec
while the GHC version is
instance ReadF Expr where readPrecF = readPrec
| | | Methods | | | Instances | |
|
|
|
| | Methods | | | Instances | |
|
|
|
| | Methods | | | Instances | |
|
|
|
| | Methods | | | Instances | |
|
|
|
|
|
|
| Attrib (cofree comonad)
|
|
|
A newtype wrapper around Attr f a so that we can make Attr f
an instance of Functor, Foldable and Traversable (and Comonad). This is necessary
since Haskell does not allow partial application of type synonyms.
Equivalent to the co-free comonad.
| | Constructors | | Instances | |
|
|
| CoAttrib (free monad)
|
|
|
| Categorial dual of Attrib. Equivalent to the free monad.
| | Constructors | | Instances | |
|
|
| Produced by Haddock version 2.6.1 |