flatMap signature (original) (raw)

Brian Goetz brian.goetz at oracle.com
Tue Apr 2 06:06:42 PDT 2013


----------------------------------------------------------------------------------------------------------- T reduce(T identity, BinaryOperator accumulator); and Optional reduce(BinaryOperator accumulator);

Can't be fixed because they used 'BinaryOperator', But if 'BiFunction' is used then we have more flexibility

Not sure if "fixed" is the right word here :)

In any case, you've correctly identified that the argument to BinaryOperator is invariant because it is both an input and output parameter.

------------------------------------------------------------------------------------------------------------ R collect(Supplier resultFactory, BiConsumer<? super R, ? super T> accumulator, BiConsumer<? super R, ? super R> combiner)

Instead of: R collect(Supplier resultFactory, BiConsumer<R, ? super T> accumulator, BiConsumer<R, R> combiner);

Looks right.



More information about the lambda-dev mailing list