Function ap

  • <A, B>(of: Opt<(_: A) => B>) => (oa: Opt<A>): Opt<B>
    

    Apply oa to function of. If any argument is None then result is None.

    ap(opt(x => x > 0))(opt(1)) // Opt(true)
    ap(opt(x => x > 0))(none) // None
    ap(none)(opt(1)) // None
    ap(none)(none) // None

    Type Parameters

    • A

    • B

    Parameters

    • of: Opt<((_) => B)>

    Returns ((oa) => Opt<B>)

      • (oa): Opt<B>
      • Parameters

        Returns Opt<B>

    Typeparam

    A input of function inside of

    Typeparam

    B output of function inside of

Generated using TypeDoc