module Exports:sig..end
TypeCore.vars.vars (What is the var that stands
for "int::int"?), andvars (This implementation
contains "val x". Which var is "x"?)
What does this have to do with kind-check? Well, kind-check expects an
environment where all required interfaces have been _imported_. This means
that if there is an occurrence of module "m" in implementation "impl", then
kind-checking expects "m::x" to be available in the environment. Opening a
module is managed internally by KindCheck and TransSurface.
Rather than using a separate, high-level environment, which we would inject
into the kind-checking environment, we cheat and reuse kind-checking
environments as high-level environments. The invariant is that a high-level
environment only contains NonLocal bindings, either qualified or
unqualified.
typevalue_exports =(Variable.name * TypeCore.var) list
typedatacon_exports =(TypeCore.var * Datacon.name * SurfaceSyntax.datacon_info) list
val bind_implementation_values : TypeCore.env -> value_exports -> TypeCore.envfind_unqualified_var, for instance when printing a signature, or in the
test-suite, when poking at a specific variable.val bind_implementation_types : TypeCore.env ->
TypeCore.data_type_group ->
TypeCore.var list -> datacon_exports -> TypeCore.envval bind_interface_value : TypeCore.env -> Module.name -> Variable.name -> TypeCore.var -> TypeCore.envfind_qualified_var at any
time. Such bindings will be used by the kind-checking, translation and
type-checking phases.val bind_interface_types : TypeCore.env ->
Module.name ->
TypeCore.data_type_group ->
TypeCore.var list -> datacon_exports -> TypeCore.envval find_qualified_var : TypeCore.env -> Module.name -> Variable.name -> TypeCore.varfind_qualified_var env mname x finds name x as exported by module
mname. Use this to reach values exported by _interfaces_ which the current
program depends on.val find_unqualified_var : TypeCore.env -> Variable.name -> TypeCore.varfind_unqualified_var env x finds the name x as exported by the current
module. Use it after type-checking an _implementation_.