ClojureDocs

导航

命名空间

折叠

clojure.core.reducers

自 1.5 版本起可用
  • (fold reducef coll)
  • (fold combinef reducef coll)
  • (fold n combinef reducef coll)
Reduces a collection using a (potentially parallel) reduce-combine
strategy. The collection is partitioned into groups of approximately
n (default 512), each of which is reduced with reducef (with a seed
value obtained by calling (combinef) with no arguments). The results
of these reductions are then reduced with combinef (default
reducef). combinef must be associative, and, when called with no
arguments, (combinef) must produce its identity element. These
operations may be performed in parallel, but the results will
preserve order.