Transform the Maybe into a Result, using the wrapped value as the Ok value if Just; otherwise using elseFn to generate Err.
Maybe
Result
Ok
Just
elseFn
Err
The function which generates an error of type E.
E
The Maybe instance to convert.
A Result containing the value wrapped in maybe in an Ok, or the value generated by elseFn in an Err.
maybe
T The wrapped value.
E The error type to in the Result.
Transform the
Maybe
into aResult
, using the wrapped value as theOk
value ifJust
; otherwise usingelseFn
to generateErr
.