Skip to main content

orElse()

orElse<E1, A, E2>(onLeft): (ma) => Either<E2, A>

Recovers from a Left by applying a function.


Type Parametersโ€‹

E1: E1โ€‹

The original error type.

A: Aโ€‹

The success type.

E2: E2โ€‹

The new error type.


Parametersโ€‹

onLeft: (e) => Either<E2, A>โ€‹

Handler for Left case.


Returnsโ€‹

A function that transforms the Either.


Sinceโ€‹

2.0.0