Skip to content

Clojure Zippers

Usually tress are of the forms of maps and vectors

(defn map-zipper [m]
  (zip/zipper
   (fn [x] (or (map? x) #_(vector? x))
   (fn [x] (:children x))
   (fn [x children]
     (assoc x :children children)) m))

See also (generated)