     (fn [gr spec]
       (reduce
        (fn [g d]
-           ;; If this creates a circular reference, then
-           ;; just skip it.
+         ;; If this creates a circular reference, then
+         ;; just skip it.
          (if (deps/depends? g d spec)
            g
            (deps/depend g spec d)))

                      s/form
                      (tree-seq coll? identity)
                      (map str)))
        (expound/expound-str spec form)))))

                                    topo-sort
                                    (filter keyword?)))))

(defn mutate-coll [x]
  (cond
    (map? x)
    (into [] x)

    (vector? x)
    (into #{} x)

    (set? x)
    (reverse (into '() x))

    (list? x)
    (into {} (map vec (partition 2 x)))

    :else
    x))

(defn mutate-type [x]
  (cond
    (number? x)
    (str x)

    (string? x)
    (keyword x)

    (keyword? x)
    (str x)

    (boolean? x)
    (str x)

    (symbol? x)
    (str x)

    (char? x)
    (int x)

    (uuid? x)
    (str x)

    :else
    x))

(defn mutate [form path]
  (let [[head & rst] path]
    (cond
      (empty? path)
      (if (coll? form)
        (mutate-coll form)
        (mutate-type form))

      (map? form)
      (if (empty? form)
        (mutate-coll form)
        (let [k (nth (keys form) (mod head (count (keys form))))]
          (assoc form k
                 (mutate (get form k) rst))))

      (vector? form)
      (if (empty? form)
        (mutate-coll form)
        (let [idx (mod head (count form))]
          (assoc form idx
                 (mutate (nth form idx) rst))))

      (not (coll? form))
      (mutate-type form)

      :else
      (mutate-coll form))))

#?(:clj
   (deftest real-spec-tests
     (checking
      "for any real-world spec and any data, explain-str returns a string"
      ;; At 50, it might find a bug in failures for the
      ;; :ring/handler spec, but keep it plugged in, since it
      ;; takes a long time to shrink
      50
      [spec spec-gen
       form gen/any-printable]
      (when-not (some
