module Erase: sig
.. end
Map to unique names
type
state
val create_state : unit -> state
val add_name : state -> string -> ID.t -> unit
Add the mapping name <=> id
to the state. It will shadow
the previous binding of name
, if any.
Raises Invalid_argument
if id
is already bound
val to_name : ?encode:(ID.t -> string -> string) -> state -> ID.t -> string
to_name state id
maps id
to a unique name, and remembers the
inverse mapping so that of_name state (to_name state id) = id
.
encode
: a function to transform the name before remembering it
val of_name : state -> string -> ID.t
Raises Not_found
if the name corresponds to no ID