Run a function to change the root node forest. If the tree is a Leaf
the given function will receive the empty array as a parameter, if it returns
any trees then leaves will be turned into a Branches, and if it
returns the empty array branches will be turned into leaves.
Type Param: A
Underlying tree type.
Param: self
Tree on which to run the given function.
Param: f
Function to apply on the root forest.
Returns
The given tree with its root forest set to the result of the given function.
Run a function to change the root node forest. If the tree is a Leaf the given function will receive the empty array as a parameter, if it returns any trees then leaves will be turned into a Branches, and if it returns the empty array branches will be turned into leaves.
Type Param: A
Underlying tree type.
Param: self
Tree on which to run the given function.
Param: f
Function to apply on the root forest.
Returns
The given tree with its root forest set to the result of the given function.