diff demo/url.ur @ 774:412ccd97ab71

url demo
author Adam Chlipala <adamc@hcoop.net>
date Sun, 03 May 2009 12:24:39 -0400
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/demo/url.ur	Sun May 03 12:24:39 2009 -0400
@@ -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>