Set the root node forest to a given forest of the same type. If the given tree is leaf it is upgraded into a branch.
import * as Tree from 'effect-tree'const leaf = Tree.of(1)const changed = Tree.setForest(leaf, [Tree.of(2)])expect(Tree.getForest(changed)).toEqual([Tree.of(2)]) Copy
import * as Tree from 'effect-tree'const leaf = Tree.of(1)const changed = Tree.setForest(leaf, [Tree.of(2)])expect(Tree.getForest(changed)).toEqual([Tree.of(2)])
Underlying tree type.
The tree being changed.
New forest.
A new tree where the forest has been replaced by the given forest.
Set the root node forest to a given forest of the same type. If the given tree is leaf it is upgraded into a branch.
Example
Type Param: A
Underlying tree type.
Param: self
The tree being changed.
Param: forest
New forest.
Returns
A new tree where the forest has been replaced by the given forest.