Commit 08002107 authored by simonpj's avatar simonpj
Browse files

[project @ 2001-03-23 10:47:21 by simonpj]

Comments, plus dead code elim
parent 644c1be9
......@@ -381,12 +381,6 @@ tidyTopBind mod ext_ids cg_info_env top_tidy_env (Rec prs)
rhs' = tidyExpr rec_tidy_env rhs
-- the CafInfo for a recursive group says whether *any* rhs in
-- the group may refer indirectly to a CAF (because then, they all do).
(bndrs, rhss) = unzip prs'
pred v = v `notElem` bndrs
tidyTopBinder :: Module -> IdEnv Bool
-> CgInfoEnv
-> TidyEnv -> CoreExpr
......
......@@ -707,7 +707,7 @@ exprEtaExpandArity e
ok_note InlineCall = True
ok_note other = False
-- Notice that we do not look through __inline_me__
-- This one is a bit more surprising, but consider
-- This may seem surprising, but consider
-- f = _inline_me (\x -> e)
-- We DO NOT want to eta expand this to
-- f = \x -> (_inline_me (\x -> e)) x
......@@ -747,8 +747,6 @@ etaExpand :: Int -- Add this number of value args
-- would return
-- (/\b. coerce T (\y::A -> (coerce (A->B) (E b) y)
-- (case x of { I# x -> /\ a -> coerce T E)
etaExpand n us expr ty
| n == 0 -- Saturated, so nothing to do
= expr
......
......@@ -690,6 +690,11 @@ There is no point in looking for a combination of the two, because
that would leave use with some lets sandwiched between lambdas; that's
what the final test in the first equation is for.
In Case 1, we may have to sandwich some coerces between the lambdas
to make the types work. exprEtaExpandArity looks through coerces
when computing arity; and etaExpand adds the coerces as necessary when
actually computing the expansion.
\begin{code}
tryEtaExpansion :: OutExpr -> OutType -> SimplM ([OutBind], OutExpr)
tryEtaExpansion rhs rhs_ty
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment