Fmlib_std.OptionOptional elements of a certain type.
val return : 'a -> 'a treturn a Equivalent to Some a.
val fail : 'a tEquivalent to None.
Chaining of operations which return optional elements.
Example:
let* a = op1 ... in (* 'op1 ... ' returns an optional element *)
let* b = op2 ... in
let* c = op3 ... in
...
return (f a b c ...)mf <*> ma is equivalent to
let* f = mf in
let* a = ma in
return (f a)val to_list : 'a t -> 'a listto_list a Returns a one element list or an empty list.
val to_result : 'e -> 'a t -> ('a, 'e) Stdlib.resultto_result err opt
Map the optional opt into a result. If the optional has a value v it is transformed to Ok v. If there is no value then Error err is returned.