• Pattern matches on an Either, handling both Right and Left cases.

    Type Parameters

    • E
    • A
    • B
    • C

    Parameters

    • onLeft: (left: E) => B

      Function to handle the Left case

    • onRight: (right: A) => C

      Function to handle the Right case

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

    The result of either onLeft or onRight based on the Either state