Interface ConcreteGiven<F, A>

Common options for testing concrete type typeclass laws. These are the typeclasses that do not expect a higher-kinded type as their parameter. All the concrete typeclass laws expect these options to be provided.

interface ConcreteGiven<F, A> {
    a: Arbitrary<A>;
    equalsA: Equivalence<A>;
    F: Kind<F, never, unknown, unknown, A>;
    suffix?: string;
}

Type Parameters

  • F extends TypeLambda

    The type lambda of the typeclass under test. If we are testing Monoid laws, for example, then it would be set to MonoidTypeLambda.

  • A

    The datatype under test. For example, when testing Monoid laws on Option<number>, this would be set to Option<number>.

Properties

Properties

a: Arbitrary<A>

An arbitrary for the values used to test the typeclass. For example when testing Monoid on Option<number>, this should return an arbitrary for an Option<number>.

equalsA: Equivalence<A>

An arbitrary for the values used to test the typeclass. For example when testing Monoid on Option<number>, this should return an equivalence for an Option<number>.

F: Kind<F, never, unknown, unknown, A>

Instance under test. For example when testing the Monoid typeclass laws on an instance of the Option Monoid, with the underlying type set at number, then the type parameter A would be set at Option<number> and this field at Monoid<Option<number>>.

suffix?: string

Optional suffix to attach to LawTest label.