       'maybe (schema->fn (:schema schema))
       nil)))
 
+(defn schema? [x]
+  (:schema x))
+
 (defn pull [x fns]
   ((apply comp (reverse fns)) x))
 
 (defn spec [schema & extr]
   (Spec. schema extr))
+
+(defn schema [schema]
+  (Schema. schema))
 
 (def ->spec spec)
 


(defrecord Spec [schema extr])

(defprotocol Extractable
  (extract [_ _])
  (text [_])

      (condp get (type (:schema spec))
        #{clojure.lang.PersistentArrayMap
          clojure.lang.PersistentHashMap}
        (if (some schema? (vals (:schema spec)))
          (filter-keys identity
                       (map-kv (fn [k v]
                                 (let [v (extract v (->node nodes))]
                                   (if (instance? schema.core.OptionalKey k)
                                     (when v
                                       [(:k k) v])
                                     [k v])))
                               (:schema spec)))
          (pull (->node nodes) fns))

        #{clojure.lang.PersistentVector}
        (map #(extract (first (:schema spec)) %) nodes)
