Set the value of a tree root to a given value of the same type.
import * as Tree from 'effect-tree'const leaf = Tree.of(1)const changed = Tree.setValue(leaf, 2)expect(Tree.getValue(changed)).toBe(2) Copy
import * as Tree from 'effect-tree'const leaf = Tree.of(1)const changed = Tree.setValue(leaf, 2)expect(Tree.getValue(changed)).toBe(2)
Underlying tree type.
The tree being changed.
New value for the root node.
A new tree where the root value has been replaced by the given value.
Set the value of a tree root to a given value of the same type.
Example
Type Param: A
Underlying tree type.
Param: self
The tree being changed.
Param: value
New value for the root node.
Returns
A new tree where the root value has been replaced by the given value.