Same as destruct but only for branches, so you are guaranteed a non-empty forest.
Underlying tree type.
The branch being deconstructed.
A pair of the tree node value and a non-empty list of child trees.
import * as Tree from 'effect-tree'const branch: Tree.Branch<number> = Tree.branch(1, [Tree.of(2), Tree.of(3)])const [value, forest] = Tree.destructBranch(branch)expect(value, 'value').toBe(1)expect(forest, 'forest').toEqual([Tree.of(2), Tree.of(3)]) Copy
import * as Tree from 'effect-tree'const branch: Tree.Branch<number> = Tree.branch(1, [Tree.of(2), Tree.of(3)])const [value, forest] = Tree.destructBranch(branch)expect(value, 'value').toBe(1)expect(forest, 'forest').toEqual([Tree.of(2), Tree.of(3)])
Same as destruct but only for branches, so you are guaranteed a non-empty forest.