Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
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 -> Annotation Source
Add an annotation to a collection.
An empty collection.
map :: (Typeable a, Typeable b) => (a -> b) -> Annotation -> Annotation Source
Map all annotations of type a
to type b
,
while leaving the others untouched.
set :: Typeable a => a -> Annotation -> Annotation Source
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 -> Annotation Source
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 a Source
Extract the first annotation of the given type, if it exists.