Re:Java 8: Replace traditional for loops with IntStreams
by pron on Wednesday June 10, 2015 @09:02AM
(#9691772)
Streams are an API built on top of the Spliterator[1] abstraction, which basically gives a collection the option of partitioning an iterator into two, allowing parallel traversal of both partitions and thus parallelization via fork/join. Clojure already does something very similar with reducers[2], which are pretty much the same as Java streams, but implementing the reducer protocol to employ spliterators should be rather simple.
[1]: https://docs.oracle.com/javase/8/docs/api/java/util/Splitera...
[2]: http://clojure.org/reducers