summaryrefslogtreecommitdiff
path: root/tests/where.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/where.ur
parentb145f505390243386da2992877a276edc8ab0256 (diff)
Monoized GROUP BY
Diffstat (limited to 'tests/where.ur')
-rw-r--r--tests/where.ur19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/where.ur b/tests/where.ur
index ab430941..8b4d89c5 100644
--- a/tests/where.ur
+++ b/tests/where.ur
@@ -9,3 +9,22 @@ val q5 = (SELECT * FROM t1 WHERE {1} = {1})
val q6 = (SELECT * FROM t1 WHERE {"Hi"} < {"Bye"})
val q7 = (SELECT * FROM t1 WHERE {1} <> {1} AND NOT ({"Hi"} >= {"Bye"}))
val q8 = (SELECT * FROM t1 WHERE t1.A = 1 OR t1.C < 3.0)
+
+datatype list a = Nil | Cons of a * list a
+
+val r1 : transaction (list {A : int, B : string, C : float}) =
+ query q8
+ (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>