[Ur] record expression

Adam Chlipala adamc at impredicative.com
Thu Oct 13 08:35:22 EDT 2011


Gergely Buday wrote:
> Adam wrote:
>
>    
>> I would do it as:
>>
>> type copiedType = float (* fill something else in here *)
>>
>> con copiedFields = [1, 2, 3] (* fill something else in here *)
>>
>> type myRecord = $([MyField = int, MyOtherField = string] ++ mapU copiedType
>> copiedFields)
>>      
> Thanks, this is clear. Is it possible to have a variable number of fields here?
>    

Yes, as I tried to hint at before, you can write [myRecord] as a 
type-level function over [copiedFields], if you include an appropriate 
disjointness constraint.



More information about the Ur mailing list