Function unfoldGiven

Unfold a ParameterizedGiven into an equivalence and arbitrary required by typeclass tests.

  • Type Parameters

    • Class extends TypeLambda
    • F extends TypeLambda
    • A
    • B = A
    • C = A
    • In1 = never
    • Out2 = unknown
    • Out1 = unknown

    Parameters

    Returns {
        a: Arbitrary<A>;
        ab: Arbitrary<((a: A) => B)>;
        afb: Arbitrary<((a: A) => Kind<F, In1, Out2, Out1, B>)>;
        b: Arbitrary<B>;
        ba: Arbitrary<((a: B) => A)>;
        bc: Arbitrary<((a: B) => C)>;
        bfc: Arbitrary<((a: B) => Kind<F, In1, Out2, Out1, C>)>;
        c: Arbitrary<C>;
        cb: Arbitrary<((a: C) => B)>;
        equalsA: Equivalence<A>;
        equalsB: Equivalence<B>;
        equalsC: Equivalence<C>;
        equalsFa: Equivalence<Kind<F, In1, Out2, Out1, A>>;
        equalsFb: Equivalence<Kind<F, In1, Out2, Out1, B>>;
        equalsFc: Equivalence<Kind<F, In1, Out2, Out1, C>>;
        F: Kind<Class, In1, Out2, Out1, F>;
        fa: Arbitrary<Kind<F, In1, Out2, Out1, A>>;
        fabOf: ((of: (<T>(a: T) => Kind<F, In1, Out2, Out1, T>)) => Arbitrary<Kind<F, In1, Out2, Out1, ((a: A) => B)>>);
        fb: Arbitrary<Kind<F, In1, Out2, Out1, B>>;
        fbcOf: ((of: (<T>(a: T) => Kind<F, In1, Out2, Out1, T>)) => Arbitrary<Kind<F, In1, Out2, Out1, ((a: B) => C)>>);
        fc: Arbitrary<Kind<F, In1, Out2, Out1, C>>;
        getArbitrary: LiftArbitrary<F, In1, Out2, Out1>;
        getEquivalence: LiftEquivalence<F, In1, Out2, Out1>;
        Monoid?: Monoid<A>;
    }

    • a: Arbitrary<A>

      An equivalence for the underlying type A.

    • ab: Arbitrary<((a: A) => B)>
    • afb: Arbitrary<((a: A) => Kind<F, In1, Out2, Out1, B>)>
    • b: Arbitrary<B>

      An equivalence for the underlying type B.

    • ba: Arbitrary<((a: B) => A)>
    • bc: Arbitrary<((a: B) => C)>
    • bfc: Arbitrary<((a: B) => Kind<F, In1, Out2, Out1, C>)>
    • c: Arbitrary<C>

      An equivalence for the underlying type C.

    • cb: Arbitrary<((a: C) => B)>
    • 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.

    • equalsFa: Equivalence<Kind<F, In1, Out2, Out1, A>>
    • equalsFb: Equivalence<Kind<F, In1, Out2, Out1, B>>
    • equalsFc: Equivalence<Kind<F, In1, Out2, Out1, 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>.

    • fa: Arbitrary<Kind<F, In1, Out2, Out1, A>>
    • fabOf: ((of: (<T>(a: T) => Kind<F, In1, Out2, Out1, T>)) => Arbitrary<Kind<F, In1, Out2, Out1, ((a: A) => B)>>)
    • fb: Arbitrary<Kind<F, In1, Out2, Out1, B>>
    • fbcOf: ((of: (<T>(a: T) => Kind<F, In1, Out2, Out1, T>)) => Arbitrary<Kind<F, In1, Out2, Out1, ((a: B) => C)>>)
    • fc: Arbitrary<Kind<F, In1, Out2, Out1, C>>
    • 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.

    • OptionalMonoid?: Monoid<A>

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