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

    Function maximumNodeHeight

    • Compute the maximum node depth of all nodes in a tree.

      Type Parameters

      • A

      Parameters

      Returns number

      import {from, of, maximumNodeHeight} from 'effect-tree'

      const tree = from(
      1,
      from(
      2,
      of(
      3 // ← deepest leaf
      )
      ),
      of(4),
      )

      expect(maximumNodeHeight(tree)).toBe(3)