An iterator over the values stored on the nodes of this tree, in a depth first manner starting from the root.
Returns an iterator for the values at the leaves of this tree
The number of nodes in this tree.
Transforms this tree into a new tree by applying the function f
to
the value at every node.
Transforms this tree into a new tree by applying the function f
to
the value at every node. Does not change the shape of the tree.
Combines the values in this tree into a single value by recursively
collapsing each subtree using the function f
, starting from the leaves
and working its way back up to the root.
Transforms this tree into a new Tree by recursively walking the nodes
and applying the function f
to each subtree to transform it.
Transforms this tree into a new Tree by recursively walking the nodes
and applying the function f
to each subtree to transform it. Starts from
the leaves and works its way back up to the root.
An immutable tree with each node containing a value, and a
Seq
of children. Provides all normalSeq
functionality as well as some tree specific methods.