Zed.Zed_ropeUnicode ropes
include Sexplib0.Sexpable.S with type t := tinclude Sexplib0.Sexpable.Of_sexp with type t := tval t_of_sexp : Sexplib0.Sexp.t -> tinclude Sexplib0.Sexpable.Sexp_of with type t := tval sexp_of_t : t -> Sexplib0.Sexp.ttype rope = tAlias.
Exception raised when trying to access a character which is outside the bounds of a rope.
val empty : tThe empty rope.
val make : int -> Zed_char.t -> tmake length char creates a rope of length length containing only char.
val init : int -> (int -> Zed_char.t) -> tinit n f returns the contenation of singleton (f 0), singleton (f 1), ..., singleton (f (n - 1)).
val rev_init : int -> (int -> Zed_char.t) -> trev_init n f returns the contenation of singleton (f (n - 1)), ..., singleton (f 1), singleton (f 0).
val singleton : Zed_char.t -> tsingleton ch creates a rope of length 1 containing only ch.
val length : t -> intReturns the length of the given rope.
val is_empty : t -> boolis_empty rope returns whether str is the empty rope or not.
val of_string : string -> tof_string str creates a rope from a string. The string must be UTF-8 encoded and is validated. Note that str must not be modified after this operation, if you intend to do so you must copy it before passing it to of_string.
val to_string : t -> stringto_string rope flatten a rope into a string encoded in UTF-8.
val get : t -> int -> Zed_char.tget str rope returns the character at index idx in rope.
sub rope ofs len Returns the sub-rope of rope starting at ofs and of length len.
break rope pos returns the sub-ropes before and after pos in rope. It is more efficient than creating two sub-ropes with sub.
remove rope pos len removes the len characters at position pos in rope
replace rope pos len repl replaces the len characters at position pos in rope by repl.
lchop rope returns rope without is first character. Returns empty if rope is empty.
rchop rope returns rope without is last character. Returns empty if rope is empty.
val iter : (Zed_char.t -> unit) -> t -> unititer f rope applies f on all characters of rope starting from the left.
val rev_iter : (Zed_char.t -> unit) -> t -> unitrev_iter f rope applies f an all characters of rope starting from the right.
val fold : (Zed_char.t -> 'a -> 'a) -> t -> 'a -> 'afold f rope acc applies f on all characters of rope starting from the left, accumulating a value.
val rev_fold : (Zed_char.t -> 'a -> 'a) -> t -> 'a -> 'arev_fold f rope acc applies f on all characters of rope starting from the right, accumulating a value.
val map : (Zed_char.t -> Zed_char.t) -> t -> tmap f rope maps all characters of rope with f.
val rev_map : (Zed_char.t -> Zed_char.t) -> t -> trev_map f str maps all characters of rope with f in reverse order.
Note: for all of the following functions, the leaves must absolutely not be modified.
val iter_leaf : (Zed_utf8.t -> unit) -> t -> unititer_leaf f rope applies f on all leaves of rope starting from the left.
val rev_iter_leaf : (Zed_utf8.t -> unit) -> t -> unititer_leaf f rope applies f on all leaves of rope starting from the right.
val fold_leaf : (Zed_utf8.t -> 'a -> 'a) -> t -> 'a -> 'afold f rope acc applies f on all leaves of rope starting from the left, accumulating a value.
val rev_fold_leaf : (Zed_utf8.t -> 'a -> 'a) -> t -> 'a -> 'arev_fold f rope acc applies f on all leaves of rope starting from the right, accumulating a value.
module Zip : sig ... endmodule Buffer : sig ... endThis module is similar of the Buffer module of the standard library except that it works with rope.