Applies a function to each sort in post-order
Applies a function to each sort in post-order
The mapping is done starting from the leaf of the sort tree. For each node, first apply recursively the postMap on the children from left to right, then apply the function to the current sort with the new children.
the function to apply. If it returns None then do not update the corresponding node.
the sort to traverse
the new sort after applying the mapping
Applies a function to each sort in pre-order
Applies a function to each sort in pre-order
The mapping is done starting from the root of the sort tree. For each node, first apply the function to the current node, then do it recursively on the children from left to right.
the function to apply. If it returns None then do not update the corresponding node
the sort to traverse
the new sort after applying the mapping
this operation can diverge if f is not well formed