diff options
author | Adam Chlipala <adamc@hcoop.net> | 2009-05-21 11:45:04 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2009-05-21 11:45:04 -0400 |
commit | 32f6bd8f1bcf65a5db96160d63ef2050c9eb5e52 (patch) | |
tree | 502ef8ac60b6ab054bea740f53ef75ae77f0c66e | |
parent | c53470daa7b350ac8545d8934cedbcb1aae49bd0 (diff) |
Change List.mapM' to avoid leaving functions around
-rw-r--r-- | lib/ur/list.ur | 6 | ||||
-rw-r--r-- | src/especialize.sml | 9 | ||||
-rw-r--r-- | src/monoize.sml | 4 |
3 files changed, 12 insertions, 7 deletions
diff --git a/lib/ur/list.ur b/lib/ur/list.ur index 2ee60538..7079f6bc 100644 --- a/lib/ur/list.ur +++ b/lib/ur/list.ur @@ -44,8 +44,8 @@ fun mapM (m ::: (Type -> Type)) (_ : monad m) (a ::: Type) (b ::: Type) f = let fun mapM' acc ls = case ls of - [] => acc - | x :: ls => mapM' (x' <- f x; ls' <- acc; return (x' :: ls')) ls + [] => return (rev acc) + | x :: ls => x' <- f x; mapM' (x' :: acc) ls in - mapM' (return []) + mapM' [] end diff --git a/src/especialize.sml b/src/especialize.sml index 9504a0be..e2bbeb9d 100644 --- a/src/especialize.sml +++ b/src/especialize.sml @@ -205,7 +205,10 @@ fun specialize' file = [("e'", CorePrint.p_exp CoreEnv.empty e)];*) (#1 e, st) end - | (_, true) => (e, st) + | (_, true) => ((*Print.prefaces ("No(" ^ name ^ ")") + [("fxs'", + Print.p_list (CorePrint.p_exp CoreEnv.empty) fxs')];*) + (e, st)) | (NONE, false) => let (*val () = Print.prefaces "New one" @@ -213,6 +216,10 @@ fun specialize' file = ("mns", Print.p_list Print.PD.string (SS.listItems (!mayNotSpec)))]*) + (*val () = Print.prefaces ("Yes(" ^ name ^ ")") + [("fxs'", + Print.p_list (CorePrint.p_exp CoreEnv.empty) fxs')]*) + fun subBody (body, typ, fxs') = case (#1 body, #1 typ, fxs') of (_, _, []) => SOME (body, typ) diff --git a/src/monoize.sml b/src/monoize.sml index 615863c3..bfb95644 100644 --- a/src/monoize.sml +++ b/src/monoize.sml @@ -2538,9 +2538,7 @@ fun monoExp (env, st, fm) (all as (e, loc)) = | "dyn" => (case attrs of - (*[("Signal", (L'.EApp ((L'.EAbs (_, _, _, (L'.ESignalReturn (L'.ERel 0, _), _)), _), - e), _), _)] => (e, fm) - |*) [("Signal", e, _)] => + [("Signal", e, _)] => ((L'.EStrcat ((L'.EPrim (Prim.String "<span><script type=\"text/javascript\">dyn("), loc), (L'.EStrcat ((L'.EJavaScript (L'.Script, e), loc), |