Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Ctx a
- = Top
- | L (Ctx a) a (BinaryTree a)
- | R (BinaryTree a) a (Ctx a)
- data BinaryTreeZipper a = Loc (BinaryTree a) (Ctx a)
- top :: BinaryTree a -> BinaryTreeZipper a
- left :: BinaryTreeZipper a -> Maybe (BinaryTreeZipper a)
- right :: BinaryTreeZipper a -> Maybe (BinaryTreeZipper a)
- up :: BinaryTreeZipper a -> Maybe (BinaryTreeZipper a)
- toRoot :: BinaryTreeZipper a -> BinaryTreeZipper a
- visitAll :: BinaryTree a -> [BinaryTreeZipper a]
- accessZ :: BinaryTreeZipper a -> Maybe a
- subTrees :: BinaryTree a -> [BinaryTree a]
- splitTree :: BinaryTreeZipper a -> (BinaryTree a, BinaryTree a)
Documentation
Top | |
L (Ctx a) a (BinaryTree a) | |
R (BinaryTree a) a (Ctx a) |
data BinaryTreeZipper a Source #
Loc (BinaryTree a) (Ctx a) |
Functor BinaryTreeZipper Source # | |
Foldable BinaryTreeZipper Source # | |
Traversable BinaryTreeZipper Source # | |
Eq a => Eq (BinaryTreeZipper a) Source # | |
Ord a => Ord (BinaryTreeZipper a) Source # | |
Read a => Read (BinaryTreeZipper a) Source # | |
Show a => Show (BinaryTreeZipper a) Source # | |
top :: BinaryTree a -> BinaryTreeZipper a Source #
Focus on the root
left :: BinaryTreeZipper a -> Maybe (BinaryTreeZipper a) Source #
Go to the left child
right :: BinaryTreeZipper a -> Maybe (BinaryTreeZipper a) Source #
Go to the right child
up :: BinaryTreeZipper a -> Maybe (BinaryTreeZipper a) Source #
Move to the parent
toRoot :: BinaryTreeZipper a -> BinaryTreeZipper a Source #
Navigate to the root
visitAll :: BinaryTree a -> [BinaryTreeZipper a] Source #
Returns a list of zippers; one focussed on each node in the tree
accessZ :: BinaryTreeZipper a -> Maybe a Source #
Get the value stored at the current node
subTrees :: BinaryTree a -> [BinaryTree a] Source #
Returns all subtrees; i.e. every node with all its decendents
splitTree :: BinaryTreeZipper a -> (BinaryTree a, BinaryTree a) Source #
Splits the tree here, returns a pair (innerTree,outerTree)