                        #(assoc % :children %2)
                        tree))
 
+     (def qr1 (query z1 {:a #(-> % :id #{6})}
+                     #(->> % :children :set (some #{:a}))
+                     ))
+
      (ppcp (z/root z1))
 
 

  ((or *get-tags-mz* get-tags)
   node
   pred-map))

#_ (get-tags' {:id 1} {:a #(-> % :id #{1}) :b #(-> % :id #{1})})

(defn insert-tags-into-parent-tag-summary
  [& [tags summary]]

      (let [zn (z/next z)]
        (if-not (z/end? zn)
          (recur (tag* zn pred-map))
          ;; reset zipper
          (z/edit zipr (-> z z/root constantly)))))))

(defn pred-query
  [zipr pred]
  (let [z' (set-zip-children zipr
                             (->> zipr
                                  children-zips
                                  (mapcat #(pred-query %
                                                       pred))
                                  vec))
        n (z/node z')]
    (if (-> n
            meta
            ::?
            pred)
      [n] ;; clear meta ::?
      (z/children z'))))

(defn query
  [zipr pred-map pred-final]
  (-> zipr
      (tag pred-map)
      (pred-query pred-final)))

#_ (do
     (def z2 (tag z1
                  {:a #(-> % :id #{1 2 3 4}) :even #(-<> (do %)
                                                         :id
                                                         even?)}))

     (ppcp tree2)
     (println)
     (-> tree2
