    (problem-group-str type spec-name val path problems opts)
    "\n\n"
    (if (:print-specs? opts) (relevant-specs problems) "")))
-
-(defn problem-type [failure problem]
-  (cond
-    (insufficient-input? failure problem)
-    :problem/insufficient-input
-
-    (extra-input? failure problem)
-    :problem/extra-input
-
-    (not-in-set? failure problem)
-    :problem/not-in-set
-
-    (missing-key? failure problem)
-    :problem/missing-key
-
-    (missing-spec? failure problem)
-    :problem/missing-spec
-
-    (fspec-exception-failure? failure problem)
-    :problem/fspec-exception-failure
-
-    (fspec-ret-failure? failure problem)
-    :problem/fspec-ret-failure
-
-    (fspec-fn-failure? failure problem)
-    :problem/fspec-fn-failure
-
-    :else
-    :problem/unknown))
-
-(defn safe-sort-by
-  "Same as sort-by, but if an error is raised, returns the original unsorted collection"
-  [key-fn comp coll]
-  (try
-    (sort-by key-fn comp coll)
-    (catch #?(:cljs :default
-              :clj Exception) e coll)))
 
 (defn instrumentation-info [failure caller]
   ;; As of version 1.9.562, Clojurescript does

   (header-label "Missing spec")
   (expected-str _type spec-name val path problems opts)))

;; TODO - reorder to avoid this
(declare sorted-and-grouped-problems)
(declare problem-type)

(defmethod expected-str :problem/insufficient-input [_type spec-name val path problems opts]
  (s/assert ::singleton problems)

                (and
                 (s/get-spec last-via)
                 (= pred (s/form (s/get-spec last-via)))) last-via)
           non-matching-value [:expound/value-that-should-never-match]]
       (if
        (and (not (symbol? pred))
             sp)
         (let [explain-data (s/explain-data sp  non-matching-value)
               new-problems (sorted-and-grouped-problems (problems/annotate explain-data))]
           (apply str
                  (for [[[in type] problems'] new-problems]
                    (expected-str type :expound/no-spec-name non-matching-value in problems' opts))))

         (let [ptype (problem-type nil (dissoc problem :reason))
               new-problems (map #(dissoc % :reason) problems)]
           (apply str
