summaryrefslogtreecommitdiff
path: root/src/effectize.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-05-05 10:23:16 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-05-05 10:23:16 -0400
commitaa5999ae1e92576a1557e4b9e93c12a2f800379f (patch)
treebede52199ad6681e3598dd198333b0c9dfef60ff /src/effectize.sml
parent011a2d458a677c5db5c2fdf0684eeecaf688d6d9 (diff)
Make Effectize more precise
Diffstat (limited to 'src/effectize.sml')
-rw-r--r--src/effectize.sml15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/effectize.sml b/src/effectize.sml
index e3d62ff8..c07f74bc 100644
--- a/src/effectize.sml
+++ b/src/effectize.sml
@@ -41,7 +41,7 @@ fun effectful x = Settings.isEffectful x andalso not (Settings.isClientOnly x)
fun effectize file =
let
- fun exp evs e =
+ fun expOnload evs e =
case e of
EFfi f => effectful f
| EFfiApp (m, x, _) => effectful (m, x)
@@ -49,6 +49,19 @@ fun effectize file =
| 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)
+ | ERecord xets => List.exists (fn ((CName "Onload", _), e, _) => couldWriteOnload evs e
+ | _ => false) xets
+ | _ => false
+
fun couldWrite evs = U.Exp.exists {kind = fn _ => false,
con = fn _ => false,
exp = exp evs}