Import Upstream version 20180207
[hcoop/debian/mlton.git] / doc / guide / src / XMLSimplifyTypes.adoc
CommitLineData
7f918cf1
CE
1XMLSimplifyTypes
2================
3
4<:XMLSimplifyTypes:> is an optimization pass for the <:XML:>
5<:IntermediateLanguage:>, invoked from <:XMLSimplify:>.
6
7== Description ==
8
9This pass simplifies types in an <:XML:> program, eliminating all
10unused 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
19It first computes a simple fixpoint on all the `datatype` declarations
20to determine which `datatype` `tycon` args are actually used. Then it
21does a single pass over the program to determine which polymorphic
22declaration type variables are used, and rewrites types to eliminate
23unused type arguments.
24
25This pass should eliminate any spurious duplication that the
26<:Monomorphise:> pass might perform due to phantom types.