comparison demo/more/dlist.ur @ 1641:68429cfce8db

Redo HTML context classification, to keep regular <body> tags out of <table> and <tr>
author Adam Chlipala <adam@chlipala.net>
date Tue, 20 Dec 2011 19:02:04 -0500
parents f0afe61a6f8b
children
comparison
equal deleted inserted replaced
1640:dc986eb6113c 1641:68429cfce8db
64 hd <- build (List.rev ls) tl; 64 hd <- build (List.rev ls) tl;
65 tlS <- source tl; 65 tlS <- source tl;
66 set dl (Nonempty {Head = Cons (x, hd), Tail = tlS}) 66 set dl (Nonempty {Head = Cons (x, hd), Tail = tlS})
67 end 67 end
68 68
69 fun renderDyn [ctx] [ctx ~ body] [t] (f : t -> position -> xml (ctx ++ body) [] []) filter pos len dl = <xml> 69 fun renderDyn [ctx] [ctx ~ [Dyn]] [t] (f : t -> position -> xml (ctx ++ [Dyn]) [] []) filter pos len dl = <xml>
70 <dyn signal={dl' <- signal dl; 70 <dyn signal={dl' <- signal dl;
71 case dl' of 71 case dl' of
72 Empty => return <xml/> 72 Empty => return <xml/>
73 | Nonempty {Head = hd, Tail = tlTop} => 73 | Nonempty {Head = hd, Tail = tlTop} =>
74 let 74 let
117 hd <- skip pos hd; 117 hd <- skip pos hd;
118 return (render' None hd len) 118 return (render' None hd len)
119 end}/> 119 end}/>
120 </xml> 120 </xml>
121 121
122 fun renderFlat [ctx] [ctx ~ body] [t] (f : t -> position -> xml (ctx ++ body) [] []) 122 fun renderFlat [ctx] [ctx ~ [Dyn]] [t] (f : t -> position -> xml (ctx ++ [Dyn]) [] [])
123 : option int -> list (t * position) -> xml (ctx ++ body) [] [] = 123 : option int -> list (t * position) -> xml (ctx ++ [Dyn]) [] [] =
124 let 124 let
125 fun renderFlat' len ls = 125 fun renderFlat' len ls =
126 case len of 126 case len of
127 Some 0 => <xml/> 127 Some 0 => <xml/>
128 | _ => 128 | _ =>
184 end 184 end
185 in 185 in
186 sort' 186 sort'
187 end 187 end
188 188
189 fun render [ctx] [ctx ~ body] [t] f (r : {Filter : t -> signal bool, 189 fun render [ctx] [ctx ~ [Dyn]] [t] f (r : {Filter : t -> signal bool,
190 Sort : signal (option (t -> t -> signal bool)), 190 Sort : signal (option (t -> t -> signal bool)),
191 StartPosition : signal (option int), 191 StartPosition : signal (option int),
192 MaxLength : signal (option int)}) dl = <xml> 192 MaxLength : signal (option int)}) dl = <xml>
193 <dyn signal={len <- r.MaxLength; 193 <dyn signal={len <- r.MaxLength;
194 cmp <- r.Sort; 194 cmp <- r.Sort;
195 pos <- r.StartPosition; 195 pos <- r.StartPosition;
196 196
197 case cmp of 197 case cmp of