[Ur] using argument's field name in a functor signature

Gergely Buday gbuday at gmail.com
Fri Oct 21 09:01:57 EDT 2011


> Here is a (not entirely satisfactory, but not crazy either) "fix" that gets
> your code to parse:
>
>        sig
>        con fieldName = M.fieldName
>            val foo : {} -> $(mapU {fieldName : int} roles)
>        end
>
> Or, a version with more up-front cost, but that scales better to mention of
> more field names from [M]:
>
> functor DummyF (M : S) :
>        sig
>        include S
>            val foo : {} -> $(mapU {fieldName : int} roles)

Thanks. According to the old wisdom, a notation should be easy to
read, not easy to write, so I prefer the former. Another advantage is
that it is more explicit.

- Gergely



More information about the Ur mailing list