flatMapTaskEither<C> method

ReaderTaskEither<E, L, C> flatMapTaskEither<C>(
  1. TaskEither<L, C> f(
    1. R r
    )
)

Chain a function that takes the current value R inside this TaskEither and returns Either.

Similar to flatMap, but f returns Either instead of TaskEither.

Implementation

ReaderTaskEither<E, L, C> flatMapTaskEither<C>(
  TaskEither<L, C> Function(R r) f,
) =>
    ReaderTaskEither((env) => run(env).then(
          (either) async => either.match(
            left,
            (r) => f(r).run(),
          ),
        ));