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

CopyrightCopyright (C) 2010 Uwe Schmidt
LicenseMIT
MaintainerUwe Schmidt (uwe\@fh-wedel.de)
Stabilitystable
Portabilityportable
Safe HaskellSafe
LanguageHaskell98

Data.Tree.NTree.Zipper.TypeDefs

Contents

Description

Implementation of navigateble trees for rose trees. The implementation is done with zippers. A description and introductory tutorial about zippers can be found in http://learnyouahaskell.com/zippers

Synopsis

Documentation

data NTZipper a #

Zipper for rose trees

A zipper consist of the current tree and the branches on the way back to the root

Constructors

NTZ 

Fields

Instances

Functor NTZipper # 

Methods

fmap :: (a -> b) -> NTZipper a -> NTZipper b #

(<$) :: a -> NTZipper b -> NTZipper a #

Tree NTZipper # 

Methods

mkTree :: a -> [NTZipper a] -> NTZipper a #

mkLeaf :: a -> NTZipper a #

isLeaf :: NTZipper a -> Bool #

isInner :: NTZipper a -> Bool #

getNode :: NTZipper a -> a #

getChildren :: NTZipper a -> [NTZipper a] #

changeNode :: (a -> a) -> NTZipper a -> NTZipper a #

changeChildren :: ([NTZipper a] -> [NTZipper a]) -> NTZipper a -> NTZipper a #

setNode :: a -> NTZipper a -> NTZipper a #

setChildren :: [NTZipper a] -> NTZipper a -> NTZipper a #

foldTree :: (a -> [b] -> b) -> NTZipper a -> b #

nodesTree :: NTZipper a -> [a] #

depthTree :: NTZipper a -> Int #

cardTree :: NTZipper a -> Int #

formatTree :: (a -> String) -> NTZipper a -> String #

NavigatableTree NTZipper # 
Show a => Show (NTZipper a) # 

Methods

showsPrec :: Int -> NTZipper a -> ShowS #

show :: NTZipper a -> String #

showList :: [NTZipper a] -> ShowS #

type NTBreadCrumbs a = [NTCrumb a] #

The list of unzipped nodes from a current tree back to the root

data NTCrumb a #

One unzipped step consists of the left siblings, the node info and the right siblings

Constructors

NTC (NTrees a) a (NTrees a) 

Instances

Functor NTCrumb # 

Methods

fmap :: (a -> b) -> NTCrumb a -> NTCrumb b #

(<$) :: a -> NTCrumb b -> NTCrumb a #

Show a => Show (NTCrumb a) # 

Methods

showsPrec :: Int -> NTCrumb a -> ShowS #

show :: NTCrumb a -> String #

showList :: [NTCrumb a] -> ShowS #

toNTZipper :: NTree a -> NTZipper a #

Conversion of a rose tree into a navigatable rose tree

fromNTZipper :: NTZipper a -> NTree a #

Conversion of a navigatable rose tree into an ordinary rose tree.

The context, the parts for moving up to the root are just removed from the tree. So when transforming a navigatable tree by moving around and by changing some nodes, one has to navigate back to the root, else that parts are removed from the result

up :: NTZipper a -> Maybe (NTZipper a) #

up1 :: NTree a -> NTCrumb a -> NTree a #

Orphan instances