Open
Description
What’s the idiomatic way to map a function into a nested collection? For example, in Haskell I’d do:
The best I could come up with in clojure was:
(((comp #(partial map %) #(partial map %)) inc) [[1 2][3 4]])
but that seems pretty ugly
clojure.walk/ post-replace works on every value
clojure.walk/postwalk
applies a function
(clojure.walk/postwalk
#(if (number? %)
(inc %)
%)
the-data)