Module type Ezirmin.Rope

module type Rope = sig .. end


Mergeable rope



Rope provides an efficient mergeable data structure for storing and manipulating int-indexed sequence of contents.
include Ezirmin_repo.S
type t 
The type of rope.
type atom 
The type of an element in the Ezirmin.Rope.content.
type content 
The type of rope contents.
val create : unit -> t Lwt.t
Create an empty rope.
val make : content -> t Lwt.t
Make a rope from the given content.
val flush : t -> content Lwt.t
Flush a rope to a content representation.
val is_empty : t -> bool Lwt.t
Returns true if the rope is empty.
val length : t -> int Lwt.t
Return the length of the rope.
val set : t -> pos:int -> atom -> t Lwt.t
set r i v returns a new rope with element at position i updated to v in r.
val get : t -> pos:int -> atom Lwt.t
get r i return the element at position i in r.
val insert : t -> pos:int -> content -> t Lwt.t
insert r i c returns a new rope with content c inserted at position i in r.
val delete : t -> pos:int -> len:int -> t Lwt.t
delete r i n returns a new rope with n elements deleted from position i in r.
val append : t -> t -> t Lwt.t
append r r' returns a new rope with r' appended to the end of r.
val concat : sep:t -> t list -> t Lwt.t
concat s rl returns a new rope that is a concatenation of ropes from rl separated by s.
val split : t -> pos:int -> (t * t) Lwt.t
split r i returns a pair of new ropes obtained by splitting r at position i.
val write : ?message:string -> branch -> path:string list -> t -> unit Lwt.t
update m b p r updates the rope at path p in branch b to r. The commit message is m.
val read : branch -> path:string list -> t option Lwt.t
read b p returns the rope at path p in branch b. Returns None if a rope does not exist at this path.