[MLton] free type variables in datatype decs

Stephen Weeks MLton@mlton.org
Sat, 5 Feb 2005 11:54:26 -0800


> You are absolutely right, rule 14 saves the day. In fact, I recall now that
> the side condition (and a similar one in rule 26) was added in the Revisid
> Definition, for exactly the reason that the property you cite was violated
> by the respective rules in SML'90 (as pointed out by Stefan Kahrs).

Yes, Appendix G.7 explains it this way.  The example they give as
being legal in SML '90 but not SML '97 is even pretty similar to the
one we've been discussing.

fn x => let datatype t = C
            val _ = if true then x else C
        in 5
        end