comparison tests/crud.ur @ 332:02d15d81ae9b

foldTRX2
author Adam Chlipala <adamc@hcoop.net>
date Sat, 13 Sep 2008 11:13:46 -0400
parents eec65c11d3e2
children 9601c717d2f3
comparison
equal deleted inserted replaced
331:41458a694575 332:02d15d81ae9b
18 rows <- query (SELECT * FROM tab AS T) 18 rows <- query (SELECT * FROM tab AS T)
19 (fn (fs : {T : $([Id = int] ++ M.cols)}) acc => return <body> 19 (fn (fs : {T : $([Id = int] ++ M.cols)}) acc => return <body>
20 {acc} 20 {acc}
21 <tr> 21 <tr>
22 <td>{txt _ fs.T.Id}</td> 22 <td>{txt _ fs.T.Id}</td>
23 {foldTR2 [idT] [colMeta'] [fn _ => xtr] 23 {foldTRX2 [idT] [colMeta'] [tr]
24 (fn (nm :: Name) (t :: Type) (rest :: {Type}) => 24 (fn (nm :: Name) (t :: Type) (rest :: {Type}) =>
25 [[nm] ~ rest] => 25 [[nm] ~ rest] =>
26 fn v funcs acc => 26 fn v funcs => <tr>
27 <tr>
28 <td>{funcs.Show v}</td> 27 <td>{funcs.Show v}</td>
29 {acc}
30 </tr>) 28 </tr>)
31 <tr></tr>
32 [M.cols] (fs.T -- #Id) M.cols} 29 [M.cols] (fs.T -- #Id) M.cols}
33 </tr> 30 </tr>
34 </body>) <body></body>; 31 </body>) <body></body>;
35 return <html><head> 32 return <html><head>
36 <title>List</title> 33 <title>List</title>