             (if (identical? new-root root)
               coll
               (PersistentHashMap. meta (dec cnt) new-root has-nil? nil-val nil)))))
+
+  IKVReduce
+  (-kv-reduce [coll f init]
+    (let [init (if has-nil? (f init nil nil-val) init)]
+      (cond
+        (reduced? init)          @init
+        (coercive-not= nil root) (.kv-reduce root f init)
+        :else                    init)))
 
   IFn
   (-invoke [coll k]

             (pv-aset ret subidx nil)
             ret))))

(declare tv-editable-root tv-editable-tail TransientVector)

(deftype PersistentVector [meta cnt shift root tail ^:mutable __hash]
  Object


  (replace [node key val left right]
    (BlackNode. key val left right nil))

  (kv-reduce [node f init]
    (tree-map-kv-reduce node f init))

  (toString [this]
    (pr-str this))
