Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Alex D
GHC
Commits
f0fc29ce
Commit
f0fc29ce
authored
Sep 19, 2006
by
chak@cse.unsw.edu.au.
Browse files
Adapt Simplify to conditional envs
parent
7121d829
Changes
1
Hide whitespace changes
Inline
Side-by-side
compiler/simplCore/Simplify.lhs
View file @
f0fc29ce
...
@@ -814,9 +814,12 @@ simplCast env body co cont
...
@@ -814,9 +814,12 @@ simplCast env body co cont
-- t2 :=: s2 with left and right on the curried form:
-- t2 :=: s2 with left and right on the curried form:
-- (->) t1 t2 :=: (->) s1 s2
-- (->) t1 t2 :=: (->) s1 s2
[co1, co2] = decomposeCo 2 co
[co1, co2] = decomposeCo 2 co
new_arg = mkCoerce (mkSymCoercion co1) (substExpr arg_env arg)
new_arg = mkCoerce (mkSymCoercion co1) arg'
arg_env = setInScope arg_se env
arg' = case arg_se of
result = ApplyTo dup new_arg (zapSubstEnv env) (addCoerce co2 cont)
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
addCoerce co cont = CoerceIt co cont
in
in
simplType env co `thenSmpl` \ co' ->
simplType env co `thenSmpl` \ co' ->
...
@@ -1713,6 +1716,7 @@ knownCon env scrut con args bndr alts cont
...
@@ -1713,6 +1716,7 @@ knownCon env scrut con args bndr alts cont
simplNonRecX env bndr bndr_rhs $ \ env ->
simplNonRecX env bndr bndr_rhs $ \ env ->
simplExprF env rhs cont
simplExprF env rhs cont
where
where
dead_bndr = isDeadBinder bndr
n_drop_tys = tyConArity (dataConTyCon dc)
n_drop_tys = tyConArity (dataConTyCon dc)
-- Ugh!
-- Ugh!
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment