Chains Either operations that return Eithers. Unlike map which wraps the result in a new Either, flatMap prevents nested Eithers like Right(Right(value)).
Either
map
flatMap
Right(Right(value))
A function that returns an Either
The Either returned by the function if the input is Right, Left otherwise
Right
Left
Chains
Either
operations that returnEither
s. Unlikemap
which wraps the result in a newEither
,flatMap
prevents nestedEither
s likeRight(Right(value))
.