Construct a Maybe
from a
{@linkcode Result.Result Result<T, E>}.
The type of the value wrapped in a Result.Ok
and in the Just
of the resulting Maybe
.
The Result
to construct a Maybe
from.
Just
if result
was Ok
or Nothing
if it was Err
.
The wrapped value.
The error type to in the Result
.
The function which generates an error of type 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
.
The wrapped value.
The error type to in the Result
.
The error value to use if the Maybe
is Nothing
.
The Maybe
instance to convert.
A Result
containing the value wrapped in maybe
in an Ok
, or
error
in an Err
.
Generated using TypeDoc
Transform a {@linkcode Maybe.Maybe Maybe} into a
Result
.If the
Maybe
is a {@linkcode Maybe.Just Just}, its value will be wrapped in theOk
variant; if it is a {@linkcode Maybe.Nothing Nothing} theerrValue
will be wrapped in theErr
variant.