flatMap<R, A, B> function

ReaderTask<R, B> Function(ReaderTask<R, A>) flatMap<R, A, B>(
  1. ReaderTask<R, B> f(
    1. A a
    )
)

flatMap transforms the previous computation result using the given function.

Implementation

ReaderTask<R, B> Function(ReaderTask<R, A>) flatMap<R, A, B>(
  ReaderTask<R, B> Function(A a) f,
) =>
    (fa) => ReaderTask((r) => fa(r).chain(T.flatMap((a) => f(a)(r))));