summaryrefslogtreecommitdiff
path: root/tests/group_by.ur
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-08-31 15:04:10 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-08-31 15:04:10 -0400
commit0ca7aad45b1581ab86d136aaf7829418e093bb24 (patch)
treecea3dc87d8c098a2e61a5f6f4253020fbda34465 /tests/group_by.ur
parentb145f505390243386da2992877a276edc8ab0256 (diff)
Monoized GROUP BY
Diffstat (limited to 'tests/group_by.ur')
-rw-r--r--tests/group_by.ur20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/group_by.ur b/tests/group_by.ur
index 569676d5..93655568 100644
--- a/tests/group_by.ur
+++ b/tests/group_by.ur
@@ -9,3 +9,23 @@ val q4 = (SELECT * FROM t1 WHERE t1.A = 0 GROUP BY t1.C HAVING t1.C < 0.2)
val q5 = (SELECT t1.A, t2.D FROM t1, t2 GROUP BY t2.D, t1.A)
val q6 = (SELECT t1.A, t2.D FROM t1, t2 WHERE t1.C = 0.0 GROUP BY t2.D, t1.A HAVING t1.A = t1.A AND t2.D = 17)
+
+
+datatype list a = Nil | Cons of a * list a
+
+val r1 : transaction (list {B : string}) =
+ query q1
+ (fn fs acc => return (Cons (fs.T1, acc)))
+ Nil
+
+val r2 : transaction string =
+ ls <- r1;
+ return (case ls of
+ Nil => "Problem"
+ | Cons ({B = b, ...}, _) => b)
+
+val main : unit -> transaction page = fn () =>
+ s <- r2;
+ return <html><body>
+ {cdata s}
+ </body></html>