API / Js / Js_option

Js_option

t

type t<'a> = option<'a>

some

let some: 'a => option<'a>

isSome

let isSome: option<'a> => bool

isSomeValue

let isSomeValue: ((. 'a, 'a) => bool, 'a, option<'a>) => bool

isNone

let isNone: option<'a> => bool

getExn

let getExn: option<'a> => 'a

equal

let equal: ((. 'a, 'b) => bool, option<'a>, option<'b>) => bool

andThen

let andThen: ((. 'a) => option<'b>, option<'a>) => option<'b>

map

let map: ((. 'a) => 'b, option<'a>) => option<'b>

getWithDefault

let getWithDefault: ('a, option<'a>) => 'a

default

let default: ('a, option<'a>) => 'a

filter

let filter: ((. 'a) => bool, option<'a>) => option<'a>

firstSome

let firstSome: (option<'a>, option<'a>) => option<'a>