foldable-seq icon indicating copy to clipboard operation
foldable-seq copied to clipboard

Making lazy sequences foldable

foldable-seq

Clojure's fold function falls back to a sequential reduce when given a lazy sequence.

This library provides a foldable-seq function that takes a lazy sequence and returns a sequence that supports parallel fold operations.

See https://github.com/paulbutcher/foldable-seq-example for an example of its use.

This has been contributed as a potential enhancement to Clojure:

http://dev.clojure.org/jira/browse/CLJ-1197