mapLeft<L2> method

Either<L2, R> mapLeft<L2>(
  1. L2 combiner(
    1. L left
    )
)

Maps the left value, leaving the right value unchanged.

Implementation

Either<L2, R> mapLeft<L2>(L2 Function(L left) combiner) {
  return fold(
    (left) => Left<L2, R>(combiner(left)),
    (right) => Right<L2, R>(right),
  );
}