summaryrefslogtreecommitdiff
path: root/demo
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-11-06 12:46:45 -0500
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-11-06 12:46:45 -0500
commit24777c2dc9b6ea0f3db24ae372be2af0c3f70602 (patch)
tree199cf905309f9068ba5eb6d2e395a8f12f403343 /demo
parent6c3a51281f4140589e1b7dfb01b17b6ee38cb4bc (diff)
Cookie prose; fix bugs that broke demo compilation
Diffstat (limited to 'demo')
-rw-r--r--demo/cookie.ur29
-rw-r--r--demo/prose6
2 files changed, 18 insertions, 17 deletions
diff --git a/demo/cookie.ur b/demo/cookie.ur
index 02f4cab5..ad4e19ec 100644
--- a/demo/cookie.ur
+++ b/demo/cookie.ur
@@ -6,21 +6,16 @@ fun set r =
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
-
+ return <xml><body>
+ {case ro of
+ None => <xml>No cookie set.</xml>
+ | Some v => <xml>Cookie: A = {[v.A]}, B = {[v.B]}, C = {[v.C]}</xml>}
+ <br/><br/>
+ <form>
+ A: <textbox{#A}/><br/>
+ B: <textbox{#B}/><br/>
+ C: <textbox{#C}/><br/>
+ <submit action={set}/>
+ </form>
+ </body></xml>
diff --git a/demo/prose b/demo/prose
index 06c47722..fad98e26 100644
--- a/demo/prose
+++ b/demo/prose
@@ -58,6 +58,12 @@ nested.urp
<p>Here is an implementation of the tiny challenge problem from <a href="http://www.accursoft.co.uk/web/">this web framework comparison</a>. Using nested function definitions, it is easy to persist state across clicks.</p>
+cookie.urp
+
+<p>Often, it is useful to associate persistent data with particular web clients. Ur/Web includes an easy facility for using type-safe cookies. This example shows how to use a form to set a named cookie.</p>
+
+<p>After setting the cookie, try browsing back to this demo from the main index. The data you entered should still be there.</p>
+
listShop.urp
<p>This example shows off algebraic datatypes, parametric polymorphism, and functors.</p>