Module Unsafe.
(** Index into an [ocaml_string], without an [option] wrapper.  Throws an exception if out of bounds. *)
Parameter get : ocaml_string -> int -> char.
Extract Inlined Constant get => "String.get".
(** Create a string of repeated characters.  Throws an exception if [n < 0] or [n > Sys.max_string_length]. *)
Parameter make : int -> char -> ocaml_string.
Extract Inlined Constant make => "String.make".
(** Create a string with a function from indices to characters.  Throws an exception if [n < 0] or [n > Sys.max_string_length]. *)
Parameter init : int -> (int -> char) -> ocaml_string.
Extract Inlined Constant init => "String.init".
(** [sub i len s] is the substring of [s] with length [len] starting at index [i].  Throws an exception if out of bounds. *)
Parameter sub : ocaml_string -> int -> int -> ocaml_string.
Extract Inlined Constant sub => "String.sub".
End Unsafe.
(** * Extras *)
(** Conversion between [ocaml_string] and [list char]. *)
Parameter to_list : ocaml_string -> list char.
Parameter of_list : list char -> ocaml_string.

Axiom to_from_list :
forall s, of_list (to_list s) = s.