sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page
Tree.Forest
SourceA 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
uncons forest
splits the forest into a tree and a sequence of trees.
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.