flatMap<C> method

  1. @override
TaskEither<L, C> flatMap<C>(
  1. covariant TaskEither<L, C> f(
    1. R r
    )
)
override

Used to chain multiple functions that return a TaskEither.

You can extract the value of every Right in the chain without handling all possible missing cases. If running any of the tasks in the chain returns Left, the result is Left.

Implementation

@override
TaskEither<L, C> flatMap<C>(covariant TaskEither<L, C> Function(R r) f) =>
    TaskEither(() => run().then(
          (either) async => either.match(
            left,
            (r) => f(r).run(),
          ),
        ));