 
 
 (defn tree-shake
-  "λ Whole-AST → options → Whole-AST
+  "(λ Whole-AST → options) → Whole-AST
 
   Implements def elimination on the basis of prior reachability
   analysis. Uses the reachability analysis as proof that a given def

         (symbol? entry)
         (every? (partial contains? ast) modules)]}
  (let [ast      (require-pass ast analyze-var-dependencies options)
        emit-set (get (:reach-map ast) (resolve entry))]
    (-> ast
        (trim-with-emit-set emit-set)
        (clobber-passes))))


(defn deps-to-uses
  "λ {Var → #{Var}} → {Var → #{Var}}

  Takes a mapping from vars to dependencies and computes the reverse
  mapping, being vars to uses."
  [deps-map]
  (let [acc  (atom {})
        sconj #(conj (or %1 #{}) %2)]
    ;; FIXME
    ;;   There's probably a way to write this comprehension which is
    ;;   more efficient, but this works for now.
    (doseq [[var deps] deps-map
            dep  deps]
      (swap! acc update-in [dep] sconj var))
    @acc))


(defn analyze-var-uses
  "λ Whole-AST → Options → Whole-AST

  Walks the argument AST, accumulating call site information about
  vars. Returns an updated Whole-AST which has the `:var-used' and



(defn reach-set
  "(λ AST) → #{Var}

  Computes the var reach set of an AST"
  [source]
