comparison lib/ur/top.ur @ 1406:e8bea46f8eda

Fix the two functions I just added
author Adam Chlipala <adam@chlipala.net>
date Thu, 20 Jan 2011 12:50:42 -0500
parents 8631e9ed0ee8
children 44f78d6fec29
comparison
equal deleted inserted replaced
1405:8631e9ed0ee8 1406:e8bea46f8eda
274 case ls of 274 case ls of
275 [] => <xml/> 275 [] => <xml/>
276 | x :: ls => <xml>{f i x}{qxi ls (i+1)}</xml> 276 | x :: ls => <xml>{f i x}{qxi ls (i+1)}</xml>
277 in 277 in
278 ls <- queryL q; 278 ls <- queryL q;
279 return (qxi ls 0) 279 return (qxi (rev ls) 0)
280 end 280 end
281 281
282 fun queryX1 [nm ::: Name] [fs ::: {Type}] [ctx ::: {Unit}] [inp ::: {Type}] 282 fun queryX1 [nm ::: Name] [fs ::: {Type}] [ctx ::: {Unit}] [inp ::: {Type}]
283 (q : sql_query [] [] [nm = fs] []) 283 (q : sql_query [] [] [nm = fs] [])
284 (f : $fs -> xml ctx inp []) = 284 (f : $fs -> xml ctx inp []) =
294 case ls of 294 case ls of
295 [] => <xml/> 295 [] => <xml/>
296 | x :: ls => <xml>{f i x.nm}{qx1i ls (i+1)}</xml> 296 | x :: ls => <xml>{f i x.nm}{qx1i ls (i+1)}</xml>
297 in 297 in
298 ls <- queryL q; 298 ls <- queryL q;
299 return (qx1i ls 0) 299 return (qx1i (rev ls) 0)
300 end 300 end
301 301
302 fun queryX' [tables ::: {{Type}}] [exps ::: {Type}] [ctx ::: {Unit}] [inp ::: {Type}] 302 fun queryX' [tables ::: {{Type}}] [exps ::: {Type}] [ctx ::: {Unit}] [inp ::: {Type}]
303 [tables ~ exps] (q : sql_query [] [] tables exps) 303 [tables ~ exps] (q : sql_query [] [] tables exps)
304 (f : $(exps ++ map (fn fields :: {Type} => $fields) tables) 304 (f : $(exps ++ map (fn fields :: {Type} => $fields) tables)