Import Upstream version 20180207
[hcoop/debian/mlton.git] / doc / guide / localhost / PhantomType
1 <!DOCTYPE html>
2 <html lang="en">
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <meta name="generator" content="AsciiDoc 8.6.9">
6 <title>PhantomType</title>
7 <link rel="stylesheet" href="./asciidoc.css" type="text/css">
8 <link rel="stylesheet" href="./pygments.css" type="text/css">
9
10
11 <script type="text/javascript" src="./asciidoc.js"></script>
12 <script type="text/javascript">
13 /*<![CDATA[*/
14 asciidoc.install();
15 /*]]>*/
16 </script>
17 <link rel="stylesheet" href="./mlton.css" type="text/css">
18 </head>
19 <body class="article">
20 <div id="banner">
21 <div id="banner-home">
22 <a href="./Home">MLton 20180207</a>
23 </div>
24 </div>
25 <div id="header">
26 <h1>PhantomType</h1>
27 </div>
28 <div id="content">
29 <div id="preamble">
30 <div class="sectionbody">
31 <div class="paragraph"><p>A phantom type is a type that has no run-time representation, but is
32 used to force the type checker to ensure invariants at compile time.
33 This is done by augmenting a type with additional arguments (phantom
34 type variables) and expressing constraints by choosing phantom types
35 to stand for the phantom types in the types of values.</p></div>
36 </div>
37 </div>
38 <div class="sect1">
39 <h2 id="_also_see">Also see</h2>
40 <div class="sectionbody">
41 <div class="ulist"><ul>
42 <li>
43 <p>
44 <a href="References#Blume01">Blume01</a>
45 </p>
46 <div class="ulist"><ul>
47 <li>
48 <p>
49 dimensions
50 </p>
51 </li>
52 <li>
53 <p>
54 C type system
55 </p>
56 </li>
57 </ul></div>
58 </li>
59 <li>
60 <p>
61 <a href="References#FluetPucella06">FluetPucella06</a>
62 </p>
63 <div class="ulist"><ul>
64 <li>
65 <p>
66 subtyping
67 </p>
68 </li>
69 </ul></div>
70 </li>
71 <li>
72 <p>
73 socket module in <a href="BasisLibrary">Basis Library</a>
74 </p>
75 </li>
76 </ul></div>
77 </div>
78 </div>
79 </div>
80 <div id="footnotes"><hr></div>
81 <div id="footer">
82 <div id="footer-text">
83 </div>
84 <div id="footer-badges">
85 </div>
86 </div>
87 </body>
88 </html>