Tabulators, reducers, etc (original) (raw)

Remi Forax forax at univ-mlv.fr
Mon Dec 31 10:17:40 PST 2012


On 12/31/2012 07:08 PM, Brian Goetz wrote:

One option might be: use "reduce" for the purely functional forms, use accumulate/accumulateConcurrent for the others:

T reduce(T zero, BinaryOperator reducer); Optional reduce(BinaryOperator reducer); U reduce(U zero, BiFunction<U, T, U> accumulator, BinaryOperator reducer); R accumulate(Accumulator<T, R> reducer); R accumulate(Supplier seedFactory, BiBlock<R, T> accumulator, BiBlock<R, R> reducer); R accumulateConcurrent(ConcurrentAccumulator<T, R> tabulator); This would let us get rid of the Tabulator abstraction (it is identical to MutableReducer; both get renamed to Accumulator). Separately, with a small crowbar, we could simplify ConcurrentAccumulator down to fitting into existing SAMs, and the top-level abstraction could go away. While the concurrent use case is clearly the odd man out here -- suggesting more work is left to do on this -- the rest of it seems an improvement on what we have now. I would like to move forward with this while we continue to work out the correct set of canned accumulators and the correct way to surface concurrent accumulation.

while do you want to surface concurrent accumulator given that we have forEach ??

Rémi



More information about the lambda-libs-spec-experts mailing list