 
                   :else
                   (split node path-spec data lcs))))))
+
+(defn view
+  "Returns a view representation of a prefix-tree."
+  [x]
+  (vec (concat
+         [(get-segment x)]
+         (some->> (get-chidren x) vals seq (map view))
+         (some->> (get-data x) vector))))

  (lookup [this path params])
  (get-segment [this])
  (update-segment [this subs lcs])
  (set-data [this data])
  (add-child [this key child])
  (insert-child [this key path-spec data]))


  (let [?wild (maybe-wild-node children)
        ?catch (maybe-catch-all-node children)
        children' (impl/fast-map children)]
    ^{:type ::node}
    (reify
      Node
      (lookup [_ path params]
