Std.Tree
40 public declarations
- at
&Std.Tree.Tree[T] -> &Array[Int] -> Option[Std.Tree.Tree[T]]The subtree at a path, or `None` when the path leads nowhere.
- breadthFirst
&Std.Tree.Tree[T] -> Array[T]Every value, nearest the root first, level by level.
- childrenOf
&Std.Tree.Tree[T] -> Array[Std.Tree.Tree[T]]The children of a node, in order.
- contains
&Std.Tree.Tree[T] -> T -> Bool where T: EqWhether any node carries this value.
- count
&Std.Tree.Tree[T] -> fn(T) -> Bool -> IntHow many nodes the test accepts.
- degree
&Std.Tree.Tree[T] -> IntHow many children a node has directly.
- find
&Std.Tree.Tree[T] -> fn(T) -> Bool -> Option[T]The first value the test accepts, in preorder, or `None`.
- flatMap
&Std.Tree.Tree[A] -> fn(A) -> Std.Tree.Tree[B] -> Std.Tree.Tree[B]Each value replaced by a whole tree, grafted where the value stood.
- fold
&Std.Tree.Tree[T] -> fn(A, T) -> A -> A -> AEvery value combined into one, each node before its children.
- foldTree
&Std.Tree.Tree[A] -> fn(A, Array[B]) -> B -> BEach node combined with what its children answered.
- Forest
A sequence of trees standing side by side.
- height
&Std.Tree.Tree[T] -> IntHow many nodes lie on the longest path from the root, the root included.
- isLeaf
&Std.Tree.Tree[T] -> BoolWhether a node has nothing beneath it.
- leaf
T -> Std.Tree.Tree[T]A node with nothing beneath it.
- leaves
&Std.Tree.Tree[T] -> Array[T]Every value that has nothing beneath it, in preorder.
- levels
&Std.Tree.Tree[T] -> Array[Array[T]]The values at each depth, nearest the root first.
- map
&Std.Tree.Tree[A] -> fn(A) -> B -> Std.Tree.Tree[B]Every value transformed, keeping the shape and the order.
- mapOption
&Std.Tree.Tree[A] -> fn(A) -> Option[B] -> Option[Std.Tree.Tree[B]]Every value transformed, keeping the shape, where transforming may answer
- mapResult
&Std.Tree.Tree[A] -> fn(A) -> Result[B, E] -> Result[Std.Tree.Tree[B], E]Every value transformed, keeping the shape, where transforming may fail.
- mapWithPath
&Std.Tree.Tree[A] -> fn(Array[Int], A) -> B -> Std.Tree.Tree[B]Every value transformed, told where in the tree it sits.
- node
T -> &Array[Std.Tree.Tree[T]] -> Std.Tree.Tree[T]A node with the given children, in the order given.
- outline
&Std.Tree.Tree[T] -> Array[Str]The tree drawn as indented lines, each value shown as the session shows it.
- pathTo
&Std.Tree.Tree[T] -> fn(T) -> Bool -> Option[Array[Int]]The path to the first node the test accepts, in preorder, or `None`.
- postorder
&Std.Tree.Tree[T] -> Array[T]Every value, each node after its children, children in order.
- preorder
&Std.Tree.Tree[T] -> Array[T]Every value, each node before its children, children in order.
- prune
&Std.Tree.Tree[T] -> fn(T) -> Bool -> Option[Std.Tree.Tree[T]]The tree with every node the test rejects removed, along with everything
- reversed
&Std.Tree.Tree[T] -> Std.Tree.Tree[T]The tree with its children in the reverse of their order, at every depth.
- sameShape
&Std.Tree.Tree[A] -> &Std.Tree.Tree[B] -> BoolWhether two trees hold the same values in the same shape and order.
- sequenceOption
&Std.Tree.Tree[Option[T]] -> Option[Std.Tree.Tree[T]]A tree of options turned into an option holding a tree.
- sequenceResult
&Std.Tree.Tree[Result[T, E]] -> Result[Std.Tree.Tree[T], E]A tree of results turned into a result holding a tree.
- size
&Std.Tree.Tree[T] -> IntHow many nodes the tree holds, the root included.
- trailTo
&Std.Tree.Tree[T] -> fn(T) -> Bool -> Option[Array[T]]The values from the root down to the first node the test accepts.
- Tree
A value with a sequence of trees beneath it.
- unfold
S -> fn(S) -> (T, Array[S]) -> Std.Tree.Tree[T]A tree grown from a starting value.
- unfoldForest
&Array[S] -> fn(S) -> (T, Array[S]) -> Array[Std.Tree.Tree[T]]A forest grown from several starting values.
- unfoldResult
S -> fn(S) -> Result[(T, Array[S]), E] -> Result[Std.Tree.Tree[T], E]A tree grown from a starting value, where growing may fail.
- unfoldTo
S -> fn(S) -> (T, Array[S]) -> Int -> Std.Tree.Tree[T]A tree grown from a starting value, stopping at a given depth.
- valueOf
&Std.Tree.Tree[T] -> TThe value a node carries.
- withChild
&Std.Tree.Tree[T] -> &Std.Tree.Tree[T] -> Std.Tree.Tree[T]The tree with a child added after the ones already there.
- zipWith
&Std.Tree.Tree[A] -> &Std.Tree.Tree[B] -> fn(A, B) -> C -> Std.Tree.Tree[C]Two trees combined node by node, as far as both go.
