 
                   :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))))

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

        segment)
      (update-segment [_ subs lcs]
        (static-node (subs segment lcs) children data))
      (get-data [_]
        data)
      (set-data [_ data]
        (static-node segment children data))
      (get-chidren [_]
        children)
      (add-child [_ key child]
        (static-node segment (assoc children key child) data))
      (insert-child [_ key path-spec child-data]
