API / JavaScript / Js / Option

Option

Provide utilities for handling option.

type t('a) = option('a);
let some: 'a => option('a);
let isSome: option('a) => bool;
let isSomeValue: ((. 'a, 'a) => bool, 'a, option('a)) => bool;
let isNone: option('a) => bool;
let getExn: option('a) => 'a;
let equal: ((. 'a, 'b) => bool, option('a), option('b)) => bool;
let andThen: ((. 'a) => option('b), option('a)) => option('b);
let map: ((. 'a) => 'b, option('a)) => option('b);
let getWithDefault: ('a, option('a)) => 'a;
let default: ('a, option('a)) => 'a;
let filter: ((. 'a) => bool, option('a)) => option('a);
let firstSome: (option('a), option('a)) => option('a);