Append a tree to the children of the root node. If self is a leaf, it is converted into a branch.
self
import * as Tree from 'effect-tree'const tree = Tree.tree(1, [Tree.of(2), Tree.of(3)])const changed = Tree.append(tree, Tree.of(4))expect(Tree.getForest(changed)).toEqual([ Tree.of(2), Tree.of(3), Tree.of(4),]) Copy
import * as Tree from 'effect-tree'const tree = Tree.tree(1, [Tree.of(2), Tree.of(3)])const changed = Tree.append(tree, Tree.of(4))expect(Tree.getForest(changed)).toEqual([ Tree.of(2), Tree.of(3), Tree.of(4),])
Tree underlying type.
The tree to modify.
Child to append.
A new updated tree with the new node appended.
Append a tree to the children of the root node. If
selfis a leaf, it is converted into a branch.Example
Type Param: A
Tree underlying type.
Param: self
The tree to modify.
Param: child
Child to append.
Returns
A new updated tree with the new node appended.