comparison src/reduce.sml @ 1289:3b22c3c67f35

Reduce: Inline let-bound variables whose types involve functions
author Adam Chlipala <adam@chlipala.net>
date Sun, 22 Aug 2010 13:43:46 -0400
parents 56bd4a4f6e66
children b4480a56cab7
comparison
equal deleted inserted replaced
1288:fc7ecf8883b1 1289:3b22c3c67f35
650 650
651 | EWrite e => (EWrite (exp env e), loc) 651 | EWrite e => (EWrite (exp env e), loc)
652 | EClosure (n, es) => (EClosure (n, map (exp env) es), loc) 652 | EClosure (n, es) => (EClosure (n, map (exp env) es), loc)
653 653
654 | ELet (x, t, e1, e2) => 654 | ELet (x, t, e1, e2) =>
655 (ELet (x, con env t, exp env e1, exp (UnknownE :: env) e2), loc) 655 let
656 val t = con env t
657 in
658 if ESpecialize.functionInside t then
659 exp (KnownE e1 :: env) e2
660 else
661 (ELet (x, con env t, exp env e1, exp (UnknownE :: env) e2), loc)
662 end
656 663
657 | EServerCall (n, es, t) => (EServerCall (n, map (exp env) es, con env t), loc) 664 | EServerCall (n, es, t) => (EServerCall (n, map (exp env) es, con env t), loc)
658 in 665 in
659 (*if dangling (edepth' (deKnown env)) r then 666 (*if dangling (edepth' (deKnown env)) r then
660 (Print.prefaces "exp" [("e", CorePrint.p_exp CoreEnv.empty all), 667 (Print.prefaces "exp" [("e", CorePrint.p_exp CoreEnv.empty all),