package hardcaml

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Map a set of names to a set of unique names.

type t

A mangler is a mapping from strings to the next available integer which should be added to the name to make it unique.

val sexp_of_t : t -> Ppx_sexp_conv_lib.Sexp.t
val create : case_sensitive:Base.Bool.t -> t

Create a new mangler.

val add_identifier : t -> Base.String.t -> [ `Ok | `Duplicate ]
val add_identifiers_exn : t -> Base.String.t Base.List.t -> Base.Unit.t

Add a list of identifiers to the mangler table. Raises if an identifier is already in the table.

val find_index : t -> Base.String.t -> Base.Int.t Base.Option.t

Test if the string is in the mangler, and return its mangler index if it is.

val mangle : t -> Base.String.t -> Base.String.t

mangle t name returns a unique, mangled name.

OCaml

Innovation. Community. Security.