- go env [] = return (env, [])
- go env (alt:alts)
- = do { (env, alt') <- mkDupableAlt env case_bndr' alt
- ; (env, alts') <- go env alts
- ; return (env, alt' : alts' ) }
-
+ go env0 [] = return (env0, [])
+ go env0 (alt:alts)
+ = do { (env1, alt') <- mkDupableAlt env0 case_bndr' alt
+ ; (env2, alts') <- go env1 alts
+ ; return (env2, alt' : alts' ) }
+
+mkDupableAlt :: SimplEnv -> OutId -> (AltCon, [CoreBndr], CoreExpr)
+ -> SimplM (SimplEnv, (AltCon, [CoreBndr], CoreExpr))