traverseIterable<A, B> function

Task<IList<B>> Function(Iterable<A>) traverseIterable<A, B>(
  1. Task<B> f(
    1. A a
    )
)

Implementation

Task<IList<B>> Function(Iterable<A>) traverseIterable<A, B>(
  Task<B> Function(A a) f,
) =>
    (as) => Task(() => Future.wait(as.map((a) => Future.sync(f(a).call)))
        .then((bs) => IList(bs)));