the design is intentional, it's for performance. sorted maps are mainly for debugging
if you want your sorted map to work, use the code at the bottom of this answer
```clojure
(defn update-vals
"m f => {k (f v) ...}
Given a map m and a function f of 1-argument, returns a new map where the keys of m
are mapped to result of applying f to the corresponding values of m."
{:added "1.11"}
[m f]
(with-meta
(persistent!
(reduce-kv (fn [acc k v] (assoc! acc k (f v)))
(if (instance? clojure.lang.IEditableCollection m)
(transient m)
(transient (empty m)))
m))
(meta m)))
(update-vals
(sorted-map
:d :e
:b :c
:h :a
:a :g
)
str)
```
error
```clojure
1. Unhandled java.lang.ClassCastException
class clojure.lang.PersistentTreeMap cannot be cast to class clojure.lang.IEditableCollection
(clojure.lang.PersistentTreeMap and clojure.lang.IEditableCollection are in unnamed module of loader 'app')
```
code that works with sorted maps, but is slower
```clojure
(defn update-vals
"m f => {k (f v) ...}
Given a map m and a function f of 1-argument, returns a new map where the keys of m
are mapped to result of applying f to the corresponding values of m."
{:added "1.11"}
[m f]
(with-meta
(reduce-kv (fn [acc k v] (assoc acc k (f v)))
(empty m)
m)
(meta m)))
```