[commit: ghc] master: TcTyClsDecls: use zipWith3M_ instead of generating triplets (62155a6)

git at git.haskell.org git at git.haskell.org
Mon Dec 21 03:37:21 UTC 2015


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/62155a606b2d32a088b8fcdf660d79f5d57b36c7/ghc

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

commit 62155a606b2d32a088b8fcdf660d79f5d57b36c7
Author: Ömer Sinan Ağacan <omeragacan at gmail.com>
Date:   Sun Dec 20 22:36:43 2015 -0500

    TcTyClsDecls: use zipWith3M_ instead of generating triplets


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

62155a606b2d32a088b8fcdf660d79f5d57b36c7
 compiler/typecheck/TcTyClsDecls.hs | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/compiler/typecheck/TcTyClsDecls.hs b/compiler/typecheck/TcTyClsDecls.hs
index 30447a4..c475382 100644
--- a/compiler/typecheck/TcTyClsDecls.hs
+++ b/compiler/typecheck/TcTyClsDecls.hs
@@ -2139,18 +2139,18 @@ checkValidDataCon dflags existential_ok tc con
           -- Check that UNPACK pragmas and bangs work out
           -- E.g.  reject   data T = MkT {-# UNPACK #-} Int     -- No "!"
           --                data T = MkT {-# UNPACK #-} !a      -- Can't unpack
-        ; mapM_ check_bang (zip3 (dataConSrcBangs con) (dataConImplBangs con) [1..])
+        ; zipWith3M_ check_bang (dataConSrcBangs con) (dataConImplBangs con) [1..]
 
         ; traceTc "Done validity of data con" (ppr con <+> ppr (dataConRepType con))
     }
   where
     ctxt = ConArgCtxt (dataConName con)
 
-    check_bang (HsSrcBang _ _ SrcLazy, _, n)
+    check_bang (HsSrcBang _ _ SrcLazy) _ n
       | not (xopt LangExt.StrictData dflags)
       = addErrTc
           (bad_bang n (ptext (sLit "Lazy annotation (~) without StrictData")))
-    check_bang (HsSrcBang _ want_unpack strict_mark, rep_bang, n)
+    check_bang (HsSrcBang _ want_unpack strict_mark) rep_bang n
       | isSrcUnpacked want_unpack, not is_strict
       = addWarnTc (bad_bang n (ptext (sLit "UNPACK pragma lacks '!'")))
       | isSrcUnpacked want_unpack
@@ -2164,7 +2164,7 @@ checkValidDataCon dflags existential_ok tc con
                       NoSrcStrict -> xopt LangExt.StrictData dflags
                       bang        -> isSrcStrict bang
 
-    check_bang _
+    check_bang _ _ _
       = return ()
 
     bad_bang n herald



More information about the ghc-commits mailing list