mapLeft<C> method
The given function is applied if this is a Left
.
Example
Right<int, int>(12).mapLeft((_) => 'flower'); // Result: Right(12)
Left<int, int>(12).mapLeft((_) => 'flower'); // Result: Left('flower')
Implementation
Either<C, R> mapLeft<C>(C Function(L value) f) => _foldInternal(
ifLeft: (l) => Either<C, R>.left(f(l)),
ifRight: (r) => Either<C, R>.right(r),
);