[Ur] Minimal example of <select> widget for foreign-key field; error "Some constructor unification variables are undetermined" mentions field [Id = string] - but my field is actually [Id = int]
Adam Chlipala
adamc at csail.mit.edu
Tue Jul 28 09:49:17 EDT 2015
On 07/27/2015 07:50 PM, Stefan Scott Alexander wrote:
> Strangely, this error message mentions a field [Id = string] - but my
> code only uses [Id = int].
The problem is in this code, where you use [r.Id] as an <option> value,
which must be a string. The type of [option] in basis.urs makes that
requirement explicit.
> colorOptions <-
> queryX1 (SELECT * FROM color)
> (fn r => <xml> <option value={r.Id}> {[r.Nam]} </option> </xml>);
> The Ur/Web compiler gives the following error:
>
> ```
> Some constructor unification variables are undetermined in declaration
> (look for them as "<UNIF:...>")
> ```
>
> It can be difficult to debug this error, as it refers to a wide range
> of lines (covering all the function definitions).
As the message indicates, you're supposed to do a text search for
"<UNIF:" to see where the undetermined unification variables are.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.impredicative.com/pipermail/ur/attachments/20150728/04f7386a/attachment-0001.html>
More information about the Ur
mailing list