std/core/maybe▲toc

Standard maybestd/core/types/maybe: V -> V functions.

.

fun (==)( mb1 : maybestd/core/types/maybe: V -> V<a>, mb2 : maybestd/core/types/maybe: V -> V<a>, ?(==) : (a, a) -> boolstd/core/types/bool: V ) : boolstd/core/types/bool: V

Equality on maybestd/core/types/maybe: V -> V.

fun (||)( m1 : maybestd/core/types/maybe: V -> V<a>, m2 : maybestd/core/types/maybe: V -> V<a> ) : maybestd/core/types/maybe: V -> V<a>
fun bool( mb : maybestd/core/types/maybe: V -> V<a> ) : boolstd/core/types/bool: V

Convert a maybe type to a boolean, equivalent to is-juststd/core/types/is-just: forall<a> (maybe : maybe<a>) -> bool.

fun cmp( mb1 : maybestd/core/types/maybe: V -> V<a>, mb2 : maybestd/core/types/maybe: V -> V<a>, ?cmp : (a, a) -> orderstd/core/types/order: V ) : orderstd/core/types/order: V

Order on maybestd/core/types/maybe: V -> V values.

fun default( m : maybestd/core/types/maybe: V -> V<a>, nothing : a ) : a

Convert a maybestd/core/types/maybe: V -> V<a> value to a, using the nothing parameter for Nothingstd/core/types/Nothing: forall<a> maybe<a>.

fun map( m : maybestd/core/types/maybe: V -> V<a>, f : (a) -> e b ) : e maybestd/core/types/maybe: V -> V<b>
fun maybe( m : maybestd/core/types/maybe: V -> V<a>, onNothing : b, onJust : (a) -> e b ) : e b

Match a maybestd/core/types/maybe: V -> V value and either return a default value on Nothingstd/core/types/Nothing: forall<a> maybe<a> or apply a function to the value on Juststd/core/types/Just: forall<a> (value : a) -> maybe<a>.

fun order2( mb1 : maybestd/core/types/maybe: V -> V<a>, mb2 : maybestd/core/types/maybe: V -> V<a>, ^?order2 : (a, a) -> order2std/core/types/order2: V -> V<a> ) : order2std/core/types/order2: V -> V<maybestd/core/types/maybe: V -> V<a>>

Order two maybestd/core/types/maybe: V -> V values in ascending order.

fun show( mb : maybestd/core/types/maybe: V -> V<a>, ?show : (a) -> e stringstd/core/types/string: V ) : e stringstd/core/types/string: V

Show a maybestd/core/types/maybe: V -> V type.

fun unjust( m : maybestd/core/types/maybe: V -> V<a> ) : exnstd/core/exn/exn: (E, V) -> V a

Get the value of the Juststd/core/types/Just: forall<a> (value : a) -> maybe<a> constructor or raise an exception.

private import std/core/typesstd/core/types, std/core/hndstd/core/hnd, std/core/exnstd/core/exn