The Random Access Zipper: Simple, Purely-Functional Sequences
Kyle Headley, Matthew A. Hammer

TL;DR
The paper introduces the Random Access Zipper, a simple, purely-functional data structure that efficiently supports editing and cursor movement in sequences, combining ease of implementation with optimal time bounds.
Contribution
It presents the RAZ, a novel data structure that unifies zipper and tree features, offering simplicity and efficiency for functional sequence editing.
Findings
Supports constant-time edits at cursor
Enables logarithmic-time cursor relocation
Simpler and more concise than existing structures
Abstract
We introduce the Random Access Zipper (RAZ), a simple, purely-functional data structure for editable sequences. A RAZ combines the structure of a zipper with that of a tree: like a zipper, edits at the cursor require constant time; by leveraging tree structure, relocating the edit cursor in the sequence requires logarithmic time. While existing data structures provide these time bounds, none do so with the same simplicity and brevity of code as the RAZ. The simplicity of the RAZ provides the opportunity for more programmers to extend the structure to their own needs, and we provide some suggestions for how to do so.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsAlgorithms and Data Compression · Optimization and Search Problems · Cellular Automata and Applications
