fold<R, L, A, B> function
ReaderTask<R, B> Function(ReaderTaskEither<R, L, A> )
fold<R, L, A, B>(
- B onLeft(
- L left
- B onRight(
- A right
Unwraps the Either value, returning a ReaderTask that resolves to the result.
onRight
is run if the value is an Right, and onLeft
for Left.
Implementation
ReaderTask<R, B> Function(ReaderTaskEither<R, L, A>) fold<R, L, A, B>(
B Function(L left) onLeft,
B Function(A right) onRight,
) =>
(fa) => ReaderTask((r) => fa(r).p(TE.fold(onLeft, onRight)));