# HG changeset patch # User Adam Chlipala # Date 1225993605 18000 # Node ID ddd363e856ff5741c14b87aaf8aa2d8b8019eec1 # Parent 91914c15a85bd61fbcc38733c5bffb3b4775b872 Cookie prose; fix bugs that broke demo compilation diff -r 91914c15a85b -r ddd363e856ff demo/cookie.ur --- a/demo/cookie.ur Thu Nov 06 12:22:50 2008 -0500 +++ b/demo/cookie.ur Thu Nov 06 12:46:45 2008 -0500 @@ -6,21 +6,16 @@ fun main () = ro <- getCookie c; - let - val xml = case ro of - None => No cookie set. - | Some v => Cookie: A = {[v.A]}, B = {[v.B]}, C = {[v.C]} - in - return - {xml}

+ return + {case ro of + None => No cookie set. + | Some v => Cookie: A = {[v.A]}, B = {[v.B]}, C = {[v.C]}} +

-
- A:
- B:
- C:
- - -
- end - - +
+ A:
+ B:
+ C:
+ + +
diff -r 91914c15a85b -r ddd363e856ff demo/prose --- a/demo/prose Thu Nov 06 12:22:50 2008 -0500 +++ b/demo/prose Thu Nov 06 12:46:45 2008 -0500 @@ -58,6 +58,12 @@

Here is an implementation of the tiny challenge problem from this web framework comparison. Using nested function definitions, it is easy to persist state across clicks.

+cookie.urp + +

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.

+ +

After setting the cookie, try browsing back to this demo from the main index. The data you entered should still be there.

+ listShop.urp

This example shows off algebraic datatypes, parametric polymorphism, and functors.

diff -r 91914c15a85b -r ddd363e856ff src/mono_reduce.sml --- a/src/mono_reduce.sml Thu Nov 06 12:22:50 2008 -0500 +++ b/src/mono_reduce.sml Thu Nov 06 12:46:45 2008 -0500 @@ -352,9 +352,10 @@ (EApp (b, liftExpInExp 0 e'), loc)), loc)) | ELet (x, t, e', (EAbs (x', t' as (TRecord [], _), ran, e''), loc)) => - if impure e' then + (*if impure e' then e - else + else*) + (* Seems unsound in general without the check... should revisit later *) EAbs (x', t', ran, (ELet (x, t, liftExpInExp 0 e', swapExpVars 0 e''), loc)) | ELet (x, t, e', b) => diff -r 91914c15a85b -r ddd363e856ff src/monoize.sml --- a/src/monoize.sml Thu Nov 06 12:22:50 2008 -0500 +++ b/src/monoize.sml Thu Nov 06 12:46:45 2008 -0500 @@ -1565,13 +1565,9 @@ | L.EFfiApp ("Basis", "nextval", [e]) => let - val un = (L'.TRecord [], loc) - val int = (L'.TFfi ("Basis", "int"), loc) val (e, fm) = monoExp (env, st, fm) e in - ((L'.EAbs ("_", un, int, - (L'.ENextval (liftExpInExp 0 e), loc)), loc), - fm) + ((L'.ENextval e, loc), fm) end | L.EApp (