[commit: packages/hoopl] master: Guard redundant equations (5405469)

git at git.haskell.org git at git.haskell.org
Mon Dec 21 22:13:56 UTC 2015


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

On branch  : master
Link       : http://git.haskell.org/packages/hoopl.git/commitdiff/5405469b2357580a653ceb41c15c33091b2d1a06

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

commit 5405469b2357580a653ceb41c15c33091b2d1a06
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Thu Dec 3 13:45:07 2015 -0500

    Guard redundant equations
    
    GHC's exhaustiveness checker used to be quite rudimentary. As of GHC
    8.0 we have a new exhaustiveness checker which correctly recognizes the
    cases covered by these equations as invalid.


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

5405469b2357580a653ceb41c15c33091b2d1a06
 src/Compiler/Hoopl/Dataflow.hs | 4 ++++
 src/Compiler/Hoopl/Graph.hs    | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/src/Compiler/Hoopl/Dataflow.hs b/src/Compiler/Hoopl/Dataflow.hs
index d798f82..ca5eb8c 100644
--- a/src/Compiler/Hoopl/Dataflow.hs
+++ b/src/Compiler/Hoopl/Dataflow.hs
@@ -247,7 +247,9 @@ arfGraph pass at FwdPass { fp_lattice = lattice,
                 -> Fact e f -> m (DG f n e C, Fact C f)
              c NothingC (JustO entry)   = block entry `cat` body (successors entry) bdy
              c (JustC entries) NothingO = body entries bdy
+#if __GLASGOW_HASKELL__ < 711
              c _ _ = error "bogus GADT pattern match failure"
+#endif
 
     -- Lift from nodes to blocks
 -- @ start block.tex -2
@@ -439,7 +441,9 @@ arbGraph pass at BwdPass { bp_lattice  = lattice,
                 -> Fact C f -> m (DG f n e C, Fact e f)
              c NothingC (JustO entry)   = block entry `cat` body (successors entry) bdy
              c (JustC entries) NothingO = body entries bdy
+#if __GLASGOW_HASKELL__ < 711
              c _ _ = error "bogus GADT pattern match failure"
+#endif
 
     -- Lift from nodes to blocks
     block BNil          = \f -> return (dgnil, f)
diff --git a/src/Compiler/Hoopl/Graph.hs b/src/Compiler/Hoopl/Graph.hs
index 9c1cc3c..c0e6b04 100644
--- a/src/Compiler/Hoopl/Graph.hs
+++ b/src/Compiler/Hoopl/Graph.hs
@@ -193,7 +193,9 @@ splice bcat = sp
         sp (GMany e1 b1 NothingO) (GMany NothingO b2 x2)
           = {-# SCC "sp5" #-} (GMany e1 $! b1 `bodyUnion` b2) x2
 
+#if __GLASGOW_HASKELL__ < 711
         sp _ _ = error "bogus GADT match failure"
+#endif
 
 gSplice :: NonLocal n => Graph n e a -> Graph n a x -> Graph n e x
 gSplice = splice blockAppend



More information about the ghc-commits mailing list