FunctionVariants

class Object
trait Matchable
class Any
object Gen.type
object GenF2.type

Value members

Concrete methods

final def function[R, A, B](gen: Gen[R, B])(implicit trace: Trace): Gen[R, A => B]

Constructs a generator of functions from A to B given a generator of B values. Two A values will be considered to be equal, and thus will be guaranteed to generate the same B value, if they have the same hashCode.

Constructs a generator of functions from A to B given a generator of B values. Two A values will be considered to be equal, and thus will be guaranteed to generate the same B value, if they have the same hashCode.

final def function2[R, A, B, C](gen: Gen[R, C])(implicit trace: Trace): Gen[R, (A, B) => C]

A version of function that generates functions that accept two parameters.

A version of function that generates functions that accept two parameters.

final def function3[R, A, B, C, D](gen: Gen[R, D])(implicit trace: Trace): Gen[R, (A, B, C) => D]

A version of function that generates functions that accept three parameters.

A version of function that generates functions that accept three parameters.

final def function4[R, A, B, C, D, E](gen: Gen[R, E])(implicit trace: Trace): Gen[R, (A, B, C, D) => E]

A version of function that generates functions that accept four parameters.

A version of function that generates functions that accept four parameters.

final def functionWith[R, A, B](gen: Gen[R, B])(hash: A => Int)(implicit trace: Trace): Gen[R, A => B]

Constructs a generator of functions from A to B given a generator of B values and a hashing function for A values. Two A values will be considered to be equal, and thus will be guaranteed to generate the same B value, if they have have the same hash. This is useful when A does not implement hashCode in a way that is consistent with equality.

Constructs a generator of functions from A to B given a generator of B values and a hashing function for A values. Two A values will be considered to be equal, and thus will be guaranteed to generate the same B value, if they have have the same hash. This is useful when A does not implement hashCode in a way that is consistent with equality.

final def functionWith2[R, A, B, C](gen: Gen[R, C])(hash: (A, B) => Int)(implicit trace: Trace): Gen[R, (A, B) => C]

A version of functionWith that generates functions that accept two parameters.

A version of functionWith that generates functions that accept two parameters.

final def functionWith3[R, A, B, C, D](gen: Gen[R, D])(hash: (A, B, C) => Int)(implicit trace: Trace): Gen[R, (A, B, C) => D]

A version of functionWith that generates functions that accept three parameters.

A version of functionWith that generates functions that accept three parameters.

final def functionWith4[R, A, B, C, D, E](gen: Gen[R, E])(hash: (A, B, C, D) => Int)(implicit trace: Trace): Gen[R, (A, B, C, D) => E]

A version of functionWith that generates functions that accept four parameters.

A version of functionWith that generates functions that accept four parameters.