comparison demo/more/meta.ur @ 1009:59097824f19b

Viewing papers
author Adam Chlipala <adamc@hcoop.net>
date Thu, 22 Oct 2009 12:16:31 -0400
parents 1911e84df461
children 16f7cb0891b6
comparison
equal deleted inserted replaced
1008:1911e84df461 1009:59097824f19b
33 <textarea{nm} rows={10} cols={80}>{[s]}</textarea> 33 <textarea{nm} rows={10} cols={80}>{[s]}</textarea>
34 </xml>, 34 </xml>,
35 Parse = fn s => s, 35 Parse = fn s => s,
36 Inject = _} 36 Inject = _}
37 37
38 fun allContent [ts ::: {(Type * Type)}] (r : $(map meta ts)) (vs : $(map fst ts)) (fl : folder ts) =
39 foldRX2 [meta] [fst] [_]
40 (fn [nm :: Name] [p :: (Type * Type)] [rest :: {(Type * Type)}] [[nm] ~ rest]
41 (m : meta p) v =>
42 <xml><b>{[m.Nam]}</b>: {m.Show v}<br/></xml>)
43 [_] fl r vs
44
38 fun allWidgets [ts ::: {(Type * Type)}] (r : $(map meta ts)) (fl : folder ts) = 45 fun allWidgets [ts ::: {(Type * Type)}] (r : $(map meta ts)) (fl : folder ts) =
39 foldR [meta] [fn ts :: {(Type * Type)} => xml form [] (map snd ts)] 46 foldR [meta] [fn ts :: {(Type * Type)} => xml form [] (map snd ts)]
40 (fn [nm :: Name] [t :: (Type * Type)] [rest :: {(Type * Type)}] 47 (fn [nm :: Name] [t :: (Type * Type)] [rest :: {(Type * Type)}]
41 [[nm] ~ rest] (col : meta t) (acc : xml form [] (map snd rest)) => <xml> 48 [[nm] ~ rest] (col : meta t) (acc : xml form [] (map snd rest)) => <xml>
42 <b>{[col.Nam]}</b>: {col.Widget [nm]}<br/> 49 <b>{[col.Nam]}</b>: {col.Widget [nm]}<br/>