Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Additional operations on standard rose trees
Annotating nodes
Offset of a node in the tree
This is the horizontal offset of a node across all nodes at that depth.
For example, the offsets of
A / \ B C / \ \ D E F
are given by
(A,0) / \ (B,0) (C,1) / \ \ (D,0) (E,1) (F,2)
Similarly, the offsets of
A / \ B C / \ D E
are given by
(A,0) / \ (B,0) (C,1) / \ (D,0) (E,1)
Note that in this second example, D gets number 0 because it's the first node at this level; it's therefore not the case that the nodes with number 0 necessarily make up the _spine_ of the tree.
Coordinates of a node in the tree
Metadata of a node in the tree