summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-08-31 16:13:07 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-08-31 16:13:07 -0400
commit9a3af2ced0937e9578595053f730cb1b11cca6e5 (patch)
treee298baa9166fa65a1d54273285cf25eea757d573
parentb027a79d3f701b4d2d4d1849449e4e6d8b973fcd (diff)
Monoize unops
-rw-r--r--src/monoize.sml26
-rw-r--r--tests/where.ur2
2 files changed, 27 insertions, 1 deletions
diff --git a/src/monoize.sml b/src/monoize.sml
index 3bf96f26..920291a6 100644
--- a/src/monoize.sml
+++ b/src/monoize.sml
@@ -781,6 +781,32 @@ fun monoExp (env, st, fm) (all as (e, loc)) =
(L.ECApp (
(L.ECApp (
(L.ECApp (
+ (L.EFfi ("Basis", "sql_unary"), _),
+ _), _),
+ _), _),
+ _), _),
+ _), _),
+ _) =>
+ let
+ val s = (L'.TFfi ("Basis", "string"), loc)
+ fun sc s = (L'.EPrim (Prim.String s), loc)
+ in
+ ((L'.EAbs ("c", s, (L'.TFun (s, (L'.TFun (s, s), loc)), loc),
+ (L'.EAbs ("e1", s, (L'.TFun (s, s), loc),
+ strcat loc [sc "(",
+ (L'.ERel 1, loc),
+ sc " ",
+ (L'.ERel 0, loc),
+ sc ")"]), loc)), loc),
+ fm)
+ end
+ | L.EFfi ("Basis", "sql_not") => ((L'.EPrim (Prim.String "NOT"), loc), fm)
+
+ | L.ECApp (
+ (L.ECApp (
+ (L.ECApp (
+ (L.ECApp (
+ (L.ECApp (
(L.ECApp (
(L.EFfi ("Basis", "sql_binary"), _),
_), _),
diff --git a/tests/where.ur b/tests/where.ur
index 8b4d89c5..aa6c519b 100644
--- a/tests/where.ur
+++ b/tests/where.ur
@@ -13,7 +13,7 @@ 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
+ query q7
(fn fs acc => return (Cons (fs.T1, acc)))
Nil