Import Upstream version 20180207
[hcoop/debian/mlton.git] / doc / guide / localhost / XMLSimplifyTypes
CommitLineData
7f918cf1
CE
1<!DOCTYPE html>\r
2<html lang="en">\r
3<head>\r
4<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">\r
5<meta name="generator" content="AsciiDoc 8.6.9">\r
6<title>XMLSimplifyTypes</title>\r
7<link rel="stylesheet" href="./asciidoc.css" type="text/css">\r
8<link rel="stylesheet" href="./pygments.css" type="text/css">\r
9\r
10\r
11<script type="text/javascript" src="./asciidoc.js"></script>\r
12<script type="text/javascript">\r
13/*<![CDATA[*/\r
14asciidoc.install();\r
15/*]]>*/\r
16</script>\r
17<link rel="stylesheet" href="./mlton.css" type="text/css">\r
18</head>\r
19<body class="article">\r
20<div id="banner">\r
21<div id="banner-home">\r
22<a href="./Home">MLton 20180207</a>\r
23</div>\r
24</div>\r
25<div id="header">\r
26<h1>XMLSimplifyTypes</h1>\r
27</div>\r
28<div id="content">\r
29<div id="preamble">\r
30<div class="sectionbody">\r
31<div class="paragraph"><p><a href="XMLSimplifyTypes">XMLSimplifyTypes</a> is an optimization pass for the <a href="XML">XML</a>\r
32<a href="IntermediateLanguage">IntermediateLanguage</a>, invoked from <a href="XMLSimplify">XMLSimplify</a>.</p></div>\r
33</div>\r
34</div>\r
35<div class="sect1">\r
36<h2 id="_description">Description</h2>\r
37<div class="sectionbody">\r
38<div class="paragraph"><p>This pass simplifies types in an <a href="XML">XML</a> program, eliminating all\r
39unused type arguments.</p></div>\r
40</div>\r
41</div>\r
42<div class="sect1">\r
43<h2 id="_implementation">Implementation</h2>\r
44<div class="sectionbody">\r
45<div class="ulist"><ul>\r
46<li>\r
47<p>\r
48<a href="https://github.com/MLton/mlton/blob/master/mlton/xml/simplify-types.sig"><span class="monospaced">simplify-types.sig</span></a>\r
49</p>\r
50</li>\r
51<li>\r
52<p>\r
53<a href="https://github.com/MLton/mlton/blob/master/mlton/xml/simplify-types.fun"><span class="monospaced">simplify-types.fun</span></a>\r
54</p>\r
55</li>\r
56</ul></div>\r
57</div>\r
58</div>\r
59<div class="sect1">\r
60<h2 id="_details_and_notes">Details and Notes</h2>\r
61<div class="sectionbody">\r
62<div class="paragraph"><p>It first computes a simple fixpoint on all the <span class="monospaced">datatype</span> declarations\r
63to determine which <span class="monospaced">datatype</span> <span class="monospaced">tycon</span> args are actually used. Then it\r
64does a single pass over the program to determine which polymorphic\r
65declaration type variables are used, and rewrites types to eliminate\r
66unused type arguments.</p></div>\r
67<div class="paragraph"><p>This pass should eliminate any spurious duplication that the\r
68<a href="Monomorphise">Monomorphise</a> pass might perform due to phantom types.</p></div>\r
69</div>\r
70</div>\r
71</div>\r
72<div id="footnotes"><hr></div>\r
73<div id="footer">\r
74<div id="footer-text">\r
75</div>\r
76<div id="footer-badges">\r
77</div>\r
78</div>\r
79</body>\r
80</html>\r