Post-transform and the standard Collectors

Brian Goetz brian.goetz at oracle.com
Wed Jun 12 17:17:57 PDT 2013


> Ok,
> making the accumulator a bi-consumer instead of a bi-function (thus
> removing STRICTLY_MUTATIVE) is something enough important to postpone
> this discussion.

Yes, this is where it started, and this felt pretty natural, given that 
Collector is about *mutable* reduction.  We switched to BiFunction when 
we tried to wedge reduction in (which was a missing element as a 
downstream reducer to a grouping, needed for things like "max sale by 
salesman.")  Now that we're able to sever the tie between accumulation 
type and return type, we can once again return to where we started, 
where the accumulator is a consumer (like ArrayList::add).




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