I was searching and was not able to find the answer to my question.
I'm reading Clojure For The Brave and True and found the implementation of the map over map values.
(reduce (fn [new-map [key val]]
(assoc new-map key (inc val)))
{}
{:max 30 :min 10})
which works fine, except it throws an error in both REPL and file:
java.lang.Exception: Unable to resolve symbol: new-map in this context
when executed inside a function:
(defn map-map [fn hash]
(reduce (fn [new-map [key val]]
(assoc new-map key (inc val)))
{}
hash))
My own implementation (after reading 3rd chapter) works fine:
(defn map-map [fn hash]
(into {} (map #(conj [(first %)] (fn (second %))) hash)))