Function withOuterOption

Return the given options transformed into options for a composed typeclass test, where the outer composed datatype is an Option. This is a version of liftGiven fixed on composing with the Option as outer datatype.

  • Type Parameters

    • K extends "Of" | "Invariant" | "Covariant" | "Applicative" | "Foldable" | "Traversable"
    • Class extends TypeLambda
    • F extends TypeLambda
    • A
    • B = A
    • C = A
    • R = never
    • O = unknown
    • E = unknown

    Parameters

    • key: K

      Type of composition requested: Of, Invariant, Covariant, Applicative, or Traversable. The Option datatype can do all of them.

    • given: ParameterizedGiven<Class, F, A, B, C, R, O, E>

      The original ParameterizedGiven for the typeclass under test as it is before composition.

    • optionInstance: Kind<Class, R, O, E, OptionTypeLambda>

      The instance of Option for the typeclass under test.

    Returns readonly [
        `${K}Composition.${string}`,
        ParameterizedGiven<
            Class,
            ComposeTypeLambda<OptionTypeLambda, F, R, O, E, R, O, E>,
            A,
            B,
            C,
            R,
            O,
            E,
        >,
    ]

    Typeclass test options for the F datatype when it is wrapped in an Option.