From 7ecf87b26ca50c1b6def186c32f4dfa0e9cedb97 Mon Sep 17 00:00:00 2001 From: "simonpj@microsoft.com" Date: Tue, 22 Apr 2008 11:52:21 +0000 Subject: [PATCH] Comments only --- compiler/specialise/Rules.lhs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/compiler/specialise/Rules.lhs b/compiler/specialise/Rules.lhs index 65975f8..6a4dff0 100644 --- a/compiler/specialise/Rules.lhs +++ b/compiler/specialise/Rules.lhs @@ -123,11 +123,13 @@ ruleCantMatch :: [Maybe Name] -> [Maybe Name] -> Bool -- It's only a one-way match; unlike instance matching we -- don't consider unification -- --- Notice that there is no case --- ruleCantMatch (Just n1 : ts) (Nothing : as) = True --- Reason: a local variable 'v' in the actuals might --- have an unfolding which is a global. --- This quite often happens with case scrutinees. +-- Notice that [_$_] +-- ruleCantMatch [Nothing] [Just n2] = False +-- Reason: a template variable can be instantiated by a constant +-- Also: +-- ruleCantMatch [Just n1] [Nothing] = False +-- Reason: a local variable 'v' in the actuals might [_$_] + ruleCantMatch (Just n1 : ts) (Just n2 : as) = n1 /= n2 || ruleCantMatch ts as ruleCantMatch (t : ts) (a : as) = ruleCantMatch ts as ruleCantMatch ts as = False -- 1.7.10.4