Transform the Maybe into a Result.Result Result, using the wrapped value as the Ok value if Just; otherwise using the supplied error value for Err.
Maybe
Ok
Just
error
Err
The error value to use if the Maybe is Nothing.
Nothing
The Maybe instance to convert.
A Result containing the value wrapped in maybe in an Ok, or error in an Err.
Result
maybe
T The wrapped value.
E The error type to in the Result.
Transform the
Maybe
into a Result.Result Result, using the wrapped value as theOk
value ifJust
; otherwise using the suppliederror
value forErr
.