package core_kernel
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=34a0288f16027c6b90e4ad16cb5cc677d7063d310faf918748ce70f1745116c0
doc/core_kernel.rope/Rope/index.html
Module Rope
Source
A rope is a standard data structure that represents a single string as a tree of strings, allowing concatenation to do no work up front. See the README.md file for details and motivating examples.
include Ppx_quickcheck_runtime.Quickcheckable.S with type t := t
include Sexplib0.Sexpable.S with type t := t
val t_of_sexp : Sexplib0.Sexp.t -> t
val sexp_of_t : t -> Sexplib0.Sexp.t
Allocates a fresh string, so takes time proportional to the total size of the result.
to_char_sequence
can often produce characters incrementally, but in the worst case it takes time and memory proportional to the total length of the string to produce even a single character. (In such cases, it should still only take O(length) time to produce the rest of the string.)
Appends the contents of the Rope at the end of a destination buffer.
is_prefix a ~prefix:b
is a more efficient version of String.is_prefix (Rope.to_string a) ~prefix:(Rope.to_string b)
. However, the worst-case time complexity is still O(length t)
instead of O(min(length t, length prefix))
as one could expect.