Module HString
Perfect shared strings by hashconsing
- author
- Christoph Sticksel
Hashtables, maps and sets
val hash : t -> intHashing function on hashconsed strings
module HStringHashtbl : Stdlib.Hashtbl.S with type HStringHashtbl.key = tHash table over hashconsed strings
module HStringSet : Stdlib.Set.S with type HStringSet.elt = tSet over hashconsed strings
module HStringMap : Stdlib.Map.S with type HStringMap.key = tMap over hashconsed strings
Constructor
val mk_hstring : string -> tHashcons a string
String functions
Omitted functions from the String module in the standard library:
copy: All strings are shared
Modified signature:
sub: return a string, not a hashconsed stringfill,blit: no in-place modifications
val length : t -> intval get : t -> int -> charval set : t -> int -> char -> tval create : int -> tval make : int -> char -> tval sub : t -> int -> int -> stringval fill : t -> int -> int -> char -> tval blit : t -> int -> t -> int -> int -> tval concat : t -> t list -> tval iter : (char -> unit) -> t -> unitval iteri : (int -> char -> unit) -> t -> unitval map : (char -> char) -> t -> tval trim : t -> tval escaped : t -> tval index : t -> char -> intval rindex : t -> char -> intval index_from : t -> int -> char -> intval rindex_from : t -> int -> char -> intval contains : t -> char -> boolval contains_from : t -> int -> char -> boolval rcontains_from : t -> int -> char -> boolval uppercase : t -> tval lowercase : t -> tval capitalize : t -> tval uncapitalize : t -> t
Pretty-printing
val pp_print_hstring : Stdlib.Format.formatter -> t -> unitPretty-print a hashconsed string
val print_hstring : t -> unitPretty-print a hashconsed term to the standard formatter
val string_of_hstring : t -> stringReturn the string