[Ur] Grammar/Parser bug?
Adam Chlipala
adamc at csail.mit.edu
Sat Oct 8 13:05:29 EDT 2016
It does seem likely that the parser isn't allowing qualified names in
record literals. The problem is easy to work around by defining a type
synonym that you use instead. Here's some code (not actually run
through Ur/Web yet!):
type blah x y z = $([x = y] ++ z)
... where type t = blah A.n1 A.t1 A.t2
It may need extra kind annotations.
On 10/07/2016 08:42 AM, Saulo Araujo wrote:
> Hi,
>
> I am trying to do something like
>
> signature ARGUMENTS = sig
> con n1 :: Name
> con t1 :: Type
> con t2 :: {Type}
> constraint [n1] ~ t2
> end
>
> signature RESULT = sig
> type t
> end
>
> functor Functor(A : ARGUMENTS) : RESULT where type t = $([A.n1 = A.t1]
> ++ A.t2) = struct
> open A
>
> type t = $([n1 = t1] ++ t2)
> end
>
> but the Ur/Web compiler complains saying:
>
> test.ur:12:58: (to 12:60) syntax error: deleting CSYMBOL DOT
> Parse failure
>
> Apparently, one cannot construct type-level records by projecting name
> variables from a module. Is this a grammar/parser bug? If so, is there
> a workaround?
>
> Sincrely,
> Saulo
More information about the Ur
mailing list