flatMapLeft<L2> method

Either<L2, R> flatMapLeft<L2>(
  1. Either<L2, R> f(
    1. L
    )
)

Flat maps the left value if this is a Left

Implementation

Either<L2, R> flatMapLeft<L2>(Either<L2, R> Function(L) f) {
  return switch (this) {
    Left(:final value) => f(value),
    Right() => this as Either<L2, R>,
  };
}