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

    Function branch

    Create a new branch from its value and a non-empty list of child nodes. child nodes.

    At the flipped key you will find a flipped curried version that accepts two argument lists: the first with the value and the second with the forest.

    At the tupled key you will find a tupled version that accepts as its single argument a tuple of value and forest.

    import * as Tree from 'effect-tree'

    const branch = Tree.branch(1, [Tree.of(2)])

    expect(Tree.isBranch(branch), 'isBranch').toBe(true)
    expect(Tree.getValue(branch), 'value').toBe(1)
    expect(Tree.getForest(branch), 'forest').toEqual([Tree.of(2)])

    Underlying tree type.

    The tree root value.

    A non-empty list of child nodes, all of the same type as this parent node.

    A new branch with the given value and forest.

    Index

    Properties

    Properties

    flipped: <A>(value: A) => (forest: readonly [Tree<A>, Tree<A>]) => Branch<A>
    tupled: <A>(
        valueAndForest: [value: A, forest: readonly [Tree<A>, Tree<A>]],
    ) => Branch<A>