package links

  1. Overview
  2. Docs

IR variables

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

Term variables

val pp_var : Ppx_deriving_runtime.Format.formatter -> var -> Ppx_deriving_runtime.unit
val show_var : var -> Ppx_deriving_runtime.string
val equal_var : var -> var -> Ppx_deriving_runtime.bool
val var_to_yojson : var -> Yojson.Safe.t
val var_of_yojson : Yojson.Safe.t -> var Ppx_deriving_yojson_runtime.error_or
type var_info
val pp_var_info : Ppx_deriving_runtime.Format.formatter -> var_info -> Ppx_deriving_runtime.unit
val show_var_info : var_info -> Ppx_deriving_runtime.string
type binder
val pp_binder : Ppx_deriving_runtime.Format.formatter -> binder -> Ppx_deriving_runtime.unit
val show_binder : binder -> Ppx_deriving_runtime.string
val dummy_var : int
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 : var_info -> Types.datatype
val info_of_type : Types.datatype -> var_info
val make_info : Types.datatype -> string -> Scope.t -> var_info
val make_local_info : (Types.datatype * string) -> var_info
val make_global_info : (Types.datatype * string) -> var_info
val make_binder : var -> var_info -> binder
val update_type : Types.datatype -> binder -> binder
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
val globalise_binder : binder -> binder

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

OCaml

Innovation. Community. Security.