Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Synopsis
- data TreeNode a = TreeNode {
- treeNodeParent :: Maybe (TreeNode a)
- treeNodeLabel :: a
- treeNodeChildren :: [TreeNode a]
- freeze :: forall a. Tree a -> TreeNode a
- thaw :: TreeNode a -> Tree a
Documentation
A variant of Tree
in which we can walk from the root towards the leaves,
as usual, but also from a leaf towards the root.
Trees are not typically represented this way because the cycles between each node and its parent mean that any change to the tree requires reallocating all of its node, not just the path from the root to the modified element. For this reason, we do not offer any update operations.
TreeNode | |
|