   (? (% (? ? a a) a)
      (% (? ? a a) a))
 
-  ;; todo test recursion
+  ;; todo
+  ;; - exception propogation
+  ;; - test recursion
+  ;; - types
 
   )

        ;; F without pars evals to its expr
        (empty? pars) expr
        ;; uncurries immediately nested F
        (f? expr) (F. (fv- pars expr) (:expr expr) (into pars (:pars expr)))
        :else     (F. (fv- pars expr)        expr        pars))))
  A
  (fv [this] (:vars this))
  (ev [{:keys [vars form]} dict]
    (let [dict (select-keys dict vars)
          [func & args :as form] (cond->> form (seq dict) (mapv #(ev % dict)))]
      (if (f? func)
        ;; asap beta-reduces val/var args
        (let [{:keys [pars expr]} func
              [args pars dict]
              , (loop [args (seq args)  args' []
                       pars (seq pars)  pars' []
                       dict {}]
                  (if-let   [[arg & args] args]
                    (if-let [[par & pars] pars]
                      (if (or (empty? (fv arg)) (v? arg))
                        (recur args       args'      pars       pars'      (assoc  dict par arg))
                        (recur args (conj args' arg) pars (conj pars' par) (dissoc dict par)))
                      (throw (ex-info "arity error" {:form form})))
                    [args' (into pars' pars) (reduce dissoc dict pars)]))
              func (-> (fv- pars expr)
                       (F.  expr pars)
                       (ev dict))]
          (if (seq args)
            (A. (apply fv- [] func args) (into [func] args))
            func))
        ;; defers application or applies primitive func
        (let [vars (apply fv- [] form)]
          (if (seq vars)
            (A. vars form)
            (apply func args))))))
  V
  (fv [this] #{this})
  (ev [this dict] (dict this this))

  (fv [this])
  (ev [this dict]))

(defn- ff [expr pars]
  (-> (reduce disj (fv expr) pars)
      (F. expr (vec pars))))

(defn- aa [expr args]
  (-> (reduce into (fv expr) (map fv args))
      (A. expr (vec args))))

(extend-protocol Expr
  F
