Std.Tree.unfoldTo
1 declaration
fn
unfoldTo: S -> fn(S) -> (T, Array[S]) -> Int -> Std.Tree.Tree[T]This is a callable function.
What it does
A tree grown from a starting value, stopping at a given depth.
The depth counts nodes, so a depth of 1 answers a leaf and a depth of 0 or
less answers a leaf as well: there is always a root, because a tree with no
nodes is not one.
Read the signature
- The text after the name is the type checked by Pudu.
- Read arrows from left to right: inputs come first, and the final type is returned.
- Names inside [ ] are type arguments, such as the item type held by a collection.
