comparison demo/metaform.ur @ 1302:d008c4c43a0a

Flex kinds for type-level tuples; ::_ notation
author Adam Chlipala <adam@chlipala.net>
date Sun, 10 Oct 2010 13:07:38 -0400
parents 51e596feec37
children c7b9a33c26c8
comparison
equal deleted inserted replaced
1301:4359e185d3af 1302:d008c4c43a0a
4 val names : $(mapU 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 {@mapUX2 [string] [string] [body] 8 {@mapUX2 [string] [string] [body]
9 (fn [nm :: Name] [rest :: {Unit}] [[nm] ~ rest] name value => <xml> 9 (fn [nm :: Name] [rest ::_] [[nm] ~ rest] name value => <xml>
10 <li> {[name]} = {[value]}</li> 10 <li> {[name]} = {[value]}</li>
11 </xml>) 11 </xml>)
12 M.fl M.names values} 12 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 [] (mapU string cols)] 17 {@foldUR [string] [fn cols => xml form [] (mapU string cols)]
18 (fn [nm :: Name] [rest :: {Unit}] [[nm] ~ rest] name 18 (fn [nm :: Name] [rest ::_] [[nm] ~ rest] name
19 (acc : xml form [] (mapU 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/>