diff options
Diffstat (limited to 'demo/more/meta.ur')
-rw-r--r-- | demo/more/meta.ur | 12 |
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)] |