Data.Generics.Fixplate.Base
Description
The core types of Fixplate.
Documentation
forget :: Functor f => Attr f a -> Mu fSource
A function forgetting all the attributes from an annotated tree.
The fixed-point type.
Annotations.
"Functorised" versions of standard type classes. If you have your own 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
showsPrecF :: Show a => Int -> f a -> ShowSSource
A newtype wrapper around Attr f a so that we can make Attr f
an instance of Functor, Foldable and Traversable. This is necessary
since Haskell does not allow partial application of type synonyms.