module Cap:sig..end
This modules provides the same set of features as String, but
with the added twist that strings can be made read-only or write-only.
Read-only strings may then be safely shared and distributed.
There is no loss of performance involved.
type 'a t
If 'a contains [`Read], the contents of the string may be read.
If 'a contains [`Write], the contents of the string may be written.
Other (user-defined) capabilities may be added without loss of
performance or features. For instance, a string could be labelled
[`Read | `UTF8] to state that it contains UTF-8 encoded data and
may be used only for reading. Conversely, a string labelled with
[] (i.e. nothing) can neither be read nor written. It can only
be compared for textual equality using OCaml's built-in compare
or for physical equality using OCaml's built-in ==.
val length : 'a t -> intval is_empty : 'a t -> boolval get : [> `Read ] t -> int -> charval set : [> `Write ] t -> int -> char -> unitval create : int -> 'a tval of_string : string -> 'a tval to_string : [ `Read | `Write ] t -> stringval read_only : [> `Read ] t -> [ `Read ] tval write_only : [> `Write ] t -> [ `Write ] tval make : int -> char -> 'a tval init : int -> (int -> char) -> 'a tval enum : [> `Read ] t -> char BatEnum.tval of_enum : char BatEnum.t -> 'a tval backwards : [> `Read ] t -> char BatEnum.tval of_backwards : char BatEnum.t -> 'a tval of_list : char list -> 'a tval to_list : [> `Read ] t -> char listval of_int : int -> 'a tval of_float : float -> 'a tval of_char : char -> 'a tval to_int : [> `Read ] t -> intval to_float : [> `Read ] t -> floatval map : (char -> char) -> [> `Read ] t -> 'a tval fold_left : ('a -> char -> 'a) -> 'a -> [> `Read ] t -> 'aval fold_right : (char -> 'a -> 'a) -> [> `Read ] t -> 'a -> 'aval filter : (char -> bool) -> [> `Read ] t -> 'a tval filter_map : (char -> char option) -> [> `Read ] t -> 'a tval iter : (char -> unit) -> [> `Read ] t -> unitval index : [> `Read ] t -> char -> intval rindex : [> `Read ] t -> char -> intval index_from : [> `Read ] t -> int -> char -> intval rindex_from : [> `Read ] t -> int -> char -> intval contains : [> `Read ] t -> char -> boolval contains_from : [> `Read ] t -> int -> char -> boolval rcontains_from : [> `Read ] t -> int -> char -> boolval find : [> `Read ] t -> [> `Read ] t -> intval find_from : [> `Read ] t -> int -> [> `Read ] t -> intval rfind : [> `Read ] t -> [> `Read ] t -> intval rfind_from : [> `Read ] t -> int -> [> `Read ] t -> intval ends_with : [> `Read ] t -> [> `Read ] t -> boolval starts_with : [> `Read ] t -> [> `Read ] t -> boolval exists : [> `Read ] t -> [> `Read ] t -> boolval lchop : ?n:int -> [> `Read ] t -> 'a tval rchop : ?n:int -> [> `Read ] t -> 'a tval trim : [> `Read ] t -> 'a tval quote : [> `Read ] t -> stringval left : [> `Read ] t -> int -> 'a tval right : [> `Read ] t -> int -> 'a tval head : [> `Read ] t -> int -> 'a tval tail : [> `Read ] t -> int -> 'a tval strip : ?chars:[> `Read ] t ->
[> `Read ] t -> 'a tval uppercase : [> `Read ] t -> 'a tval lowercase : [> `Read ] t -> 'a tval capitalize : [> `Read ] t -> 'a tval uncapitalize : [> `Read ] t -> 'a tval copy : [> `Read ] t -> 'a tval sub : [> `Read ] t -> int -> int -> 'a tval fill : [> `Write ] t -> int -> int -> char -> unitval blit : [> `Read ] t ->
int -> [> `Write ] t -> int -> int -> unitval concat : [> `Read ] t ->
[> `Read ] t list -> 'a tval escaped : [> `Read ] t -> 'a tval replace_chars : (char -> [> `Read ] t) ->
[> `Read ] t -> 'a tval replace : str:[> `Read ] t ->
sub:[> `Read ] t ->
by:[> `Read ] t -> bool * 'a tval nreplace : str:[> `Read ] t ->
sub:[> `Read ] t ->
by:[> `Read ] t -> 'a tval repeat : [> `Read ] t -> int -> 'a tval split : [> `Read ] t ->
by:[> `Read ] t -> 'a t * 'b tval rsplit : [> `Read ] t -> by:string -> string * stringval nsplit : [> `Read ] t ->
by:[> `Read ] t -> 'a t listval splice : [ `Read | `Write ] t ->
int -> int -> [> `Read ] t -> stringval join : [> `Read ] t ->
[> `Read ] t list -> 'a tval slice : ?first:int -> ?last:int -> [> `Read ] t -> 'a tval explode : [> `Read ] t -> char listval implode : char list -> 'a tval compare : [> `Read ] t -> [> `Read ] t -> intval icompare : [> `Read ] t -> [> `Read ] t -> intval print : 'a BatInnerIO.output -> [> `Read ] t -> unitval println : 'a BatInnerIO.output -> [> `Read ] t -> unitval print_quoted : 'a BatInnerIO.output -> [> `Read ] t -> unitmodule Exceptionless:sig..end