hxt-8.4.1: A collection of tools for processing XML with Haskell.

Data.NavTree

Description

Navigable tree structure which allow a program to traverse up the tree as well as down. copied and modified from HXML (http://www.flightlab.com/~joe/hxml/)

Synopsis

Documentation

data NavTree a Source

navigable tree with nodes of type node

a navigable tree consists of a n-ary tree for the current fragment tree, a navigable tree for all ancestors, and two n-ary trees for the previous- and following siblings

Constructors

NT (NTree a) [NavTree a] [NTree a] [NTree a] 

Instances

Eq a => Eq (NavTree a) 
Ord a => Ord (NavTree a) 
Show a => Show (NavTree a) 

ntree :: NTree a -> NavTree aSource

converts a n-ary tree in a navigable tree

subtreeNT :: NavTree a -> NTree aSource

converts a navigable tree in a n-ary tree

dataNT :: NavTree a -> aSource

function for selecting the value of the current fragment tree

o' :: Monad m => (b -> m c) -> (a -> m b) -> a -> m cSource

Kleisli composition:

maybePlus :: (a -> Maybe a) -> a -> [a]Source

maybeStar :: (a -> Maybe a) -> a -> [a]Source