diff src/monoize.sml @ 264:35ed669a253f

Monoize unops
author Adam Chlipala <adamc@hcoop.net>
date Sun, 31 Aug 2008 16:13:07 -0400
parents 02e1870a0516
children b66e692422a4
line wrap: on
line diff
--- a/src/monoize.sml	Sun Aug 31 16:11:15 2008 -0400
+++ b/src/monoize.sml	Sun Aug 31 16:13:07 2008 -0400
@@ -781,6 +781,32 @@
              (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"), _),
                  _), _),