effect-tree - v1.0.36
    Preparing search index...

    Function setForest

    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)])

    Underlying tree type.

    The tree being changed.

    New forest.

    A new tree where the forest has been replaced by the given forest.

    Index

    Properties

    Properties

    flip: <A>(self: Tree<A>) => (forest: readonly [Tree<A>, Tree<A>]) => Branch<A>