diff src/mono_util.sml @ 568:55fc747a67dc

Initial <dyn> support
author Adam Chlipala <adamc@hcoop.net>
date Sat, 20 Dec 2008 15:46:48 -0500
parents 1901db85acb4
children 162d5308e34f
line wrap: on
line diff
--- a/src/mono_util.sml	Sat Dec 20 14:19:21 2008 -0500
+++ b/src/mono_util.sml	Sat Dec 20 15:46:48 2008 -0500
@@ -51,6 +51,7 @@
       | (TDatatype (n1, _), TDatatype (n2, _)) => Int.compare (n1, n2)
       | (TFfi (m1, x1), TFfi (m2, x2)) => join (String.compare (m1, m2), fn () => String.compare (x1, x2))
       | (TOption t1, TOption t2) => compare (t1, t2)
+      | (TSignal t1, TSignal t2) => compare (t1, t2)
 
       | (TFun _, _) => LESS
       | (_, TFun _) => GREATER
@@ -64,6 +65,9 @@
       | (TFfi _, _) => LESS
       | (_, TFfi _) => GREATER
 
+      | (TOption _, _) => LESS
+      | (_, TOption _) => GREATER
+
 and compareFields ((x1, t1), (x2, t2)) =
     join (String.compare (x1, x2),
           fn () => compare (t1, t2))
@@ -96,6 +100,10 @@
                 S.map2 (mft t,
                         fn t' =>
                            (TOption t, loc))
+              | TSignal t =>
+                S.map2 (mft t,
+                        fn t' =>
+                           (TSignal t, loc))
     in
         mft
     end
@@ -311,10 +319,14 @@
                         S.map2 (mft t,
                                 fn t' =>
                                    (EUnurlify (e', t'), loc)))
-              | EJavaScript e =>
+              | EJavaScript (m, e) =>
                 S.map2 (mfe ctx e,
                      fn e' =>
-                        (EJavaScript e', loc))
+                        (EJavaScript (m, e'), loc))
+              | ESignalReturn e =>
+                S.map2 (mfe ctx e,
+                     fn e' =>
+                        (ESignalReturn e', loc))
     in
         mfe
     end