folder

added
1.5

ns
clojure.core.reducers

type
function

(folder coll xf)

Given a foldable collection, and a transformation function xf,
returns a foldable collection, where any supplied reducing
fn will be transformed by xf. xf is a function of reducing fn to
reducing fn.

                (require '[clojure.core.reducers :as r])
(r/fold
  (r/monoid merge (constantly {}))
  (fn [m k v] (assoc m k (+ 3 v)))
  (r/folder
    (zipmap (range 100) (range 100))
    (fn [rf] (fn [m k v] (if (zero? (mod k 10)) (rf m k v) m)))))
;; {0 3, 70 73, 20 23, 60 63, 50 53, 40 43, 90 93, 30 33, 10 13, 80 83}