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
Eitheroperations that returnEithers. Unlikemapwhich wraps the result in a newEither,flatMapprevents nestedEithers likeRight(Right(value)).