You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
590 B
18 lines
590 B
/*
|
|
* Typecheck an AST with a given environment
|
|
* the environment maps variables to types
|
|
* a variable can either be bound or free
|
|
* when we say a variable is free that means that it is either
|
|
* unbound (which causes an exception to be raised immediately)
|
|
* or it is bound in the outer scope
|
|
*
|
|
* So the AST must first be converted to a form where each function body is tied
|
|
* to an environment mapping identifiers to types
|
|
*/
|
|
|
|
import rep from "./representation.js";
|
|
import env from "./environments.js";
|
|
|
|
/*
|
|
* Map all bindings with explicit type annotations in the environment
|
|
*/
|
|
|