Backport from sid to buster
[hcoop/debian/mlton.git] / doc / guide / src / SXML.adoc
1 SXML
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
10 SXML 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
24 There are only two differences between <:XML:> and <:SXML:>. First,
25 <:SXML:> `val`, `fun`, and `datatype` declarations always have an
26 empty list of type variables. Second, <:SXML:> variable references
27 always have an empty list of type arguments. Constructors uses can
28 only have a nonempty list of type arguments if the constructor is a
29 primitive.
30
31 Although we could rely on the type system to enforce these constraints
32 by parameterizing the <:XML:> signature, <:StephenWeeks:> did so in a
33 previous version of the compiler, and the software engineering gains
34 were not worth the effort.