nano-rope: B-tree text rope with flat chunks, multi-unit indexing and custom measures
A persistent text rope for editors, language servers and parsers.
UTF-8 chunks of at most 512 bytes keep local edits small, even in documents with very long lines.
A B-tree with up to 16 children per node shares unchanged text between versions, making snapshots and undo inexpensive.
Consecutive insertions can use a bounded keystroke buffer to reduce tree updates.
Cached byte, code point, UTF-16 and newline counts support logarithmic-time indexing and conversion between units.
Chunk scans use SSE2 or AVX2 on supported x86-64 systems, with portable C elsewhere. Build with
-f -simdfor Haskell-only scans.Chunk views and buffered UTF-8 output avoid flattening the document.
Custom monoidal measures support application-specific summaries and prefix searches.
[Skip to Readme]
Modules
[Index] [Quick Jump]
Flags
Manual Flags
| Name | Description | Default |
|---|---|---|
| simd | Enable C chunk scans, with runtime-selected SSE2 or AVX2 on supported x86-64 systems and portable C elsewhere. Disable for Haskell-only scans that process up to 8 bytes at a time. | Enabled |
| compare-text-rope | Run the benchmarks on text-rope as well, for comparison. | Disabled |
| compare-yi-rope | Run the benchmarks on yi-rope as well, for comparison. | Disabled |
| compare-core-text | Run the benchmarks on core-text as well, for comparison. | Disabled |
Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info
Downloads
- nano-rope-0.1.0.0.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
- No Candidates
| Versions [RSS] | 0.1.0.0 |
|---|---|
| Change log | CHANGELOG.md |
| Dependencies | base (>=4.17 && <4.23), deepseq (>=1.4 && <1.6), primitive (>=0.9 && <0.10), text (>=2.0 && <2.2) [details] |
| Tested with | ghc ==9.14.1 |
| License | MIT |
| Author | goolord |
| Maintainer | zacharyachurchill@gmail.com |
| Uploaded | by goolord at 2026-09-20T17:06:08Z |
| Category | Text |
| Distributions | |
| Downloads | 2 total (2 in the last 30 days) |
| Rating | (no votes yet) [estimated by Bayesian average] |
| Your Rating | |
| Status | Docs uploaded by user Build status unknown [no reports yet] |