Results for “Std.Tree.Tree”
39 matching declarations
Use module:Std.List, kind:fn, or is:exact. Put a Pudu type after ::.
- Std.Tree.Tree
A value with a sequence of trees beneath it.
- Std.Tree.at
&Std.Tree.Tree[T] -> &Array[Int] -> Option[Std.Tree.Tree[T]]The subtree at a path, or
Nonewhen the path leads nowhere. - Std.Tree.breadthFirst
&Std.Tree.Tree[T] -> Array[T]Every value, nearest the root first, level by level.
- Std.Tree.childrenOf
&Std.Tree.Tree[T] -> Array[Std.Tree.Tree[T]]The children of a node, in order.
- Std.Tree.contains
&Std.Tree.Tree[T] -> T -> Bool where T: EqWhether any node carries this value.
- Std.Tree.count
&Std.Tree.Tree[T] -> fn(T) -> Bool -> IntHow many nodes the test accepts.
- Std.Tree.degree
&Std.Tree.Tree[T] -> IntHow many children a node has directly.
- Std.Tree.find
&Std.Tree.Tree[T] -> fn(T) -> Bool -> Option[T]The first value the test accepts, in preorder, or
None. - Std.Tree.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.
- Std.Tree.fold
&Std.Tree.Tree[T] -> fn(A, T) -> A -> A -> AEvery value combined into one, each node before its children.
- Std.Tree.foldTree
&Std.Tree.Tree[A] -> fn(A, Array[B]) -> B -> BEach node combined with what its children answered.
- Std.Tree.height
&Std.Tree.Tree[T] -> IntHow many nodes lie on the longest path from the root, the root included.
- Std.Tree.isLeaf
&Std.Tree.Tree[T] -> BoolWhether a node has nothing beneath it.
- Std.Tree.leaf
T -> Std.Tree.Tree[T]A node with nothing beneath it.
- Std.Tree.leaves
&Std.Tree.Tree[T] -> Array[T]Every value that has nothing beneath it, in preorder.
- Std.Tree.levels
&Std.Tree.Tree[T] -> Array[Array[T]]The values at each depth, nearest the root first.
- Std.Tree.map
&Std.Tree.Tree[A] -> fn(A) -> B -> Std.Tree.Tree[B]Every value transformed, keeping the shape and the order.
- Std.Tree.mapOption
&Std.Tree.Tree[A] -> fn(A) -> Option[B] -> Option[Std.Tree.Tree[B]]Every value transformed, keeping the shape, where transforming may answer
- Std.Tree.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.
- Std.Tree.mapWithPath
&Std.Tree.Tree[A] -> fn(Array[Int], A) -> B -> Std.Tree.Tree[B]Every value transformed, told where in the tree it sits.
- Std.Tree.node
T -> &Array[Std.Tree.Tree[T]] -> Std.Tree.Tree[T]A node with the given children, in the order given.
- Std.Tree.outline
&Std.Tree.Tree[T] -> Array[Str]The tree drawn as indented lines, each value shown as the session shows it.
- Std.Tree.pathTo
&Std.Tree.Tree[T] -> fn(T) -> Bool -> Option[Array[Int]]The path to the first node the test accepts, in preorder, or
None. - Std.Tree.postorder
&Std.Tree.Tree[T] -> Array[T]Every value, each node after its children, children in order.
- Std.Tree.preorder
&Std.Tree.Tree[T] -> Array[T]Every value, each node before its children, children in order.
- Std.Tree.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
- Std.Tree.reversed
&Std.Tree.Tree[T] -> Std.Tree.Tree[T]The tree with its children in the reverse of their order, at every depth.
- Std.Tree.sameShape
&Std.Tree.Tree[A] -> &Std.Tree.Tree[B] -> BoolWhether two trees hold the same values in the same shape and order.
- Std.Tree.sequenceOption
&Std.Tree.Tree[Option[T]] -> Option[Std.Tree.Tree[T]]A tree of options turned into an option holding a tree.
- Std.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.
- Std.Tree.size
&Std.Tree.Tree[T] -> IntHow many nodes the tree holds, the root included.
- Std.Tree.trailTo
&Std.Tree.Tree[T] -> fn(T) -> Bool -> Option[Array[T]]The values from the root down to the first node the test accepts.
- Std.Tree.unfold
S -> fn(S) -> (T, Array[S]) -> Std.Tree.Tree[T]A tree grown from a starting value.
- Std.Tree.unfoldForest
&Array[S] -> fn(S) -> (T, Array[S]) -> Array[Std.Tree.Tree[T]]A forest grown from several starting values.
- Std.Tree.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.
- Std.Tree.unfoldTo
S -> fn(S) -> (T, Array[S]) -> Int -> Std.Tree.Tree[T]A tree grown from a starting value, stopping at a given depth.
- Std.Tree.valueOf
&Std.Tree.Tree[T] -> TThe value a node carries.
- Std.Tree.withChild
&Std.Tree.Tree[T] -> &Std.Tree.Tree[T] -> Std.Tree.Tree[T]The tree with a child added after the ones already there.
- Std.Tree.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.
