[MLton] SXML datatype definitions and the variables that use them
Daniel Harvey
dharvey@cc.gatech.edu
Thu, 15 Jun 2006 16:52:24 -0400 (EDT)
My understanding of how datatype definitions are made is that they live in
the top level Program structure and are simply a vector of Tycon.t * {con:
Con.t * arg: Type.t option} vector each of which represents the definition
of one datatype where {Con.t * Type.t option} a specific case (or arm) of
that datatype.
My question is if I construct a new datatype definition, for example,
datatype foo = A of unit | B of int
and have a variable
val bar = A()
How do I construct the type of bar?
It seems logical that I would use Type.con and pass it the foo Tycon, but
I'm unsure what the second argument (which is a vector of Type.t) does, or
if this is even the correct thing to be doing.