X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fspecialise%2FSpecConstr.lhs;h=e5583e19dc1181c9e03d46d4bc6521ec473f66f9;hb=f80b81f8b56ebd0fa0f7f82494a5090e9ab64256;hp=8bba247a531dc3a14506c54103b6db4b9d16dd99;hpb=a3995529c5dc1e4970b1245764ffd3d51a2db25a;p=ghc-hetmet.git diff --git a/compiler/specialise/SpecConstr.lhs b/compiler/specialise/SpecConstr.lhs index 8bba247..e5583e1 100644 --- a/compiler/specialise/SpecConstr.lhs +++ b/compiler/specialise/SpecConstr.lhs @@ -875,6 +875,13 @@ argToPat in_scope con_env (Var v) arg_occ then return (True, Var v) else wildCardPat (idType v) +argToPat in_scope con_env (Let _ arg) arg_occ + = argToPat in_scope con_env arg arg_occ + -- Look through let expressions + -- e.g. f (let v = rhs in \y -> ...v...) + -- Here we can specialise for f (\y -> ...) + -- because the rule-matcher will look through the let. + argToPat in_scope con_env arg arg_occ | is_value_lam arg = return (True, arg)