diff tests/where.ur @ 255:69d337f186eb

Monoized GROUP BY
author Adam Chlipala <adamc@hcoop.net>
date Sun, 31 Aug 2008 15:04:10 -0400
parents 71bafe66dbe1
children 35ed669a253f
line wrap: on
line diff
--- a/tests/where.ur	Sun Aug 31 14:33:22 2008 -0400
+++ b/tests/where.ur	Sun Aug 31 15:04:10 2008 -0400
@@ -9,3 +9,22 @@
 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>