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