Safe Haskell | Safe-Inferred |
---|
Working with NE trees and forests.
- data Span w = Span {}
- leafSpan :: w -> Span w
- (<>) :: Ord w => Span w -> Span w -> Span w
- spanSet :: Ix w => Span w -> Set w
- span :: Tree (a, Span w) -> Span w
- spanTree :: Ord w => Tree (Either n w) -> Tree (Either n w, Span w)
- spanForest :: Ord w => Forest (Either n w) -> Forest (Either n w, Span w)
- unSpanTree :: Tree (k, Span w) -> Tree k
- unSpanForest :: Forest (k, Span w) -> Forest k
- sortTree :: Ord w => Tree (k, Span w) -> Tree (k, Span w)
- sortForest :: Ord w => Forest (k, Span w) -> Forest (k, Span w)
- mapLeaves :: (a -> b) -> Tree (Either c a) -> Tree (Either c b)
- mapNodes :: (a -> b) -> Tree (Either a c) -> Tree (Either b c)
- mapTrees :: (a -> b) -> Forest a -> Forest b
Span
Spanning of a tree.
Trees with span
spanTree :: Ord w => Tree (Either n w) -> Tree (Either n w, Span w)Source
Annotate tree nodes with spanning info given the function which assignes indices to leaf nodes.
spanForest :: Ord w => Forest (Either n w) -> Forest (Either n w, Span w)Source
Annotate forest nodes with spanning info.
unSpanTree :: Tree (k, Span w) -> Tree kSource
Remove span annotations from the tree.
unSpanForest :: Forest (k, Span w) -> Forest kSource
Remove span annotations from the forest.
sortTree :: Ord w => Tree (k, Span w) -> Tree (k, Span w)Source
Sort the tree with respect to spanning info.
sortForest :: Ord w => Forest (k, Span w) -> Forest (k, Span w)Source
Sort the forest with respect to spanning info.