Instead of nesting maps, use (partial) to manipulate objects deep inside sequences
It's a longer solution, but with less parentheses, more linear, and simpler once you get your head around it.
(->> [[["foo" "bar"] ["bak" "wak"]][["koo" "kar"]]]
(map (fn [x] (map (fn [y] (map #(str "X-" %) y)) x))))
versus
(->> [[["foo" "bar"] ["bak" "wak"]][["koo" "kar"]]]
((->> (partial str "X-") (partial map) (partial map) (partial map))))
both yielding
((("X-foo" "X-bar") ("X-bak" "X-wak")) (("X-koo" "X-kar")))
Written by Konrad
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Clojure
Authors
Related Tags
#clojure
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#