aboutsummaryrefslogtreecommitdiffhomepage
path: root/demo/more/meta.ur
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-10-22 16:15:56 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-10-22 16:15:56 -0400
commit7e1e019f3fef4c229c06ba2c0c2aa3ec021eedad (patch)
treea765ee0cd11f8b42d77606fa4d133daceefff056 /demo/more/meta.ur
parentc4becb5fa4357e7a27e6536f3a20e3d5d6136cb0 (diff)
Initial support for char in SQL
Diffstat (limited to 'demo/more/meta.ur')
-rw-r--r--demo/more/meta.ur12
1 files changed, 12 insertions, 0 deletions
diff --git a/demo/more/meta.ur b/demo/more/meta.ur
index 9470eea0..74b5004f 100644
--- a/demo/more/meta.ur
+++ b/demo/more/meta.ur
@@ -52,6 +52,18 @@ fun allWidgets [ts ::: {(Type * Type)}] (r : $(map meta ts)) (fl : folder ts) =
<xml/>
[_] fl r
+fun allPopulated [ts ::: {(Type * Type)}] (r : $(map meta ts)) (vs : $(map fst ts)) (fl : folder ts) =
+ foldR2 [meta] [fst] [fn cols :: {(Type * Type)} =>
+ xml form [] (map snd cols)]
+ (fn [nm :: Name] [p :: (Type * Type)] [rest :: {(Type * Type)}] [[nm] ~ rest]
+ (m : meta p) v (acc : xml form [] (map snd rest)) =>
+ <xml>
+ {[m.Nam]}: {m.WidgetPopulated [nm] v}<br/>
+ {useMore acc}
+ </xml>)
+ <xml/>
+ [_] fl r vs
+
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)]