summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorManuel M T Chakravarty <chak@cse.unsw.edu.au>2006-09-19 18:10:58 +0000
committerManuel M T Chakravarty <chak@cse.unsw.edu.au>2006-09-19 18:10:58 +0000
commitf0fc29ce3e100c613846b7b2daa1bee4c751138d (patch)
treea6312e0e6a875d97e10b6b56006ec2f7fd454b30 /compiler
parent7121d8296720cf1a79259350f361f5771210b23d (diff)
downloadhaskell-f0fc29ce3e100c613846b7b2daa1bee4c751138d.tar.gz
Adapt Simplify to conditional envs
Diffstat (limited to 'compiler')
-rw-r--r--compiler/simplCore/Simplify.lhs10
1 files changed, 7 insertions, 3 deletions
diff --git a/compiler/simplCore/Simplify.lhs b/compiler/simplCore/Simplify.lhs
index 36e723d209..efc59d16cc 100644
--- a/compiler/simplCore/Simplify.lhs
+++ b/compiler/simplCore/Simplify.lhs
@@ -814,9 +814,12 @@ simplCast env body co cont
-- t2 :=: s2 with left and right on the curried form:
-- (->) t1 t2 :=: (->) s1 s2
[co1, co2] = decomposeCo 2 co
- new_arg = mkCoerce (mkSymCoercion co1) (substExpr arg_env arg)
- arg_env = setInScope arg_se env
- result = ApplyTo dup new_arg (zapSubstEnv env) (addCoerce co2 cont)
+ new_arg = mkCoerce (mkSymCoercion co1) arg'
+ arg' = case arg_se of
+ Nothing -> arg
+ Just arg_se -> substExpr (setInScope arg_se env) arg
+ result = ApplyTo dup new_arg (Just $ zapSubstEnv env)
+ (addCoerce co2 cont)
addCoerce co cont = CoerceIt co cont
in
simplType env co `thenSmpl` \ co' ->
@@ -1713,6 +1716,7 @@ knownCon env scrut con args bndr alts cont
simplNonRecX env bndr bndr_rhs $ \ env ->
simplExprF env rhs cont
where
+ dead_bndr = isDeadBinder bndr
n_drop_tys = tyConArity (dataConTyCon dc)
-- Ugh!