Function sampleUnaryEquivalence

Attempt to find an example input where the pair of given unary functions is not equal. Given an arbitrary of A, an equivalence for B and a pair of functions, check the functions compute the same B given the same A, for numRuns values. Returns none or some value found.

  • Type Parameters

    • A
    • B

    Parameters

    • a: Arbitrary<A>

      An arbitrary for the function argument type A.

    • equalsB: Equivalence<B>

      Equivalence for the function return value type B.

    • parameters: Parameters<A> = ...

    Returns ((self: ((a: A) => B), that: ((a: A) => B)) => Option<A>)

    none if no counter-example to the equivalence was found, else some of the A that was found to produce different values.

      • (self, that): Option<A>
      • Parameters

        • self: ((a: A) => B)

          First function to sample.

            • (a): B
            • Parameters

              Returns B

        • that: ((a: A) => B)

          Second function to sample.

            • (a): B
            • Parameters

              Returns B

        Returns Option<A>