diff options
Diffstat (limited to 'demo')
-rw-r--r-- | demo/prose | 4 | ||||
-rw-r--r-- | demo/rec.ur | 7 | ||||
-rw-r--r-- | demo/rec.urp | 2 | ||||
-rw-r--r-- | demo/rec.urs | 1 |
4 files changed, 14 insertions, 0 deletions
@@ -38,6 +38,10 @@ link.urp <p>In <tt>link.ur</tt>, we see how easy it is to link to another page. The Ur/Web compiler guarantees that all links are valid. We just write some Ur/Web code inside an "antiquote" in our XML, denoting a transaction that will produce the new page if the link is clicked.</p> +rec.urp + +<p>Crafting webs of interlinked pages is easy, using recursion.</p> + form.urp <p>Here we see a basic form. The type system tracks which form inputs we include, and it enforces that the form handler function expects a record containing exactly those fields, with exactly the proper types.</p> diff --git a/demo/rec.ur b/demo/rec.ur new file mode 100644 index 00000000..a8084462 --- /dev/null +++ b/demo/rec.ur @@ -0,0 +1,7 @@ +fun main () = return <xml><body> + <a link={other ()}>Go to the other one!</a> +</body></xml> + +and other () = return <xml><body> + <a link={main ()}>Return to <tt>main</tt>!</a> +</body></xml> diff --git a/demo/rec.urp b/demo/rec.urp new file mode 100644 index 00000000..979d20d5 --- /dev/null +++ b/demo/rec.urp @@ -0,0 +1,2 @@ + +rec diff --git a/demo/rec.urs b/demo/rec.urs new file mode 100644 index 00000000..6ac44e0b --- /dev/null +++ b/demo/rec.urs @@ -0,0 +1 @@ +val main : unit -> transaction page |