🎉 Add transducer version of mapm data helper.

This commit is contained in:
Andrey Antukh 2021-03-15 08:38:32 +01:00
parent f7d0383919
commit 2de1c92ee8

View file

@ -146,8 +146,10 @@
(defn mapm (defn mapm
"Map over the values of a map" "Map over the values of a map"
[mfn coll] ([mfn]
(into {} (map (fn [[key val]] [key (mfn key val)]) coll))) (map (fn [[key val]] [key (mfn key val)])))
([mfn coll]
(into {} (mapm mfn) coll)))
(defn filterm (defn filterm
"Filter values of a map that satisfy a predicate" "Filter values of a map that satisfy a predicate"