Created
October 6, 2017 08:43
-
-
Save lagenorhynque/4bdff687d29731c2eeecacff257783fb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; cf. https://github.com/ctford/traversy | |
| user> (require '[traversy.lens :as lens]) | |
| nil | |
| user> (def data {:a [{:aa 1 :bb 2} | |
| {:cc 3}] | |
| :b [{:dd 4}]}) | |
| #'user/data | |
| user> (-> data | |
| (lens/update (lens/*> lens/all-values lens/each lens/all-values) | |
| #(if (even? %) (inc %) %))) | |
| {:a [{:aa 1, :bb 3} {:cc 3}], :b [{:dd 5}]} | |
| user> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment