diff options
author | simonpj@microsoft.com <unknown> | 2009-07-02 09:44:44 +0000 |
---|---|---|
committer | simonpj@microsoft.com <unknown> | 2009-07-02 09:44:44 +0000 |
commit | d05cdffb3c74d8baa1c72579b84740e483c0afc4 (patch) | |
tree | 245774d061c03666e925864ea45d9a8a4538a8fd /compiler/specialise/Rules.lhs | |
parent | 4c719df405e70f6d58c6e351df8bf94a3af6b1fe (diff) | |
download | haskell-d05cdffb3c74d8baa1c72579b84740e483c0afc4.tar.gz |
Look through Notes when matching
Diffstat (limited to 'compiler/specialise/Rules.lhs')
-rw-r--r-- | compiler/specialise/Rules.lhs | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/compiler/specialise/Rules.lhs b/compiler/specialise/Rules.lhs index 0cf7a445b8..a15cc6f03a 100644 --- a/compiler/specialise/Rules.lhs +++ b/compiler/specialise/Rules.lhs @@ -488,9 +488,10 @@ match menv subst (Var v1) e2 | Just subst <- match_var menv subst v1 e2 = Just subst -match menv subst e1 (Note _ e2) - = match menv subst e1 e2 - -- See Note [Notes in RULE matching] +match menv subst (Note _ e1) e2 = match menv subst e1 e2 +match menv subst e1 (Note _ e2) = match menv subst e1 e2 + -- Ignore notes in both template and thing to be matched + -- See Note [Notes in RULE matching] match menv subst e1 (Var v2) -- Note [Expanding variables] | not (locallyBoundR rn_env v2) -- Note [Do not expand locally-bound variables] @@ -684,11 +685,11 @@ Hence, (a) the guard (not (isLocallyBoundR v2)) Note [Notes in RULE matching] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Look through Notes. In particular, we don't want to -be confused by InlineMe notes. Maybe we should be more -careful about profiling notes, but for now I'm just -riding roughshod over them. -See Note [Notes in call patterns] in SpecConstr +Look through Notes in both template and expression being matched. In +particular, we don't want to be confused by InlineMe notes. Maybe we +should be more careful about profiling notes, but for now I'm just +riding roughshod over them. cf Note [Notes in call patterns] in +SpecConstr Note [Matching lets] ~~~~~~~~~~~~~~~~~~~~ |