summaryrefslogtreecommitdiff
path: root/tests/relops.ur
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-08-31 15:47:32 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-08-31 15:47:32 -0400
commit003594fd2ed4739b9f1fdc8df350615fdc11a3f7 (patch)
tree8705b6c057ab6c4bca2a68a6f3901722a9802d03 /tests/relops.ur
parent1d2a33433b530bdfe2c4cf7c7f0e6bc7190d87c5 (diff)
Monoize relops
Diffstat (limited to 'tests/relops.ur')
-rw-r--r--tests/relops.ur22
1 files changed, 21 insertions, 1 deletions
diff --git a/tests/relops.ur b/tests/relops.ur
index c9fca0cc..b876c482 100644
--- a/tests/relops.ur
+++ b/tests/relops.ur
@@ -7,4 +7,24 @@ val q2 = (SELECT t1.A, t1.B FROM t1 WHERE t1.A = 0
INTERSECT SELECT t1.B, t1.A FROM t1 WHERE t1.B = t1.B)
val q3 = (SELECT t1.A, t1.B, t1.C FROM t1 WHERE t1.A = 0
INTERSECT SELECT * FROM t1 WHERE t1.B = 'Hello world!'
- EXCEPT SELECT * FROM t1 WHERE t1.A < t1.A)
+ EXCEPT SELECT * FROM t1 WHERE t1.A < t1.A
+ UNION SELECT * FROM t1 WHERE t1.A > t1.A)
+
+datatype list a = Nil | Cons of a * list a
+
+val r1 : transaction (list {A : int, B : string, C : float}) =
+ query q3
+ (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>