runLogTask<O> static method

Task<IList<O>> runLogTask<O>(
  1. Conveyor<Task, O> cto
)

Implementation

static Task<IList<O>> runLogTask<O>(Conveyor<Task, O> cto) {
  Task<IList<O>> go(Conveyor<Task, O> cur, IList<O> acc) =>
    cur.interpret((h, t) => go(t, cons(h, acc)),
        (req, recv) => req.attempt().bind((Either<Object, dynamic> e) => go(Try(() => recv(e)), acc)),
        (err) => err == End ? new Task(() => new Future.value(acc.reverse())) : new Task(() => new Future.error(err)));
  return go(cto, nil());
}