flatMap<R2> method

  1. @override
Either<L, R2> flatMap<R2>(
  1. Either<L, R2> f(
    1. R right
    )
)
override

Applies the function f to the value contained in Right, if it exists, and returns a new Either containing the result. If this is a Left, it is returned unchanged.

Implementation

@override
Either<L, R2> flatMap<R2>(Either<L, R2> Function(R right) f) {
  // Left stays unchanged during flatMap
  return Left<L, R2>(value);
}