MLton 20100608 Elaborate
Home  Index  
Elaborate is a translation pass from the AST IntermediateLanguage to the CoreML IntermediateLanguage.

Description

This pass performs type inference and type checking according to the Definition. It also defunctorizes the program, eliminating all module-level constructs.

Implementation

[WWW]elaborate.sig [WWW]elaborate.fun
[WWW]elaborate-env.sig [WWW]elaborate-env.fun
[WWW]elaborate-modules.sig [WWW]elaborate-modules.fun
[WWW]elaborate-core.sig [WWW]elaborate-core.fun
[WWW]elaborate

Details and Notes

At the modules level, the Elaborate pass:

Then, within each structure or functor body, for each declaration (<dec> in the Standard ML grammar), the Elaborate pass does three steps:

  1. ScopeInference

  2. Overloaded {constant, function, record pattern} resolution

Defunctorization

The Elaborate pass performs a number of duties historically assigned to the Defunctorize pass.

As part of the Elaborate pass, all module level constructs (open, signature, structure, functor, long identifiers) are removed. This works because the Elaborate pass assigns a unique name to every type and variable in the program. This also allows the Elaborate pass to eliminate local declarations, which are purely for namespace management.

Examples

Here are a number of examples of elaboration.


Last edited on 2007-08-15 22:05:40 by MatthewFluet.