Skip to content

ap

ap<A>(arg): <B>(data) => Option<B>

Defined in: Core/Option.ts:247

Applies a function wrapped in a Option to a value wrapped in a Option.

A

Option<A>

<B>(data): Option<B>

B

Option<(a) => B>

Option<B>

const add = (a: number) => (b: number) => a + b;
pipe(
  Option.of(add),
  Option.ap(Option.of(5)),
  Option.ap(Option.of(3))
); // Some(8)