summaryrefslogtreecommitdiff
path: root/src/especialize.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2010-03-06 19:14:48 -0500
committerGravatar Adam Chlipala <adamc@hcoop.net>2010-03-06 19:14:48 -0500
commitdf76c398867ef66c583e5d481bdb33e046acfc09 (patch)
treebc477781e8f3c91a920b10819bf743d10968ca88 /src/especialize.sml
parent6f22b8b971cf196d425d5dad67cdf4da9d8f41b5 (diff)
Got split1 working, but noticed a nasty type inference bug with transplanted unification variables
Diffstat (limited to 'src/especialize.sml')
-rw-r--r--src/especialize.sml15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/especialize.sml b/src/especialize.sml
index 4936cc61..b0a4a8c2 100644
--- a/src/especialize.sml
+++ b/src/especialize.sml
@@ -43,6 +43,13 @@ structure KM = BinaryMapFn(K)
structure IM = IntBinaryMap
structure IS = IntBinarySet
+val isOpen = U.Exp.exists {kind = fn _ => false,
+ con = fn c =>
+ case c of
+ CRel _ => true
+ | _ => false,
+ exp = fn _ => false}
+
val freeVars = U.Exp.foldB {kind = fn (_, _, xs) => xs,
con = fn (_, _, xs) => xs,
exp = fn (bound, e, xs) =>
@@ -221,7 +228,12 @@ fun specialize' (funcs, specialized) file =
in
((ECApp (e, c), loc), st)
end
- | ECAbs _ => (e, st)
+ | ECAbs (x, k, e) =>
+ let
+ val (e, st) = exp (env, e, st)
+ in
+ ((ECAbs (x, k, e), loc), st)
+ end
| EKAbs _ => (e, st)
| EKApp (e, k) =>
let
@@ -349,6 +361,7 @@ fun specialize' (funcs, specialized) file =
if not fin
orelse List.all (fn (ERel _, _) => true
| _ => false) fxs'
+ orelse List.exists isOpen fxs'
orelse (IS.numItems fvs >= length fxs
andalso IS.exists (fn n => functionInside (#2 (List.nth (env, n)))) fvs) then
((*Print.prefaces "No" [("name", Print.PD.string name),