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

    Function leaf

    • Create a new leaf from its value.

      Type Parameters

      • A

        Underlying tree type.

      Parameters

      • value: A

        The tree root value.

      Returns Leaf<A>

      A new leaf with the given value.

      import * as Tree from 'effect-tree'

      const leaf = Tree.leaf(1)

      expect(Tree.isLeaf(leaf), 'isLeaf').toBe(true)
      expect(Tree.getValue(leaf), 'value').toBe(1)