fix update only evens
This commit is contained in:
parent
e6451ba33b
commit
0c20d12b90
1 changed files with 2 additions and 1 deletions
|
|
@ -18,7 +18,8 @@ Consider these examples:
|
|||
:b [{:dd 4}]})
|
||||
|
||||
;; Manual Clojure
|
||||
(update-vals data (fn [vals] (map #(update-vals % inc) vals)))
|
||||
(let [update-even #(update-vals % (fn [v] (cond-> v (even? v) inc)))]
|
||||
(update-vals data #(mapv update-even %)))
|
||||
|
||||
;; Specter
|
||||
(transform [MAP-VALS ALL MAP-VALS even?] inc data)
|
||||
|
|
|
|||
Loading…
Reference in a new issue