summaryrefslogtreecommitdiff
path: root/src/reduce.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2010-08-22 13:43:46 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2010-08-22 13:43:46 -0400
commit7765b90d25f98bd9eb0cf2998121e51d4551f733 (patch)
treed081f569cf52ee803d96962b25ab35f828c696df /src/reduce.sml
parent1bd7feb39add77e14df852d2087902049f2b5df3 (diff)
Reduce: Inline let-bound variables whose types involve functions
Diffstat (limited to 'src/reduce.sml')
-rw-r--r--src/reduce.sml9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/reduce.sml b/src/reduce.sml
index 963863e8..36c9f44e 100644
--- a/src/reduce.sml
+++ b/src/reduce.sml
@@ -652,7 +652,14 @@ fun kindConAndExp (namedC, namedE) =
| EClosure (n, es) => (EClosure (n, map (exp env) es), loc)
| ELet (x, t, e1, e2) =>
- (ELet (x, con env t, exp env e1, exp (UnknownE :: env) e2), loc)
+ let
+ val t = con env t
+ in
+ if ESpecialize.functionInside t then
+ exp (KnownE e1 :: env) e2
+ else
+ (ELet (x, con env t, exp env e1, exp (UnknownE :: env) e2), loc)
+ end
| EServerCall (n, es, t) => (EServerCall (n, map (exp env) es, con env t), loc)
in