                      vals
                      (remove empty?)
                      empty?)
-                (empty? (::validator-errors @value))))))
+                (valid? (::validator-errors @value))))))
 
 (defn field [form type path]
   (->Field form (coercer type) (reify Validator
                                  (validate [_ value] [])) path))
 
+(deftype ValidationResult [errors]
+  PathErrors
+  (path-errors [this path]
+    (remove nil? [(get-in errors path)]))
+
+  Validatable
+  (valid? [this]
+    (empty? errors)))
+
 (defn create-form [value validator]
-  (->Form (reagent/atom {::value     value
-                         ::original  value
-                         ::validator #(-> %
-                                          (st/validate validator)
-                                          first)})))
+  (->Form (reagent/atom {::value    value
+                         ::original value
+                         })
+          #(->ValidationResult (-> %
+                                 (st/validate validator)
+                                 first))))
 
 (defn handle-str-value [field]
   #(set-str-value! field (-> % .-target .-value)))
 
 (defcard first-card
-  (sab/html [:div
-             [:h1 "This is your first devcard!"]]))
+         (sab/html [:div
+                    [:h1 "This is your first devcard!"]]))
 
 
 (defn my-field [type field]

  (path-value [this type path]
              [this type path default]))

(defprotocol CoercedValue
  (str-value [this])
  (set-str-value! [this val]))



(defn- validate-form
  ([validator f]
   (fn [value & args]
     (validate-form value validator f args)))
  ([value validator f & args]
   (let [new-value (apply f value args)]
     (-> new-value
         (assoc ::validator-errors (validator (::value new-value)))))))

(extend-type nil
  Validatable
  (valid? [this]
    true)

  PathErrors
  (path-errors [this path]
    []))

(defrecord Form [value validator]
  ISwap
  (-swap! [o f]
    (swap! value validate-form validator f))
  (-swap! [o f a]
    (swap! value validate-form validator f a))
  (-swap! [o f a b]
    (swap! value validate-form validator f a b))
  (-swap! [o f a b xs]
    (apply swap! value validate-form validator f a b xs))

  Value
  (value [this]
