Persistent rope of immutable string chunks with a Bytesrw projection
0

Configure Feed

Select the types of activity you want to include in your feed.

OCaml 93.1%
Dune 2.1%
Other 4.8%
24 1 0

Clone this repository

https://git.vm.fail/gazagnaire.org/ocaml-rope https://git.vm.fail/did:plc:mtkrrborohwntrisf5naakge
ssh://git@git.recoil.org:2222/gazagnaire.org/ocaml-rope ssh://git@git.recoil.org:2222/did:plc:mtkrrborohwntrisf5naakge

For self-hosted knots, clone URLs may differ based on your setup.


README.md

nox-rope#

A zero-copy, structurally shared byte sequence.

A persistent rope whose leaves are immutable (string, offset, length) views. Append, drop-prefix and sub-range are O(log n) and copy no bytes; bytes are materialised only on demand or projected to a Bytesrw writer zero-copy. It is the shape a protocol's send buffer wants inside a functional state machine -- a TCP retransmit queue, an SSH or TLS output buffer. Adapted from robur-coop/utcp's rope.

Install#

opam install nox-rope

If opam cannot find the package, it may not yet be released in the public opam-repository. Add the overlay repository, then install it:

$ opam repo add samoht https://tangled.org/gazagnaire.org/opam-overlay.git
$ opam update
$ opam install nox-rope

API#

The Rope module (lib/rope.mli) is the whole interface: build ropes from strings, append/drop/sub in O(log n), and materialise or stream the bytes.

License#

ISC. See LICENSE.md.