ap<B> method

  1. @override
ReaderTask<E, B> ap<B>(
  1. covariant ReaderTask<E, B Function(A a)> a
)
override

Apply the function contained inside a to change the value of type A to a value of type B.

Implementation

@override
ReaderTask<E, B> ap<B>(covariant ReaderTask<E, B Function(A a)> a) =>
    ReaderTask(
      (env) => a.run(env).then(
            (f) => run(env).then(
              (v) => f(v),
            ),
          ),
    );