
Data.Generics.Fixplate.Base 




Description 
The core types of Fixplate.


Synopsis 



Documentation 


The fixedpoint 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 fixedpoint type. Equivalent to CoFree f a



Lifting natural transformations to annotations.


Coannotations



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 placeholder 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  


Higherorder 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
fixedpoint 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 cofree comonad.
 Constructors   Instances  


CoAttrib (free monad)



Categorial dual of Attrib. Equivalent to the free monad.
 Constructors   Instances  


Produced by Haddock version 2.6.1 