comparison 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
comparison
equal deleted inserted replaced
781:c884a42599f3 782:a44daa674810
39 39
40 fun effectful x = Settings.isEffectful x andalso not (Settings.isClientOnly x) 40 fun effectful x = Settings.isEffectful x andalso not (Settings.isClientOnly x)
41 41
42 fun effectize file = 42 fun effectize file =
43 let 43 let
44 fun expOnload evs e =
45 case e of
46 EFfi f => effectful f
47 | EFfiApp (m, x, _) => effectful (m, x)
48 | ENamed n => IM.inDomain (evs, n)
49 | EServerCall (n, _, _, _) => IM.inDomain (evs, n)
50 | _ => false
51
52 fun couldWriteOnload evs = U.Exp.exists {kind = fn _ => false,
53 con = fn _ => false,
54 exp = expOnload evs}
55
44 fun exp evs e = 56 fun exp evs e =
45 case e of 57 case e of
46 EFfi f => effectful f 58 EFfi f => effectful f
47 | EFfiApp (m, x, _) => effectful (m, x) 59 | EFfiApp (m, x, _) => effectful (m, x)
48 | ENamed n => IM.inDomain (evs, n) 60 | ENamed n => IM.inDomain (evs, n)
49 | EServerCall (n, _, _, _) => IM.inDomain (evs, n) 61 | ERecord xets => List.exists (fn ((CName "Onload", _), e, _) => couldWriteOnload evs e
62 | _ => false) xets
50 | _ => false 63 | _ => false
51 64
52 fun couldWrite evs = U.Exp.exists {kind = fn _ => false, 65 fun couldWrite evs = U.Exp.exists {kind = fn _ => false,
53 con = fn _ => false, 66 con = fn _ => false,
54 exp = exp evs} 67 exp = exp evs}