comparison lib/top.ur @ 334:9601c717d2f3

queryX
author Adam Chlipala <adamc@hcoop.net>
date Sat, 13 Sep 2008 19:49:53 -0400
parents 02d15d81ae9b
children 34847732cefc
comparison
equal deleted inserted replaced
333:c655eddc3795 334:9601c717d2f3
24 foldTR2 [tf1] [tf2] [fn _ => xml ctx [] []] 24 foldTR2 [tf1] [tf2] [fn _ => xml ctx [] []]
25 (fn (nm :: Name) (t :: Type) (rest :: {Type}) => 25 (fn (nm :: Name) (t :: Type) (rest :: {Type}) =>
26 [[nm] ~ rest] => 26 [[nm] ~ rest] =>
27 fn r1 r2 acc => <xml>{f [nm] [t] [rest] r1 r2}{acc}</xml>) 27 fn r1 r2 acc => <xml>{f [nm] [t] [rest] r1 r2}{acc}</xml>)
28 <xml></xml> 28 <xml></xml>
29
30 fun queryX (tables ::: {{Type}}) (exps ::: {Type}) (ctx ::: {Unit}) (q : sql_query tables exps) =
31 [tables ~ exps] =>
32 fn (f : $(exps ++ fold (fn nm (fields :: {Type}) acc => [nm] ~ acc => [nm = $fields] ++ acc) [] tables)
33 -> xml ctx [] []) =>
34 query q
35 (fn fs acc => return <xml>{acc}{f fs}</xml>)
36 <xml></xml>