            error)])
       {:success-type typ})))
 
-;; TODO this allows a OR reloationship??
-;; lets formalize this as an and relationship
-;; the or-spec handles the OR relationship
-
+;; TODO or relationship
 (defn type-check-value [parent-type value state]
   (if-let [preds (all-predicates parent-type)]
     (let [errors   (map #(type-check-pred % value state) preds)

   :break
   (print-document document)])

#_(pp)

;; Todos

;; handle printing :correct-path with knowledge of available config
;;     esp. for bad path errors

;; make coloring conditional

;; move current enum functions into type system in config_validation
;; look at adding smart documentation fns
;; conditional predicate i.e. conditional on neighbor or sister config parameters
;; tighten up unknown-key errors to include information about current parent config

(defn type-doc [parent-type]
  (when-let [[_ _ d] (first (schema-rules [:doc-type parent-type]))]
    d))

      (nth res 3)
      res)))

(defn format-key
  ([k] (pr-str k))
  ([k colr] (color (format-key k) colr)))
