Commit | Line | Data |
---|---|---|
7f918cf1 CE |
1 | XMLSimplifyTypes |
2 | ================ | |
3 | ||
4 | <:XMLSimplifyTypes:> is an optimization pass for the <:XML:> | |
5 | <:IntermediateLanguage:>, invoked from <:XMLSimplify:>. | |
6 | ||
7 | == Description == | |
8 | ||
9 | This pass simplifies types in an <:XML:> program, eliminating all | |
10 | unused type arguments. | |
11 | ||
12 | == Implementation == | |
13 | ||
14 | * <!ViewGitFile(mlton,master,mlton/xml/simplify-types.sig)> | |
15 | * <!ViewGitFile(mlton,master,mlton/xml/simplify-types.fun)> | |
16 | ||
17 | == Details and Notes == | |
18 | ||
19 | It first computes a simple fixpoint on all the `datatype` declarations | |
20 | to determine which `datatype` `tycon` args are actually used. Then it | |
21 | does a single pass over the program to determine which polymorphic | |
22 | declaration type variables are used, and rewrites types to eliminate | |
23 | unused type arguments. | |
24 | ||
25 | This pass should eliminate any spurious duplication that the | |
26 | <:Monomorphise:> pass might perform due to phantom types. |