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