Safe Haskell | None |
---|---|
Language | Haskell98 |
A zipper for TagSoup TagTree
s.
- data TagTreePos str = TagTreePos {}
- fromTagTree :: TagTree str -> TagTreePos str
- root :: TagTreePos str -> TagTreePos str
- parent :: TagTreePos str -> Maybe (TagTreePos str)
- firstChild :: TagTreePos str -> Maybe (TagTreePos str)
- lastChild :: TagTreePos str -> Maybe (TagTreePos str)
- prevSibling :: TagTreePos str -> Maybe (TagTreePos str)
- nextSibling :: TagTreePos str -> Maybe (TagTreePos str)
- iteratePos :: (TagTreePos str -> Maybe (TagTreePos str)) -> TagTreePos str -> [TagTreePos str]
- traverseTree :: Monoid m => (TagTreePos str -> m) -> TagTreePos str -> m
- traverseTreeBF :: Monoid m => (TagTreePos str -> m) -> TagTreePos str -> m
Documentation
fromTagTree :: TagTree str -> TagTreePos str Source #
root :: TagTreePos str -> TagTreePos str Source #
parent :: TagTreePos str -> Maybe (TagTreePos str) Source #
firstChild :: TagTreePos str -> Maybe (TagTreePos str) Source #
lastChild :: TagTreePos str -> Maybe (TagTreePos str) Source #
prevSibling :: TagTreePos str -> Maybe (TagTreePos str) Source #
nextSibling :: TagTreePos str -> Maybe (TagTreePos str) Source #
iteratePos :: (TagTreePos str -> Maybe (TagTreePos str)) -> TagTreePos str -> [TagTreePos str] Source #
iteratePos iter pos
applies iter
to pos
until Nothing
is returned, collecting all
new positions in the result list.
traverseTree :: Monoid m => (TagTreePos str -> m) -> TagTreePos str -> m Source #
traverseTree f pos
performs a depth-first traversal of a tree. The starting position is
pos
, and the result is obtained from the values produced by applying f
to each visited
node. Note that this function will also traverse parent nodes if the position isn't
indicating the root of the tree.
traverseTreeBF :: Monoid m => (TagTreePos str -> m) -> TagTreePos str -> m Source #
Like traverseTree
, but performs a breadth-first traversal.