summaryrefslogtreecommitdiff
path: root/demo/more/meta.ur
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-10-22 11:51:31 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-10-22 11:51:31 -0400
commit34d3f5b515acbe3e83c0f2201253a08c4dea38b6 (patch)
treec5717cddb5c35dac338b88916ed982d2263d9cbc /demo/more/meta.ur
parentd2ddd6abe74aa089e261c051b3ddf6c182dce011 (diff)
Move stuff from bulkEdit to meta
Diffstat (limited to 'demo/more/meta.ur')
-rw-r--r--demo/more/meta.ur17
1 files changed, 17 insertions, 0 deletions
diff --git a/demo/more/meta.ur b/demo/more/meta.ur
index 39aeb901..944db822 100644
--- a/demo/more/meta.ur
+++ b/demo/more/meta.ur
@@ -44,3 +44,20 @@ fun allWidgets [ts ::: {(Type * Type)}] (r : $(map meta ts)) (fl : folder ts) =
</xml>)
<xml/>
[_] fl r
+
+fun allPopulatedTr [ts ::: {(Type * Type)}] (r : $(map meta ts)) (vs : $(map fst ts)) (fl : folder ts) =
+ foldR2 [meta] [fst] [fn cols :: {(Type * Type)} =>
+ xml [Body, Form, Tr] [] (map snd cols)]
+ (fn [nm :: Name] [p :: (Type * Type)] [rest :: {(Type * Type)}] [[nm] ~ rest]
+ (m : meta p) v (acc : xml [Body, Form, Tr] [] (map snd rest)) =>
+ <xml>
+ <td>{m.WidgetPopulated [nm] v}</td>
+ {useMore acc}
+ </xml>)
+ <xml/>
+ [_] fl r vs
+
+fun ensql [avail] [ts ::: {(Type * Type)}] (r : $(map meta ts)) (vs : $(map snd ts)) (fl : folder ts) =
+ map2 [meta] [snd] [fn ts :: (Type * Type) => sql_exp avail [] [] ts.1]
+ (fn [ts] meta v => @sql_inject meta.Inject (meta.Parse v))
+ [_] fl r vs