sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page
Tree.ForestSourceA forest can be considered as a non-empty sequence of trees. The functions declared in this module transposed naturally the functions provided on tree.
Function of this modules always ensure that the sequence is not empty. This is why the function sequence takes two arguments instead of one.
Because of the non-emptiness property, the function first is total.
Names of those functions are inspired from Haskell.
Datatype for a forest.
make root produces a forest with a single tree by using make
first forest returns the first tree of the forest. This function is total since the module guarantees the forest is never empty.
is_singleton forest returns true if there is a single tree in the forest. false otherwise.
seqnece tree forest returns a new forest made of a sequence of forest, namely Seq.cons tree forest |> Seq.concat.
map f forest applies a function f over each value of the forest.
map_tree f forest applies a function f over each tree of the forest.
bind forest f is a generalisation of bind over sequence of trees.