acme-circular-containers- Spineless containers which are fast to read but inefficient to update

Safe HaskellSafe




data TreeNode a Source #

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.



freeze :: forall a. Tree a -> TreeNode a Source #

Returns the root TreeNode. O(n)

thaw :: TreeNode a -> Tree a Source #

Returns the Tree rooted at the given TreeNode. O(n)