Function apFn

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

    Apply oa to function f. If argument is None then result is None.

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

    Type Parameters

    • A

    • B

    Parameters

    • f: ((_) => B)
        • (_): B
        • Parameters

          • _: A

          Returns B

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

      • (oa): Opt<B>
      • Parameters

        Returns Opt<B>

    Typeparam

    A input of function f

    Typeparam

    B output of function f

Generated using TypeDoc