[commit: ghc] wip/gadtpm: removed some unused sanity checks (3553b4e)

git at git.haskell.org git at git.haskell.org
Fri Nov 20 14:35:45 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/gadtpm
Link       : http://ghc.haskell.org/trac/ghc/changeset/3553b4e2ca15458eabcb2513ce5691cbc7c037a8/ghc

>---------------------------------------------------------------

commit 3553b4e2ca15458eabcb2513ce5691cbc7c037a8
Author: George Karachalias <george.karachalias at gmail.com>
Date:   Fri Nov 20 15:05:58 2015 +0100

    removed some unused sanity checks


>---------------------------------------------------------------

3553b4e2ca15458eabcb2513ce5691cbc7c037a8
 compiler/deSugar/Check.hs | 25 +------------------------
 1 file changed, 1 insertion(+), 24 deletions(-)

diff --git a/compiler/deSugar/Check.hs b/compiler/deSugar/Check.hs
index 9d94a15..fbd285c 100644
--- a/compiler/deSugar/Check.hs
+++ b/compiler/deSugar/Check.hs
@@ -832,7 +832,6 @@ A simple example is trac #322:
 %************************************************************************
 -}
 
--- ADD ASSERTS EVERYWHERE, THEY COME *FOR FREE* (ACTIVATED ONLY WHEN DEBUGISON)
 type PmArity = Int
 
 patVecArity :: PatVec -> PmArity
@@ -842,28 +841,6 @@ patternArity :: Pattern -> PmArity
 patternArity (PmGuard  {}) = 0
 patternArity (NonGuard {}) = 1
 
--- Should get a default value because an empty set has any arity
--- (We have no value vector abstractions to see)
-vsaArity :: PmArity -> ValSetAbs -> PmArity
-vsaArity  arity Empty = arity
-vsaArity _arity vsa   = ASSERT (allTheSame arities) (head arities)
-  where arities = vsaArities vsa
-
-vsaArities :: ValSetAbs -> [PmArity] -- Arity for every path. INVARIANT: All the same
-vsaArities Empty              = []
-vsaArities (Union vsa1 vsa2)  = vsaArities vsa1 ++ vsaArities vsa2
-vsaArities Singleton          = [0]
-vsaArities (Constraint _ vsa) = vsaArities vsa
-vsaArities (Cons _ vsa)       = [1 + arity | arity <- vsaArities vsa]
-
-allTheSame :: Eq a => [a] -> Bool
-allTheSame []     = True
-allTheSame (x:xs) = all (==x) xs
-
-sameArity :: PatVec -> ValSetAbs -> Bool
-sameArity pv vsa = vsaArity pv_a vsa == pv_a
-  where pv_a = patVecArity pv
-
 {-
 %************************************************************************
 %*                                                                      *
@@ -1260,7 +1237,7 @@ guards in the first pattern `p' though.
 dsPmWarn :: DynFlags -> DsMatchContext -> DsM PmResult -> DsM ()
 dsPmWarn dflags ctx@(DsMatchContext kind loc) mPmResult -- (redundant, inaccessible, uncovered)
   = when (flag_i || flag_u) $ do
-      (redundant, inaccessible, uncovered) <- mPmResult
+      (redundant, inaccessible, uncovered) <- mPmResult -- shadows, change the names?
       let exists_r = flag_i && notNull redundant
           exists_i = flag_i && notNull inaccessible
           exists_u = flag_u && notNull uncovered



More information about the ghc-commits mailing list