effect-ts-laws
    Preparing search index...

    Interface ParameterizedGiven<Typeclass, F1, A, B, C, R, O, E>

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

    The type lambda of the datatype under test. For example when testing an instance of Covariant<Array<string>>, F would be the type lambda of the higher-kinded type Array.

    interface ParameterizedGiven<
        Typeclass extends TypeLambda,
        F1 extends TypeLambda,
        A,
        B = A,
        C = A,
        R = never,
        O = unknown,
        E = unknown,
    > {
        a: Arbitrary<A>;
        b: Arbitrary<B>;
        c: Arbitrary<C>;
        equalsA: Equivalence<A>;
        equalsB: Equivalence<B>;
        equalsC: Equivalence<C>;
        F: Kind<Typeclass, R, O, E, F1>;
        getArbitrary: LiftArbitrary<F1, R, O, E>;
        getEquivalence: LiftEquivalence<F1, R, O, E>;
        Monoid: Monoid<A>;
        predicateA: Arbitrary<Predicate<A>>;
        predicateB: Arbitrary<Predicate<B>>;
        predicateC: Arbitrary<Predicate<C>>;
    }

    Type Parameters

    • Typeclass extends TypeLambda

      The type lambda of the typeclass under tests. For example when testing an instance of Covariant<Array<string>>, Typeclass would be the type lambda of the higher-kinded type Covariant.

    • F1 extends TypeLambda
    • A
    • B = A
    • C = A
    • R = never
    • O = unknown
    • E = unknown

    Hierarchy (View Summary)

    Index

    Properties

    a: Arbitrary<A>

    An arbitrary for the underlying type A.

    b: Arbitrary<B>

    An arbitrary for the underlying type B.

    c: Arbitrary<C>

    An arbitrary 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<Typeclass, R, O, E, F1>

    The higher-kinded type Typeclass<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<F1, R, O, E>

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

    getEquivalence: LiftEquivalence<F1, R, O, E>

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

    Monoid: Monoid<A>

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

    predicateA: Arbitrary<Predicate<A>>

    Predicate for values of type A.

    predicateB: Arbitrary<Predicate<B>>

    Predicate for values of type B.

    predicateC: Arbitrary<Predicate<C>>

    Predicate for values of type C.