Primitive streams (original) (raw)

Brian Goetz brian.goetz at oracle.com
Sat Dec 29 10:19:57 PST 2012


So instead of stream.sumBy(IntMapper), we already have: stream.map(IntMapper).sum(). If the pipeline prefer to use fuzed operation, it's an implementation detail.

If we have IntStream, then yes this is most natural. The sumBy suggestion (Don's, I believe) was an alternative in the event we do not have IntStream; you can't define sum() on Stream but you can define sumBy(IntMapper) on Stream.



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