Mercurial > urweb
diff lib/top.ur @ 469:b393c2fc80f8
About to begin optimization of recursive transaction functions
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Thu, 06 Nov 2008 17:09:53 -0500 |
parents | dfc8c991abd0 |
children | 7cb418e9714f |
line wrap: on
line diff
--- a/lib/top.ur Thu Nov 06 15:52:13 2008 -0500 +++ b/lib/top.ur Thu Nov 06 17:09:53 2008 -0500 @@ -202,6 +202,17 @@ (fn fs acc => return <xml>{acc}{f fs}</xml>) <xml/> +fun queryX' (tables ::: {{Type}}) (exps ::: {Type}) (ctx ::: {Unit}) + (q : sql_query tables exps) [tables ~ exps] + (f : $(exps ++ fold (fn nm (fields :: {Type}) acc [[nm] ~ acc] => + [nm = $fields] ++ acc) [] tables) + -> transaction (xml ctx [] [])) = + query q + (fn fs acc => + r <- f fs; + return <xml>{acc}{r}</xml>) + <xml/> + fun oneOrNoRows (tables ::: {{Type}}) (exps ::: {Type}) (q : sql_query tables exps) [tables ~ exps] = query q