orElse<TL> method

TaskEither<TL, R> orElse<TL>(
  1. TaskEither<TL, R> orElse(
    1. L l
    )
)

When this TaskEither returns a Left then return the result of orElse. Otherwise return this TaskEither.

Implementation

TaskEither<TL, R> orElse<TL>(TaskEither<TL, R> Function(L l) orElse) =>
    TaskEither(() async => (await run()).match(
        (l) => orElse(l).run(), (r) => TaskEither<TL, R>.right(r).run()));