-- in \y. ....case f of {...} ....
-- Here f is used just once, and duplicating the case work is fine (exprIsCheap).
-- But
--- * We can't preInlineUnconditionally because that woud invalidate
--- the occ info for b.
--- * We can't postInlineUnconditionally because the RHS is big, and
--- that risks exponential behaviour
--- * We can't call-site inline, because the rhs is big
+-- - We can't preInlineUnconditionally because that woud invalidate
+-- the occ info for b.
+-- - We can't postInlineUnconditionally because the RHS is big, and
+-- that risks exponential behaviour
+-- - We can't call-site inline, because the rhs is big
-- Alas!
where
activeRule :: DynFlags -> SimplEnv -> Maybe (Activation -> Bool)
-- Nothing => No rules at all
activeRule dflags env
- | not (dopt Opt_RewriteRules dflags)
+ | not (dopt Opt_EnableRewriteRules dflags)
= Nothing -- Rewriting is off
| otherwise
= case getMode env of
_ -> return [(DEFAULT, [], deflt_rhs)]
| debugIsOn, isAlgTyCon tycon, [] <- tyConDataCons tycon
- = pprTrace "prepareDefault" (ppr case_bndr <+> ppr tycon <+> ppr deflt_rhs)
+ = pprTrace "prepareDefault" (ppr case_bndr <+> ppr tycon)
+ -- This can legitimately happen for type families
$ return [(DEFAULT, [], deflt_rhs)]
--------- Catch-all cases -----------