/
simpleRope.mli
41 lines (33 loc) · 1.39 KB
/
simpleRope.mli
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
(***********************************************************************)
(* *)
(* HEVEA *)
(* *)
(* Tibault Suzanne, Luc Maranget, projet Moscova, INRIA Rocquencourt *)
(* *)
(* Copyright 2012 Institut National de Recherche en Informatique et *)
(* Automatique. Distributed only by permission. *)
(* *)
(***********************************************************************)
(* Simple rope data structure *)
type t
(* Basics *)
val length : t -> int
val of_string : string -> t
val singleton : char -> t
val empty : t
(* Usual strings *)
val append : t -> t -> t
val append_string : t -> string -> t
val append_char : t -> char -> t
val sub : t -> int -> int -> t
val get : t -> int -> char
val iter_range : (char -> unit) -> t -> int -> int -> unit
(* Translations *)
val output : out_channel -> t -> unit
val debug : out_channel -> t -> unit
val to_string : t -> string
(* Index function *)
val index : t -> char -> int
val rindex : t -> char -> int
(* Hevea specific: erase suffix that validates predicate *)
val erase : t -> (char -> bool) -> t