diff src/effectize.sml @ 782:a44daa674810

Make Effectize more precise
author Adam Chlipala <adamc@hcoop.net>
date Tue, 05 May 2009 10:23:16 -0400
parents a28982de5645
children ed06e25c70ef
line wrap: on
line diff
--- a/src/effectize.sml	Sun May 03 16:00:43 2009 -0400
+++ b/src/effectize.sml	Tue May 05 10:23:16 2009 -0400
@@ -41,12 +41,25 @@
 
 fun effectize file =
     let
+        fun expOnload evs e =
+            case e of
+                EFfi f => effectful f
+              | EFfiApp (m, x, _) => effectful (m, x)
+              | ENamed n => IM.inDomain (evs, n)
+              | EServerCall (n, _, _, _) => IM.inDomain (evs, n)
+              | _ => false
+
+        fun couldWriteOnload evs = U.Exp.exists {kind = fn _ => false,
+                                                 con = fn _ => false,
+                                                 exp = expOnload evs}
+
         fun exp evs e =
             case e of
                 EFfi f => effectful f
               | EFfiApp (m, x, _) => effectful (m, x)
               | ENamed n => IM.inDomain (evs, n)
-              | EServerCall (n, _, _, _) => IM.inDomain (evs, n)
+              | ERecord xets => List.exists (fn ((CName "Onload", _), e, _) => couldWriteOnload evs e
+                                              | _ => false) xets
               | _ => false
 
         fun couldWrite evs = U.Exp.exists {kind = fn _ => false,