comparison demo/metaform.ur @ 643:aa2290c32ce2

Avoid any JavaScript when pages don't need it; update demo prose
author Adam Chlipala <adamc@hcoop.net>
date Tue, 10 Mar 2009 10:44:26 -0400
parents 6c4643880df5
children 669ac5e9a69e
comparison
equal deleted inserted replaced
642:4a125bbc602d 643:aa2290c32ce2
1 functor Make (M : sig 1 functor Make (M : sig
2 con fs :: {Unit} 2 con fs :: {Unit}
3 val fl : folder fs 3 val fl : folder fs
4 val names : $(mapUT string fs) 4 val names : $(mapU string fs)
5 end) = struct 5 end) = struct
6 6
7 fun handler values = return <xml><body> 7 fun handler values = return <xml><body>
8 {foldURX2 [string] [string] [body] 8 {foldURX2 [string] [string] [body]
9 (fn (nm :: Name) (rest :: {Unit}) [[nm] ~ rest] name value => <xml> 9 (fn (nm :: Name) (rest :: {Unit}) [[nm] ~ rest] name value => <xml>
12 [M.fs] M.fl M.names values} 12 [M.fs] M.fl M.names values}
13 </body></xml> 13 </body></xml>
14 14
15 fun main () = return <xml><body> 15 fun main () = return <xml><body>
16 <form> 16 <form>
17 {foldUR [string] [fn cols :: {Unit} => xml form [] (mapUT string cols)] 17 {foldUR [string] [fn cols :: {Unit} => xml form [] (mapU string cols)]
18 (fn (nm :: Name) (rest :: {Unit}) [[nm] ~ rest] name 18 (fn (nm :: Name) (rest :: {Unit}) [[nm] ~ rest] name
19 (acc : xml form [] (mapUT string rest)) => <xml> 19 (acc : xml form [] (mapU string rest)) => <xml>
20 <li> {[name]}: <textbox{nm}/></li> 20 <li> {[name]}: <textbox{nm}/></li>
21 {useMore acc} 21 {useMore acc}
22 </xml>) 22 </xml>)
23 <xml/> 23 <xml/>
24 [M.fs] M.fl M.names} 24 [M.fs] M.fl M.names}