effect-ts-laws
    Preparing search index...

    Function findCounterexample

    • 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.

      • Optionalparameters: Parameters<A>

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

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

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

          • self: (a: A) => B

            First function to sample.

          • that: (a: A) => B

            Second function to sample.

          Returns Option<A>