X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FdeSugar%2FCheck.lhs;h=b604a2ff6053f462176a52d60962d6fbd11532bf;hb=5fca973afdf0d3bf593476af00dd5536dbc13dde;hp=2432051c7bc7a638854723b8e4006a852e034fc1;hpb=faca1a62c1385aa6ebdeb7d25ffa193ba2283fb9;p=ghc-hetmet.git diff --git a/compiler/deSugar/Check.lhs b/compiler/deSugar/Check.lhs index 2432051..b604a2f 100644 --- a/compiler/deSugar/Check.lhs +++ b/compiler/deSugar/Check.lhs @@ -110,9 +110,11 @@ type EqnSet = UniqSet EqnNo check :: [EquationInfo] -> ([ExhaustivePat], [EquationInfo]) -- Second result is the shadowed equations -- if there are view patterns, just give up - don't know what the function is -check qs = (untidy_warns, shadowed_eqns) +check qs = pprTrace "check" (ppr tidy_qs) $ + (untidy_warns, shadowed_eqns) where - (warns, used_nos) = check' ([1..] `zip` map tidy_eqn qs) + tidy_qs = map tidy_eqn qs + (warns, used_nos) = check' ([1..] `zip` tidy_qs) untidy_warns = map untidy_exhaustive warns shadowed_eqns = [eqn | (eqn,i) <- qs `zip` [1..], not (i `elementOfUniqSet` used_nos)] @@ -671,8 +673,6 @@ tidy_pat (CoPat _ pat _) = tidy_pat pat tidy_pat (NPlusKPat id _ _ _) = WildPat (idType (unLoc id)) tidy_pat (ViewPat _ _ ty) = WildPat ty -tidy_pat (NPat lit mb_neg eq) = tidyNPat lit mb_neg eq - tidy_pat pat@(ConPatOut { pat_con = L _ id, pat_args = ps }) = pat { pat_args = tidy_con id ps } @@ -696,6 +696,8 @@ tidy_pat (TuplePat ps boxity ty) where arity = length ps +tidy_pat (NPat lit mb_neg eq) = tidyNPat lit mb_neg eq + -- Unpack string patterns fully, so we can see when they overlap with -- each other, or even explicit lists of Chars. tidy_pat (LitPat lit)