summaryrefslogtreecommitdiff
path: root/demo/url.ur
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-05-03 12:24:39 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-05-03 12:24:39 -0400
commit74b6027d504c62667f804dc3952d1c7773622a68 (patch)
treebbd4fa663e5c412c295510f3cc6c75afa5191e48 /demo/url.ur
parent9638ff0c1f7b2254186a089a0e883a6b9f04f2bd (diff)
url demo
Diffstat (limited to 'demo/url.ur')
-rw-r--r--demo/url.ur13
1 files changed, 13 insertions, 0 deletions
diff --git a/demo/url.ur b/demo/url.ur
new file mode 100644
index 00000000..48d1bdc3
--- /dev/null
+++ b/demo/url.ur
@@ -0,0 +1,13 @@
+fun yourChoice r = return <xml><body>
+ {case checkUrl r.Url of
+ None => <xml>You aren't allowed to link to there.</xml>
+ | Some url => <xml><a href={url}>Enjoy!</a></xml>}
+</body></xml>
+
+fun main () = return <xml><body>
+ <a href="http://en.wikipedia.org/wiki/Type_inference">Learn something</a><br/>
+ <br/>
+ <form>
+ URL of your choice: <textbox{#Url}/> <submit action={yourChoice}/>
+ </form>
+</body></xml>