diff src/monoize.sml @ 437:1a4c1b5f4d8f

Add time to some type classes
author Adam Chlipala <adamc@hcoop.net>
date Thu, 30 Oct 2008 14:40:42 -0400
parents 024478c34f4d
children 322c8620bbdf
line wrap: on
line diff
--- a/src/monoize.sml	Thu Oct 30 14:36:48 2008 -0400
+++ b/src/monoize.sml	Thu Oct 30 14:40:42 2008 -0400
@@ -597,6 +597,13 @@
                                  (L'.TFfi ("Basis", "bool"), loc),
                                  (L'.EBinop ("!strcmp", (L'.ERel 1, loc), (L'.ERel 0, loc)), loc)), loc)), loc),
              fm)
+          | L.EFfi ("Basis", "eq_time") =>
+            ((L'.EAbs ("x", (L'.TFfi ("Basis", "time"), loc),
+                       (L'.TFun ((L'.TFfi ("Basis", "time"), loc), (L'.TFfi ("Basis", "bool"), loc)), loc),
+                       (L'.EAbs ("y", (L'.TFfi ("Basis", "time"), loc),
+                                 (L'.TFfi ("Basis", "bool"), loc),
+                                 (L'.EBinop ("==", (L'.ERel 1, loc), (L'.ERel 0, loc)), loc)), loc)), loc),
+             fm)
           | L.ECApp ((L.EFfi ("Basis", "mkEq"), _), t) =>
             let
                 val t = monoType env t
@@ -799,6 +806,19 @@
                        boolBin "<",
                        boolBin "<=")
             end
+          | L.EFfi ("Basis", "ord_time") =>
+            let
+                fun boolBin s =
+                    (L'.EAbs ("x", (L'.TFfi ("Basis", "time"), loc),
+                              (L'.TFun ((L'.TFfi ("Basis", "time"), loc), (L'.TFfi ("Basis", "bool"), loc)), loc),
+                              (L'.EAbs ("y", (L'.TFfi ("Basis", "time"), loc),
+                                        (L'.TFfi ("Basis", "bool"), loc),
+                                        (L'.EBinop (s, (L'.ERel 1, loc), (L'.ERel 0, loc)), loc)), loc)), loc)
+            in
+                ordEx ((L'.TFfi ("Basis", "time"), loc),
+                       boolBin "<",
+                       boolBin "<=")
+            end
                        
           | L.ECApp ((L.EFfi ("Basis", "show"), _), t) =>
             let