Module Fix.Gensym

This module offers a simple facility for generating fresh integer identifiers.

type gensym = unit -> int

A gensym is a generator of unique integer identifiers.

val make : unit -> gensym

make() produces a new gensym.

type generator

A generator whose current state can be inspected (but not modified).

val generator : unit -> generator

generator() creates a new generator.

val fresh : generator -> int

fresh g causes the generator g to create and return a fresh integer identifier.

val current : generator -> int

current g returns the current state of the generator g, that is, the next available integer identifier.