Module Mlsem_types.RVar

type t = Sstt.RowVar.t
val all_vars : kind -> RVarSet.t

Every variable of that kind created since the program started: this is a global registry, not a query about some term. It is how the set of rigid variables fed to tallying is obtained, and it grows monotonically for the lifetime of the process.

val has_kind : kind -> t -> bool

false for a variable that was not created by this module, where the accessors below raise instead.

val kind : t -> kind
  • raises Not_found

    if the variable was not created by this module.

val equal : t -> t -> bool
val compare : t -> t -> int
val name : t -> string
  • raises Invalid_argument

    if the variable was not created by this module.

val prefix : t -> string

The prefix under which the variable is printed (' for type variables, ` for row variables).

  • raises Invalid_argument

    if the variable was not created by this module.

val mk : kind -> string option -> t

Creates a fresh variable, with the given display name if any. Variables are never deduplicated by name: calling this twice with the same name yields two distinct variables that print identically. A caller that wants a name to denote one variable must keep its own table.

val pp : Stdlib.Format.formatter -> t -> unit
val row : t -> Mlsem_types__.Tvar.Row.t
val fty : t -> FTy.t