Mercurial > urweb
comparison tests/query.ur @ 253:7f6620853c36
Monoized a WHERE clause with a comparison
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Sun, 31 Aug 2008 14:27:01 -0400 |
parents | 326fb4686f60 |
children | f8d9395575ec |
comparison
equal
deleted
inserted
replaced
252:7e9bd70ad3ce | 253:7f6620853c36 |
---|---|
1 table t1 : {A : int, B : string, C : float} | 1 table t1 : {A : int, B : string, C : float, D : bool} |
2 table t2 : {A : float, D : int} | 2 table t2 : {A : float, D : int} |
3 | 3 |
4 datatype list a = Nil | Cons of a * list a | 4 datatype list a = Nil | Cons of a * list a |
5 | 5 |
6 val q1 = (SELECT * FROM t1) | 6 (*val q1 = (SELECT * FROM t1)*) |
7 val r1 : transaction (list {A : int, B : string, C : float}) = | 7 val q1 = (SELECT * FROM t1 WHERE t1.A = 0) |
8 | |
9 val r1 : transaction (list {A : int, B : string, C : float, D : bool}) = | |
8 query q1 | 10 query q1 |
9 (fn fs acc => return (Cons (fs.T1, acc))) | 11 (fn fs acc => return (Cons (fs.T1, acc))) |
10 Nil | 12 Nil |
11 | 13 |
12 val r2 : transaction string = | 14 val r2 : transaction string = |