[Ur] Using a type variable for the type of a table

Adam Chlipala adamc at csail.mit.edu
Mon May 27 08:25:49 EDT 2013


On 05/26/2013 09:38 PM, Istvan Chung wrote:
> I have in my .ur file the following lines:
>
>      type t = {A : int, B : float, C : string}
>      table theTable : t
>    

The issue here is that the schema of a table is actually a record of 
types, not a type.  The curly-braces notation defines a type, and there 
is a bit of syntactic sugar that treats such notation differently when 
it appears directly in a table declaration.  If you want to define a 
table schema (i.e. record of types) on its own, you would write the code 
like this:

     con t = [A = int, B = float, C = string]
     table theTable : t




More information about the Ur mailing list