Module Stdlib_stable.Or_nullSource
Nullable values.
Nullable values explicitly indicate the presence or absence of a value, representing present values as themselves and absent ones as null pointers. Unlike the regular option, the or_null type can't be nested.
This module mirrors Option, except for join which can't be defined.
The type of nullable values. Either Null or a value This v. 'a or_null has a non-standard value_or_null layout, preventing the type constructor from being nested.
value o ~default is v if o is This v and default otherwise.
bind o f is f v if o is This v and Null if o is Null.
map f o is Null if o is Null and This v if o is This v.
fold ~null ~this o is null if o is Null and this v if o is This v.
iter f o is f v if o is This v and () otherwise.
equal eq o0 o1 is true if and only if o0 and o1 are both Null or if they are This v0 and This v1 and eq v0 v1 is true.
compare f o o' is a total order on or_null using cmp to compare values wrapped by This _. Null is smaller than This _ values.
to_result ~null o is Ok v if o is This v and Error null otherwise.
to_seq o is o as a sequence. Null is the empty sequence and This v is the singleton sequence containing v.
to_option o is Some v if o is This v and None otherwise.