Interface ParameterizedGiven<Class, F, A, B, C, In1, Out2, Out1>

Options for testing parameterized-type typeclasses. All the typeclass laws here expect their arguments to be of this type.

interface ParameterizedGiven<Class, F, A, B, C, In1, Out2, Out1> {
    a: Arbitrary<A>;
    b: Arbitrary<B>;
    c: Arbitrary<C>;
    equalsA: Equivalence<A>;
    equalsB: Equivalence<B>;
    equalsC: Equivalence<C>;
    F: Kind<Class, In1, Out2, Out1, F>;
    getArbitrary: LiftArbitrary<F, In1, Out2, Out1>;
    getEquivalence: LiftEquivalence<F, In1, Out2, Out1>;
    Monoid?: Monoid<A>;
}

Type Parameters

  • Class extends TypeLambda

    The type lambda of the typeclass under tests.

  • F extends TypeLambda

    The type lambda of the datatype under test.

  • A
  • B = A
  • C = A
  • In1 = never
  • Out2 = unknown
  • Out1 = unknown

Hierarchy (view full)

Properties

a: Arbitrary<A>

An equivalence for the underlying type A.

b: Arbitrary<B>

An equivalence for the underlying type B.

c: Arbitrary<C>

An equivalence for the underlying type C.

equalsA: Equivalence<A>

An equivalence for the underlying type A.

equalsB: Equivalence<B>

An equivalence for the underlying type B.

equalsC: Equivalence<C>

An equivalence for the underlying type C.

F: Kind<Class, In1, Out2, Out1, F>

The higher-kinded type Class<F> is the typeclass instance under test. For example when testing the Monad laws on an Either<number, string>, this would be Monad<Either>.

getArbitrary: LiftArbitrary<F, In1, Out2, Out1>

A function that will get an equivalence for the type under test from an equivalence for the underlying type.

getEquivalence: LiftEquivalence<F, In1, Out2, Out1>

A function that will get an equivalence for the type under test from an equivalence for the underlying type.

Monoid?: Monoid<A>

Optional Monoid for the underlying type A, useful for typeclasses like Applicative that can build their own Monoid instance from it.