Do folks have a strategy dealing with spec + sorted maps? I understand why this is happening, curious about the solution space.
(s/def ::k string?)
=> :user/k
(s/valid? (s/keys :req [::k])
(sorted-map 1 1))
Execution error (ClassCastException) at user/eval163130$fn (user.clj:1).
class java.lang.Long cannot be cast to class clojure.lang.Keyword (java.lang.Long is in module java.base of loader 'bootstrap'; clojure.lang.Keyword is in unnamed module of loader 'app')
A worse-case solution could be something like this - where I wrap all s/keys in this prior to calling s/valid?.
(defn banish-sorted
[s]
(s/with-gen (s/and map? #(not (sorted? %)) s) #(s/gen s)))