# HG changeset patch # User Adam Chlipala # Date 1241368585 14400 # Node ID a8bdd5a0d9b025ea78ebebc893d530af3d58515a # Parent 412ccd97ab710dc82c66adfcb250dad0fa4d80ce css demo diff -r 412ccd97ab71 -r a8bdd5a0d9b0 demo/css.ur --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/demo/css.ur Sun May 03 12:36:25 2009 -0400 @@ -0,0 +1,11 @@ +style quote + +fun main () = return + + + + + +
Here's a quote.
+ +
diff -r 412ccd97ab71 -r a8bdd5a0d9b0 demo/css.urp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/demo/css.urp Sun May 03 12:36:25 2009 -0400 @@ -0,0 +1,4 @@ +allow url http://adam.chlipala.net/style.css +rewrite style Css/quote quote + +css diff -r 412ccd97ab71 -r a8bdd5a0d9b0 demo/css.urs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/demo/css.urs Sun May 03 12:36:25 2009 -0400 @@ -0,0 +1,1 @@ +val main : unit -> transaction page diff -r 412ccd97ab71 -r a8bdd5a0d9b0 demo/prose --- a/demo/prose Sun May 03 12:24:39 2009 -0400 +++ b/demo/prose Sun May 03 12:36:25 2009 -0400 @@ -70,6 +70,10 @@

Further, each Ur/Web application enforces a global condition on which strings are allowed as URLs. The .urp file for this demo shows an example that specifies particular rules about which URLs are allowed. You can try entering a variety of URLs on the form on the front page. Only those satisfying the allow url/deny url conditions should be permitted.

+css.urp + +

Ur/Web supports a structured approach to Cascading Style Sheets, where each style is a first-class value within a module. This demo shows the importing of an external style sheet with one style. By default, like other Ur/Web entities, the name of the style would be Css_quote. We use the rewrite directive in the .urp file to specify an alternate name for a particular canonical module path. The external style sheet contains a definition of a style with the alternate name that we give.

+ listShop.urp

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

diff -r 412ccd97ab71 -r a8bdd5a0d9b0 lib/ur/basis.urs --- a/lib/ur/basis.urs Sun May 03 12:24:39 2009 -0400 +++ b/lib/ur/basis.urs Sun May 03 12:36:25 2009 -0400 @@ -31,7 +31,7 @@ val plus : t ::: Type -> num t -> t -> t -> t val minus : t ::: Type -> num t -> t -> t -> t val times : t ::: Type -> num t -> t -> t -> t -val div : t ::: Type -> num t -> t -> t -> t +val divide : t ::: Type -> num t -> t -> t -> t val mod : t ::: Type -> num t -> t -> t -> t val num_int : num int val num_float : num float @@ -536,6 +536,7 @@ val br : bodyTagStandalone [] val span : bodyTag [] +val div : bodyTag [] val p : bodyTag [] val b : bodyTag [] diff -r 412ccd97ab71 -r a8bdd5a0d9b0 src/monoize.sml --- a/src/monoize.sml Sun May 03 12:24:39 2009 -0400 +++ b/src/monoize.sml Sun May 03 12:36:25 2009 -0400 @@ -811,7 +811,7 @@ ((L'.EAbs ("r", numTy t, (L'.TFun (t, (L'.TFun (t, t), loc)), loc), (L'.EField ((L'.ERel 0, loc), "Times"), loc)), loc), fm) end - | L.ECApp ((L.EFfi ("Basis", "div"), _), t) => + | L.ECApp ((L.EFfi ("Basis", "divide"), _), t) => let val t = monoType env t in