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"
          | "Traversable"
    • Class extends TypeLambda
    • F extends TypeLambda
    • A
    • B = A
    • C = A
    • 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, any, any, E>

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

    • optionInstance: Kind<Class, unknown, never, never, OptionTypeLambda>

      The instance of Option for the typeclass under test.

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

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