Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
- type family Annotated a f
- data AnnotatedF a f t = NoteF {}
- pattern Note :: forall t t1. t1 -> t (Fix (AnnotatedF t1 t)) -> Fix (AnnotatedF t1 t)
- note :: Fix (AnnotatedF t f) -> t
- erase :: Functor f => Fix (AnnotatedF t f) -> Fix f
- foldMemo :: Functor f => (f t -> t) -> Fix f -> Fix (AnnotatedF t f)
The Annotated
type family
type family Annotated a f Source #
If T
is a type that is defined as a fixpoint, then
an Annotated a T
will be the type of "T
s with an
a
-valued annotation attached to each node".
Types
data AnnotatedF a f t Source #
AnnotatedF a f
transforms the functor f
to add
a
-valued annotations.
Decomposed (AnnotatedF a) Source # | |
Functor f => Functor (AnnotatedF a f) Source # | |
(Eq (f t), Eq a) => Eq (AnnotatedF a f t) Source # | |
(Ord (f t), Ord a) => Ord (AnnotatedF a f t) Source # | |
(Pretty (f (Fix (AnnotatedF a f))), Show a) => Pretty (AnnotatedF a f (Fix (AnnotatedF a f))) Source # | Pretty-printer for annotations. |
Patterns for hiding Fix
pattern Note :: forall t t1. t1 -> t (Fix (AnnotatedF t1 t)) -> Fix (AnnotatedF t1 t) Source #
Utility functions
note :: Fix (AnnotatedF t f) -> t Source #
Extract the top-level annotation.