summaryrefslogtreecommitdiff
path: root/lib/top.ur
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-09-13 19:49:53 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-09-13 19:49:53 -0400
commit92865c5cf94bde77b7250450042e915a48e0025d (patch)
tree356d6e919b861559a016a13aeedc5a32fac63dd3 /lib/top.ur
parenta5a647f670f8e2fa7749e29aee39e2511afb2a21 (diff)
queryX
Diffstat (limited to 'lib/top.ur')
-rw-r--r--lib/top.ur8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/top.ur b/lib/top.ur
index af009242..7c18da21 100644
--- a/lib/top.ur
+++ b/lib/top.ur
@@ -26,3 +26,11 @@ fun foldTRX2 (tf1 :: Type -> Type) (tf2 :: Type -> Type) (ctx :: {Unit})
[[nm] ~ rest] =>
fn r1 r2 acc => <xml>{f [nm] [t] [rest] r1 r2}{acc}</xml>)
<xml></xml>
+
+fun queryX (tables ::: {{Type}}) (exps ::: {Type}) (ctx ::: {Unit}) (q : sql_query tables exps) =
+ [tables ~ exps] =>
+ fn (f : $(exps ++ fold (fn nm (fields :: {Type}) acc => [nm] ~ acc => [nm = $fields] ++ acc) [] tables)
+ -> xml ctx [] []) =>
+ query q
+ (fn fs acc => return <xml>{acc}{f fs}</xml>)
+ <xml></xml>