X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FsimplCore%2FSimplify.lhs;h=ada2e8f45b7856e9521eec9d68de54098e70fbc9;hb=1b1190e01d0c65043628d2532988d9b1b4a78384;hp=f718bcb7849675976655b4ab21590cdfcc99a233;hpb=4e36a8b19e25e69d28c43f8d09d5ecc02329948d;p=ghc-hetmet.git diff --git a/compiler/simplCore/Simplify.lhs b/compiler/simplCore/Simplify.lhs index f718bcb..ada2e8f 100644 --- a/compiler/simplCore/Simplify.lhs +++ b/compiler/simplCore/Simplify.lhs @@ -864,14 +864,7 @@ simplLam :: SimplEnv -> [InId] -> InExpr -> SimplCont simplLam env [] body cont = simplExprF env body cont - -- Type-beta reduction -simplLam env (bndr:bndrs) body (ApplyTo _ (Type ty_arg) arg_se cont) - = ASSERT( isTyVar bndr ) - do { tick (BetaReduction bndr) - ; ty_arg' <- simplType (arg_se `setInScope` env) ty_arg - ; simplLam (extendTvSubst env bndr ty_arg') bndrs body cont } - - -- Ordinary beta reduction + -- Beta reduction simplLam env (bndr:bndrs) body (ApplyTo _ arg arg_se cont) = do { tick (BetaReduction bndr) ; simplNonRecE env bndr (arg, arg_se) (bndrs, body) cont } @@ -904,9 +897,11 @@ simplNonRecE :: SimplEnv -- Why? Because of the binder-occ-info-zapping done before -- the call to simplLam in simplExprF (Lam ...) - -- First deal with type lets: let a = Type ty in b + -- First deal with type applications and type lets + -- (/\a. e) (Type ty) and (let a = Type ty in e) simplNonRecE env bndr (Type ty_arg, rhs_se) (bndrs, body) cont - = do { ty_arg' <- simplType (rhs_se `setInScope` env) ty_arg + = ASSERT( isTyVar bndr ) + do { ty_arg' <- simplType (rhs_se `setInScope` env) ty_arg ; simplLam (extendTvSubst env bndr ty_arg') bndrs body cont } simplNonRecE env bndr (rhs, rhs_se) (bndrs, body) cont