Safe Haskell | None |
---|---|
Language | Haskell2010 |
A Knot
which adds an annotation to every node in a tree
Synopsis
- data Ann a k = Ann {}
- ann :: forall a k. Lens' (Ann a k) a
- val :: forall a k k. Lens (Ann a k) (Ann a k) ((#) k (Ann a)) ((#) k (Ann a))
- data family KWitness k :: (Knot -> Type) -> Type
- annotations :: forall k a b. RTraversable k => Traversal (Tree (Ann a) k) (Tree (Ann b) k) a b
- strip :: Recursively KFunctor expr => Tree (Ann a) expr -> Tree Pure expr
- addAnnotations :: Recursively KFunctor k => (forall n. KRecWitness k n -> Tree n (Ann a) -> a) -> Tree Pure k -> Tree (Ann a) k
Documentation
A Knot
which adds an annotation to every node in a tree
Instances
data family KWitness k :: (Knot -> Type) -> Type Source #
KWitness k n
is a witness that n
is a node of k
Instances
annotations :: forall k a b. RTraversable k => Traversal (Tree (Ann a) k) (Tree (Ann b) k) a b Source #
A Traversal
from an annotated tree to its annotations
strip :: Recursively KFunctor expr => Tree (Ann a) expr -> Tree Pure expr Source #
Remove a tree's annotations
addAnnotations :: Recursively KFunctor k => (forall n. KRecWitness k n -> Tree n (Ann a) -> a) -> Tree Pure k -> Tree (Ann a) k Source #
Compute annotations for a tree from the bottom up