Stdlib320.Result
A module containing basic result operations
val is_ok : ('a, 'e) result -> bool
is_ok r
is
true
if r = Ok x
false
if r = Error e
val is_error : ('a, 'e) result -> bool
is_error r
is equivalent to not (is_ok e)
Mapping function for result values. It applies a function to the value of the result if the result is not an error and passes along the error otherwise. map f r
is
Ok (f x)
if r = Ok x
Error e
if r = Error e
Mapping function for result errors, similar to the previous function but on errors, i.e. map f r
is
Ok x
if r = Ok x
Error (f e)
if r = Error e