Skip to main content

match()

match<E, A, B>(onLeft, onRight): (ma) => B

Pattern matches on an Either.


Type Parameters​

E: E​

The error type.

A: A​

The success type.

B: B​

The return type.


Parameters​

onLeft: (e) => B​

Handler for Left case.

onRight: (a) => B​

Handler for Right case.


Returns​

A function that takes an Either and returns B.


Since​

2.0.0