X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FdeSugar%2FDsBinds.lhs;h=5be1774c31d3d269c27a3b9582fe277536ffd4a2;hb=03aa4b6dfb67cc20b94b5fb19c8e8c5958603ea6;hp=87fda8eb18e298330e41acffcf226b7e8163f070;hpb=9d836b9c4887e861c8f39a41d7bdab23d9d1d803;p=ghc-hetmet.git diff --git a/ghc/compiler/deSugar/DsBinds.lhs b/ghc/compiler/deSugar/DsBinds.lhs index 87fda8e..5be1774 100644 --- a/ghc/compiler/deSugar/DsBinds.lhs +++ b/ghc/compiler/deSugar/DsBinds.lhs @@ -266,11 +266,13 @@ decomposeRuleLhs all_bndrs lhs -- Substitute dicts in the LHS args, so that there -- aren't any lets getting in the way + -- Note that we substitute the function too; we might have this as + -- a LHS: let f71 = M.f Int in f71 go env (Let (NonRec dict rhs) body) = go (extendVarEnv env dict (simpleSubst env rhs)) body go env body - = case collectArgs body of - (Var fn, args) -> Just (all_bndrs', fn, map (simpleSubst env) args) + = case collectArgs (simpleSubst env body) of + (Var fn, args) -> Just (all_bndrs', fn, args) other -> Nothing simpleSubst :: IdEnv CoreExpr -> CoreExpr -> CoreExpr