Mercurial > urweb
comparison demo/crud.ur @ 1303:c7b9a33c26c8
Hopeful fix for the Great Unification Bug
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Sun, 10 Oct 2010 14:41:03 -0400 |
parents | d008c4c43a0a |
children | 6bc2a8cb3a67 |
comparison
equal
deleted
inserted
replaced
1302:d008c4c43a0a | 1303:c7b9a33c26c8 |
---|---|
76 | 76 |
77 <br/><hr/><br/> | 77 <br/><hr/><br/> |
78 | 78 |
79 <form> | 79 <form> |
80 {@foldR [colMeta] [fn cols => xml form [] (map snd cols)] | 80 {@foldR [colMeta] [fn cols => xml form [] (map snd cols)] |
81 (fn [nm :: Name] [t ::_] [rest ::_] [[nm] ~ rest] (col : colMeta t) (acc : xml form [] (map snd rest)) => <xml> | 81 (fn [nm :: Name] [t ::_] [rest ::_] [[nm] ~ rest] (col : colMeta t) acc => <xml> |
82 <li> {cdata col.Nam}: {col.Widget [nm]}</li> | 82 <li> {cdata col.Nam}: {col.Widget [nm]}</li> |
83 {useMore acc} | 83 {useMore acc} |
84 </xml>) | 84 </xml>) |
85 <xml/> | 85 <xml/> |
86 M.fl M.cols} | 86 M.fl M.cols} |
126 fso <- oneOrNoRows (SELECT tab.{{map fst M.cols}} FROM tab WHERE tab.Id = {[id]}); | 126 fso <- oneOrNoRows (SELECT tab.{{map fst M.cols}} FROM tab WHERE tab.Id = {[id]}); |
127 case fso : (Basis.option {Tab : $(map fst M.cols)}) of | 127 case fso : (Basis.option {Tab : $(map fst M.cols)}) of |
128 None => return <xml><body>Not found!</body></xml> | 128 None => return <xml><body>Not found!</body></xml> |
129 | Some fs => return <xml><body><form> | 129 | Some fs => return <xml><body><form> |
130 {@foldR2 [fst] [colMeta] [fn cols => xml form [] (map snd cols)] | 130 {@foldR2 [fst] [colMeta] [fn cols => xml form [] (map snd cols)] |
131 (fn [nm :: Name] [t ::_] [rest ::_] [[nm] ~ rest] (v : t.1) (col : colMeta t) | 131 (fn [nm :: Name] [t ::_] [rest ::_] [[nm] ~ rest] v (col : colMeta t) |
132 (acc : xml form [] (map snd rest)) => | 132 (acc : xml form [] (map snd rest)) => |
133 <xml> | 133 <xml> |
134 <li> {cdata col.Nam}: {col.WidgetPopulated [nm] v}</li> | 134 <li> {cdata col.Nam}: {col.WidgetPopulated [nm] v}</li> |
135 {useMore acc} | 135 {useMore acc} |
136 </xml>) | 136 </xml>) |