Create a new branch from its value and a non-empty list of child nodes. child nodes.
At the flipped key you will find a flipped curried version that accepts two argument lists: the first with the value and the second with the forest.
flipped
At the tupled key you will find a tupled version that accepts as its single argument a tuple of value and forest.
tupled
import * as Tree from 'effect-tree'const branch = Tree.branch(1, [Tree.of(2)])expect(Tree.isBranch(branch), 'isBranch').toBe(true)expect(Tree.getValue(branch), 'value').toBe(1)expect(Tree.getForest(branch), 'forest').toEqual([Tree.of(2)]) Copy
import * as Tree from 'effect-tree'const branch = Tree.branch(1, [Tree.of(2)])expect(Tree.isBranch(branch), 'isBranch').toBe(true)expect(Tree.getValue(branch), 'value').toBe(1)expect(Tree.getForest(branch), 'forest').toEqual([Tree.of(2)])
Underlying tree type.
The tree root value.
A non-empty list of child nodes, all of the same type as this parent node.
A new branch with the given value and forest.
Create a new branch from its value and a non-empty list of child nodes. child nodes.
At the
flippedkey you will find a flipped curried version that accepts two argument lists: the first with the value and the second with the forest.At the
tupledkey you will find a tupled version that accepts as its single argument a tuple of value and forest.Example
Type Param: A
Underlying tree type.
Param: value
The tree root value.
Param: forest
A non-empty list of child nodes, all of the same type as this parent node.
Returns
A new branch with the given value and forest.