Returns a Just
containing the Either
value if this is of a Right
or a Nothing
if this is a Left
.
{{{ Right(21).right.toMaybe // Just(21) Left(21).right.toMaybe // Nothing }}}
Binds the given function across Right
if this is of a Right
, otherwise
returns the original Either
. Slightly different from map
is that fn
is expected to return an Either
.
The function to bind accross the Right
Returns the value from this Either
if this is of a Right
, or the given
argument if this is of a Left
.
The default value
Maps the function argument through Right
if this is of a Right
,
otherwise returns the original Eihter
.
The function to map
Generated using TypeDoc
Returns the value from this
Either
if this is of aRight
, otherwise throws an Error.