summaryrefslogtreecommitdiff
path: root/demo
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-11-06 12:22:50 -0500
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-11-06 12:22:50 -0500
commit6c3a51281f4140589e1b7dfb01b17b6ee38cb4bc (patch)
treef912371c11c979cbede6963adb21a3fe2318623b /demo
parent9f6397d0f801f6e020aa6123f14ddc44e11deee7 (diff)
Cookie demo code; fix error message display
Diffstat (limited to 'demo')
-rw-r--r--demo/cookie.ur26
-rw-r--r--demo/cookie.urp2
-rw-r--r--demo/cookie.urs1
3 files changed, 29 insertions, 0 deletions
diff --git a/demo/cookie.ur b/demo/cookie.ur
new file mode 100644
index 00000000..02f4cab5
--- /dev/null
+++ b/demo/cookie.ur
@@ -0,0 +1,26 @@
+cookie c : {A : string, B : float, C : int}
+
+fun set r =
+ setCookie c {A = r.A, B = readError r.B, C = readError r.C};
+ return <xml>Cookie set.</xml>
+
+fun main () =
+ ro <- getCookie c;
+ let
+ val xml = case ro of
+ None => <xml>No cookie set.</xml>
+ | Some v => <xml>Cookie: A = {[v.A]}, B = {[v.B]}, C = {[v.C]}</xml>
+ in
+ return <xml><body>
+ {xml}<br/><br/>
+
+ <form>
+ A: <textbox{#A}/><br/>
+ B: <textbox{#B}/><br/>
+ C: <textbox{#C}/><br/>
+ <submit action={set}/>
+ </form>
+ </body></xml>
+ end
+
+
diff --git a/demo/cookie.urp b/demo/cookie.urp
new file mode 100644
index 00000000..9e283d4b
--- /dev/null
+++ b/demo/cookie.urp
@@ -0,0 +1,2 @@
+
+cookie
diff --git a/demo/cookie.urs b/demo/cookie.urs
new file mode 100644
index 00000000..6ac44e0b
--- /dev/null
+++ b/demo/cookie.urs
@@ -0,0 +1 @@
+val main : unit -> transaction page