• Chains Either operations that return Eithers. Unlike map which wraps the result in a new Either, flatMap prevents nested Eithers like Right(Right(value)).

    Type Parameters

    • E
    • A
    • B

    Parameters

    • f: (right: A) => Either<E, B>

      A function that returns an Either

    Returns (either: Either<E, A>) => Either<E, B>

    The Either returned by the function if the input is Right, Left otherwise