    :snapshot [:record {:time   :long
                        :bodies [:list :body]}]})
 
-;; PLAYGROUND
-
-(spec/conform ::schema
-              [:record {:user-data [:record {:id :int}]
-                        :position  :coord
-                        :angle     :float
-                        :body-type [:enum [:dynamic :static :kinetic]]
-                        :fixtures  [:list :fixture]}])
-
-(spec/conform (spec/map-of keyword? ::schema)
-              {:body [:set [:list :int]]})
-
-(spec/conform (spec/and (spec/coll-of ::schema [])
-                        (spec/conformer identity))
-              [[:set [:list :int]]])
-
-(spec/conform ::schema [:set {:sorted-by 'adf} :int])
-
-(spec/conform (spec/cat :u (spec/and integer?
-                                     (spec/conformer (constantly nil))))
-              [1])
-
-(spec/conform (spec/and integer? (spec/conformer (constantly nil)))
-              10)
+;; ISSUES
+;; conform does not flow into coll-of / map-of


(alter-var-root #'type/hierarchy type/add-custom-types [:body :fixture :coord :snapshot])

(defn opts [& keys]
  (fn [{:keys [options]}]
    (select-keys options keys)))

(spec/def ::pre
  symbol?)

  (spec/spec (constantly true)))

(defmethod spec-type :list [_]
  (composite-spec :options (options-spec)
                  :schema  ::schema))

(defmethod spec-type :vector [_]
  (composite-spec :options (options-spec)
                  :schema  ::schema))

(defmethod spec-type :set [_]
  (composite-spec :options (options-spec ::sorted-by)
                  :schema  ::schema))

(defmethod spec-type :map [_]
  (composite-spec :options    (options-spec ::sorted-by)
                  :key-schema ::schema
                  :val-schema ::schema))

(defmethod spec-type :tuple [_]
  (composite-spec :options (options-spec)
                  :schemas (spec/coll-of ::schema [])))

(defmethod spec-type :record [_]
  (composite-spec :options (options-spec ::constructor)
                  :schemas (spec/map-of keyword? ::schema)))

(defmethod spec-type :optional [_]
  (composite-spec :options (options-spec)
                  :schema  ::schema))

(defmethod spec-type :enum [_]
  (composite-spec :options (options-spec)
                  :values  (spec/coll-of keyword? [])))

(defmethod spec-type :multi [_]
  (composite-spec :options (options-spec)
                  :selector symbol?
                  :schemas  (spec/map-of (constantly true) ::schema)))

(defmethod spec-type :wrapped [_]
  (composite-spec :options (options-spec)
                  :pre     symbol?
                  :post    symbol?
                  :schema  ::schema))

(defmethod spec-type :clojure.spec/invalid [_]
  nil)

(spec/def ::schema
  (spec/multi-spec spec-type util/type-of))

(spec/def ::schemas
  (spec/and (spec/map-of keyword? ::schema)
            (fn [schemas]
               (not-any? #(isa? type/hierarchy % :built-in)
                         (keys schemas)))))

(spec/def ::options
  (spec/keys :opt-un [::schemas]))

;; PLAYGROUND

(spec/conform ::schemas
  {:body     [:record {:user-data [:record {:id :int}]
