A "bigstring" here is simply a bigarray of chars. It can be used instead of regular strings when IO involve calling C (or another language), when very large strings are required, or for memory-mapping.
val init : int ‑> (int ‑> char) ‑> tInitialize with the given function (called at every index).
init n f is the string f 0, f 1, ..., f (n-1).
val fill_slice : t ‑> char ‑> int ‑> int ‑> unitfill_slice s c i len is the same as fill (sub s i len) c, it
fills the slice from i to i+len-1 of s with the char c
val get : t ‑> int ‑> charObtain the byte at the given index.
val unsafe_get : t ‑> int ‑> charSame as get, but without bound check. Can fail arbitrarily (including segfault) if used improperly.
val set : t ‑> int ‑> char ‑> unitChange the byte at the given index.
val unsafe_set : t ‑> int ‑> char ‑> unitSame as set, but without bound check. Can fail arbitrarily (including segfault) if used improperly.
Blit a slice of the bigstring into another.
blit s1 i1 s2 i2 len means that elements from s1 whose indices
range from i1 to i1+len-1 are copied into the slots of s2
whose indices range from i2 to i2+len-1. This is similar to
String.blit or Bytes.blit or Array.blit.
sub s i len takes a slice of length len from the string s, starting
at offset i. The slice shares the same memory as s, meaning that
modifications of the slice will modify s as well.
Slicing is cheap since it does not involve copying the whole range.
i, len doesn't designate a valid substringval to_bytes : t ‑> Bytes.tval of_bytes : Bytes.t ‑> tval of_bytes_slice : Bytes.t ‑> int ‑> int ‑> tval sub_bytes : t ‑> int ‑> int ‑> Bytes.tval blit_to_bytes : t ‑> int ‑> Bytes.t ‑> int ‑> int ‑> unitval blit_of_bytes : Bytes.t ‑> int ‑> t ‑> int ‑> int ‑> unitval blit_of_buffer : Buffer.t ‑> int ‑> t ‑> int ‑> int ‑> unitval to_string : t ‑> stringval of_string : string ‑> tval of_string_slice : string ‑> int ‑> int ‑> tval sub_string : t ‑> int ‑> int ‑> stringval blit_of_string : string ‑> int ‑> t ‑> int ‑> int ‑> unittrim s returns a slice of s without the leading and trailing
whitespaces, where whitespaces are defined identically to String.trim.
note that it does not copy the substring, but returns a slice!
s, or empty if s is totally composed of whitespacesval index : t ‑> c:char ‑> intindex s ~c returns the index of the first
occurrence of character c in string s.
c does not occurr in sval rindex : t ‑> c:char ‑> intrindex s ~c returns the index of the last
occurrence of character c in string s.
c does not occurr in sval index_pred : f:(char ‑> bool) ‑> t ‑> intindex_pred ~f s returns the index of the first char in s that
satisfies s.
s satisfies pval rindex_pred : f:(char ‑> bool) ‑> t ‑> intrindex_pred ~f s returns the index of the last char in s that
satisfies s.
s satisfies p