Import Upstream version 20180207
[hcoop/debian/mlton.git] / doc / guide / src / SXML.adoc
CommitLineData
7f918cf1
CE
1SXML
2====
3
4<:SXML:> is an <:IntermediateLanguage:>, translated from <:XML:> by
5<:Monomorphise:>, optimized by <:SXMLSimplify:>, and translated by
6<:ClosureConvert:> to <:SSA:>.
7
8== Description ==
9
10SXML is a simply-typed version of <:XML:>.
11
12== Implementation ==
13
14* <!ViewGitFile(mlton,master,mlton/xml/sxml.sig)>
15* <!ViewGitFile(mlton,master,mlton/xml/sxml.fun)>
16* <!ViewGitFile(mlton,master,mlton/xml/sxml-tree.sig)>
17
18== Type Checking ==
19
20<:SXML:> shares the type checker for <:XML:>.
21
22== Details and Notes ==
23
24There are only two differences between <:XML:> and <:SXML:>. First,
25<:SXML:> `val`, `fun`, and `datatype` declarations always have an
26empty list of type variables. Second, <:SXML:> variable references
27always have an empty list of type arguments. Constructors uses can
28only have a nonempty list of type arguments if the constructor is a
29primitive.
30
31Although we could rely on the type system to enforce these constraints
32by parameterizing the <:XML:> signature, <:StephenWeeks:> did so in a
33previous version of the compiler, and the software engineering gains
34were not worth the effort.