Function equals

  • Allows quick triple-equal equality check between the values inside two maybe instances without having to unwrap them first.

    const a = Maybe.of(3);
    const b = Maybe.of(3);
    const c = Maybe.of(null);
    const d = Maybe.nothing();

    Maybe.equals(a, b); // true
    Maybe.equals(a, c); // false
    Maybe.equals(c, d); // true

    Type Parameters

    • T

    Parameters

    • mb: Maybe<T>

      A maybe to compare to.

    • ma: Maybe<T>

      A maybe instance to check.

    Returns boolean

  • Type Parameters

    • T

    Parameters

    Returns ((ma: Maybe<T>) => boolean)

      • (ma): boolean
      • Parameters

        Returns boolean