Safe Haskell | Safe-Infered |
---|
Annotation
is a collection of Typeable
s
with which you can annotate each OM node.
- type Annotation = [Dynamic]
- add :: Typeable a => a -> Annotation -> Annotation
- empty :: Annotation
- map :: (Typeable a, Typeable b) => (a -> b) -> Annotation -> Annotation
- set :: Typeable a => a -> Annotation -> Annotation
- weakSet :: Typeable a => a -> Annotation -> Annotation
- toList :: Typeable a => Annotation -> [a]
- toMaybe :: Typeable a => Annotation -> Maybe a
Documentation
type Annotation = [Dynamic]Source
add :: Typeable a => a -> Annotation -> AnnotationSource
Add an annotation to a collection.
An empty collection.
map :: (Typeable a, Typeable b) => (a -> b) -> Annotation -> AnnotationSource
Map all annotations of type a
to type b
,
while leaving the others untouched.
set :: Typeable a => a -> Annotation -> AnnotationSource
Remove all elements of type a
from the collection, and
set x
as the only member of the type in the collection.
weakSet :: Typeable a => a -> Annotation -> AnnotationSource
set x
as the only member of the type in the collection,
only if no annotation of the same type pre-exists.
toList :: Typeable a => Annotation -> [a]Source
Extract all annotations of type a
from
the collection.
toMaybe :: Typeable a => Annotation -> Maybe aSource
Extract the first annotation of the given type, if it exists.