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:Hardcaml__.Import.Bool.t -> t

Create a new mangler.

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

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

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

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

val mangle : t -> Hardcaml__.Import.String.t -> Hardcaml__.Import.String.t

mangle t name returns a unique, mangled name.

OCaml

Innovation. Community. Security.