package links

  1. Overview
  2. Docs

IR variables

module Scope : sig ... end
type var = int

Term variables

val equal_var : var -> var -> Ppx_deriving_runtime.bool
val var_to_yojson : var -> Yojson.Safe.t
type var_info = Types.datatype * string * Scope.t
val show_var_info : var_info -> Ppx_deriving_runtime.string
type binder = var * var_info
val show_binder : binder -> Ppx_deriving_runtime.string
val dummy_var : int
val variable_counter : int ref

Generation of fresh variables

val fresh_raw_var : unit -> var

Generate just a fresh identifier

val fresh_binder : var_info -> binder

Given metadata, generate a full binder

val fresh_var : var_info -> binder * var

Given metadata, generate a full binder and pair it with the new variable identifer; note this identifier is already the first component of the binder value

Manipulate binder metadata

val info_type : ('a * 'b * 'c) -> 'a
val info_of_type : 'a -> 'a * string * Scope.t
val make_local_info : ('a * 'b) -> 'a * 'b * Scope.t
val make_global_info : ('a * 'b) -> 'a * 'b * Scope.t
val update_type : 'a -> ('b * ('c * 'd * 'e)) -> 'b * ('a * 'd * 'e)
val fresh_binder_of_type : Types.datatype -> binder
val fresh_var_of_type : Types.datatype -> binder * var
val fresh_global_var_of_type : Types.datatype -> binder * var
val var_of_binder : binder -> var
val info_of_binder : binder -> var_info
val type_of_binder : binder -> Types.datatype
val name_of_binder : binder -> string
val scope_of_binder : binder -> Scope.t

Create a copy of a type environment mapping vars (= ints) to types instead of strings to types

OCaml

Innovation. Community. Security.