match<A> method
- A onLeft(
- L l
- A onRight(
- R r
Pattern matching to convert a TaskEither to a Task.
Execute onLeft
when running this TaskEither returns a Left.
Otherwise execute onRight
.
Implementation
Task<A> match<A>(A Function(L l) onLeft, A Function(R r) onRight) =>
Task(() async => (await run()).match(onLeft, onRight));