fold()
constfold: <E,A,B>(onLeft,onRight) => (ma) =>B=match
Alias for match.
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