redeemWith<C, D> method
Redeem an Either to an Either by resolving the error
or mapping the value R
to C
with an Either.
redeemWith is derived from flatMap and handleErrorWith.
This is functionally equivalent to flatMap(rightOperation).handleErrorWith(leftOperation)
.
Implementation
Either<C, D> redeemWith<C, D>({
required Either<C, D> Function(L value) leftOperation,
required Either<C, D> Function(R value) rightOperation,
}) =>
_foldInternal(
ifLeft: leftOperation,
ifRight: rightOperation,
);