[commit: ghc] wip/gadtpm: Make hlint happy + address thomie's comments (3df7e1a)

git at git.haskell.org git at git.haskell.org
Mon Dec 21 10:55:17 UTC 2015


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

On branch  : wip/gadtpm
Link       : http://ghc.haskell.org/trac/ghc/changeset/3df7e1aa43ffa23d154a8879eeb5427a439246db/ghc

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

commit 3df7e1aa43ffa23d154a8879eeb5427a439246db
Author: George Karachalias <george.karachalias at gmail.com>
Date:   Mon Dec 21 11:54:02 2015 +0100

    Make hlint happy + address thomie's comments


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

3df7e1aa43ffa23d154a8879eeb5427a439246db
 compiler/deSugar/Check.hs         | 9 +++++----
 compiler/types/OptCoercion.hs     | 9 +++++----
 libraries/base/Foreign/C/Error.hs | 1 +
 3 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/compiler/deSugar/Check.hs b/compiler/deSugar/Check.hs
index a67b109..0795edc 100644
--- a/compiler/deSugar/Check.hs
+++ b/compiler/deSugar/Check.hs
@@ -655,10 +655,11 @@ process_guards  us  oversimplify gs
 -- of the first (or the single -WHEREVER IT IS- valid to use?) pattern
 pmPatType :: PmPat p -> Type
 pmPatType (PmCon { pm_con_con = con, pm_con_arg_tys = tys })
-                                      = mkTyConApp (dataConTyCon con) tys
-pmPatType (PmVar { pm_var_id  = x  }) = idType x
-pmPatType (PmLit { pm_lit_lit = l  }) = pmLitType l
-pmPatType (PmGrd { pm_grd_pv  = pv }) = ASSERT(patVecArity pv == 1) (pmPatType p)
+  = mkTyConApp (dataConTyCon con) tys
+pmPatType (PmVar { pm_var_id  = x }) = idType x
+pmPatType (PmLit { pm_lit_lit = l }) = pmLitType l
+pmPatType (PmGrd { pm_grd_pv  = pv })
+  = ASSERT(patVecArity pv == 1) (pmPatType p)
   where Just p = find ((==1) . patternArity) pv
 
 mkOneConFull :: Id -> UniqSupply -> DataCon -> (ValAbs, [PmConstraint])
diff --git a/compiler/types/OptCoercion.hs b/compiler/types/OptCoercion.hs
index d0f1402..41cec21 100644
--- a/compiler/types/OptCoercion.hs
+++ b/compiler/types/OptCoercion.hs
@@ -1,13 +1,14 @@
 -- (c) The University of Glasgow 2006
 
 {-# LANGUAGE CPP #-}
--- {-# OPTIONS_GHC -fno-warn-overlapping-patterns -fno-warn-incomplete-patterns #-}
 #if __GLASGOW_HASKELL__ > 710
 {-# OPTIONS_GHC -Wno-too-many-guards #-}
 #endif
- -- Inexplicably, this module takes 10GB of memory to compile with the new
- -- (Nov '15) pattern-match check. This needs to be fixed. But we need
- -- to be able to compile in the meantime.
+ -- This module used to take 10GB of memory to compile with the new
+ -- (Nov '15) pattern-match check. In order to be able to compile it,
+ -- do not enable -ffull-guard-reasoning. Instead, simplify the guards
+ -- (default behaviour when guards are too many) but suppress the
+ -- "too-many-guards" warning (-Werror is on).
 
 module OptCoercion ( optCoercion, checkAxInstCo ) where
 
diff --git a/libraries/base/Foreign/C/Error.hs b/libraries/base/Foreign/C/Error.hs
index 7614351..4607c37 100644
--- a/libraries/base/Foreign/C/Error.hs
+++ b/libraries/base/Foreign/C/Error.hs
@@ -1,5 +1,6 @@
 {-# LANGUAGE Trustworthy #-}
 {-# LANGUAGE CPP, NoImplicitPrelude #-}
+{-# OPTIONS_GHC -ffull-guard-reasoning #-}
 
 -----------------------------------------------------------------------------
 -- |



More information about the ghc-commits mailing list