3 ms·
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
by pron 11y ago
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/Spliterator.html https://docs.oracle.com/javase/8/docs/api/java/util/Splitera...
[2]: http://clojure.org/reducers http://clojure.org/reducers