diff src/mono_reduce.sml @ 765:a28982de5645

Successfully influenced effectful-ness status of FFI func
author Adam Chlipala <adamc@hcoop.net>
date Sat, 02 May 2009 11:27:26 -0400
parents f7e2026dd5ae
children e92cfac1608f
line wrap: on
line diff
--- a/src/mono_reduce.sml	Thu Apr 30 17:15:14 2009 -0400
+++ b/src/mono_reduce.sml	Sat May 02 11:27:26 2009 -0400
@@ -53,20 +53,7 @@
       | ENone _ => false
       | ESome (_, e) => impure e
       | EFfi _ => false
-      | EFfiApp ("Basis", "set_cookie", _) => true
-      | EFfiApp ("Basis", "new_client_source", _) => true
-      | EFfiApp ("Basis", "get_client_source", _) => true
-      | EFfiApp ("Basis", "set_client_source", _) => true
-      | EFfiApp ("Basis", "alert", _) => true
-      | EFfiApp ("Basis", "new_channel", _) => true
-      | EFfiApp ("Basis", "subscribe", _) => true
-      | EFfiApp ("Basis", "send", _) => true
-      | EFfiApp ("Basis", "onError", _) => true
-      | EFfiApp ("Basis", "onFail", _) => true
-      | EFfiApp ("Basis", "onConnectFail", _) => true
-      | EFfiApp ("Basis", "onDisconnect", _) => true
-      | EFfiApp ("Basis", "onServerError", _) => true
-      | EFfiApp _ => false
+      | EFfiApp (m, x, _) => Settings.isEffectful (m, x)
       | EApp ((EFfi _, _), _) => false
       | EApp _ => true
 
@@ -271,8 +258,6 @@
 
         fun summarize d (e, _) =
             let
-                fun ffi es = List.concat (map (summarize d) es) @ [Unsure]
-
                 val s =
                     case e of
                         EPrim _ => []
@@ -283,20 +268,11 @@
                       | ENone _ => []
                       | ESome (_, e) => summarize d e
                       | EFfi _ => []
-                      | EFfiApp ("Basis", "set_cookie", es) => ffi es
-                      | EFfiApp ("Basis", "new_client_source", es) => ffi es
-                      | EFfiApp ("Basis", "get_client_source", es) => ffi es
-                      | EFfiApp ("Basis", "set_client_source", es) => ffi es
-                      | EFfiApp ("Basis", "alert", es) => ffi es
-                      | EFfiApp ("Basis", "new_channel", es) => ffi es
-                      | EFfiApp ("Basis", "subscribe", es) => ffi es
-                      | EFfiApp ("Basis", "send", es) => ffi es
-                      | EFfiApp ("Basis", "onError", es) => ffi es
-                      | EFfiApp ("Basis", "onFail", es) => ffi es
-                      | EFfiApp ("Basis", "onConnectFail", es) => ffi es
-                      | EFfiApp ("Basis", "onDisconnect", es) => ffi es
-                      | EFfiApp ("Basis", "onServerError", es) => ffi es
-                      | EFfiApp (_, _, es) => List.concat (map (summarize d) es)
+                      | EFfiApp (m, x, es) =>
+                        if Settings.isEffectful (m, x) then
+                            List.concat (map (summarize d) es) @ [Unsure]
+                        else
+                            List.concat (map (summarize d) es)
                       | EApp ((EFfi _, _), e) => summarize d e
                       | EApp _ =>
                         let