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.