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

    Function includes

    • True if needle is found in the tree.

      Will short-circuit and return immediately if the needle is found.

      Type Parameters

      • A

      Parameters

      • equals: Equivalence<A>

      Returns (a: A) => Predicate<Tree<A>>

      import {includes, from, of} from 'effect-tree'
      import {Number} from 'effect'

      const tree = from(1, of(2), from(4, of(5)))

      const hasNumber = includes(Number.Equivalence)

      expect(hasNumber(3)(tree), 'not found').toBe(false)
      expect(hasNumber(5)(tree), 'found').toBe(true)