 
 (defn path
   "A middleware factory which supplies a sub-tree of `db` to the handler.
-  Supplies a narrowed view.
-  Assumes \"pure\" is in the middleware pipeline prior.
-  Grafts the result back into db.
-  If a get-in of the path results in a nil, then \"default-fn\" will be called to supply a value.
-  XXX very like update-in. Should the name be more indicative of that closeness? "
-  ([p]
-    (path p nil))
-  ([p default-fn]
+  Works a bit like update-in. Supplies a narrowed data structure for the handler.
+  Afterwards, grafts the result of the handler back into db.
+  Usage:
+     (path :some :path)
+     (path [:some :path])
+     (path [:some :path] :to :here)
+     (path [:some :path] [:to] :here)
+  "
+  [& args]
+  (let [path   (flatten args)
+        _      (if (empty? path)
+                 (warn "re-frame: path middleware given no params. Probably a mistake."))]
     (fn middleware
       [handler]
       (fn path-handler
         [db v]
-        (if-not (vector? p)
-          (warn  "re-frame: \"path\" expected a vector, got: " p))
-        (let [val (get-in db p)
-              val (if (and (nil? val) (fn? default-fn)) (default-fn) val)]
-          (assoc-in db p (handler val v)))))))
+        (assoc-in db path (handler (get-in db path) v))))))
 
 
 (defn undoable
   "A Middleware factory which stores an undo checkpoint.
   \"explanation\" can be either a string or a function. If it is a
-  function then it must be:  (db event-vec) -> string.
-  \"explanation\" can be nil. in which case no
+  function then must be:  (db event-vec) -> string.
+  \"explanation\" can be nil. in which case \"\" is recorded.
   "
   [explanation]
   (fn middleware



(defn trim-v
  "Middleware which removes the first element of v which allows you to write
  more asthetically pleasing handlers. No leading underscore on the event-v!
  Your handlers will look like this:
      (defn my-handler

  the same text, then highlight their background, and report them in a warning
  down the bottom.
  Almost any action (edit text, add new todo, remove a todo) requires a
  complete reassesment of duplication errors and warnings. Eg: that edit
  update might have introduced a new duplicate or removed one. Same with a
  todo removal.
  And to perform this enrichment, a function has inspect all the todos,
