aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-11-06 17:09:53 -0500
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-11-06 17:09:53 -0500
commit36952b2e49afdb4ba8024eb6372992e4b5d8df7a (patch)
tree16401277a8c24a1bcfcc410700526f64ba27a5b8 /lib
parent49f721d39e46ab0635cc2e9a5ed2a66944586640 (diff)
About to begin optimization of recursive transaction functions
Diffstat (limited to 'lib')
-rw-r--r--lib/basis.urs3
-rw-r--r--lib/top.ur11
-rw-r--r--lib/top.urs8
3 files changed, 22 insertions, 0 deletions
diff --git a/lib/basis.urs b/lib/basis.urs
index f68bedee..daefe954 100644
--- a/lib/basis.urs
+++ b/lib/basis.urs
@@ -374,7 +374,10 @@ val h1 : bodyTag []
val h2 : bodyTag []
val h3 : bodyTag []
val h4 : bodyTag []
+
val li : bodyTag []
+val ol : bodyTag []
+val ul : bodyTag []
val hr : bodyTag []
diff --git a/lib/top.ur b/lib/top.ur
index 347b2a35..abc70e53 100644
--- a/lib/top.ur
+++ b/lib/top.ur
@@ -202,6 +202,17 @@ fun queryX (tables ::: {{Type}}) (exps ::: {Type}) (ctx ::: {Unit})
(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
diff --git a/lib/top.urs b/lib/top.urs
index d52ec9d7..6653db07 100644
--- a/lib/top.urs
+++ b/lib/top.urs
@@ -141,6 +141,14 @@ val queryX : tables ::: {{Type}} -> exps ::: {Type} -> ctx ::: {Unit}
-> xml ctx [] [])
-> transaction (xml ctx [] [])
+val queryX' : tables ::: {{Type}} -> exps ::: {Type} -> ctx ::: {Unit}
+ -> sql_query tables exps
+ -> fn [tables ~ exps] =>
+ ($(exps ++ fold (fn nm (fields :: {Type}) acc [[nm] ~ acc] =>
+ [nm = $fields] ++ acc) [] tables)
+ -> transaction (xml ctx [] []))
+ -> transaction (xml ctx [] [])
+
val oneOrNoRows : tables ::: {{Type}} -> exps ::: {Type}
-> sql_query tables exps
-> fn [tables ~ exps] =>