[Ur] Few bugs, questions and feature requests
Vladimir Shabanov
vshabanoff at gmail.com
Sun Nov 22 15:35:19 EST 2009
First of all thanks for nice language, played with it for a some time
and here are some bug reports & questions.
__________
When there is a form and no .urs-file Ur gives strange error:
":0:0-0:0: Function needed for both a link and a form"
somemodule.ur:
fun main () : transaction page = return <xml>
<body>
<form>
<textbox{#Text}/><submit action={submit}/>
</form>
</body>
</xml>
and submit r = return <xml/>
When I add somemodule.urs (even the empty one) error disappear.
I took me about a hour to determine source of problem since error
message is quite undescriptive.
__________
Empty tags pair gives "syntax error: deleting BEGIN_TAG GT END_TAG":
fun main () = return <xml><body>
<div></div>
</body></xml>
Nested empty tags pairs gives additional "syntax error found at XML_END":
fun main () = return <xml><body>
<div><div></div></div>
</body></xml>
This is fixed by adding spaces between tags, but still I don't think
this is an error.
__________
When I try to add some attributes to html tags I get "Couldn't prove
field name disjointness" error:
fun main () = return <xml><body><table>
<tr> <td align="right">#</td> <td>123</td> </tr>
</table></body></xml>
As I understand Ur currently doesn't support html tag attributes
(except 'style' which is handled specially). But instead something
like "attributes doesn't supported, try CSS styles" error, Ur display
error which is related to record fields which is quite confusing.
__________
I get "Couldn't prove field name disjointness" for such code:
fun row (label : string) = <xml>
<div> {[label]} </div>
</xml>
fun main () = return <xml/>
And "Some constructor unification variables are undetermined in
declaration" for this one:
fun row (label : string) = <xml>
{[label]}
</xml>
fun main () = return <xml/>
Making "main () = return (row "asdf")" cures second case but not the first.
I get the same errors with xml "label".
__________
"<label>" tag gives "Unbound expression variable label".
How can I make something like:
<checkbox{#Keep}/><label for={#Keep}>Keep me signed in</label>
__________
When Ur compilation is failed it doesn't return error code (so 'make'
doesn't stops).
__________
Can the clearCookie be added? "cookie c : option {..}" & "setCookie c
None" works ok, but it took some time to figure it out.
__________
How can I setup cookie expire time?
__________
Why the () argument is used for 'transaction page' functions?
For people with Haskell background it looks quite unnecessary.
I've changed 'fun page () = ...' to 'val page = ...' and it works for
links, but not works when I point my browser to Module/page directly.
I would be nice to allow to not write superfluous unit argument for
monadic pages.
Also why there are 'let', 'fun' and 'val'? In ocaml any function/value
is written using 'let'. I think this syntax is more uniform.
__________
Sometimes I see in console "Error triggers unlimited retry: Couldn't
allocate new heap chunk contiguously". What does it mean? Program
continues to work after this error.
More information about the Ur
mailing list