traverseEvaluation<B, E, R, W, S> method
Evaluation<E, R, W, S, IList<B> >
traverseEvaluation<B, E, R, W, S>(
- Monoid<
W> WMi, - Evaluation<
E, R, W, S, B> f(- A a
Implementation
Evaluation<E, R, W, S, IList<B>> traverseEvaluation<B, E, R, W, S>(Monoid<W> WMi, Evaluation<E, R, W, S, B> f(A a)) {
Evaluation<E, R, W, S, IList<B>> result = new Evaluation(WMi, (r, s) => new Future.value(new Right(new Tuple3(WMi.zero(), s, nil()))));
var current = this;
while(current._isCons()) {
final gb = f(current._unsafeHead());
result = result.flatMap((a) => gb.map((h) => new Cons(h, a)));
current = current._unsafeTail();
}
return result.map((l) => l.reverse());
}