(frequencies "abcaaabcccaabrrcb")
(defn frequencies
"Returns a map from distinct items in coll to the number of times they appear."
{:added "1.2"}
[coll]
(persistent!
(reduce (fn [counts x]
(assoc! counts x (inc (get counts x 0))))
(transient {}) coll)))
which I think is pretty much just Raphael's solution.