A zipper update function changes a tree at the current location without mutating the original input. Navigate to a location first, then use `zip/replace` to supply a new node, `zip/edit` to transform the current node with a function, or `zip/remove` to delete it. Each operation returns a location, so navigation and editing can be composed. Call `zip/root` when finished to retrieve the resulting tree; to edit it again, create a new zipper. section 8.4.4
(-> vzip zip/down zip/rightmost (zip/replace :replaced) zip/up zip/node) ; #1 ;; [[1 2] [3 4 [5 10 [11 12]]] :replaced] (-> vzip zip/down zip/rightmost (zip/edit conj 15) zip/up zip/node) ; #2 ;; [[1 2] [3 4 [5 10 [11 12]]] [13 14 15]] (-> vzip zip/down zip/rightmost zip/remove zip/root) ; #3 ;; [[1 2] [3 4 [5 10 [11 12]]]]
Compare three edits at the rightmost child of a vector zipper: replacement changes it to `:replaced`, editing appends `15`, and removal omits it from the resulting root. section 8.4.4
Use `zip/replace` when the new value is already known and `zip/edit` when it should be computed from the existing node. Unlike an update, `zip/remove` also changes where the zipper is focused; call `zip/root` to inspect the complete result. section 8.4.4
