Module Cduce_types.Var
Polymorphic type variables.
module Set : sig ... endSets of variables.
module Map = Set.MapMaps indexed by variables.
val mk : ?kind:[ `generated | `user | `weak ] -> string -> tmk ~kind "name" creates a fresh variable with name
nameand kindkind. It is distinct (in the sense ofequalandcompare) from all other created variables, even those with the same name. The optional kind is used to indicate whether the variable was explicitely written by the user in a type definition or annotation, or if it was generated, e.g. during constraint generation or unification.
val name : t -> stringname vreturns the display name of variable v.
val id : t -> intid vreturns the internal id of the variable.
val kind : t -> [ `generated | `user | `weak ]kind vreturns the kind of the variable.
val print : Stdlib.Format.formatter -> t -> unitprint ppf vprints the variable's display name.
val renaming : Set.t -> t Map.maprenaming vsetreturns a map from variables fromvsetto fresh variables with distinct names. In case of aliases, one occurrence of the variables invsetis unchanged and the others are renamed with a suffix1,2, … The function tries to keep the name of`uservariables unchanged if possible.