xml and sxml

Stephen Weeks sweeks@wasabi.epr.com
Wed, 17 Nov 1999 12:34:01 -0800 (PST)


> I'm having trouble figuring out where I should make
> the call to uncurry.  Right now, since uncurry's
> signature is XmlTree.Program.t -> XmlTree.Program.t,
> it can be invoked from xml/simplify.fun.  This wouldn't
> be correct if I changed its signature to operate
> Sxml since simplify.sig expects simplify to take an
> XmlTree.Program.t.  This is confusing to me since
> sxml.sig states that SXML = XML.  What magic am I 
> missing here?

The SML type system does not enforce the difference between XML and
SXML.  At some point it did, but this resulted in tons of code
duplication.  I don't know a good way to do it without refinement
types.  So, I decided to merge them.  If you put code in
xml/simplify.fun, then it must work on both XML and SXML.

I recommend making the call to uncurry in src/compile.fun, right
between implement exceptions and polyvariance (i.e. at the first point
at which the program is in SXML).  You could also try it just after
polyvariance as well.