Skip to content

ap

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

Defined in: Core/Option.ts:237

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.some(add),
  Option.ap(Option.some(5)),
  Option.ap(Option.some(3))
); // Some(8)