From git at git.haskell.org Fri Jan 1 00:56:25 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 1 Jan 2016 00:56:25 +0000 (UTC) Subject: [commit: ghc] master: Canonicalise `MonadPlus` instances (dafeb51) Message-ID: <20160101005625.511C43A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/dafeb51f266793a67e8ae18ae39a2e2e87943824/ghc >--------------------------------------------------------------- commit dafeb51f266793a67e8ae18ae39a2e2e87943824 Author: Herbert Valerio Riedel Date: Fri Jan 1 01:45:08 2016 +0100 Canonicalise `MonadPlus` instances This refactoring exploits the fact that since AMP, in most cases, `instance MonadPlus` can be automatically derived from the respective `Alternative` instance. This is because `MonadPlus`'s default method implementations are fully defined in terms of `Alternative(empty, (<>))`. >--------------------------------------------------------------- dafeb51f266793a67e8ae18ae39a2e2e87943824 compiler/prelude/PrelRules.hs | 10 ++++------ compiler/simplCore/CoreMonad.hs | 14 +++++--------- compiler/types/Unify.hs | 12 ++++-------- compiler/utils/IOEnv.hs | 14 +++++--------- compiler/utils/MonadUtils.hs | 6 ++++-- libraries/base/Control/Arrow.hs | 4 +--- libraries/base/Data/Semigroup.hs | 4 +--- libraries/base/GHC/Conc/Sync.hs | 4 +--- libraries/base/Text/ParserCombinators/ReadP.hs | 12 ++++-------- libraries/base/Text/ParserCombinators/ReadPrec.hs | 8 +++----- 10 files changed, 32 insertions(+), 56 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc dafeb51f266793a67e8ae18ae39a2e2e87943824 From git at git.haskell.org Fri Jan 1 00:56:27 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 1 Jan 2016 00:56:27 +0000 (UTC) Subject: [commit: ghc] master: Minor fix of MonadFail instance for `ReadPrec` (b469b30) Message-ID: <20160101005627.E99CB3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/b469b308351cf6120e335bf2127c13ec56b6c381/ghc >--------------------------------------------------------------- commit b469b308351cf6120e335bf2127c13ec56b6c381 Author: Herbert Valerio Riedel Date: Fri Jan 1 01:50:07 2016 +0100 Minor fix of MonadFail instance for `ReadPrec` This fixes the instance to be semantically cleaner but other than that this fix has no practical consequences as the implementations of `Monad(fail)` and `MonadFail(fail)` for `ReadP` coincide. >--------------------------------------------------------------- b469b308351cf6120e335bf2127c13ec56b6c381 libraries/base/Text/ParserCombinators/ReadPrec.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/base/Text/ParserCombinators/ReadPrec.hs b/libraries/base/Text/ParserCombinators/ReadPrec.hs index 2a9c1d0..4306c6e 100644 --- a/libraries/base/Text/ParserCombinators/ReadPrec.hs +++ b/libraries/base/Text/ParserCombinators/ReadPrec.hs @@ -85,7 +85,7 @@ instance Monad ReadPrec where P f >>= k = P (\n -> do a <- f n; let P f' = k a in f' n) instance MonadFail.MonadFail ReadPrec where - fail s = P (\_ -> fail s) + fail s = P (\_ -> MonadFail.fail s) instance MonadPlus ReadPrec From git at git.haskell.org Fri Jan 1 09:12:49 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 1 Jan 2016 09:12:49 +0000 (UTC) Subject: [commit: ghc] master: Update Cabal submodule, Fixes #11326 (ab0d733) Message-ID: <20160101091249.AE40D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/ab0d733da504fac25b98b15f1fb758d6997d0534/ghc >--------------------------------------------------------------- commit ab0d733da504fac25b98b15f1fb758d6997d0534 Author: Alan Zimmerman Date: Fri Jan 1 11:11:57 2016 +0200 Update Cabal submodule, Fixes #11326 Troublesome commit in Cabal was reverted. >--------------------------------------------------------------- ab0d733da504fac25b98b15f1fb758d6997d0534 libraries/Cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/Cabal b/libraries/Cabal index 072e472..bf4d05e 160000 --- a/libraries/Cabal +++ b/libraries/Cabal @@ -1 +1 @@ -Subproject commit 072e4728079e6caf521339e3934e1279aa09e83d +Subproject commit bf4d05efa79a41a819e3d9278d5e9e1e5a055ce7 From git at git.haskell.org Fri Jan 1 10:28:27 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 1 Jan 2016 10:28:27 +0000 (UTC) Subject: [commit: ghc] master: Add strictness for runRW# (f3cc345) Message-ID: <20160101102827.C741A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/f3cc34568b13abb29de7b54a5f657681e9e116ca/ghc >--------------------------------------------------------------- commit f3cc34568b13abb29de7b54a5f657681e9e116ca Author: Simon Peyton Jones Date: Thu Dec 31 22:25:31 2015 +0000 Add strictness for runRW# runRW# isn't inlined until CorePrep, so it's good to expose its strictness. Moreover, if we don't we can get obscure failures in coreToStg; see Note [runRW arg] in CorePrep. This fixes Trac #11291, and makes DfltProb1 compile with -O always in order to expose it more vigorously >--------------------------------------------------------------- f3cc34568b13abb29de7b54a5f657681e9e116ca compiler/basicTypes/MkId.hs | 9 ++++++++- compiler/coreSyn/CorePrep.hs | 12 ++++++++++++ testsuite/tests/typecheck/should_compile/all.T | 3 ++- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/compiler/basicTypes/MkId.hs b/compiler/basicTypes/MkId.hs index f690732..f796d76 100644 --- a/compiler/basicTypes/MkId.hs +++ b/compiler/basicTypes/MkId.hs @@ -1179,7 +1179,14 @@ oneShotId = pcMiscPrelId oneShotName ty info runRWId :: Id -- See Note [runRW magic] in this module runRWId = pcMiscPrelId runRWName ty info where - info = noCafIdInfo `setInlinePragInfo` neverInlinePragma + info = noCafIdInfo `setInlinePragInfo` neverInlinePragma + `setStrictnessInfo` strict_sig + `setArityInfo` 1 + strict_sig = mkClosedStrictSig [strictApply1Dmd] topRes + -- Important to express its strictness, + -- since it is not inlined until CorePrep + -- Also see Note [runRW arg] in CorePrep + -- State# RealWorld stateRW = mkTyConApp statePrimTyCon [realWorldTy] -- (# State# RealWorld, o #) diff --git a/compiler/coreSyn/CorePrep.hs b/compiler/coreSyn/CorePrep.hs index adaad61..df18f8b 100644 --- a/compiler/coreSyn/CorePrep.hs +++ b/compiler/coreSyn/CorePrep.hs @@ -518,6 +518,18 @@ cpeRhsE env (Var f `App` _levity `App` _type `App` arg) = case arg of -- beta reducing if possible Lam s body -> cpeRhsE (extendCorePrepEnv env s realWorldPrimId) body _ -> cpeRhsE env (arg `App` Var realWorldPrimId) + -- See Note [runRW arg] + +{- Note [runRW arg] +~~~~~~~~~~~~~~~~~~~ +If we got, say + runRW# (case bot of {}) +which happened in Trac #11291, we do /not/ want to turn it into + (case bot of {}) realWorldPrimId# +because that gives a panic in CoreToStg.myCollectArgs, which expects +only variables in function position. But if we are sure to make +runRW# strict (which we do in MkId), this can't happen +-} cpeRhsE env expr@(App {}) = cpeApp env expr diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T index 3fa1f8c..0c1d0c1 100644 --- a/testsuite/tests/typecheck/should_compile/all.T +++ b/testsuite/tests/typecheck/should_compile/all.T @@ -383,7 +383,8 @@ test('T5792',normal,run_command, test('PolytypeDecomp', normal, compile, ['']) test('T6011', normal, compile, ['']) test('T6055', normal, compile, ['']) -test('DfltProb1', normal, compile, ['']) +test('DfltProb1', normal, compile, ['-O']) +# Add -O for DfltProb1 to expose Trac #11291 test('DfltProb2', normal, compile, ['']) test('T6134', normal, compile, ['']) test('T6018', extra_clean(['T6018.hi' , 'T6018.o' From git at git.haskell.org Fri Jan 1 11:28:26 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 1 Jan 2016 11:28:26 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Add strictness for runRW# (ae2c4d8) Message-ID: <20160101112826.898F73A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/ae2c4d8af8b8e2e0e310a7fbfed6bd1d6b43386b/ghc >--------------------------------------------------------------- commit ae2c4d8af8b8e2e0e310a7fbfed6bd1d6b43386b Author: Simon Peyton Jones Date: Thu Dec 31 22:25:31 2015 +0000 Add strictness for runRW# runRW# isn't inlined until CorePrep, so it's good to expose its strictness. Moreover, if we don't we can get obscure failures in coreToStg; see Note [runRW arg] in CorePrep. This fixes Trac #11291, and makes DfltProb1 compile with -O always in order to expose it more vigorously (cherry picked from commit f3cc34568b13abb29de7b54a5f657681e9e116ca) >--------------------------------------------------------------- ae2c4d8af8b8e2e0e310a7fbfed6bd1d6b43386b compiler/basicTypes/MkId.hs | 9 ++++++++- compiler/coreSyn/CorePrep.hs | 12 ++++++++++++ testsuite/tests/typecheck/should_compile/all.T | 3 ++- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/compiler/basicTypes/MkId.hs b/compiler/basicTypes/MkId.hs index f690732..f796d76 100644 --- a/compiler/basicTypes/MkId.hs +++ b/compiler/basicTypes/MkId.hs @@ -1179,7 +1179,14 @@ oneShotId = pcMiscPrelId oneShotName ty info runRWId :: Id -- See Note [runRW magic] in this module runRWId = pcMiscPrelId runRWName ty info where - info = noCafIdInfo `setInlinePragInfo` neverInlinePragma + info = noCafIdInfo `setInlinePragInfo` neverInlinePragma + `setStrictnessInfo` strict_sig + `setArityInfo` 1 + strict_sig = mkClosedStrictSig [strictApply1Dmd] topRes + -- Important to express its strictness, + -- since it is not inlined until CorePrep + -- Also see Note [runRW arg] in CorePrep + -- State# RealWorld stateRW = mkTyConApp statePrimTyCon [realWorldTy] -- (# State# RealWorld, o #) diff --git a/compiler/coreSyn/CorePrep.hs b/compiler/coreSyn/CorePrep.hs index 8b4b13b..28fee20 100644 --- a/compiler/coreSyn/CorePrep.hs +++ b/compiler/coreSyn/CorePrep.hs @@ -522,6 +522,18 @@ cpeRhsE env (Var f `App` _levity `App` _type `App` arg) = case arg of -- beta reducing if possible Lam s body -> cpeRhsE (extendCorePrepEnv env s realWorldPrimId) body _ -> cpeRhsE env (arg `App` Var realWorldPrimId) + -- See Note [runRW arg] + +{- Note [runRW arg] +~~~~~~~~~~~~~~~~~~~ +If we got, say + runRW# (case bot of {}) +which happened in Trac #11291, we do /not/ want to turn it into + (case bot of {}) realWorldPrimId# +because that gives a panic in CoreToStg.myCollectArgs, which expects +only variables in function position. But if we are sure to make +runRW# strict (which we do in MkId), this can't happen +-} cpeRhsE env expr@(App {}) = cpeApp env expr diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T index 3fa1f8c..0c1d0c1 100644 --- a/testsuite/tests/typecheck/should_compile/all.T +++ b/testsuite/tests/typecheck/should_compile/all.T @@ -383,7 +383,8 @@ test('T5792',normal,run_command, test('PolytypeDecomp', normal, compile, ['']) test('T6011', normal, compile, ['']) test('T6055', normal, compile, ['']) -test('DfltProb1', normal, compile, ['']) +test('DfltProb1', normal, compile, ['-O']) +# Add -O for DfltProb1 to expose Trac #11291 test('DfltProb2', normal, compile, ['']) test('T6134', normal, compile, ['']) test('T6018', extra_clean(['T6018.hi' , 'T6018.o' From git at git.haskell.org Fri Jan 1 15:42:51 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 1 Jan 2016 15:42:51 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Various API Annotations fixes (b24fcb5) Message-ID: <20160101154251.55EC03A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/b24fcb5e0d1594cc296845931fe8daad34e13f7e/ghc >--------------------------------------------------------------- commit b24fcb5e0d1594cc296845931fe8daad34e13f7e Author: Alan Zimmerman Date: Wed Dec 30 18:51:53 2015 +0200 Various API Annotations fixes - Export unicodeAnn from GHC - unicodeAnn for Annlarrowtail was wrong - Use actual source for a CImport SourceText (cherry picked from commit 25e4556d97429e95ddb5972f6e7e6599ef902e9c) >--------------------------------------------------------------- b24fcb5e0d1594cc296845931fe8daad34e13f7e compiler/main/GHC.hs | 1 + compiler/parser/ApiAnnotation.hs | 2 +- compiler/parser/RdrHsSyn.hs | 2 +- testsuite/tests/ghc-api/annotations/T11018.stdout | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/compiler/main/GHC.hs b/compiler/main/GHC.hs index 0ac1331..666ff49 100644 --- a/compiler/main/GHC.hs +++ b/compiler/main/GHC.hs @@ -272,6 +272,7 @@ module GHC ( ApiAnns,AnnKeywordId(..),AnnotationComment(..), getAnnotation, getAndRemoveAnnotation, getAnnotationComments, getAndRemoveAnnotationComments, + unicodeAnn, -- * Miscellaneous --sessionHscEnv, diff --git a/compiler/parser/ApiAnnotation.hs b/compiler/parser/ApiAnnotation.hs index b5214c1..73490e4 100644 --- a/compiler/parser/ApiAnnotation.hs +++ b/compiler/parser/ApiAnnotation.hs @@ -324,7 +324,7 @@ unicodeAnn AnnDcolon = AnnDcolonU unicodeAnn AnnLarrow = AnnLarrowU unicodeAnn AnnRarrow = AnnRarrowU unicodeAnn AnnDarrow = AnnDarrowU -unicodeAnn Annlarrowtail = AnnLarrowtailU +unicodeAnn Annlarrowtail = AnnlarrowtailU unicodeAnn Annrarrowtail = AnnrarrowtailU unicodeAnn AnnLarrowtail = AnnLarrowtailU unicodeAnn AnnRarrowtail = AnnRarrowtailU diff --git a/compiler/parser/RdrHsSyn.hs b/compiler/parser/RdrHsSyn.hs index f423c6e..0f38086 100644 --- a/compiler/parser/RdrHsSyn.hs +++ b/compiler/parser/RdrHsSyn.hs @@ -1268,7 +1268,7 @@ mkImport (L lc cconv) (L ls safety) (L loc (StringLiteral esrc entity), v, ty) | cconv == PrimCallConv = do let funcTarget = CFunction (StaticTarget esrc entity Nothing True) importSpec = CImport (L lc PrimCallConv) (L ls safety) Nothing funcTarget - (L loc (unpackFS entity)) + (L loc esrc) return (ForD (ForeignImport { fd_name = v, fd_sig_ty = ty , fd_co = noForeignImportCoercionYet , fd_fi = importSpec })) diff --git a/testsuite/tests/ghc-api/annotations/T11018.stdout b/testsuite/tests/ghc-api/annotations/T11018.stdout index ac32549..011867e 100644 --- a/testsuite/tests/ghc-api/annotations/T11018.stdout +++ b/testsuite/tests/ghc-api/annotations/T11018.stdout @@ -142,7 +142,7 @@ ((Test11018.hs:43:11-17,AnnOpenP), [Test11018.hs:43:11]), ((Test11018.hs:43:12,AnnComma), [Test11018.hs:43:13]), ((Test11018.hs:43:14,AnnComma), [Test11018.hs:43:15]), -((Test11018.hs:43:22-34,AnnLarrowtailU), [Test11018.hs:43:30]), +((Test11018.hs:43:22-34,AnnlarrowtailU), [Test11018.hs:43:30]), ((Test11018.hs:43:32-34,AnnVal), [Test11018.hs:43:33]), ((Test11018.hs:45:1-36,AnnDcolon), [Test11018.hs:45:5-6]), ((Test11018.hs:45:1-36,AnnSemi), [Test11018.hs:46:1]), From git at git.haskell.org Fri Jan 1 18:33:10 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 1 Jan 2016 18:33:10 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: fix ghci build on ArchUnknown targets (8775e4c) Message-ID: <20160101183310.C188C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/8775e4caebb5d181ce00189aa3b84bde6c64dfcd/ghc >--------------------------------------------------------------- commit 8775e4caebb5d181ce00189aa3b84bde6c64dfcd Author: Sergei Trofimovich Date: Thu Dec 31 10:32:40 2015 +0000 fix ghci build on ArchUnknown targets Observed failure on ia64 as: "inplace/bin/hsc2hs" \ ... \ --cflag=-Dia64_HOST_ARCH=1 --cflag=-Dlinux_HOST_OS=1 \ ... \ libraries/ghci/./GHCi/InfoTable.hsc \ -o libraries/ghci/dist-install/build/GHCi/InfoTable.hs InfoTable.hsc:84:2: error: #error Unknown architecture Signed-off-by: Sergei Trofimovich (cherry picked from commit 75851bf930067ae7c57bee3c6feea456534eafed) >--------------------------------------------------------------- 8775e4caebb5d181ce00189aa3b84bde6c64dfcd libraries/ghci/GHCi/InfoTable.hsc | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/libraries/ghci/GHCi/InfoTable.hsc b/libraries/ghci/GHCi/InfoTable.hsc index 14e1698..0244990 100644 --- a/libraries/ghci/GHCi/InfoTable.hsc +++ b/libraries/ghci/GHCi/InfoTable.hsc @@ -56,8 +56,16 @@ type ItblCodes = Either [Word8] [Word32] funPtrToInt :: FunPtr a -> Int funPtrToInt (FunPtr a) = I## (addr2Int## a) -data Arch = ArchSPARC | ArchPPC | ArchX86 | ArchX86_64 | ArchAlpha | ArchARM - | ArchARM64 | ArchPPC64 | ArchPPC64LE +data Arch = ArchSPARC + | ArchPPC + | ArchX86 + | ArchX86_64 + | ArchAlpha + | ArchARM + | ArchARM64 + | ArchPPC64 + | ArchPPC64LE + | ArchUnknown deriving Show platform :: Arch @@ -81,7 +89,11 @@ platform = #elif defined(powerpc64le_HOST_ARCH) ArchPPC64LE #else -#error Unknown architecture +# if defined(TABLES_NEXT_TO_CODE) +# error Unimplemented architecture +# else + ArchUnknown +# endif #endif mkJumpToAddr :: EntryFunPtr -> ItblCodes @@ -245,6 +257,11 @@ mkJumpToAddr a = case platform of 0x618C0000 .|. lo16 w32, 0x7D8903A6, 0x4E800420 ] + -- This code must not be called. You either need to + -- add your architecture as a distinct case or + -- use non-TABLES_NEXT_TO_CODE mode + ArchUnknown -> error "mkJumpToAddr: ArchUnknown is unsupported" + byte0 :: (Integral w) => w -> Word8 byte0 w = fromIntegral w From git at git.haskell.org Fri Jan 1 18:33:13 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 1 Jan 2016 18:33:13 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Improve exprIsBottom (28b0693) Message-ID: <20160101183313.668453A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/28b069319eb0390fd1745949ba2ad2e623d69b00/ghc >--------------------------------------------------------------- commit 28b069319eb0390fd1745949ba2ad2e623d69b00 Author: Simon Peyton Jones Date: Thu Dec 31 09:07:33 2015 +0000 Improve exprIsBottom This fixes Trac #11290, by being sligthtly cleverer about finding what expressions are bottom. Actually this might have minor other side benefits. (cherry picked from commit 0579fe99b933384172d19beb6a00dc8a1238101a) >--------------------------------------------------------------- 28b069319eb0390fd1745949ba2ad2e623d69b00 compiler/coreSyn/CoreUtils.hs | 2 ++ compiler/simplCore/SetLevels.hs | 13 ++++++++++++- testsuite/tests/deriving/should_compile/all.T | 3 ++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/compiler/coreSyn/CoreUtils.hs b/compiler/coreSyn/CoreUtils.hs index f31eac6..d89612a 100644 --- a/compiler/coreSyn/CoreUtils.hs +++ b/compiler/coreSyn/CoreUtils.hs @@ -810,6 +810,8 @@ exprIsBottom e go n (Cast e _) = go n e go n (Let _ e) = go n e go n (Lam v e) | isTyVar v = go n e + go _ (Case _ _ _ alts) = null alts + -- See Note [Empty case alternatives] in CoreSyn go _ _ = False {- Note [Bottoming expressions] diff --git a/compiler/simplCore/SetLevels.hs b/compiler/simplCore/SetLevels.hs index b742a29..b84d67b 100644 --- a/compiler/simplCore/SetLevels.hs +++ b/compiler/simplCore/SetLevels.hs @@ -542,7 +542,7 @@ See Maessen's paper 1999 "Bottom extraction: factoring error handling out of functional programs" (unpublished I think). When we do this, we set the strictness and arity of the new bottoming -Id, *immediately*, for two reasons: +Id, *immediately*, for three reasons: * To prevent the abstracted thing being immediately inlined back in again via preInlineUnconditionally. The latter has a test for bottoming Ids @@ -551,6 +551,17 @@ Id, *immediately*, for two reasons: * So that it's properly exposed as such in the interface file, even if this is all happening after strictness analysis. + * In case we do CSE with the same expression that *is* marked bottom + lvl = error "urk" + x{str=bot) = error "urk" + Here we don't want to replace 'x' with 'lvl', else we may get Lint + errors, e.g. via a case with empty alternatives: (case x of {}) + Lint complains unless the scrutinee of such a case is clearly bottom. + + This was reported in Trac #11290. But since the whole bottoming-float + thing is based on the cheap-and-cheerful exprIsBottom, I'm not sure + that it'll nail all such cases. + Note [Bottoming floats: eta expansion] c.f Note [Bottoming floats] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tiresomely, though, the simplifier has an invariant that the manifest diff --git a/testsuite/tests/deriving/should_compile/all.T b/testsuite/tests/deriving/should_compile/all.T index 36d49f5..ff26d37 100644 --- a/testsuite/tests/deriving/should_compile/all.T +++ b/testsuite/tests/deriving/should_compile/all.T @@ -31,7 +31,8 @@ test('T4966', normal, compile, ['']) test('drv-functor1', normal, compile, ['']) test('drv-functor2', normal, compile, ['']) test('drv-foldable-traversable1', normal, compile, ['']) -test('T6031', extra_clean(['T6031a.o', 'T6031a.hi']), multimod_compile, ['T6031', '-v0']) +test('T6031', extra_clean(['T6031a.o', 'T6031a.hi']), multimod_compile, ['T6031', '-v0 -O']) +# Adding -O on T6031 to expose Trac #11245 regardless of way test('T1133', extra_clean(['T1133.o-boot', 'T1133.hi-boot', 'T1133a.o', 'T1133a.hi']), run_command, From git at git.haskell.org Fri Jan 1 18:33:16 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 1 Jan 2016 18:33:16 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Update Cabal submodule, Fixes #11326 (b482745) Message-ID: <20160101183316.122003A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/b48274522b2e0a8fd8c31db42a49777386dffdd7/ghc >--------------------------------------------------------------- commit b48274522b2e0a8fd8c31db42a49777386dffdd7 Author: Alan Zimmerman Date: Fri Jan 1 11:11:57 2016 +0200 Update Cabal submodule, Fixes #11326 Troublesome commit in Cabal was reverted. (cherry picked from commit ab0d733da504fac25b98b15f1fb758d6997d0534) >--------------------------------------------------------------- b48274522b2e0a8fd8c31db42a49777386dffdd7 libraries/Cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/Cabal b/libraries/Cabal index 072e472..bf4d05e 160000 --- a/libraries/Cabal +++ b/libraries/Cabal @@ -1 +1 @@ -Subproject commit 072e4728079e6caf521339e3934e1279aa09e83d +Subproject commit bf4d05efa79a41a819e3d9278d5e9e1e5a055ce7 From git at git.haskell.org Fri Jan 1 18:33:56 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 1 Jan 2016 18:33:56 +0000 (UTC) Subject: [commit: ghc] master: API Annotations: AnnTilde missing (0b8dc7d) Message-ID: <20160101183356.3F6313A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/0b8dc7d4d5b26e184a7698e22f9fe7d8ee3c90d4/ghc >--------------------------------------------------------------- commit 0b8dc7d4d5b26e184a7698e22f9fe7d8ee3c90d4 Author: Alan Zimmerman Date: Fri Jan 1 18:59:52 2016 +0200 API Annotations: AnnTilde missing In T10689a.hs, the fragment data instance Sing (z :: [a]) = z ~ '[] => SNil | forall (m :: a) (n :: [a]). z ~ (:) m n => SCons (Sing m) (Sing n) ends up with the AnnTilde annotations for the two tildes not attached to the final AST. This patch moves the AnnTilde to the right place. Closes #11321 >--------------------------------------------------------------- 0b8dc7d4d5b26e184a7698e22f9fe7d8ee3c90d4 compiler/parser/Lexer.x | 24 +++++++++++- compiler/parser/Parser.y | 8 ++-- compiler/parser/RdrHsSyn.hs | 27 +++++++++----- testsuite/tests/ghc-api/annotations/Makefile | 4 ++ testsuite/tests/ghc-api/annotations/T11321.stderr | 3 ++ testsuite/tests/ghc-api/annotations/T11321.stdout | 45 +++++++++++++++++++++++ testsuite/tests/ghc-api/annotations/Test11321.hs | 17 +++++++++ testsuite/tests/ghc-api/annotations/all.T | 1 + 8 files changed, 114 insertions(+), 15 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 0b8dc7d4d5b26e184a7698e22f9fe7d8ee3c90d4 From git at git.haskell.org Fri Jan 1 20:52:32 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 1 Jan 2016 20:52:32 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: API Annotations: AnnTilde missing (0392a23) Message-ID: <20160101205232.A11B13A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/0392a237097ff0a271e424a40426c74f51a6f676/ghc >--------------------------------------------------------------- commit 0392a237097ff0a271e424a40426c74f51a6f676 Author: Alan Zimmerman Date: Fri Jan 1 18:59:52 2016 +0200 API Annotations: AnnTilde missing In T10689a.hs, the fragment data instance Sing (z :: [a]) = z ~ '[] => SNil | forall (m :: a) (n :: [a]). z ~ (:) m n => SCons (Sing m) (Sing n) ends up with the AnnTilde annotations for the two tildes not attached to the final AST. This patch moves the AnnTilde to the right place. Closes #11321 (cherry picked from commit 0b8dc7d4d5b26e184a7698e22f9fe7d8ee3c90d4) >--------------------------------------------------------------- 0392a237097ff0a271e424a40426c74f51a6f676 compiler/parser/Lexer.x | 24 +++++++++++- compiler/parser/Parser.y | 8 ++-- compiler/parser/RdrHsSyn.hs | 27 +++++++++----- testsuite/tests/ghc-api/annotations/Makefile | 4 ++ testsuite/tests/ghc-api/annotations/T11321.stderr | 3 ++ testsuite/tests/ghc-api/annotations/T11321.stdout | 45 +++++++++++++++++++++++ testsuite/tests/ghc-api/annotations/Test11321.hs | 17 +++++++++ testsuite/tests/ghc-api/annotations/all.T | 1 + 8 files changed, 114 insertions(+), 15 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 0392a237097ff0a271e424a40426c74f51a6f676 From git at git.haskell.org Fri Jan 1 22:44:45 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 1 Jan 2016 22:44:45 +0000 (UTC) Subject: [commit: ghc] master: mk/config.mk.in: drop unused CONF_CC_OPTS for ia64 (78daabc) Message-ID: <20160101224445.11DBA3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/78daabc514e220ef52645b175a60ec39cfd4eeb1/ghc >--------------------------------------------------------------- commit 78daabc514e220ef52645b175a60ec39cfd4eeb1 Author: Sergei Trofimovich Date: Fri Jan 1 22:43:18 2016 +0000 mk/config.mk.in: drop unused CONF_CC_OPTS for ia64 There is CONF_CC_OPTS_STAGE$(N) but not CONF_CC_OPTS thus option does not work for a while. Signed-off-by: Sergei Trofimovich >--------------------------------------------------------------- 78daabc514e220ef52645b175a60ec39cfd4eeb1 mk/config.mk.in | 4 ---- 1 file changed, 4 deletions(-) diff --git a/mk/config.mk.in b/mk/config.mk.in index 2091671..e1259e5 100644 --- a/mk/config.mk.in +++ b/mk/config.mk.in @@ -618,10 +618,6 @@ CONF_CPP_OPTS_STAGE0 = @CONF_CPP_OPTS_STAGE0@ CONF_CPP_OPTS_STAGE1 = @CONF_CPP_OPTS_STAGE1@ CONF_CPP_OPTS_STAGE2 = @CONF_CPP_OPTS_STAGE2@ -ifeq "$(TARGETPLATFORM)" "ia64-unknown-linux" -CONF_CC_OPTS += -G0 -endif - # The .hsc files aren't currently safe for cross-compilation on Windows: # libraries\haskeline\.\System\Console\Haskeline\Backend\Win32.hsc:160 # directive "let" is not safe for cross-compilation From git at git.haskell.org Sat Jan 2 08:16:17 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Jan 2016 08:16:17 +0000 (UTC) Subject: [commit: packages/parallel] tag 'v3.2.1.0' created Message-ID: <20160102081617.229B33A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/parallel New tag : v3.2.1.0 Referencing: aa3d11b8a301ff34b64fc72c31e7634037a71469 From git at git.haskell.org Sat Jan 2 08:16:19 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Jan 2016 08:16:19 +0000 (UTC) Subject: [commit: packages/parallel] tag 'v3.2.0.5' created Message-ID: <20160102081619.22B013A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/parallel New tag : v3.2.0.5 Referencing: db09f1737ce8327644df7406aafef4d9a14591f7 From git at git.haskell.org Sat Jan 2 08:16:21 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Jan 2016 08:16:21 +0000 (UTC) Subject: [commit: packages/parallel] tag 'v3.2.0.6' created Message-ID: <20160102081621.2407E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/parallel New tag : v3.2.0.6 Referencing: b9b9c107e082902777c97b597f76a80f34e439b5 From git at git.haskell.org Sat Jan 2 08:16:23 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Jan 2016 08:16:23 +0000 (UTC) Subject: [commit: packages/parallel] master: Add Hackage-shield to README.md (b02d38a) Message-ID: <20160102081623.2A0053A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/parallel On branch : master Link : http://git.haskell.org/packages/parallel.git/commitdiff/b02d38a9fdc53677dabeb72bc42ba60a29a1a275 >--------------------------------------------------------------- commit b02d38a9fdc53677dabeb72bc42ba60a29a1a275 Author: Herbert Valerio Riedel Date: Tue Dec 2 16:35:46 2014 +0100 Add Hackage-shield to README.md >--------------------------------------------------------------- b02d38a9fdc53677dabeb72bc42ba60a29a1a275 README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 047226f..e072c05 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -The `parallel` Package [![Build Status](https://travis-ci.org/ghc/packages-parallel.png?branch=master)](https://travis-ci.org/ghc/packages-parallel) +The `parallel` Package [![Hackage](https://img.shields.io/hackage/v/parallel.svg)](https://hackage.haskell.org/package/parallel) [![Build Status](https://travis-ci.org/haskell/parallel.svg)](https://travis-ci.org/haskell/parallel) ====================== See [`parallel` on Hackage](http://hackage.haskell.org/package/parallel) for more information. From git at git.haskell.org Sat Jan 2 08:16:25 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Jan 2016 08:16:25 +0000 (UTC) Subject: [commit: packages/parallel] master: Update Travis CI job (b969cb2) Message-ID: <20160102081625.2F3263A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/parallel On branch : master Link : http://git.haskell.org/packages/parallel.git/commitdiff/b969cb28442a425f178305abb518f14a6c6d78f6 >--------------------------------------------------------------- commit b969cb28442a425f178305abb518f14a6c6d78f6 Author: Herbert Valerio Riedel Date: Tue Dec 2 17:07:42 2014 +0100 Update Travis CI job >--------------------------------------------------------------- b969cb28442a425f178305abb518f14a6c6d78f6 .travis.yml | 47 ++++++++++++++++++++++------------------------- 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/.travis.yml b/.travis.yml index 20c61fc..8bc5b39 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,40 +1,37 @@ env: - - GHCVER=7.0.1 - - GHCVER=7.0.2 - - GHCVER=7.0.3 - - GHCVER=7.0.4 - - GHCVER=7.2.2 - - GHCVER=7.4.1 - - GHCVER=7.4.2 - - GHCVER=7.6.1 - - GHCVER=7.6.2 - - GHCVER=7.6.3 - - GHCVER=head + - CABALVER=1.16 HCVER=7.0.1 + - CABALVER=1.16 HCVER=7.0.4 + - CABALVER=1.16 HCVER=7.2.2 + - CABALVER=1.16 HCVER=7.4.2 + - CABALVER=1.16 HCVER=7.6.3 + - CABALVER=1.18 HCVER=7.8.3 + - CABALVER=head HCVER=head matrix: allow_failures: - - env: GHCVER=head + - env: CABALVER=head HCVER=head before_install: - - sudo add-apt-repository -y ppa:hvr/ghc - - sudo apt-get update - - sudo apt-get install cabal-install-1.18 ghc-$GHCVER - - export PATH=/opt/ghc/$GHCVER/bin:$PATH + - travis_retry sudo add-apt-repository -y ppa:hvr/ghc + - travis_retry sudo apt-get update + - travis_retry sudo apt-get install cabal-install-$CABALVER ghc-$GHCVER + - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$PATH + - cabal --version + - echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]" install: - - cabal-1.18 update - - cabal-1.18 install --only-dependencies - - ghc --version + - travis_retry cabal update + - cabal install --only-dependencies script: - - cabal-1.18 configure -v2 - - cabal-1.18 build - - cabal-1.18 check - - cabal-1.18 sdist - - export SRC_TGZ=$(cabal-1.18 info . | awk '{print $2 ".tar.gz";exit}') ; + - cabal configure -v2 + - cabal build + - cabal check || [ "$CABALVER" == "1.16" ] + - cabal sdist + - export SRC_TGZ=$(cabal info . | awk '{print $2 ".tar.gz";exit}') ; cd dist/; if [ -f "$SRC_TGZ" ]; then - cabal-1.18 install "$SRC_TGZ"; + cabal install "$SRC_TGZ"; else echo "expected '$SRC_TGZ' not found"; exit 1; From git at git.haskell.org Sat Jan 2 08:16:27 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Jan 2016 08:16:27 +0000 (UTC) Subject: [commit: packages/parallel] master: Fix-up broken Travis-job commit b969cb2 (ad13ba8) Message-ID: <20160102081627.3498B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/parallel On branch : master Link : http://git.haskell.org/packages/parallel.git/commitdiff/ad13ba8794c0bb87c997a56e91e82536bcef1c86 >--------------------------------------------------------------- commit ad13ba8794c0bb87c997a56e91e82536bcef1c86 Author: Herbert Valerio Riedel Date: Tue Dec 2 17:19:06 2014 +0100 Fix-up broken Travis-job commit b969cb2 >--------------------------------------------------------------- ad13ba8794c0bb87c997a56e91e82536bcef1c86 .travis.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8bc5b39..cc5fb0b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,15 @@ env: - - CABALVER=1.16 HCVER=7.0.1 - - CABALVER=1.16 HCVER=7.0.4 - - CABALVER=1.16 HCVER=7.2.2 - - CABALVER=1.16 HCVER=7.4.2 - - CABALVER=1.16 HCVER=7.6.3 - - CABALVER=1.18 HCVER=7.8.3 - - CABALVER=head HCVER=head + - CABALVER=1.16 GHCVER=7.0.1 + - CABALVER=1.16 GHCVER=7.0.4 + - CABALVER=1.16 GHCVER=7.2.2 + - CABALVER=1.16 GHCVER=7.4.2 + - CABALVER=1.16 GHCVER=7.6.3 + - CABALVER=1.18 GHCVER=7.8.3 + - CABALVER=head GHCVER=head matrix: allow_failures: - - env: CABALVER=head HCVER=head + - env: CABALVER=head GHCVER=head before_install: - travis_retry sudo add-apt-repository -y ppa:hvr/ghc From git at git.haskell.org Sat Jan 2 08:16:29 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Jan 2016 08:16:29 +0000 (UTC) Subject: [commit: packages/parallel] master: Prepare for 3.2.0.5 release (c4863d9) Message-ID: <20160102081629.38F4D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/parallel On branch : master Link : http://git.haskell.org/packages/parallel.git/commitdiff/c4863d925c446ba5416aeed6a11012f2e978686e >--------------------------------------------------------------- commit c4863d925c446ba5416aeed6a11012f2e978686e Author: Herbert Valerio Riedel Date: Tue Dec 2 17:16:51 2014 +0100 Prepare for 3.2.0.5 release >--------------------------------------------------------------- c4863d925c446ba5416aeed6a11012f2e978686e changelog.md | 4 ++-- parallel.cabal | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/changelog.md b/changelog.md index fce3072..f940ec9 100644 --- a/changelog.md +++ b/changelog.md @@ -1,8 +1,8 @@ # Changelog for [`parallel` package](http://hackage.haskell.org/package/parallel) -## 3.2.0.5 *TBA* +## 3.2.0.5 *Dec 2014* - - Support `base-4.8.0.0` + - Support `base-4.8.0.0`/`deepseq-1.4.0.0` (and thus GHC 7.10) ## 3.2.0.4 *Nov 2013* diff --git a/parallel.cabal b/parallel.cabal index 90f0583..71fbd37 100644 --- a/parallel.cabal +++ b/parallel.cabal @@ -4,6 +4,7 @@ version: 3.2.0.5 license: BSD3 license-file: LICENSE maintainer: libraries at haskell.org +bug-reports: https://github.com/haskell/parallel/issues synopsis: Parallel programming library category: Control, Parallelism build-type: Simple @@ -16,7 +17,7 @@ extra-source-files: changelog.md source-repository head type: git - location: http://git.haskell.org/packages/parallel.git + location: https://github.com/haskell/parallel.git library default-language: Haskell2010 From git at git.haskell.org Sat Jan 2 08:16:31 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Jan 2016 08:16:31 +0000 (UTC) Subject: [commit: packages/parallel] master: Add GHC 7.10.1 to test-matrix (1ccf213) Message-ID: <20160102081631.3F12A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/parallel On branch : master Link : http://git.haskell.org/packages/parallel.git/commitdiff/1ccf213252289fd3191bf381f7ca79898417aef2 >--------------------------------------------------------------- commit 1ccf213252289fd3191bf381f7ca79898417aef2 Author: Herbert Valerio Riedel Date: Sun Dec 28 09:50:20 2014 +0100 Add GHC 7.10.1 to test-matrix >--------------------------------------------------------------- 1ccf213252289fd3191bf381f7ca79898417aef2 .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index cc5fb0b..db49af6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,8 @@ env: - CABALVER=1.16 GHCVER=7.2.2 - CABALVER=1.16 GHCVER=7.4.2 - CABALVER=1.16 GHCVER=7.6.3 - - CABALVER=1.18 GHCVER=7.8.3 + - CABALVER=1.18 GHCVER=7.8.4 + - CABALVER=1.22 GHCVER=7.10.1 - CABALVER=head GHCVER=head matrix: From git at git.haskell.org Sat Jan 2 08:16:33 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Jan 2016 08:16:33 +0000 (UTC) Subject: [commit: packages/parallel] master: Make `-Wall` clean (e48b0de) Message-ID: <20160102081633.43ABE3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/parallel On branch : master Link : http://git.haskell.org/packages/parallel.git/commitdiff/e48b0de3fffa3e0db11fe0e2021eb6aec2bdfa2c >--------------------------------------------------------------- commit e48b0de3fffa3e0db11fe0e2021eb6aec2bdfa2c Author: Herbert Valerio Riedel Date: Sun Dec 28 10:02:59 2014 +0100 Make `-Wall` clean >--------------------------------------------------------------- e48b0de3fffa3e0db11fe0e2021eb6aec2bdfa2c Control/Parallel/Strategies.hs | 2 ++ Control/Seq.hs | 6 +++++- changelog.md | 4 ++++ parallel.cabal | 2 +- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Control/Parallel/Strategies.hs b/Control/Parallel/Strategies.hs index addf792..2ab9a8f 100644 --- a/Control/Parallel/Strategies.hs +++ b/Control/Parallel/Strategies.hs @@ -139,8 +139,10 @@ module Control.Parallel.Strategies ( NFData ) where +#if !MIN_VERSION_base(4,8,0) import Data.Traversable import Control.Applicative +#endif import Control.Parallel import Control.DeepSeq import Control.Monad diff --git a/Control/Seq.hs b/Control/Seq.hs index 5f696eb..2404501 100644 --- a/Control/Seq.hs +++ b/Control/Seq.hs @@ -1,4 +1,5 @@ {-# LANGUAGE BangPatterns #-} +{-# LANGUAGE CPP #-} ----------------------------------------------------------------------------- -- | @@ -57,9 +58,12 @@ module Control.Seq , seqTuple9 ) where -import Prelude import Control.DeepSeq (NFData, deepseq) +#if MIN_VERSION_base(4,8,0) +import Data.Foldable (toList) +#else import Data.Foldable (Foldable, toList) +#endif import Data.Map (Map) import qualified Data.Map (toList) import Data.Ix (Ix) diff --git a/changelog.md b/changelog.md index f940ec9..3989273 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,9 @@ # Changelog for [`parallel` package](http://hackage.haskell.org/package/parallel) +## 3.2.0.6 *Dec 2014* + + - Make `-Wall` message free for all supported `base` versions + ## 3.2.0.5 *Dec 2014* - Support `base-4.8.0.0`/`deepseq-1.4.0.0` (and thus GHC 7.10) diff --git a/parallel.cabal b/parallel.cabal index 71fbd37..1128110 100644 --- a/parallel.cabal +++ b/parallel.cabal @@ -1,5 +1,5 @@ name: parallel -version: 3.2.0.5 +version: 3.2.0.6 -- NOTE: Don't forget to update ./changelog.md license: BSD3 license-file: LICENSE From git at git.haskell.org Sat Jan 2 08:16:35 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Jan 2016 08:16:35 +0000 (UTC) Subject: [commit: packages/parallel] master: M-x delete-trailing-whitespace (bc4107d) Message-ID: <20160102081635.489903A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/parallel On branch : master Link : http://git.haskell.org/packages/parallel.git/commitdiff/bc4107d6a5501b862c5caf58f13cdd88895a4e3a >--------------------------------------------------------------- commit bc4107d6a5501b862c5caf58f13cdd88895a4e3a Author: Herbert Valerio Riedel Date: Sun Dec 28 10:04:23 2014 +0100 M-x delete-trailing-whitespace >--------------------------------------------------------------- bc4107d6a5501b862c5caf58f13cdd88895a4e3a Control/Seq.hs | 0 1 file changed, 0 insertions(+), 0 deletions(-) From git at git.haskell.org Sat Jan 2 08:16:37 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Jan 2016 08:16:37 +0000 (UTC) Subject: [commit: packages/parallel] master: Add `--ghc-option=-Werror` to Travis job (5b86f00) Message-ID: <20160102081637.4DE643A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/parallel On branch : master Link : http://git.haskell.org/packages/parallel.git/commitdiff/5b86f00553688195ea3496d9b7052ec1a9a9c2fe >--------------------------------------------------------------- commit 5b86f00553688195ea3496d9b7052ec1a9a9c2fe Author: Herbert Valerio Riedel Date: Sun Dec 28 10:09:10 2014 +0100 Add `--ghc-option=-Werror` to Travis job >--------------------------------------------------------------- 5b86f00553688195ea3496d9b7052ec1a9a9c2fe .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index db49af6..5421b79 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,7 +26,7 @@ install: script: - cabal configure -v2 - - cabal build + - cabal build --ghc-option=-Werror - cabal check || [ "$CABALVER" == "1.16" ] - cabal sdist - export SRC_TGZ=$(cabal info . | awk '{print $2 ".tar.gz";exit}') ; From git at git.haskell.org Sat Jan 2 08:16:39 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Jan 2016 08:16:39 +0000 (UTC) Subject: [commit: packages/parallel] master: Remove redundant constraints, discovered by -fwarn-redundant-constraints (dfb8fe5) Message-ID: <20160102081639.5240C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/parallel On branch : master Link : http://git.haskell.org/packages/parallel.git/commitdiff/dfb8fe517b10588847ca285f93300fa7f1552857 >--------------------------------------------------------------- commit dfb8fe517b10588847ca285f93300fa7f1552857 Author: Simon Peyton Jones Date: Tue Jan 6 09:44:21 2015 +0000 Remove redundant constraints, discovered by -fwarn-redundant-constraints >--------------------------------------------------------------- dfb8fe517b10588847ca285f93300fa7f1552857 Control/Seq.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Control/Seq.hs b/Control/Seq.hs index 16d3e75..ebab1b5 100644 --- a/Control/Seq.hs +++ b/Control/Seq.hs @@ -146,11 +146,11 @@ seqFoldable strat = seqList strat . toList -- | Evaluate the elements of an array according to the given strategy. -- Evaluation of the array bounds may be triggered as a side effect. -seqArray :: Ix i => Strategy a -> Strategy (Array i a) +seqArray :: Strategy a -> Strategy (Array i a) seqArray strat = seqList strat . Data.Array.elems -- | Evaluate the bounds of an array according to the given strategy. -seqArrayBounds :: Ix i => Strategy i -> Strategy (Array i a) +seqArrayBounds :: Strategy i -> Strategy (Array i a) seqArrayBounds strat = seqTuple2 strat strat . Data.Array.bounds -- | Evaluate the keys and values of a map according to the given strategies. From git at git.haskell.org Sat Jan 2 08:16:41 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Jan 2016 08:16:41 +0000 (UTC) Subject: [commit: packages/parallel] master: Remove unncessary import (e4e4228) Message-ID: <20160102081641.57D1E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/parallel On branch : master Link : http://git.haskell.org/packages/parallel.git/commitdiff/e4e4228ba94178cf31b97fe81b94bff3de6fce03 >--------------------------------------------------------------- commit e4e4228ba94178cf31b97fe81b94bff3de6fce03 Author: Simon Peyton Jones Date: Tue Jan 6 13:39:44 2015 +0000 Remove unncessary import >--------------------------------------------------------------- e4e4228ba94178cf31b97fe81b94bff3de6fce03 Control/Seq.hs | 1 - 1 file changed, 1 deletion(-) diff --git a/Control/Seq.hs b/Control/Seq.hs index ebab1b5..55fb7dd 100644 --- a/Control/Seq.hs +++ b/Control/Seq.hs @@ -66,7 +66,6 @@ import Data.Foldable (Foldable, toList) #endif import Data.Map (Map) import qualified Data.Map (toList) -import Data.Ix (Ix) import Data.Array (Array) import qualified Data.Array (bounds, elems) From git at git.haskell.org Sat Jan 2 08:16:43 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Jan 2016 08:16:43 +0000 (UTC) Subject: [commit: packages/parallel] master: Update links to multicore GHC and Strategies papers. (46fcb76) Message-ID: <20160102081643.5CC283A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/parallel On branch : master Link : http://git.haskell.org/packages/parallel.git/commitdiff/46fcb767a0af46e14415cb1c4b8a7f90baf20240 >--------------------------------------------------------------- commit 46fcb767a0af46e14415cb1c4b8a7f90baf20240 Author: Sajith Sasidharan Date: Mon Mar 9 16:56:28 2015 -0400 Update links to multicore GHC and Strategies papers. The old URLs to multicore-ghc.pdf and strategies.pdf no longer work. >--------------------------------------------------------------- 46fcb767a0af46e14415cb1c4b8a7f90baf20240 Control/Parallel/Strategies.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Control/Parallel/Strategies.hs b/Control/Parallel/Strategies.hs index 2ab9a8f..61e5c5f 100644 --- a/Control/Parallel/Strategies.hs +++ b/Control/Parallel/Strategies.hs @@ -794,7 +794,7 @@ Later, during work on the shared-memory implementation of parallelism in GHC, we discovered that the original formulation of Strategies had some problems, in particular it lead to space leaks and difficulties expressing speculative parallelism. Details are in -the paper /Runtime Support for Multicore Haskell/ . +the paper /Runtime Support for Multicore Haskell/ . This module has been rewritten in version 2. The main change is to the 'Strategy a' type synonym, which was previously @a -> Done@ and @@ -853,7 +853,7 @@ Version 3 introduced a major overhaul of the API, to match what is presented in the paper /Seq no More: Better Strategies for Parallel Haskell/ - + The major differenes in the API are: From git at git.haskell.org Sat Jan 2 08:16:45 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Jan 2016 08:16:45 +0000 (UTC) Subject: [commit: packages/parallel] master: Restore compatibility with GHC < 7.11 (0ec7fe2) Message-ID: <20160102081645.625513A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/parallel On branch : master Link : http://git.haskell.org/packages/parallel.git/commitdiff/0ec7fe287db9b837af5baab2e9566ac9bef19625 >--------------------------------------------------------------- commit 0ec7fe287db9b837af5baab2e9566ac9bef19625 Author: Herbert Valerio Riedel Date: Tue Mar 10 08:27:34 2015 +0100 Restore compatibility with GHC < 7.11 This guards the changes in e4e4228ba94178cf31b97fe81b94bff3de6fce03 and dfb8fe517b10588847ca285f93300fa7f1552857 with CPP thereby fixing #6 >--------------------------------------------------------------- 0ec7fe287db9b837af5baab2e9566ac9bef19625 Control/Seq.hs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Control/Seq.hs b/Control/Seq.hs index 55fb7dd..13c5d0e 100644 --- a/Control/Seq.hs +++ b/Control/Seq.hs @@ -66,6 +66,9 @@ import Data.Foldable (Foldable, toList) #endif import Data.Map (Map) import qualified Data.Map (toList) +#if __GLASGOW_HASKELL__ < 711 +import Data.Ix (Ix) +#endif import Data.Array (Array) import qualified Data.Array (bounds, elems) @@ -145,11 +148,19 @@ seqFoldable strat = seqList strat . toList -- | Evaluate the elements of an array according to the given strategy. -- Evaluation of the array bounds may be triggered as a side effect. +#if __GLASGOW_HASKELL__ >= 711 seqArray :: Strategy a -> Strategy (Array i a) +#else +seqArray :: Ix i => Strategy a -> Strategy (Array i a) +#endif seqArray strat = seqList strat . Data.Array.elems -- | Evaluate the bounds of an array according to the given strategy. +#if __GLASGOW_HASKELL__ >= 711 seqArrayBounds :: Strategy i -> Strategy (Array i a) +#else +seqArrayBounds :: Ix i => Strategy i -> Strategy (Array i a) +#endif seqArrayBounds strat = seqTuple2 strat strat . Data.Array.bounds -- | Evaluate the keys and values of a map according to the given strategies. From git at git.haskell.org Sat Jan 2 08:16:47 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Jan 2016 08:16:47 +0000 (UTC) Subject: [commit: packages/parallel] master: Merge pull request #5 from sajith/patch-1 (2ee8494) Message-ID: <20160102081647.6829A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/parallel On branch : master Link : http://git.haskell.org/packages/parallel.git/commitdiff/2ee8494e5bb5228a6a878d6e0e0b63316492174c >--------------------------------------------------------------- commit 2ee8494e5bb5228a6a878d6e0e0b63316492174c Merge: 0ec7fe2 46fcb76 Author: Herbert Valerio Riedel Date: Tue Mar 10 21:51:03 2015 +0100 Merge pull request #5 from sajith/patch-1 Update links to multicore GHC and Strategies papers. >--------------------------------------------------------------- 2ee8494e5bb5228a6a878d6e0e0b63316492174c Control/Parallel/Strategies.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) From git at git.haskell.org Sat Jan 2 08:16:49 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Jan 2016 08:16:49 +0000 (UTC) Subject: [commit: packages/parallel] master: Fix typo in SeqStrategy documentation (4715f86) Message-ID: <20160102081649.6D0E63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/parallel On branch : master Link : http://git.haskell.org/packages/parallel.git/commitdiff/4715f86d3171d10ee2f1733d014a05e19e4717cb >--------------------------------------------------------------- commit 4715f86d3171d10ee2f1733d014a05e19e4717cb Author: Maximilian Tagher Date: Sat May 30 22:06:18 2015 -0700 Fix typo in SeqStrategy documentation >--------------------------------------------------------------- 4715f86d3171d10ee2f1733d014a05e19e4717cb Control/Parallel/Strategies.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Control/Parallel/Strategies.hs b/Control/Parallel/Strategies.hs index 61e5c5f..67bae69 100644 --- a/Control/Parallel/Strategies.hs +++ b/Control/Parallel/Strategies.hs @@ -323,7 +323,7 @@ strat2 `dot` strat1 = strat2 . runEval . strat1 evalSeq :: SeqStrategy a -> Strategy a evalSeq strat x = strat x `pseq` return x --- | a name for @Control.Seq.Strategy@, for documetnation only. +-- | A name for @Control.Seq.Strategy@, for documentation only. type SeqStrategy a = Control.Seq.Strategy a -- -------------------------------------------------------------------------- From git at git.haskell.org Sat Jan 2 08:16:51 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Jan 2016 08:16:51 +0000 (UTC) Subject: [commit: packages/parallel] master: Make rpar's type signature consistent with rseq & co (9f7debb) Message-ID: <20160102081651.733613A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/parallel On branch : master Link : http://git.haskell.org/packages/parallel.git/commitdiff/9f7debb0f800ff0181035ae304e01f6537bfdb92 >--------------------------------------------------------------- commit 9f7debb0f800ff0181035ae304e01f6537bfdb92 Author: Maximilian Tagher Date: Sun May 31 11:00:11 2015 -0700 Make rpar's type signature consistent with rseq & co It seems inconsistent that `r0`, `rseq`, `rdeepseq` and `rparWith` are defined using the `Strategy` type synonym, but `rpar` is not. In the [module exports](https://github.com/haskell/parallel/blob/2ee8494e5bb5228a6a878d6e0e0b63316492174c/Control/Parallel/Strategies.hs#L52) it's commented as being of type `Strategy a`, just not in the type signature itself for some reason. >--------------------------------------------------------------- 9f7debb0f800ff0181035ae304e01f6537bfdb92 Control/Parallel/Strategies.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Control/Parallel/Strategies.hs b/Control/Parallel/Strategies.hs index 61e5c5f..9e06037 100644 --- a/Control/Parallel/Strategies.hs +++ b/Control/Parallel/Strategies.hs @@ -380,7 +380,7 @@ rdeepseq x = do rseq (rnf x); return x -- == rdeepseq -- | 'rpar' sparks its argument (for evaluation in parallel). -rpar :: a -> Eval a +rpar :: Strategy a #if __GLASGOW_HASKELL__ >= 702 rpar x = Eval $ \s -> spark# x s #else From git at git.haskell.org Sat Jan 2 08:16:53 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Jan 2016 08:16:53 +0000 (UTC) Subject: [commit: packages/parallel] master: Merge pull request #8 from MaxGabriel/patch-2 (d0a42b2) Message-ID: <20160102081653.787123A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/parallel On branch : master Link : http://git.haskell.org/packages/parallel.git/commitdiff/d0a42b22017ceff2035c42599e5e01452a6e0d94 >--------------------------------------------------------------- commit d0a42b22017ceff2035c42599e5e01452a6e0d94 Merge: 2ee8494 9f7debb Author: Simon Marlow Date: Mon Jun 1 20:45:07 2015 +0100 Merge pull request #8 from MaxGabriel/patch-2 Make rpar's type signature consistent with rseq & co >--------------------------------------------------------------- d0a42b22017ceff2035c42599e5e01452a6e0d94 Control/Parallel/Strategies.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) From git at git.haskell.org Sat Jan 2 08:16:55 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Jan 2016 08:16:55 +0000 (UTC) Subject: [commit: packages/parallel] master: Merge pull request #7 from MaxGabriel/patch-1 (5f547a8) Message-ID: <20160102081655.7E4423A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/parallel On branch : master Link : http://git.haskell.org/packages/parallel.git/commitdiff/5f547a8ce0fc7c8296c6ca98baa5647d71806ff8 >--------------------------------------------------------------- commit 5f547a8ce0fc7c8296c6ca98baa5647d71806ff8 Merge: d0a42b2 4715f86 Author: Simon Marlow Date: Mon Jun 1 20:53:00 2015 +0100 Merge pull request #7 from MaxGabriel/patch-1 Fix typo in SeqStrategy documentation >--------------------------------------------------------------- 5f547a8ce0fc7c8296c6ca98baa5647d71806ff8 Control/Parallel/Strategies.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) From git at git.haskell.org Sat Jan 2 08:16:57 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Jan 2016 08:16:57 +0000 (UTC) Subject: [commit: packages/parallel] master: Add NOINLINE[1] rseq to make the RULE more robust (f606922) Message-ID: <20160102081657.843933A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/parallel On branch : master Link : http://git.haskell.org/packages/parallel.git/commitdiff/f6069229df73045770fe4521991b9d22fd58e680 >--------------------------------------------------------------- commit f6069229df73045770fe4521991b9d22fd58e680 Author: Simon Marlow Date: Fri Jul 31 20:20:20 2015 +0100 Add NOINLINE[1] rseq to make the RULE more robust >--------------------------------------------------------------- f6069229df73045770fe4521991b9d22fd58e680 Control/Parallel/Strategies.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/Control/Parallel/Strategies.hs b/Control/Parallel/Strategies.hs index e65cfef..05d5385 100644 --- a/Control/Parallel/Strategies.hs +++ b/Control/Parallel/Strategies.hs @@ -509,6 +509,7 @@ parListWHNF xs = go xs `pseq` return xs -- more compositional counterpart; use RULES to do the specialisation. {-# NOINLINE [1] parList #-} +{-# NOINLINE [1] rseq #-} {-# RULES "parList/rseq" parList rseq = parListWHNF #-} From git at git.haskell.org Sat Jan 2 08:16:59 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Jan 2016 08:16:59 +0000 (UTC) Subject: [commit: packages/parallel] master: Perform early-version-bump and update changelog (ee799d0) Message-ID: <20160102081659.8974F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/parallel On branch : master Link : http://git.haskell.org/packages/parallel.git/commitdiff/ee799d033cfe6692585b34423042fbedbc2a0de9 >--------------------------------------------------------------- commit ee799d033cfe6692585b34423042fbedbc2a0de9 Author: Herbert Valerio Riedel Date: Sat Oct 31 13:31:57 2015 +0100 Perform early-version-bump and update changelog This is help make GHC HEAD nightlies more accurate about reported package versions. >--------------------------------------------------------------- ee799d033cfe6692585b34423042fbedbc2a0de9 changelog.md | 5 +++++ parallel.cabal | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 3989273..6872700 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,10 @@ # Changelog for [`parallel` package](http://hackage.haskell.org/package/parallel) +## 3.2.0.7 *TBA* + + - Add `{-# NOINLINE[1] rseq #-}` to make the `RULE` more robust + - Make `rpar`'s type signature consistent with `rseq` & co + ## 3.2.0.6 *Dec 2014* - Make `-Wall` message free for all supported `base` versions diff --git a/parallel.cabal b/parallel.cabal index 1128110..c124faf 100644 --- a/parallel.cabal +++ b/parallel.cabal @@ -1,5 +1,5 @@ name: parallel -version: 3.2.0.6 +version: 3.2.0.7 -- NOTE: Don't forget to update ./changelog.md license: BSD3 license-file: LICENSE From git at git.haskell.org Sat Jan 2 08:17:01 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Jan 2016 08:17:01 +0000 (UTC) Subject: [commit: packages/parallel] master: Minor refactoring of Functor/Applicative/Monad instances (0346f07) Message-ID: <20160102081701.8FFAA3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/parallel On branch : master Link : http://git.haskell.org/packages/parallel.git/commitdiff/0346f07f1b74c6c25e24d4a9ff4ba6fbd3275bae >--------------------------------------------------------------- commit 0346f07f1b74c6c25e24d4a9ff4ba6fbd3275bae Author: Herbert Valerio Riedel Date: Sat Oct 31 13:42:07 2015 +0100 Minor refactoring of Functor/Applicative/Monad instances We may want to override `*>` at some point for the GHC 7.2+ code However, I'm a bit puzzled by the comment -- GHC 7.2.1 added the seq# and spark# primitives, that we use in -- the Eval monad implementation in order to get the correct -- strictness behaviour. while the actual `instance Monad` implementation below doesn't use any of those primitives >--------------------------------------------------------------- 0346f07f1b74c6c25e24d4a9ff4ba6fbd3275bae Control/Parallel/Strategies.hs | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/Control/Parallel/Strategies.hs b/Control/Parallel/Strategies.hs index 05d5385..bded495 100644 --- a/Control/Parallel/Strategies.hs +++ b/Control/Parallel/Strategies.hs @@ -201,8 +201,15 @@ newtype Eval a = Eval (State# RealWorld -> (# State# RealWorld, a #)) runEval :: Eval a -> a runEval (Eval x) = case x realWorld# of (# _, a #) -> a +instance Functor Eval where + fmap = liftM + +instance Applicative Eval where + pure x = Eval $ \s -> (# s, x #) + (<*>) = ap + instance Monad Eval where - return x = Eval $ \s -> (# s, x #) + return = pure Eval x >>= k = Eval $ \s -> case x s of (# s', a #) -> case k a of Eval f -> f s' @@ -214,8 +221,15 @@ data Eval a = Done a runEval :: Eval a -> a runEval (Done x) = x +instance Functor Eval where + fmap = liftM + +instance Applicative Eval where + pure = Done + (<*>) = ap + instance Monad Eval where - return x = Done x + return = pure Done x >>= k = lazy (k x) -- Note: pattern 'Done x' makes '>>=' strict {-# RULES "lazy Done" forall x . lazy (Done x) = Done x #-} @@ -223,14 +237,6 @@ instance Monad Eval where #endif -instance Functor Eval where - fmap = liftM - -instance Applicative Eval where - (<*>) = ap - pure = return - - -- The Eval monad satisfies the monad laws. -- -- (1) Left identity: From git at git.haskell.org Sat Jan 2 08:17:03 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Jan 2016 08:17:03 +0000 (UTC) Subject: [commit: packages/parallel] master: Relax upper bound on `base` to allow for base-4.9 (ec04d05) Message-ID: <20160102081703.963313A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/parallel On branch : master Link : http://git.haskell.org/packages/parallel.git/commitdiff/ec04d059b13fc348789d87adfbabb9351f8574db >--------------------------------------------------------------- commit ec04d059b13fc348789d87adfbabb9351f8574db Author: Herbert Valerio Riedel Date: Sat Oct 31 13:46:52 2015 +0100 Relax upper bound on `base` to allow for base-4.9 >--------------------------------------------------------------- ec04d059b13fc348789d87adfbabb9351f8574db parallel.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parallel.cabal b/parallel.cabal index c124faf..7fa36c2 100644 --- a/parallel.cabal +++ b/parallel.cabal @@ -35,7 +35,7 @@ library build-depends: array >= 0.3 && < 0.6, - base >= 4.3 && < 4.9, + base >= 4.3 && < 4.10, containers >= 0.4 && < 0.6, deepseq >= 1.1 && < 1.5 From git at git.haskell.org Sat Jan 2 08:17:05 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Jan 2016 08:17:05 +0000 (UTC) Subject: [commit: packages/parallel] master: Add GHC 8.0 to Travis' test matrix (0a5c02d) Message-ID: <20160102081705.9B7023A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/parallel On branch : master Link : http://git.haskell.org/packages/parallel.git/commitdiff/0a5c02d6e98fd5b5dd075c5f31907ed4bb8cb77e >--------------------------------------------------------------- commit 0a5c02d6e98fd5b5dd075c5f31907ed4bb8cb77e Author: Herbert Valerio Riedel Date: Sat Jan 2 08:32:38 2016 +0100 Add GHC 8.0 to Travis' test matrix >--------------------------------------------------------------- 0a5c02d6e98fd5b5dd075c5f31907ed4bb8cb77e .travis.yml | 2 +- parallel.cabal | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5421b79..4c190b9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,11 @@ env: - - CABALVER=1.16 GHCVER=7.0.1 - CABALVER=1.16 GHCVER=7.0.4 - CABALVER=1.16 GHCVER=7.2.2 - CABALVER=1.16 GHCVER=7.4.2 - CABALVER=1.16 GHCVER=7.6.3 - CABALVER=1.18 GHCVER=7.8.4 - CABALVER=1.22 GHCVER=7.10.1 + - CABALVER=1.24 GHCVER=8.0.1 - CABALVER=head GHCVER=head matrix: diff --git a/parallel.cabal b/parallel.cabal index 7fa36c2..81d4ae5 100644 --- a/parallel.cabal +++ b/parallel.cabal @@ -9,7 +9,7 @@ synopsis: Parallel programming library category: Control, Parallelism build-type: Simple cabal-version: >=1.10 -tested-with: GHC==7.6.3, GHC==7.6.2, GHC==7.6.1, GHC==7.4.2, GHC==7.4.1, GHC==7.2.2, GHC==7.2.1, GHC==7.0.4, GHC==7.0.3, GHC==7.0.2, GHC==7.0.1 +tested-with: GHC==8.0.1, GHC==7.10.3, GHC==7.8.3, GHC==7.6.3, GHC==7.4.2, GHC==7.2.2, GHC==7.0.4 description: This package provides a library for parallel programming. From git at git.haskell.org Sat Jan 2 08:17:07 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Jan 2016 08:17:07 +0000 (UTC) Subject: [commit: packages/parallel] master: Use more exact CPP guards for 0ec7fe287db9b837a (77e9e30) Message-ID: <20160102081707.A0C3D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/parallel On branch : master Link : http://git.haskell.org/packages/parallel.git/commitdiff/77e9e303591cddd92506c0e856ddcaa439146320 >--------------------------------------------------------------- commit 77e9e303591cddd92506c0e856ddcaa439146320 Author: Herbert Valerio Riedel Date: Sat Jan 2 08:55:02 2016 +0100 Use more exact CPP guards for 0ec7fe287db9b837a >--------------------------------------------------------------- 77e9e303591cddd92506c0e856ddcaa439146320 Control/Seq.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Control/Seq.hs b/Control/Seq.hs index 13c5d0e..13211ff 100644 --- a/Control/Seq.hs +++ b/Control/Seq.hs @@ -66,7 +66,7 @@ import Data.Foldable (Foldable, toList) #endif import Data.Map (Map) import qualified Data.Map (toList) -#if __GLASGOW_HASKELL__ < 711 +#if !((__GLASGOW_HASKELL__ >= 711) && MIN_VERSION_array(0,5,1)) import Data.Ix (Ix) #endif import Data.Array (Array) @@ -148,7 +148,7 @@ seqFoldable strat = seqList strat . toList -- | Evaluate the elements of an array according to the given strategy. -- Evaluation of the array bounds may be triggered as a side effect. -#if __GLASGOW_HASKELL__ >= 711 +#if (__GLASGOW_HASKELL__ >= 711) && MIN_VERSION_array(0,5,1) seqArray :: Strategy a -> Strategy (Array i a) #else seqArray :: Ix i => Strategy a -> Strategy (Array i a) @@ -156,7 +156,7 @@ seqArray :: Ix i => Strategy a -> Strategy (Array i a) seqArray strat = seqList strat . Data.Array.elems -- | Evaluate the bounds of an array according to the given strategy. -#if __GLASGOW_HASKELL__ >= 711 +#if (__GLASGOW_HASKELL__ >= 711) && MIN_VERSION_array(0,5,1) seqArrayBounds :: Strategy i -> Strategy (Array i a) #else seqArrayBounds :: Ix i => Strategy i -> Strategy (Array i a) From git at git.haskell.org Sat Jan 2 08:17:09 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Jan 2016 08:17:09 +0000 (UTC) Subject: [commit: packages/parallel] master: Drop FlexibleInstances from `other-extensions` (286e293) Message-ID: <20160102081709.A61BB3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/parallel On branch : master Link : http://git.haskell.org/packages/parallel.git/commitdiff/286e29320fa7265baad1bc9f99f9caa6cdd3ff87 >--------------------------------------------------------------- commit 286e29320fa7265baad1bc9f99f9caa6cdd3ff87 Author: Herbert Valerio Riedel Date: Sat Jan 2 08:56:07 2016 +0100 Drop FlexibleInstances from `other-extensions` Because it's not needed... >--------------------------------------------------------------- 286e29320fa7265baad1bc9f99f9caa6cdd3ff87 parallel.cabal | 1 - 1 file changed, 1 deletion(-) diff --git a/parallel.cabal b/parallel.cabal index 81d4ae5..e900ecd 100644 --- a/parallel.cabal +++ b/parallel.cabal @@ -24,7 +24,6 @@ library other-extensions: BangPatterns CPP - FlexibleInstances MagicHash UnboxedTuples From git at git.haskell.org Sat Jan 2 08:17:11 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Jan 2016 08:17:11 +0000 (UTC) Subject: [commit: packages/parallel] master: Git-ignore `/dist` folder (46590f4) Message-ID: <20160102081711.AB1F63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/parallel On branch : master Link : http://git.haskell.org/packages/parallel.git/commitdiff/46590f4e4b635c853ba26566c0f1c9fb8891f9f0 >--------------------------------------------------------------- commit 46590f4e4b635c853ba26566c0f1c9fb8891f9f0 Author: Herbert Valerio Riedel Date: Sat Jan 2 08:56:58 2016 +0100 Git-ignore `/dist` folder >--------------------------------------------------------------- 46590f4e4b635c853ba26566c0f1c9fb8891f9f0 .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 242131b..9a340d7 100644 --- a/.gitignore +++ b/.gitignore @@ -16,4 +16,5 @@ # Specific generated files /GNUmakefile /dist-install/ +/dist/ /ghc.mk From git at git.haskell.org Sat Jan 2 08:17:13 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Jan 2016 08:17:13 +0000 (UTC) Subject: [commit: packages/parallel] master: Update changelog for 3.2.1.0 release (641da51) Message-ID: <20160102081713.B04033A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/parallel On branch : master Link : http://git.haskell.org/packages/parallel.git/commitdiff/641da51aee703336b9fc39f7ec95943abe805912 >--------------------------------------------------------------- commit 641da51aee703336b9fc39f7ec95943abe805912 Author: Herbert Valerio Riedel Date: Sat Jan 2 09:00:38 2016 +0100 Update changelog for 3.2.1.0 release We do a minor version bump so the `Ix`-constraint removal on `seqArray` can be tested for more easily via `MIN_VERSION_parallel(3,2,1)` >--------------------------------------------------------------- 641da51aee703336b9fc39f7ec95943abe805912 changelog.md | 7 +++++-- parallel.cabal | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/changelog.md b/changelog.md index 6872700..ed09287 100644 --- a/changelog.md +++ b/changelog.md @@ -1,9 +1,12 @@ # Changelog for [`parallel` package](http://hackage.haskell.org/package/parallel) -## 3.2.0.7 *TBA* +## 3.2.1.0 *Jan 2016* + - Support `base-4.9.0.0` - Add `{-# NOINLINE[1] rseq #-}` to make the `RULE` more robust - - Make `rpar`'s type signature consistent with `rseq` & co + - Fix broken links to papers in Haddock + - Make `rpar` type signature consistent with `rseq` via type-synonym + - Drop redundant `Ix`-constraint on `seqArray`/`seqArrayBounds` for GHC >= 8.0 ## 3.2.0.6 *Dec 2014* diff --git a/parallel.cabal b/parallel.cabal index e900ecd..141b864 100644 --- a/parallel.cabal +++ b/parallel.cabal @@ -1,5 +1,5 @@ name: parallel -version: 3.2.0.7 +version: 3.2.1.0 -- NOTE: Don't forget to update ./changelog.md license: BSD3 license-file: LICENSE From git at git.haskell.org Sat Jan 2 08:17:15 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Jan 2016 08:17:15 +0000 (UTC) Subject: [commit: packages/parallel] master: Fix minor typo in .cabal file (dbb8d9e) Message-ID: <20160102081715.B5F763A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/parallel On branch : master Link : http://git.haskell.org/packages/parallel.git/commitdiff/dbb8d9e36276f1ced95c8761ddbc3b157742bd34 >--------------------------------------------------------------- commit dbb8d9e36276f1ced95c8761ddbc3b157742bd34 Author: Herbert Valerio Riedel Date: Sat Jan 2 09:10:53 2016 +0100 Fix minor typo in .cabal file >--------------------------------------------------------------- dbb8d9e36276f1ced95c8761ddbc3b157742bd34 parallel.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parallel.cabal b/parallel.cabal index 141b864..5251903 100644 --- a/parallel.cabal +++ b/parallel.cabal @@ -9,7 +9,7 @@ synopsis: Parallel programming library category: Control, Parallelism build-type: Simple cabal-version: >=1.10 -tested-with: GHC==8.0.1, GHC==7.10.3, GHC==7.8.3, GHC==7.6.3, GHC==7.4.2, GHC==7.2.2, GHC==7.0.4 +tested-with: GHC==8.0.1, GHC==7.10.3, GHC==7.8.4, GHC==7.6.3, GHC==7.4.2, GHC==7.2.2, GHC==7.0.4 description: This package provides a library for parallel programming. From git at git.haskell.org Sat Jan 2 10:18:07 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Jan 2016 10:18:07 +0000 (UTC) Subject: [commit: ghc] master: AnnDotDot missing for Pattern Synonym export (f5ad1f0) Message-ID: <20160102101807.C10C23A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/f5ad1f0301f29e0631d3923dde3d5829b5ef8a53/ghc >--------------------------------------------------------------- commit f5ad1f0301f29e0631d3923dde3d5829b5ef8a53 Author: Alan Zimmerman Date: Sat Jan 2 12:16:20 2016 +0200 AnnDotDot missing for Pattern Synonym export For the following code fragment {-# LANGUAGE PatternSynonyms #-} module ExportSyntax ( A(.., NoA), Q(F,..), G(T,..,U)) where The second and third .. are missing AnnDotdot annotations. Closes #11332 >--------------------------------------------------------------- f5ad1f0301f29e0631d3923dde3d5829b5ef8a53 compiler/parser/Parser.y | 21 ++++----- testsuite/tests/ghc-api/annotations/Makefile | 4 ++ testsuite/tests/ghc-api/annotations/T11332.stdout | 50 ++++++++++++++++++++++ .../annotations/Test11332.hs} | 2 +- testsuite/tests/ghc-api/annotations/all.T | 1 + 5 files changed, 67 insertions(+), 11 deletions(-) diff --git a/compiler/parser/Parser.y b/compiler/parser/Parser.y index ef6c0f5..4732956 100644 --- a/compiler/parser/Parser.y +++ b/compiler/parser/Parser.y @@ -650,22 +650,23 @@ qcnames :: { ([AddAnn], [Located (Maybe RdrName)]) } | qcnames1 { $1 } qcnames1 :: { ([AddAnn], [Located (Maybe RdrName)]) } -- A reversed list - : qcnames1 ',' qcname_ext_w_wildcard {% case (last (snd $1)) of + : qcnames1 ',' qcname_ext_w_wildcard {% case (head (snd $1)) of l@(L _ Nothing) -> - return ([mj AnnComma $2, mj AnnDotdot l] - ,($3 : snd $1)) - l -> (aa (head (snd $1)) (AnnComma, $2) >> - return (fst $1, $3 : snd $1)) } + return ([mj AnnComma $2, mj AnnDotdot l] + ,(snd (unLoc $3) : snd $1)) + l -> (ams (head (snd $1)) [mj AnnComma $2] >> + return (fst $1 ++ fst (unLoc $3), + snd (unLoc $3) : snd $1)) } - -- Annotations readded in mkImpExpSubSpec - | qcname_ext_w_wildcard { ([],[$1]) } + -- Annotations re-added in mkImpExpSubSpec + | qcname_ext_w_wildcard { (fst (unLoc $1),[snd (unLoc $1)]) } -- Variable, data constructor or wildcard -- or tagged type constructor -qcname_ext_w_wildcard :: { Located (Maybe RdrName) } - : qcname_ext { Just `fmap` $1 } - | '..' { Nothing <$ $1 } +qcname_ext_w_wildcard :: { Located ([AddAnn],Located (Maybe RdrName)) } + : qcname_ext { sL1 $1 ([],Just `fmap` $1) } + | '..' { sL1 $1 ([mj AnnDotdot $1], sL1 $1 Nothing) } qcname_ext :: { Located RdrName } : qcname { $1 } diff --git a/testsuite/tests/ghc-api/annotations/Makefile b/testsuite/tests/ghc-api/annotations/Makefile index 5947455..212f7b0 100644 --- a/testsuite/tests/ghc-api/annotations/Makefile +++ b/testsuite/tests/ghc-api/annotations/Makefile @@ -114,3 +114,7 @@ T10276: .PHONY: T11321 T11321: $(CHECK_API_ANNOTATIONS) "`'$(TEST_HC)' $(TEST_HC_OPTS) --print-libdir | tr -d '\r'`" Test11321 + +.PHONY: T11332 +T11332: + $(CHECK_API_ANNOTATIONS) "`'$(TEST_HC)' $(TEST_HC_OPTS) --print-libdir | tr -d '\r'`" Test11332 diff --git a/testsuite/tests/ghc-api/annotations/T11332.stdout b/testsuite/tests/ghc-api/annotations/T11332.stdout new file mode 100644 index 0000000..cf1d859 --- /dev/null +++ b/testsuite/tests/ghc-api/annotations/T11332.stdout @@ -0,0 +1,50 @@ +---Problems (should be empty list)--- +[] +---Annotations----------------------- +-- SrcSpan the annotation is attached to, AnnKeywordId, +-- list of locations the keyword item appears in +[ +((Test11332.hs:1:1,AnnModule), [Test11332.hs:3:1-6]), +((Test11332.hs:1:1,AnnWhere), [Test11332.hs:3:52-56]), +((Test11332.hs:3:18-50,AnnCloseP), [Test11332.hs:3:50]), +((Test11332.hs:3:18-50,AnnOpenP), [Test11332.hs:3:18]), +((Test11332.hs:3:20-29,AnnCloseP), [Test11332.hs:3:29]), +((Test11332.hs:3:20-29,AnnComma), [Test11332.hs:3:24, Test11332.hs:3:30]), +((Test11332.hs:3:20-29,AnnDotdot), [Test11332.hs:3:22-23]), +((Test11332.hs:3:20-29,AnnOpenP), [Test11332.hs:3:21]), +((Test11332.hs:3:32-38,AnnCloseP), [Test11332.hs:3:38]), +((Test11332.hs:3:32-38,AnnComma), [Test11332.hs:3:39]), +((Test11332.hs:3:32-38,AnnDotdot), [Test11332.hs:3:36-37]), +((Test11332.hs:3:32-38,AnnOpenP), [Test11332.hs:3:33]), +((Test11332.hs:3:34,AnnComma), [Test11332.hs:3:35]), +((Test11332.hs:3:41-49,AnnCloseP), [Test11332.hs:3:49]), +((Test11332.hs:3:41-49,AnnComma), [Test11332.hs:3:47]), +((Test11332.hs:3:41-49,AnnDotdot), [Test11332.hs:3:45-46]), +((Test11332.hs:3:41-49,AnnOpenP), [Test11332.hs:3:42]), +((Test11332.hs:3:43,AnnComma), [Test11332.hs:3:44]), +((Test11332.hs:5:1-14,AnnData), [Test11332.hs:5:1-4]), +((Test11332.hs:5:1-14,AnnEqual), [Test11332.hs:5:8]), +((Test11332.hs:5:1-14,AnnSemi), [Test11332.hs:7:1]), +((Test11332.hs:5:10,AnnVbar), [Test11332.hs:5:12]), +((Test11332.hs:7:1-15,AnnEqual), [Test11332.hs:7:13]), +((Test11332.hs:7:1-15,AnnPattern), [Test11332.hs:7:1-7]), +((Test11332.hs:7:1-15,AnnSemi), [Test11332.hs:9:1]), +((Test11332.hs:9:1-14,AnnData), [Test11332.hs:9:1-4]), +((Test11332.hs:9:1-14,AnnEqual), [Test11332.hs:9:10]), +((Test11332.hs:9:1-14,AnnSemi), [Test11332.hs:11:1]), +((Test11332.hs:11:1-17,AnnEqual), [Test11332.hs:11:13]), +((Test11332.hs:11:1-17,AnnPattern), [Test11332.hs:11:1-7]), +((Test11332.hs:11:1-17,AnnSemi), [Test11332.hs:13:1]), +((Test11332.hs:13:1-14,AnnData), [Test11332.hs:13:1-4]), +((Test11332.hs:13:1-14,AnnEqual), [Test11332.hs:13:8]), +((Test11332.hs:13:1-14,AnnSemi), [Test11332.hs:15:1]), +((Test11332.hs:13:10,AnnVbar), [Test11332.hs:13:12]), +((Test11332.hs:15:1-13,AnnEqual), [Test11332.hs:15:11]), +((Test11332.hs:15:1-13,AnnPattern), [Test11332.hs:15:1-7]), +((Test11332.hs:15:1-13,AnnSemi), [Test11332.hs:17:1]), +((Test11332.hs:17:1-13,AnnEqual), [Test11332.hs:17:11]), +((Test11332.hs:17:1-13,AnnPattern), [Test11332.hs:17:1-7]), +((Test11332.hs:17:1-13,AnnSemi), [Test11332.hs:18:1]), +((,AnnEofPos), [Test11332.hs:18:1]) +] + diff --git a/testsuite/tests/patsyn/should_compile/ExportSyntax.hs b/testsuite/tests/ghc-api/annotations/Test11332.hs similarity index 71% copy from testsuite/tests/patsyn/should_compile/ExportSyntax.hs copy to testsuite/tests/ghc-api/annotations/Test11332.hs index 7c50cf4..41e84b0 100644 --- a/testsuite/tests/patsyn/should_compile/ExportSyntax.hs +++ b/testsuite/tests/ghc-api/annotations/Test11332.hs @@ -1,6 +1,6 @@ {-# LANGUAGE PatternSynonyms #-} -module ExportSyntax ( A(.., NoA), Q(F,..), G(T,..,U)) where +module Test11332 ( A(.., NoA), Q(F,..), G(T,..,U)) where data A = A | B diff --git a/testsuite/tests/ghc-api/annotations/all.T b/testsuite/tests/ghc-api/annotations/all.T index ad6682e..a2750ff 100644 --- a/testsuite/tests/ghc-api/annotations/all.T +++ b/testsuite/tests/ghc-api/annotations/all.T @@ -22,3 +22,4 @@ test('T11018', normal, run_command, ['$MAKE -s --no-print-directory T11018' test('bundle-export', normal, run_command, ['$MAKE -s --no-print-directory bundle-export']) test('T10276', normal, run_command, ['$MAKE -s --no-print-directory T10276']) test('T11321', normal, run_command, ['$MAKE -s --no-print-directory T11321']) +test('T11332', normal, run_command, ['$MAKE -s --no-print-directory T11332']) From git at git.haskell.org Sat Jan 2 10:55:05 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Jan 2016 10:55:05 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: AnnDotDot missing for Pattern Synonym export (8de4775) Message-ID: <20160102105505.A34023A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/8de477525418eb1f5f475b928a24ed57f1e99e24/ghc >--------------------------------------------------------------- commit 8de477525418eb1f5f475b928a24ed57f1e99e24 Author: Alan Zimmerman Date: Sat Jan 2 12:16:20 2016 +0200 AnnDotDot missing for Pattern Synonym export For the following code fragment {-# LANGUAGE PatternSynonyms #-} module ExportSyntax ( A(.., NoA), Q(F,..), G(T,..,U)) where The second and third .. are missing AnnDotdot annotations. Closes #11332 (cherry picked from commit f5ad1f0301f29e0631d3923dde3d5829b5ef8a53) >--------------------------------------------------------------- 8de477525418eb1f5f475b928a24ed57f1e99e24 compiler/parser/Parser.y | 21 ++++----- testsuite/tests/ghc-api/annotations/Makefile | 4 ++ testsuite/tests/ghc-api/annotations/T11332.stdout | 50 ++++++++++++++++++++++ .../annotations/Test11332.hs} | 2 +- testsuite/tests/ghc-api/annotations/all.T | 1 + 5 files changed, 67 insertions(+), 11 deletions(-) diff --git a/compiler/parser/Parser.y b/compiler/parser/Parser.y index ef6c0f5..4732956 100644 --- a/compiler/parser/Parser.y +++ b/compiler/parser/Parser.y @@ -650,22 +650,23 @@ qcnames :: { ([AddAnn], [Located (Maybe RdrName)]) } | qcnames1 { $1 } qcnames1 :: { ([AddAnn], [Located (Maybe RdrName)]) } -- A reversed list - : qcnames1 ',' qcname_ext_w_wildcard {% case (last (snd $1)) of + : qcnames1 ',' qcname_ext_w_wildcard {% case (head (snd $1)) of l@(L _ Nothing) -> - return ([mj AnnComma $2, mj AnnDotdot l] - ,($3 : snd $1)) - l -> (aa (head (snd $1)) (AnnComma, $2) >> - return (fst $1, $3 : snd $1)) } + return ([mj AnnComma $2, mj AnnDotdot l] + ,(snd (unLoc $3) : snd $1)) + l -> (ams (head (snd $1)) [mj AnnComma $2] >> + return (fst $1 ++ fst (unLoc $3), + snd (unLoc $3) : snd $1)) } - -- Annotations readded in mkImpExpSubSpec - | qcname_ext_w_wildcard { ([],[$1]) } + -- Annotations re-added in mkImpExpSubSpec + | qcname_ext_w_wildcard { (fst (unLoc $1),[snd (unLoc $1)]) } -- Variable, data constructor or wildcard -- or tagged type constructor -qcname_ext_w_wildcard :: { Located (Maybe RdrName) } - : qcname_ext { Just `fmap` $1 } - | '..' { Nothing <$ $1 } +qcname_ext_w_wildcard :: { Located ([AddAnn],Located (Maybe RdrName)) } + : qcname_ext { sL1 $1 ([],Just `fmap` $1) } + | '..' { sL1 $1 ([mj AnnDotdot $1], sL1 $1 Nothing) } qcname_ext :: { Located RdrName } : qcname { $1 } diff --git a/testsuite/tests/ghc-api/annotations/Makefile b/testsuite/tests/ghc-api/annotations/Makefile index 5947455..212f7b0 100644 --- a/testsuite/tests/ghc-api/annotations/Makefile +++ b/testsuite/tests/ghc-api/annotations/Makefile @@ -114,3 +114,7 @@ T10276: .PHONY: T11321 T11321: $(CHECK_API_ANNOTATIONS) "`'$(TEST_HC)' $(TEST_HC_OPTS) --print-libdir | tr -d '\r'`" Test11321 + +.PHONY: T11332 +T11332: + $(CHECK_API_ANNOTATIONS) "`'$(TEST_HC)' $(TEST_HC_OPTS) --print-libdir | tr -d '\r'`" Test11332 diff --git a/testsuite/tests/ghc-api/annotations/T11332.stdout b/testsuite/tests/ghc-api/annotations/T11332.stdout new file mode 100644 index 0000000..cf1d859 --- /dev/null +++ b/testsuite/tests/ghc-api/annotations/T11332.stdout @@ -0,0 +1,50 @@ +---Problems (should be empty list)--- +[] +---Annotations----------------------- +-- SrcSpan the annotation is attached to, AnnKeywordId, +-- list of locations the keyword item appears in +[ +((Test11332.hs:1:1,AnnModule), [Test11332.hs:3:1-6]), +((Test11332.hs:1:1,AnnWhere), [Test11332.hs:3:52-56]), +((Test11332.hs:3:18-50,AnnCloseP), [Test11332.hs:3:50]), +((Test11332.hs:3:18-50,AnnOpenP), [Test11332.hs:3:18]), +((Test11332.hs:3:20-29,AnnCloseP), [Test11332.hs:3:29]), +((Test11332.hs:3:20-29,AnnComma), [Test11332.hs:3:24, Test11332.hs:3:30]), +((Test11332.hs:3:20-29,AnnDotdot), [Test11332.hs:3:22-23]), +((Test11332.hs:3:20-29,AnnOpenP), [Test11332.hs:3:21]), +((Test11332.hs:3:32-38,AnnCloseP), [Test11332.hs:3:38]), +((Test11332.hs:3:32-38,AnnComma), [Test11332.hs:3:39]), +((Test11332.hs:3:32-38,AnnDotdot), [Test11332.hs:3:36-37]), +((Test11332.hs:3:32-38,AnnOpenP), [Test11332.hs:3:33]), +((Test11332.hs:3:34,AnnComma), [Test11332.hs:3:35]), +((Test11332.hs:3:41-49,AnnCloseP), [Test11332.hs:3:49]), +((Test11332.hs:3:41-49,AnnComma), [Test11332.hs:3:47]), +((Test11332.hs:3:41-49,AnnDotdot), [Test11332.hs:3:45-46]), +((Test11332.hs:3:41-49,AnnOpenP), [Test11332.hs:3:42]), +((Test11332.hs:3:43,AnnComma), [Test11332.hs:3:44]), +((Test11332.hs:5:1-14,AnnData), [Test11332.hs:5:1-4]), +((Test11332.hs:5:1-14,AnnEqual), [Test11332.hs:5:8]), +((Test11332.hs:5:1-14,AnnSemi), [Test11332.hs:7:1]), +((Test11332.hs:5:10,AnnVbar), [Test11332.hs:5:12]), +((Test11332.hs:7:1-15,AnnEqual), [Test11332.hs:7:13]), +((Test11332.hs:7:1-15,AnnPattern), [Test11332.hs:7:1-7]), +((Test11332.hs:7:1-15,AnnSemi), [Test11332.hs:9:1]), +((Test11332.hs:9:1-14,AnnData), [Test11332.hs:9:1-4]), +((Test11332.hs:9:1-14,AnnEqual), [Test11332.hs:9:10]), +((Test11332.hs:9:1-14,AnnSemi), [Test11332.hs:11:1]), +((Test11332.hs:11:1-17,AnnEqual), [Test11332.hs:11:13]), +((Test11332.hs:11:1-17,AnnPattern), [Test11332.hs:11:1-7]), +((Test11332.hs:11:1-17,AnnSemi), [Test11332.hs:13:1]), +((Test11332.hs:13:1-14,AnnData), [Test11332.hs:13:1-4]), +((Test11332.hs:13:1-14,AnnEqual), [Test11332.hs:13:8]), +((Test11332.hs:13:1-14,AnnSemi), [Test11332.hs:15:1]), +((Test11332.hs:13:10,AnnVbar), [Test11332.hs:13:12]), +((Test11332.hs:15:1-13,AnnEqual), [Test11332.hs:15:11]), +((Test11332.hs:15:1-13,AnnPattern), [Test11332.hs:15:1-7]), +((Test11332.hs:15:1-13,AnnSemi), [Test11332.hs:17:1]), +((Test11332.hs:17:1-13,AnnEqual), [Test11332.hs:17:11]), +((Test11332.hs:17:1-13,AnnPattern), [Test11332.hs:17:1-7]), +((Test11332.hs:17:1-13,AnnSemi), [Test11332.hs:18:1]), +((,AnnEofPos), [Test11332.hs:18:1]) +] + diff --git a/testsuite/tests/patsyn/should_compile/ExportSyntax.hs b/testsuite/tests/ghc-api/annotations/Test11332.hs similarity index 71% copy from testsuite/tests/patsyn/should_compile/ExportSyntax.hs copy to testsuite/tests/ghc-api/annotations/Test11332.hs index 7c50cf4..41e84b0 100644 --- a/testsuite/tests/patsyn/should_compile/ExportSyntax.hs +++ b/testsuite/tests/ghc-api/annotations/Test11332.hs @@ -1,6 +1,6 @@ {-# LANGUAGE PatternSynonyms #-} -module ExportSyntax ( A(.., NoA), Q(F,..), G(T,..,U)) where +module Test11332 ( A(.., NoA), Q(F,..), G(T,..,U)) where data A = A | B diff --git a/testsuite/tests/ghc-api/annotations/all.T b/testsuite/tests/ghc-api/annotations/all.T index ad6682e..a2750ff 100644 --- a/testsuite/tests/ghc-api/annotations/all.T +++ b/testsuite/tests/ghc-api/annotations/all.T @@ -22,3 +22,4 @@ test('T11018', normal, run_command, ['$MAKE -s --no-print-directory T11018' test('bundle-export', normal, run_command, ['$MAKE -s --no-print-directory bundle-export']) test('T10276', normal, run_command, ['$MAKE -s --no-print-directory T10276']) test('T11321', normal, run_command, ['$MAKE -s --no-print-directory T11321']) +test('T11332', normal, run_command, ['$MAKE -s --no-print-directory T11332']) From git at git.haskell.org Sat Jan 2 22:09:51 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 2 Jan 2016 22:09:51 +0000 (UTC) Subject: [commit: ghc] master: Test Trac #11336 (256c2cf) Message-ID: <20160102220951.73FCF3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/256c2cfc1e3690cb4b07154b3a81d89d45625685/ghc >--------------------------------------------------------------- commit 256c2cfc1e3690cb4b07154b3a81d89d45625685 Author: Simon Peyton Jones Date: Sat Jan 2 22:09:21 2016 +0000 Test Trac #11336 >--------------------------------------------------------------- 256c2cfc1e3690cb4b07154b3a81d89d45625685 testsuite/tests/patsyn/should_compile/T11336.hs | 36 +++++++++++++++++++++++++ testsuite/tests/patsyn/should_compile/all.T | 1 + 2 files changed, 37 insertions(+) diff --git a/testsuite/tests/patsyn/should_compile/T11336.hs b/testsuite/tests/patsyn/should_compile/T11336.hs new file mode 100644 index 0000000..3f30993 --- /dev/null +++ b/testsuite/tests/patsyn/should_compile/T11336.hs @@ -0,0 +1,36 @@ +{-# LANGUAGE GADTs #-} +{-# LANGUAGE PatternSynonyms #-} +{-# LANGUAGE ViewPatterns #-} + +module Bug where + +data AST s a + where + Sym :: s a -> AST s a + (:$) :: AST s (a -> b) -> AST s a -> AST s b + +data A sig where A :: A (a -> a) +data B sig where B :: B (a -> a) + +data AB a + where + AA :: A a -> AB a + BB :: B a -> AB a + +class Prj s where prj :: AB a -> Maybe (s a) + +instance Prj A + where + prj (AA s) = Just s + prj _ = Nothing + +instance Prj B + where + prj (BB s) = Just s + prj _ = Nothing + +pattern SymP s <- Sym (prj -> Just s) + +fun :: AST AB a -> AST AB a +fun (SymP A :$ _) = undefined +fun (SymP B :$ _) = undefined diff --git a/testsuite/tests/patsyn/should_compile/all.T b/testsuite/tests/patsyn/should_compile/all.T index 880d6b2..5205a24 100644 --- a/testsuite/tests/patsyn/should_compile/all.T +++ b/testsuite/tests/patsyn/should_compile/all.T @@ -47,3 +47,4 @@ test('T10897', normal, multi_compile, ['T10897', [ test('T11224b', normal, compile, ['']) test('MoreEx', normal, compile, ['']) test('T11283', normal, compile, ['']) +test('T11336', normal, compile, ['']) From git at git.haskell.org Sun Jan 3 15:55:56 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 3 Jan 2016 15:55:56 +0000 (UTC) Subject: [commit: ghc] master: Linker: ARM: Ensure that cache flush covers all symbol extras (0490fed) Message-ID: <20160103155556.D36203A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/0490fede24b4fc5d5d1b23e9a47899e50b14988c/ghc >--------------------------------------------------------------- commit 0490fede24b4fc5d5d1b23e9a47899e50b14988c Author: Ben Gamari Date: Sun Jan 3 13:25:37 2016 +0100 Linker: ARM: Ensure that cache flush covers all symbol extras Previously part of the last symbol extra wasn't covered. Differential Revision: https://phabricator.haskell.org/D1728 >--------------------------------------------------------------- 0490fede24b4fc5d5d1b23e9a47899e50b14988c rts/Linker.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rts/Linker.c b/rts/Linker.c index cb90c97..82e00e1 100644 --- a/rts/Linker.c +++ b/rts/Linker.c @@ -2758,7 +2758,9 @@ ocFlushInstructionCache( ObjectCode *oc ) } // Jump islands - __clear_cache(oc->symbol_extras, &oc->symbol_extras[oc->n_symbol_extras]); + // Note the (+1) to ensure that the last symbol extra is covered by the + // flush. + __clear_cache(oc->symbol_extras, &oc->symbol_extras[oc->n_symbol_extras+1]); } #endif From git at git.haskell.org Sun Jan 3 15:55:59 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 3 Jan 2016 15:55:59 +0000 (UTC) Subject: [commit: ghc] master: Linker: ARM: Refactor relocation handling (d159a51) Message-ID: <20160103155559.856C73A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d159a51bb0f26aa232432987e88499109002b3f7/ghc >--------------------------------------------------------------- commit d159a51bb0f26aa232432987e88499109002b3f7 Author: Ben Gamari Date: Sun Jan 3 13:27:58 2016 +0100 Linker: ARM: Refactor relocation handling This refactors handling of R_ARM_CALL, R_ARM_JUMP24, R_ARM_MOVW_NC, and R_ARM_MOVT relocations to follow the LLVM LLD implementation. The "ELF for ARM" specification is (like most documents of this type, sadly) a bit vague in some areas, so it seems safest to follow the behavior of a trusted implementation like LLD, which is remarkable in its clarity.. Moreover, we now throw a proper error message when a jump to a symbol extra is out of range. This is great improvement over the previous behavior, which ended in a segfault. See #11340. Differential Revision: https://phabricator.haskell.org/D1728 >--------------------------------------------------------------- d159a51bb0f26aa232432987e88499109002b3f7 rts/Linker.c | 93 +++++++++++++++++++++++++++++++++++------------------------- 1 file changed, 54 insertions(+), 39 deletions(-) diff --git a/rts/Linker.c b/rts/Linker.c index 82e00e1..f5ffa92 100644 --- a/rts/Linker.c +++ b/rts/Linker.c @@ -2742,6 +2742,17 @@ static int ocAllocateSymbolExtras( ObjectCode* oc, int count, int first ) #endif #endif // NEED_SYMBOL_EXTRAS +// Signed extend a number to a 32-bit int. +static inline StgInt32 sign_extend32(nat bits, StgWord32 x) { + return ((StgInt32) (x << (32 - bits))) >> (32 - bits); +} + +// Does the given signed integer fit into the given bit width? +static inline StgBool is_int(nat bits, StgInt32 x) { + return bits > 32 || (-(1 << (bits-1)) <= x + && x < (1 << (bits-1))); +} + #if defined(arm_HOST_ARCH) static void @@ -5068,15 +5079,16 @@ do_Elf_Rel_relocations ( ObjectCode* oc, char* ehdrC, #endif } - IF_DEBUG(linker,debugBelch( "Reloc: P = %p S = %p A = %p\n", - (void*)P, (void*)S, (void*)A )); + int reloc_type = ELF_R_TYPE(info); + IF_DEBUG(linker,debugBelch( "Reloc: P = %p S = %p A = %p type=%d\n", + (void*)P, (void*)S, (void*)A, reloc_type )); checkProddableBlock ( oc, pP, sizeof(Elf_Word) ); #ifdef i386_HOST_ARCH value = S + A; #endif - switch (ELF_R_TYPE(info)) { + switch (reloc_type) { # ifdef i386_HOST_ARCH case R_386_32: *pP = value; break; case R_386_PC32: *pP = value - P; break; @@ -5098,44 +5110,50 @@ do_Elf_Rel_relocations ( ObjectCode* oc, char* ehdrC, case R_ARM_CALL: case R_ARM_JUMP24: { + // N.B. LLVM's LLD linker's relocation implement is a fantastic + // resource StgWord32 *word = (StgWord32 *)P; - StgInt32 imm = (*word & 0x00ffffff) << 2; - StgInt32 offset; - int overflow; + StgInt32 imm = (*word & ((1<<24)-1)) << 2; - // Sign extend 24 to 32 bits - if (imm & 0x02000000) - imm -= 0x04000000; - offset = ((S + imm) | T) - P; + const StgBool is_blx = (*word & 0xf0000000) == 0xf0000000; + const StgWord32 hBit = is_blx ? ((*word >> 24) & 1) : 0; + imm |= hBit << 1; - overflow = offset <= (StgInt32)0xfe000000 || offset >= (StgInt32)0x02000000; + // Sign extend to 32 bits + // I would have thought this would be 24 bits but LLD uses 26 here. + // Hmm. + imm = sign_extend32(26, imm); + StgWord32 result = ((S + imm) | T) - P; + + const StgBool overflow = !is_int(26, (StgInt32) result); + + // Handle overflow and Thumb interworking if ((is_target_thm && ELF_R_TYPE(info) == R_ARM_JUMP24) || overflow) { // Generate veneer // The +8 below is to undo the PC-bias compensation done by the object producer SymbolExtra *extra = makeArmSymbolExtra(oc, ELF_R_SYM(info), S+imm+8, 0, is_target_thm); // The -8 below is to compensate for PC bias - offset = (StgWord32) &extra->jumpIsland - P - 8; - offset &= ~1; // Clear thumb indicator bit - } else if (is_target_thm && ELF_R_TYPE(info) == R_ARM_CALL) { - StgWord32 cond = (*word & 0xf0000000) >> 28; - if (cond == 0xe) { - // Change instruction to BLX - *word |= 0xf0000000; // Set first nibble - *word = (*word & ~0x01ffffff) - | ((offset >> 2) & 0x00ffffff) // imm24 - | ((offset & 0x2) << 23); // H - break; - } else { - errorBelch("%s: Can't transition from ARM to Thumb when cond != 0xe\n", - oc->fileName); + result = (StgWord32) ((StgInt32) extra->jumpIsland - P - 8); + result &= ~1; // Clear thumb indicator bit + if (!is_int(26, (StgInt32) result)) { + errorBelch("Unable to fixup overflow'd R_ARM_CALL: jump island=%p, reloc=%p\n", + (void*) extra->jumpIsland, (void*) P); return 0; } } - offset >>= 2; + const StgWord32 imm24 = (result & 0x03fffffc) >> 2; *word = (*word & ~0x00ffffff) - | (offset & 0x00ffffff); + | (imm24 & 0x00ffffff); + + const StgBool switch_mode = is_target_thm && (reloc_type == R_ARM_CALL); + if (switch_mode) { + const StgWord32 hBit = (result & 0x2) >> 1; + // Change instruction to BLX + *word = (*word & ~0xFF000000) | ((0xfa | hBit) << 24); + IF_DEBUG(linker, debugBelch("Changed BL to BLX at %p\n", word)); + } break; } @@ -5143,20 +5161,17 @@ do_Elf_Rel_relocations ( ObjectCode* oc, char* ehdrC, case R_ARM_MOVW_ABS_NC: { StgWord32 *word = (StgWord32 *)P; - StgInt32 offset = ((*word & 0xf0000) >> 4) - | (*word & 0xfff); - // Sign extend from 16 to 32 bits - offset = (offset ^ 0x8000) - 0x8000; + StgWord32 imm12 = *word & 0xfff; + StgWord32 imm4 = (*word >> 16) & 0xf; + StgInt32 offset = imm4 << 12 | imm12; + StgWord32 result = (S + offset) | T; - offset += S; - if (ELF_R_TYPE(info) == R_ARM_MOVT_ABS) - offset >>= 16; - else - offset |= T; + if (reloc_type == R_ARM_MOVT_ABS) + result = (result & 0xffff0000) >> 16; - *word = (*word & 0xfff0f000) - | ((offset & 0xf000) << 4) - | (offset & 0x0fff); + StgWord32 result12 = result & 0xfff; + StgWord32 result4 = (result >> 12) & 0xf; + *word = (*word & ~0xf0fff) | (result4 << 16) | result12; break; } From git at git.haskell.org Sun Jan 3 15:56:02 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 3 Jan 2016 15:56:02 +0000 (UTC) Subject: [commit: ghc] master: Linker: Make debugging output a bit more readable (48e0f9c) Message-ID: <20160103155602.2E5DB3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/48e0f9cb8ca8ff180d732d1b46f31132f5e1de97/ghc >--------------------------------------------------------------- commit 48e0f9cb8ca8ff180d732d1b46f31132f5e1de97 Author: Ben Gamari Date: Sun Jan 3 13:31:20 2016 +0100 Linker: Make debugging output a bit more readable Differential Revision: https://phabricator.haskell.org/D1728 >--------------------------------------------------------------- 48e0f9cb8ca8ff180d732d1b46f31132f5e1de97 rts/Linker.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rts/Linker.c b/rts/Linker.c index f5ffa92..c5781eeff 100644 --- a/rts/Linker.c +++ b/rts/Linker.c @@ -5032,7 +5032,7 @@ do_Elf_Rel_relocations ( ObjectCode* oc, char* ehdrC, int is_target_thm=0, T=0; #endif - IF_DEBUG(linker,debugBelch( "Rel entry %3d is raw(%6p %6p)", + IF_DEBUG(linker,debugBelch( "Rel entry %3d is raw(%6p %6p): ", j, (void*)offset, (void*)info )); if (!info) { IF_DEBUG(linker,debugBelch( " ZERO" )); From git at git.haskell.org Sun Jan 3 15:56:04 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 3 Jan 2016 15:56:04 +0000 (UTC) Subject: [commit: ghc] master: Linker: Use contiguous mmapping on ARM (07d127a) Message-ID: <20160103155604.C79323A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/07d127ad23c7e6056471d218adcc8ec5119fac6c/ghc >--------------------------------------------------------------- commit 07d127ad23c7e6056471d218adcc8ec5119fac6c Author: Ben Gamari Date: Sun Jan 3 13:21:39 2016 +0100 Linker: Use contiguous mmapping on ARM ARM has a 24-bit relative jump offset just like PowerPC. Ensure that symbols don't get too far from their symbol extras. See #11340. Differential Revision: https://phabricator.haskell.org/D1728 >--------------------------------------------------------------- 07d127ad23c7e6056471d218adcc8ec5119fac6c rts/Linker.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/rts/Linker.c b/rts/Linker.c index c5781eeff..e6f63cb 100644 --- a/rts/Linker.c +++ b/rts/Linker.c @@ -79,10 +79,18 @@ #endif -/* PowerPC has relative branch instructions with only 24 bit displacements - * and therefore needs jump islands contiguous with each object code module. +/* PowerPC and ARM have relative branch instructions with only 24 bit + * displacements and therefore need jump islands contiguous with each object + * code module. */ -#if (USE_MMAP && defined(powerpc_HOST_ARCH) && defined(linux_HOST_OS)) +#if defined(powerpc_HOST_ARCH) +#define SHORT_REL_BRANCH 1 +#endif +#if defined(arm_HOST_ARCH) +#define SHORT_REL_BRANCH 1 +#endif + +#if (USE_MMAP && defined(SHORT_REL_BRANCH) && defined(linux_HOST_OS)) #define USE_CONTIGUOUS_MMAP 1 #else #define USE_CONTIGUOUS_MMAP 0 From git at git.haskell.org Sun Jan 3 20:08:28 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 3 Jan 2016 20:08:28 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Linker: ARM: Ensure that cache flush covers all symbol extras (7d2f41c) Message-ID: <20160103200828.210633A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/7d2f41c093c09bdb66ff4c18b811bf75ef31aee5/ghc >--------------------------------------------------------------- commit 7d2f41c093c09bdb66ff4c18b811bf75ef31aee5 Author: Ben Gamari Date: Sun Jan 3 13:25:37 2016 +0100 Linker: ARM: Ensure that cache flush covers all symbol extras Previously part of the last symbol extra wasn't covered. Differential Revision: https://phabricator.haskell.org/D1728 (cherry picked from commit 0490fede24b4fc5d5d1b23e9a47899e50b14988c) >--------------------------------------------------------------- 7d2f41c093c09bdb66ff4c18b811bf75ef31aee5 rts/Linker.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rts/Linker.c b/rts/Linker.c index cb90c97..82e00e1 100644 --- a/rts/Linker.c +++ b/rts/Linker.c @@ -2758,7 +2758,9 @@ ocFlushInstructionCache( ObjectCode *oc ) } // Jump islands - __clear_cache(oc->symbol_extras, &oc->symbol_extras[oc->n_symbol_extras]); + // Note the (+1) to ensure that the last symbol extra is covered by the + // flush. + __clear_cache(oc->symbol_extras, &oc->symbol_extras[oc->n_symbol_extras+1]); } #endif From git at git.haskell.org Sun Jan 3 20:08:30 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 3 Jan 2016 20:08:30 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Linker: Make debugging output a bit more readable (e32765b) Message-ID: <20160103200830.C246C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/e32765bf15018b21a36839da95c24d2c11ecef70/ghc >--------------------------------------------------------------- commit e32765bf15018b21a36839da95c24d2c11ecef70 Author: Ben Gamari Date: Sun Jan 3 13:31:20 2016 +0100 Linker: Make debugging output a bit more readable Differential Revision: https://phabricator.haskell.org/D1728 (cherry picked from commit 48e0f9cb8ca8ff180d732d1b46f31132f5e1de97) >--------------------------------------------------------------- e32765bf15018b21a36839da95c24d2c11ecef70 rts/Linker.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rts/Linker.c b/rts/Linker.c index f5ffa92..c5781eeff 100644 --- a/rts/Linker.c +++ b/rts/Linker.c @@ -5032,7 +5032,7 @@ do_Elf_Rel_relocations ( ObjectCode* oc, char* ehdrC, int is_target_thm=0, T=0; #endif - IF_DEBUG(linker,debugBelch( "Rel entry %3d is raw(%6p %6p)", + IF_DEBUG(linker,debugBelch( "Rel entry %3d is raw(%6p %6p): ", j, (void*)offset, (void*)info )); if (!info) { IF_DEBUG(linker,debugBelch( " ZERO" )); From git at git.haskell.org Sun Jan 3 20:08:33 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 3 Jan 2016 20:08:33 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Linker: Use contiguous mmapping on ARM (266bc33) Message-ID: <20160103200833.6CEBE3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/266bc33cc6ac7c328ae3847e23df8681d8172d0a/ghc >--------------------------------------------------------------- commit 266bc33cc6ac7c328ae3847e23df8681d8172d0a Author: Ben Gamari Date: Sun Jan 3 13:21:39 2016 +0100 Linker: Use contiguous mmapping on ARM ARM has a 24-bit relative jump offset just like PowerPC. Ensure that symbols don't get too far from their symbol extras. See #11340. Differential Revision: https://phabricator.haskell.org/D1728 (cherry picked from commit 07d127ad23c7e6056471d218adcc8ec5119fac6c) >--------------------------------------------------------------- 266bc33cc6ac7c328ae3847e23df8681d8172d0a rts/Linker.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/rts/Linker.c b/rts/Linker.c index c5781eeff..e6f63cb 100644 --- a/rts/Linker.c +++ b/rts/Linker.c @@ -79,10 +79,18 @@ #endif -/* PowerPC has relative branch instructions with only 24 bit displacements - * and therefore needs jump islands contiguous with each object code module. +/* PowerPC and ARM have relative branch instructions with only 24 bit + * displacements and therefore need jump islands contiguous with each object + * code module. */ -#if (USE_MMAP && defined(powerpc_HOST_ARCH) && defined(linux_HOST_OS)) +#if defined(powerpc_HOST_ARCH) +#define SHORT_REL_BRANCH 1 +#endif +#if defined(arm_HOST_ARCH) +#define SHORT_REL_BRANCH 1 +#endif + +#if (USE_MMAP && defined(SHORT_REL_BRANCH) && defined(linux_HOST_OS)) #define USE_CONTIGUOUS_MMAP 1 #else #define USE_CONTIGUOUS_MMAP 0 From git at git.haskell.org Sun Jan 3 20:08:36 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 3 Jan 2016 20:08:36 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Linker: ARM: Refactor relocation handling (e042582) Message-ID: <20160103200836.13A623A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/e042582aa2cf03439456c10fb541acdd590069a0/ghc >--------------------------------------------------------------- commit e042582aa2cf03439456c10fb541acdd590069a0 Author: Ben Gamari Date: Sun Jan 3 13:27:58 2016 +0100 Linker: ARM: Refactor relocation handling This refactors handling of R_ARM_CALL, R_ARM_JUMP24, R_ARM_MOVW_NC, and R_ARM_MOVT relocations to follow the LLVM LLD implementation. The "ELF for ARM" specification is (like most documents of this type, sadly) a bit vague in some areas, so it seems safest to follow the behavior of a trusted implementation like LLD, which is remarkable in its clarity.. Moreover, we now throw a proper error message when a jump to a symbol extra is out of range. This is great improvement over the previous behavior, which ended in a segfault. See #11340. Differential Revision: https://phabricator.haskell.org/D1728 (cherry picked from commit d159a51bb0f26aa232432987e88499109002b3f7) >--------------------------------------------------------------- e042582aa2cf03439456c10fb541acdd590069a0 rts/Linker.c | 93 +++++++++++++++++++++++++++++++++++------------------------- 1 file changed, 54 insertions(+), 39 deletions(-) diff --git a/rts/Linker.c b/rts/Linker.c index 82e00e1..f5ffa92 100644 --- a/rts/Linker.c +++ b/rts/Linker.c @@ -2742,6 +2742,17 @@ static int ocAllocateSymbolExtras( ObjectCode* oc, int count, int first ) #endif #endif // NEED_SYMBOL_EXTRAS +// Signed extend a number to a 32-bit int. +static inline StgInt32 sign_extend32(nat bits, StgWord32 x) { + return ((StgInt32) (x << (32 - bits))) >> (32 - bits); +} + +// Does the given signed integer fit into the given bit width? +static inline StgBool is_int(nat bits, StgInt32 x) { + return bits > 32 || (-(1 << (bits-1)) <= x + && x < (1 << (bits-1))); +} + #if defined(arm_HOST_ARCH) static void @@ -5068,15 +5079,16 @@ do_Elf_Rel_relocations ( ObjectCode* oc, char* ehdrC, #endif } - IF_DEBUG(linker,debugBelch( "Reloc: P = %p S = %p A = %p\n", - (void*)P, (void*)S, (void*)A )); + int reloc_type = ELF_R_TYPE(info); + IF_DEBUG(linker,debugBelch( "Reloc: P = %p S = %p A = %p type=%d\n", + (void*)P, (void*)S, (void*)A, reloc_type )); checkProddableBlock ( oc, pP, sizeof(Elf_Word) ); #ifdef i386_HOST_ARCH value = S + A; #endif - switch (ELF_R_TYPE(info)) { + switch (reloc_type) { # ifdef i386_HOST_ARCH case R_386_32: *pP = value; break; case R_386_PC32: *pP = value - P; break; @@ -5098,44 +5110,50 @@ do_Elf_Rel_relocations ( ObjectCode* oc, char* ehdrC, case R_ARM_CALL: case R_ARM_JUMP24: { + // N.B. LLVM's LLD linker's relocation implement is a fantastic + // resource StgWord32 *word = (StgWord32 *)P; - StgInt32 imm = (*word & 0x00ffffff) << 2; - StgInt32 offset; - int overflow; + StgInt32 imm = (*word & ((1<<24)-1)) << 2; - // Sign extend 24 to 32 bits - if (imm & 0x02000000) - imm -= 0x04000000; - offset = ((S + imm) | T) - P; + const StgBool is_blx = (*word & 0xf0000000) == 0xf0000000; + const StgWord32 hBit = is_blx ? ((*word >> 24) & 1) : 0; + imm |= hBit << 1; - overflow = offset <= (StgInt32)0xfe000000 || offset >= (StgInt32)0x02000000; + // Sign extend to 32 bits + // I would have thought this would be 24 bits but LLD uses 26 here. + // Hmm. + imm = sign_extend32(26, imm); + StgWord32 result = ((S + imm) | T) - P; + + const StgBool overflow = !is_int(26, (StgInt32) result); + + // Handle overflow and Thumb interworking if ((is_target_thm && ELF_R_TYPE(info) == R_ARM_JUMP24) || overflow) { // Generate veneer // The +8 below is to undo the PC-bias compensation done by the object producer SymbolExtra *extra = makeArmSymbolExtra(oc, ELF_R_SYM(info), S+imm+8, 0, is_target_thm); // The -8 below is to compensate for PC bias - offset = (StgWord32) &extra->jumpIsland - P - 8; - offset &= ~1; // Clear thumb indicator bit - } else if (is_target_thm && ELF_R_TYPE(info) == R_ARM_CALL) { - StgWord32 cond = (*word & 0xf0000000) >> 28; - if (cond == 0xe) { - // Change instruction to BLX - *word |= 0xf0000000; // Set first nibble - *word = (*word & ~0x01ffffff) - | ((offset >> 2) & 0x00ffffff) // imm24 - | ((offset & 0x2) << 23); // H - break; - } else { - errorBelch("%s: Can't transition from ARM to Thumb when cond != 0xe\n", - oc->fileName); + result = (StgWord32) ((StgInt32) extra->jumpIsland - P - 8); + result &= ~1; // Clear thumb indicator bit + if (!is_int(26, (StgInt32) result)) { + errorBelch("Unable to fixup overflow'd R_ARM_CALL: jump island=%p, reloc=%p\n", + (void*) extra->jumpIsland, (void*) P); return 0; } } - offset >>= 2; + const StgWord32 imm24 = (result & 0x03fffffc) >> 2; *word = (*word & ~0x00ffffff) - | (offset & 0x00ffffff); + | (imm24 & 0x00ffffff); + + const StgBool switch_mode = is_target_thm && (reloc_type == R_ARM_CALL); + if (switch_mode) { + const StgWord32 hBit = (result & 0x2) >> 1; + // Change instruction to BLX + *word = (*word & ~0xFF000000) | ((0xfa | hBit) << 24); + IF_DEBUG(linker, debugBelch("Changed BL to BLX at %p\n", word)); + } break; } @@ -5143,20 +5161,17 @@ do_Elf_Rel_relocations ( ObjectCode* oc, char* ehdrC, case R_ARM_MOVW_ABS_NC: { StgWord32 *word = (StgWord32 *)P; - StgInt32 offset = ((*word & 0xf0000) >> 4) - | (*word & 0xfff); - // Sign extend from 16 to 32 bits - offset = (offset ^ 0x8000) - 0x8000; + StgWord32 imm12 = *word & 0xfff; + StgWord32 imm4 = (*word >> 16) & 0xf; + StgInt32 offset = imm4 << 12 | imm12; + StgWord32 result = (S + offset) | T; - offset += S; - if (ELF_R_TYPE(info) == R_ARM_MOVT_ABS) - offset >>= 16; - else - offset |= T; + if (reloc_type == R_ARM_MOVT_ABS) + result = (result & 0xffff0000) >> 16; - *word = (*word & 0xfff0f000) - | ((offset & 0xf000) << 4) - | (offset & 0x0fff); + StgWord32 result12 = result & 0xfff; + StgWord32 result4 = (result >> 12) & 0xf; + *word = (*word & ~0xf0fff) | (result4 << 16) | result12; break; } From git at git.haskell.org Sun Jan 3 22:06:49 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 3 Jan 2016 22:06:49 +0000 (UTC) Subject: [commit: ghc] wip/gadtpm: Avoid generating guards for CoPats if possible (Addresses #11276) (1a2a754) Message-ID: <20160103220649.935873A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/gadtpm Link : http://ghc.haskell.org/trac/ghc/changeset/1a2a75471bb0df5df1b7d5e37aa0de85662ce1f0/ghc >--------------------------------------------------------------- commit 1a2a75471bb0df5df1b7d5e37aa0de85662ce1f0 Author: George Karachalias Date: Sun Jan 3 23:05:55 2016 +0100 Avoid generating guards for CoPats if possible (Addresses #11276) >--------------------------------------------------------------- 1a2a75471bb0df5df1b7d5e37aa0de85662ce1f0 compiler/deSugar/Check.hs | 29 +++++- testsuite/tests/pmcheck/should_compile/T11276.hs | 107 +++++++++++++++++++++ .../tests/pmcheck/should_compile/T11276.stderr | 0 testsuite/tests/pmcheck/should_compile/all.T | 1 + 4 files changed, 132 insertions(+), 5 deletions(-) diff --git a/compiler/deSugar/Check.hs b/compiler/deSugar/Check.hs index fd0c6e0..5d8a171 100644 --- a/compiler/deSugar/Check.hs +++ b/compiler/deSugar/Check.hs @@ -52,6 +52,8 @@ import DsGRHSs -- isTrueLHsExpr import Data.List -- find import Data.Maybe -- isNothing, isJust, fromJust import Control.Monad -- liftM3, forM +import Coercion +import TcEvidence {- This module checks pattern matches for: @@ -281,11 +283,15 @@ translatePat pat = case pat of SigPatOut p _ty -> translatePat (unLoc p) - CoPat wrapper p ty -> do - ps <- translatePat p - (xp,xe) <- mkPmId2FormsSM ty - let g = mkGuard ps (HsWrap wrapper (unLoc xe)) - return [xp,g] + -- See Note [Translate CoPats] + CoPat wrapper p ty + | isIdHsWrapper wrapper -> translatePat p + | WpCast co <- wrapper, isReflexiveCo co -> translatePat p + | otherwise -> do + ps <- translatePat p + (xp,xe) <- mkPmId2FormsSM ty + let g = mkGuard ps (HsWrap wrapper (unLoc xe)) + return [xp,g] -- (n + k) ===> x (True <- x >= k) (n <- x-k) NPlusKPat (L _ n) k ge minus -> do @@ -616,6 +622,19 @@ Additionally, top-level guard translation (performed by @translateGuards@) replaces guards that cannot be reasoned about (like the ones we described in 1-4) with a single @fake_pat@ to record the possibility of failure to match. +Note [Translate CoPats] +~~~~~~~~~~~~~~~~~~~~~~~ +The pattern match checker did not know how to handle coerced patterns `CoPat` +efficiently, which gave rise to #11276. The original approach translated +`CoPat`s: + + pat |> co ===> x (pat <- (e |> co)) + +Instead, we now check whether the coercion is a hole or if it is just refl, in +which case we can drop it. Unfortunately, data families generate useful +coercions so guards are still generated in these cases and checking data +families is not really efficient. + %************************************************************************ %* * Main Pattern Matching Check diff --git a/testsuite/tests/pmcheck/should_compile/T11276.hs b/testsuite/tests/pmcheck/should_compile/T11276.hs new file mode 100644 index 0000000..c6ca650 --- /dev/null +++ b/testsuite/tests/pmcheck/should_compile/T11276.hs @@ -0,0 +1,107 @@ + +{-# LANGUAGE RankNTypes #-} +module Hang where +import Control.Monad +import Data.Char + +data Event + = EventBeginDocument + | EventEndDocument + | EventBeginDoctype + | EventEndDoctype + | EventInstruction + | EventBeginElement + | EventEndElement + | EventContent Content + | EventComment + | EventCDATA + +data Content + = ContentText String + | ContentEntity String + + +peek :: Monad m => Consumer a m (Maybe a) +peek = undefined + +type Consumer i m r = forall o. ConduitM i o m r + +tag :: forall m a b c o . Monad m => + ConduitM Event o m (Maybe c) +tag = do + _ <- dropWS + return undefined + where +-- Add this and it works +-- dropWS :: Monad m => ConduitM Event o m (Maybe Event) + dropWS = do +-- Swap these two lines and it works + -- let x = undefined + x <- peek + let isWS = + case x of + -- Remove some of these and it works + Just EventBeginDocument -> True + Just EventEndDocument -> True + Just EventBeginDoctype{} -> True + Just EventEndDoctype -> True + Just EventInstruction{} -> True + Just EventBeginElement{} -> False + Just EventEndElement{} -> False + Just (EventContent (ContentText t)) + | all isSpace t -> True + | otherwise -> False + Just (EventContent ContentEntity{}) -> False + Just EventComment{} -> True + Just EventCDATA{} -> False + Nothing -> False + if isWS then dropWS else return x + + +-- Inlined Instances + +instance Functor (ConduitM i o m) where + fmap f (ConduitM c) = ConduitM $ \rest -> c (rest . f) + +instance Applicative (ConduitM i o m) where + pure x = ConduitM ($ x) + {-# INLINE pure #-} + (<*>) = ap + {-# INLINE (<*>) #-} + +instance Monad (ConduitM i o m) where + return = pure + ConduitM f >>= g = ConduitM $ \h -> f $ \a -> unConduitM (g a) h + +instance Monad m => Functor (Pipe l i o u m) where + fmap = liftM + {-# INLINE fmap #-} + +instance Monad m => Applicative (Pipe l i o u m) where + pure = Done + {-# INLINE pure #-} + (<*>) = ap + {-# INLINE (<*>) #-} + +instance Monad m => Monad (Pipe l i o u m) where + return = pure + {-# INLINE return #-} + + HaveOutput p c o >>= fp = HaveOutput (p >>= fp) c o + NeedInput p c >>= fp = NeedInput (p >=> fp) (c >=> fp) + Done x >>= fp = fp x + PipeM mp >>= fp = PipeM ((>>= fp) `liftM` mp) + Leftover p i >>= fp = Leftover (p >>= fp) i + +newtype ConduitM i o m r = ConduitM + { unConduitM :: forall b. + (r -> Pipe i i o () m b) -> Pipe i i o () m b + } + +data Pipe l i o u m r = + HaveOutput (Pipe l i o u m r) (m ()) o + | NeedInput (i -> Pipe l i o u m r) (u -> Pipe l i o u m r) + | Done r + | PipeM (m (Pipe l i o u m r)) + | Leftover (Pipe l i o u m r) l + diff --git a/libraries/base/tests/IO/misc001.stdout b/testsuite/tests/pmcheck/should_compile/T11276.stderr similarity index 100% copy from libraries/base/tests/IO/misc001.stdout copy to testsuite/tests/pmcheck/should_compile/T11276.stderr diff --git a/testsuite/tests/pmcheck/should_compile/all.T b/testsuite/tests/pmcheck/should_compile/all.T index 292e9af..1f487ee 100644 --- a/testsuite/tests/pmcheck/should_compile/all.T +++ b/testsuite/tests/pmcheck/should_compile/all.T @@ -23,6 +23,7 @@ test('T8970', only_compiler_types(['ghc']), compile, ['-fwarn-incomplete-pattern test('T9951b',only_compiler_types(['ghc']), compile, ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns']) test('T9951', only_compiler_types(['ghc']), compile, ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns']) test('T11303', normal, compile, ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns +RTS -M1G -RTS']) +test('T11276', normal, compile, ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns']) # Other tests test('pmc001', only_compiler_types(['ghc']), compile, ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns']) From git at git.haskell.org Sun Jan 3 22:06:51 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 3 Jan 2016 22:06:51 +0000 (UTC) Subject: [commit: ghc] wip/gadtpm's head updated: Avoid generating guards for CoPats if possible (Addresses #11276) (1a2a754) Message-ID: <20160103220651.F1D9D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Branch 'wip/gadtpm' now includes: 7fef7fe drop obsolete/redundant OPTIONS pragma [skip ci] af92ef3 ghc/Main: Update list of --print modes 4f69203 Fix panic when using pattern synonyms with DisambiguateRecordFields 5bb7fec Export some useful GHC API functions. 8e735fd Fix GEq1 when optimizations are enabled 2e49c8c users_guide: Move 7.12.1-notes to 8.0.1-notes 9cb79c5 Update a few references to GHC 7.12 b093e63 Modify getFullArgs to include program name df6cb57 Accept submodule libraries/primitive commit 1af89788d fcc7649 Introduce negative patterns for literals (addresses #11303) a1e01b6 testlib: Make TyCon normalization Python 2.6-compatible adcbc98 Add regression test for #11303 e4cc19d Update Cabal submodule to latest snapshot c6cab9d Remove `cabal07`-test broken by e4cc19de4bdbcc 34af60c testsuite: normalise away `ld`-warning on AIX c06b46d Fix #11305. 8fcf1e7 Make iserv-bin compatible with GHC version bump to 8.0 07779c2 T11303: Set maximum heap size 630303a users_guide/ghci: Fix heading 3bbc01a Testsuite: mark T7653 with high_memory_usage b0fa286 Fix some typos e9ab6d5 rts/PrimOps.cmm: fix UNREG profiled build d3a79bc rts/Linker.c: mark ia64 as 64-bit ELF, drop unused branches 0380a95 glasgow_exts.rst: fix code block 947c8a5 Bump GHC HEAD's Version from 7.11 to 8.1 bb7f2e3 Address #11245: Ensure the non-matched list is always non-empty 25e4556 Various API Annotations fixes 75851bf fix ghci build on ArchUnknown targets 0579fe9 Improve exprIsBottom 5ba3caa Comments only 70eefbc Test Trac #11245 351dea4 Drop redundant `-D__GLASGOW_HASKELL__=...` flag eae40e1 Use 0/1 instead of YES/NO as `__GLASGOW_HASKELL_TH__` macro value 0d20737 Drop redundant/explicit `=1` in `-DFOO=1` flags 2f923ce Drop pre-AMP compatibility CPP conditionals 3c8cb7f Remove some redundant definitions/constraints 12ee511 Remove ghc-7.8 `-package-name`-compat handling 37945c1 Simplify -fcmm-sink handling for Parser.hs 6a010b9 Update haskeline submodule to latest snapshot 8afeaad travis: use GHC 7.10.3 dafeb51 Canonicalise `MonadPlus` instances b469b30 Minor fix of MonadFail instance for `ReadPrec` ab0d733 Update Cabal submodule, Fixes #11326 f3cc345 Add strictness for runRW# 0b8dc7d API Annotations: AnnTilde missing 78daabc mk/config.mk.in: drop unused CONF_CC_OPTS for ia64 f5ad1f0 AnnDotDot missing for Pattern Synonym export 256c2cf Test Trac #11336 0490fed Linker: ARM: Ensure that cache flush covers all symbol extras d159a51 Linker: ARM: Refactor relocation handling 48e0f9c Linker: Make debugging output a bit more readable 07d127a Linker: Use contiguous mmapping on ARM 1a2a754 Avoid generating guards for CoPats if possible (Addresses #11276) From git at git.haskell.org Sun Jan 3 22:17:39 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 3 Jan 2016 22:17:39 +0000 (UTC) Subject: [commit: ghc] wip/gadtpm: Avoid generating guards for CoPats if possible (Addresses #11276) (42c5a13) Message-ID: <20160103221739.F33EC3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/gadtpm Link : http://ghc.haskell.org/trac/ghc/changeset/42c5a13d6c66ab2cf1133a103f192bf7c2c68efa/ghc >--------------------------------------------------------------- commit 42c5a13d6c66ab2cf1133a103f192bf7c2c68efa Author: George Karachalias Date: Sun Jan 3 23:18:05 2016 +0100 Avoid generating guards for CoPats if possible (Addresses #11276) >--------------------------------------------------------------- 42c5a13d6c66ab2cf1133a103f192bf7c2c68efa compiler/deSugar/Check.hs | 29 +++++- testsuite/tests/pmcheck/should_compile/T11276.hs | 105 +++++++++++++++++++++ .../tests/pmcheck/should_compile/T11276.stderr | 0 testsuite/tests/pmcheck/should_compile/all.T | 1 + 4 files changed, 130 insertions(+), 5 deletions(-) diff --git a/compiler/deSugar/Check.hs b/compiler/deSugar/Check.hs index fd0c6e0..5d8a171 100644 --- a/compiler/deSugar/Check.hs +++ b/compiler/deSugar/Check.hs @@ -52,6 +52,8 @@ import DsGRHSs -- isTrueLHsExpr import Data.List -- find import Data.Maybe -- isNothing, isJust, fromJust import Control.Monad -- liftM3, forM +import Coercion +import TcEvidence {- This module checks pattern matches for: @@ -281,11 +283,15 @@ translatePat pat = case pat of SigPatOut p _ty -> translatePat (unLoc p) - CoPat wrapper p ty -> do - ps <- translatePat p - (xp,xe) <- mkPmId2FormsSM ty - let g = mkGuard ps (HsWrap wrapper (unLoc xe)) - return [xp,g] + -- See Note [Translate CoPats] + CoPat wrapper p ty + | isIdHsWrapper wrapper -> translatePat p + | WpCast co <- wrapper, isReflexiveCo co -> translatePat p + | otherwise -> do + ps <- translatePat p + (xp,xe) <- mkPmId2FormsSM ty + let g = mkGuard ps (HsWrap wrapper (unLoc xe)) + return [xp,g] -- (n + k) ===> x (True <- x >= k) (n <- x-k) NPlusKPat (L _ n) k ge minus -> do @@ -616,6 +622,19 @@ Additionally, top-level guard translation (performed by @translateGuards@) replaces guards that cannot be reasoned about (like the ones we described in 1-4) with a single @fake_pat@ to record the possibility of failure to match. +Note [Translate CoPats] +~~~~~~~~~~~~~~~~~~~~~~~ +The pattern match checker did not know how to handle coerced patterns `CoPat` +efficiently, which gave rise to #11276. The original approach translated +`CoPat`s: + + pat |> co ===> x (pat <- (e |> co)) + +Instead, we now check whether the coercion is a hole or if it is just refl, in +which case we can drop it. Unfortunately, data families generate useful +coercions so guards are still generated in these cases and checking data +families is not really efficient. + %************************************************************************ %* * Main Pattern Matching Check diff --git a/testsuite/tests/pmcheck/should_compile/T11276.hs b/testsuite/tests/pmcheck/should_compile/T11276.hs new file mode 100644 index 0000000..16e0155 --- /dev/null +++ b/testsuite/tests/pmcheck/should_compile/T11276.hs @@ -0,0 +1,105 @@ +{-# LANGUAGE RankNTypes #-} +module Hang where +import Control.Monad +import Data.Char + +data Event + = EventBeginDocument + | EventEndDocument + | EventBeginDoctype + | EventEndDoctype + | EventInstruction + | EventBeginElement + | EventEndElement + | EventContent Content + | EventComment + | EventCDATA + +data Content + = ContentText String + | ContentEntity String + + +peek :: Monad m => Consumer a m (Maybe a) +peek = undefined + +type Consumer i m r = forall o. ConduitM i o m r + +tag :: forall m a b c o . Monad m => + ConduitM Event o m (Maybe c) +tag = do + _ <- dropWS + return undefined + where +-- Add this and it works +-- dropWS :: Monad m => ConduitM Event o m (Maybe Event) + dropWS = do +-- Swap these two lines and it works + -- let x = undefined + x <- peek + let isWS = + case x of + -- Remove some of these and it works + Just EventBeginDocument -> True + Just EventEndDocument -> True + Just EventBeginDoctype{} -> True + Just EventEndDoctype -> True + Just EventInstruction{} -> True + Just EventBeginElement{} -> False + Just EventEndElement{} -> False + Just (EventContent (ContentText t)) + | all isSpace t -> True + | otherwise -> False + Just (EventContent ContentEntity{}) -> False + Just EventComment{} -> True + Just EventCDATA{} -> False + Nothing -> False + if isWS then dropWS else return x + + +-- Inlined Instances + +instance Functor (ConduitM i o m) where + fmap f (ConduitM c) = ConduitM $ \rest -> c (rest . f) + +instance Applicative (ConduitM i o m) where + pure x = ConduitM ($ x) + {-# INLINE pure #-} + (<*>) = ap + {-# INLINE (<*>) #-} + +instance Monad (ConduitM i o m) where + return = pure + ConduitM f >>= g = ConduitM $ \h -> f $ \a -> unConduitM (g a) h + +instance Monad m => Functor (Pipe l i o u m) where + fmap = liftM + {-# INLINE fmap #-} + +instance Monad m => Applicative (Pipe l i o u m) where + pure = Done + {-# INLINE pure #-} + (<*>) = ap + {-# INLINE (<*>) #-} + +instance Monad m => Monad (Pipe l i o u m) where + return = pure + {-# INLINE return #-} + + HaveOutput p c o >>= fp = HaveOutput (p >>= fp) c o + NeedInput p c >>= fp = NeedInput (p >=> fp) (c >=> fp) + Done x >>= fp = fp x + PipeM mp >>= fp = PipeM ((>>= fp) `liftM` mp) + Leftover p i >>= fp = Leftover (p >>= fp) i + +newtype ConduitM i o m r = ConduitM + { unConduitM :: forall b. + (r -> Pipe i i o () m b) -> Pipe i i o () m b + } + +data Pipe l i o u m r = + HaveOutput (Pipe l i o u m r) (m ()) o + | NeedInput (i -> Pipe l i o u m r) (u -> Pipe l i o u m r) + | Done r + | PipeM (m (Pipe l i o u m r)) + | Leftover (Pipe l i o u m r) l diff --git a/libraries/base/tests/IO/misc001.stdout b/testsuite/tests/pmcheck/should_compile/T11276.stderr similarity index 100% copy from libraries/base/tests/IO/misc001.stdout copy to testsuite/tests/pmcheck/should_compile/T11276.stderr diff --git a/testsuite/tests/pmcheck/should_compile/all.T b/testsuite/tests/pmcheck/should_compile/all.T index 292e9af..1f487ee 100644 --- a/testsuite/tests/pmcheck/should_compile/all.T +++ b/testsuite/tests/pmcheck/should_compile/all.T @@ -23,6 +23,7 @@ test('T8970', only_compiler_types(['ghc']), compile, ['-fwarn-incomplete-pattern test('T9951b',only_compiler_types(['ghc']), compile, ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns']) test('T9951', only_compiler_types(['ghc']), compile, ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns']) test('T11303', normal, compile, ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns +RTS -M1G -RTS']) +test('T11276', normal, compile, ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns']) # Other tests test('pmc001', only_compiler_types(['ghc']), compile, ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns']) From git at git.haskell.org Mon Jan 4 00:38:44 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 4 Jan 2016 00:38:44 +0000 (UTC) Subject: [commit: ghc] master: Omit TEST=T10697_decided_3 WAY=ghci (d935d20) Message-ID: <20160104003844.C63AD3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d935d20988af7f3109b73d7c51a0e4a6b12b926c/ghc >--------------------------------------------------------------- commit d935d20988af7f3109b73d7c51a0e4a6b12b926c Author: Thomas Miedema Date: Fri Jan 1 12:46:37 2016 +0100 Omit TEST=T10697_decided_3 WAY=ghci >--------------------------------------------------------------- d935d20988af7f3109b73d7c51a0e4a6b12b926c testsuite/tests/th/all.T | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index 549737b..f7aedd1 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -363,7 +363,7 @@ test('T10620', normal, compile_and_run, ['-v0']) test('T10638', normal, compile_fail, ['-v0']) test('T10697_decided_1', normal, compile_and_run, ['-v0']) test('T10697_decided_2', normal, compile_and_run, ['-XStrictData -v0']) -test('T10697_decided_3', normal, +test('T10697_decided_3', omit_ways(['ghci']), # ghci doesn't support -O(2) compile_and_run, ['-XStrictData -funbox-strict-fields -O2 -v0']) test('T10697_source', From git at git.haskell.org Mon Jan 4 00:38:47 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 4 Jan 2016 00:38:47 +0000 (UTC) Subject: [commit: ghc] master: Add test for #10379 (1dbc8d9) Message-ID: <20160104003847.EB09C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/1dbc8d91b7726a37c693fa769d19782871142b07/ghc >--------------------------------------------------------------- commit 1dbc8d91b7726a37c693fa769d19782871142b07 Author: Thomas Miedema Date: Sun Jan 3 19:57:42 2016 +0100 Add test for #10379 >--------------------------------------------------------------- 1dbc8d91b7726a37c693fa769d19782871142b07 testsuite/tests/parser/should_compile/T10379.hs | 9 +++++++++ testsuite/tests/parser/should_compile/all.T | 1 + 2 files changed, 10 insertions(+) diff --git a/testsuite/tests/parser/should_compile/T10379.hs b/testsuite/tests/parser/should_compile/T10379.hs new file mode 100644 index 0000000..1eb5f96 --- /dev/null +++ b/testsuite/tests/parser/should_compile/T10379.hs @@ -0,0 +1,9 @@ +{-# LANGUAGE KindSignatures, GADTs, DataKinds, TypeOperators #-} +module Foo where + +data Foo1 :: [*] -> * where + +-- ghc <= 7.10 reported (before "Add kind equalities to GHC"): +-- +-- T10379.hs:9:16: parse error on input ?]? +data Foo2 :: ([] *) -> * where diff --git a/testsuite/tests/parser/should_compile/all.T b/testsuite/tests/parser/should_compile/all.T index 9446bf1..6865e70 100644 --- a/testsuite/tests/parser/should_compile/all.T +++ b/testsuite/tests/parser/should_compile/all.T @@ -103,4 +103,5 @@ test('T9723b', normal, compile, ['']) test('T10188', normal, compile, ['']) test('VtaParse', normal, compile, ['']) test('T10196', normal, compile, ['']) +test('T10379', normal, compile, ['']) test('T10582', expect_broken(10582), compile, ['']) From git at git.haskell.org Mon Jan 4 01:15:55 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 4 Jan 2016 01:15:55 +0000 (UTC) Subject: [commit: ghc] master: Linker: ARM: Don't change to BLX if jump needed veneer (04f3524) Message-ID: <20160104011555.B9D1F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/04f3524f787b2cbd3f460e058c753529d3f2f7ac/ghc >--------------------------------------------------------------- commit 04f3524f787b2cbd3f460e058c753529d3f2f7ac Author: Ben Gamari Date: Mon Jan 4 01:39:39 2016 +0100 Linker: ARM: Don't change to BLX if jump needed veneer Since we produce ARM veneer. >--------------------------------------------------------------- 04f3524f787b2cbd3f460e058c753529d3f2f7ac rts/Linker.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rts/Linker.c b/rts/Linker.c index e6f63cb..6561e05 100644 --- a/rts/Linker.c +++ b/rts/Linker.c @@ -5137,7 +5137,8 @@ do_Elf_Rel_relocations ( ObjectCode* oc, char* ehdrC, const StgBool overflow = !is_int(26, (StgInt32) result); // Handle overflow and Thumb interworking - if ((is_target_thm && ELF_R_TYPE(info) == R_ARM_JUMP24) || overflow) { + const StgBool needs_veneer = (is_target_thm && ELF_R_TYPE(info) == R_ARM_JUMP24) || overflow; + if (needs_veneer) { // Generate veneer // The +8 below is to undo the PC-bias compensation done by the object producer SymbolExtra *extra = makeArmSymbolExtra(oc, ELF_R_SYM(info), S+imm+8, 0, is_target_thm); @@ -5151,12 +5152,14 @@ do_Elf_Rel_relocations ( ObjectCode* oc, char* ehdrC, } } + // Update the branch target const StgWord32 imm24 = (result & 0x03fffffc) >> 2; *word = (*word & ~0x00ffffff) | (imm24 & 0x00ffffff); + // Change the relocated branch into a BLX if necessary const StgBool switch_mode = is_target_thm && (reloc_type == R_ARM_CALL); - if (switch_mode) { + if (!needs_veneer && switch_mode) { const StgWord32 hBit = (result & 0x2) >> 1; // Change instruction to BLX *word = (*word & ~0xFF000000) | ((0xfa | hBit) << 24); From git at git.haskell.org Mon Jan 4 01:16:22 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 4 Jan 2016 01:16:22 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Linker: ARM: Don't change to BLX if jump needed veneer (7210976) Message-ID: <20160104011622.3EA903A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/7210976bb2a566c7101ea315630384c3659719ee/ghc >--------------------------------------------------------------- commit 7210976bb2a566c7101ea315630384c3659719ee Author: Ben Gamari Date: Mon Jan 4 01:39:39 2016 +0100 Linker: ARM: Don't change to BLX if jump needed veneer Since we produce ARM veneer. (cherry picked from commit 04f3524f787b2cbd3f460e058c753529d3f2f7ac) >--------------------------------------------------------------- 7210976bb2a566c7101ea315630384c3659719ee rts/Linker.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rts/Linker.c b/rts/Linker.c index e6f63cb..6561e05 100644 --- a/rts/Linker.c +++ b/rts/Linker.c @@ -5137,7 +5137,8 @@ do_Elf_Rel_relocations ( ObjectCode* oc, char* ehdrC, const StgBool overflow = !is_int(26, (StgInt32) result); // Handle overflow and Thumb interworking - if ((is_target_thm && ELF_R_TYPE(info) == R_ARM_JUMP24) || overflow) { + const StgBool needs_veneer = (is_target_thm && ELF_R_TYPE(info) == R_ARM_JUMP24) || overflow; + if (needs_veneer) { // Generate veneer // The +8 below is to undo the PC-bias compensation done by the object producer SymbolExtra *extra = makeArmSymbolExtra(oc, ELF_R_SYM(info), S+imm+8, 0, is_target_thm); @@ -5151,12 +5152,14 @@ do_Elf_Rel_relocations ( ObjectCode* oc, char* ehdrC, } } + // Update the branch target const StgWord32 imm24 = (result & 0x03fffffc) >> 2; *word = (*word & ~0x00ffffff) | (imm24 & 0x00ffffff); + // Change the relocated branch into a BLX if necessary const StgBool switch_mode = is_target_thm && (reloc_type == R_ARM_CALL); - if (switch_mode) { + if (!needs_veneer && switch_mode) { const StgWord32 hBit = (result & 0x2) >> 1; // Change instruction to BLX *word = (*word & ~0xFF000000) | ((0xfa | hBit) << 24); From git at git.haskell.org Mon Jan 4 09:19:06 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 4 Jan 2016 09:19:06 +0000 (UTC) Subject: [commit: ghc] wip/gadtpm: Avoid generating guards for CoPats if possible (Addresses #11276) (80d319d) Message-ID: <20160104091906.0EC7F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/gadtpm Link : http://ghc.haskell.org/trac/ghc/changeset/80d319dfbfca9ea42376a1e7cc1354f2abcb0d8d/ghc >--------------------------------------------------------------- commit 80d319dfbfca9ea42376a1e7cc1354f2abcb0d8d Author: George Karachalias Date: Sun Jan 3 23:18:05 2016 +0100 Avoid generating guards for CoPats if possible (Addresses #11276) Summary: When translating a `CoPat` to `PmPat` check whether the wrapper is just a hole or a cast with refl. In these cases we can safely drop the wrapper and generate less guard patterns. Fixes T11276. Test Plan: validate Reviewers: bgamari, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1729 GHC Trac Issues: #11276 >--------------------------------------------------------------- 80d319dfbfca9ea42376a1e7cc1354f2abcb0d8d compiler/deSugar/Check.hs | 29 +++++- testsuite/tests/pmcheck/should_compile/T11276.hs | 105 +++++++++++++++++++++ .../tests/pmcheck/should_compile/T11276.stderr | 0 testsuite/tests/pmcheck/should_compile/all.T | 1 + 4 files changed, 130 insertions(+), 5 deletions(-) diff --git a/compiler/deSugar/Check.hs b/compiler/deSugar/Check.hs index fd0c6e0..5d8a171 100644 --- a/compiler/deSugar/Check.hs +++ b/compiler/deSugar/Check.hs @@ -52,6 +52,8 @@ import DsGRHSs -- isTrueLHsExpr import Data.List -- find import Data.Maybe -- isNothing, isJust, fromJust import Control.Monad -- liftM3, forM +import Coercion +import TcEvidence {- This module checks pattern matches for: @@ -281,11 +283,15 @@ translatePat pat = case pat of SigPatOut p _ty -> translatePat (unLoc p) - CoPat wrapper p ty -> do - ps <- translatePat p - (xp,xe) <- mkPmId2FormsSM ty - let g = mkGuard ps (HsWrap wrapper (unLoc xe)) - return [xp,g] + -- See Note [Translate CoPats] + CoPat wrapper p ty + | isIdHsWrapper wrapper -> translatePat p + | WpCast co <- wrapper, isReflexiveCo co -> translatePat p + | otherwise -> do + ps <- translatePat p + (xp,xe) <- mkPmId2FormsSM ty + let g = mkGuard ps (HsWrap wrapper (unLoc xe)) + return [xp,g] -- (n + k) ===> x (True <- x >= k) (n <- x-k) NPlusKPat (L _ n) k ge minus -> do @@ -616,6 +622,19 @@ Additionally, top-level guard translation (performed by @translateGuards@) replaces guards that cannot be reasoned about (like the ones we described in 1-4) with a single @fake_pat@ to record the possibility of failure to match. +Note [Translate CoPats] +~~~~~~~~~~~~~~~~~~~~~~~ +The pattern match checker did not know how to handle coerced patterns `CoPat` +efficiently, which gave rise to #11276. The original approach translated +`CoPat`s: + + pat |> co ===> x (pat <- (e |> co)) + +Instead, we now check whether the coercion is a hole or if it is just refl, in +which case we can drop it. Unfortunately, data families generate useful +coercions so guards are still generated in these cases and checking data +families is not really efficient. + %************************************************************************ %* * Main Pattern Matching Check diff --git a/testsuite/tests/pmcheck/should_compile/T11276.hs b/testsuite/tests/pmcheck/should_compile/T11276.hs new file mode 100644 index 0000000..16e0155 --- /dev/null +++ b/testsuite/tests/pmcheck/should_compile/T11276.hs @@ -0,0 +1,105 @@ +{-# LANGUAGE RankNTypes #-} +module Hang where +import Control.Monad +import Data.Char + +data Event + = EventBeginDocument + | EventEndDocument + | EventBeginDoctype + | EventEndDoctype + | EventInstruction + | EventBeginElement + | EventEndElement + | EventContent Content + | EventComment + | EventCDATA + +data Content + = ContentText String + | ContentEntity String + + +peek :: Monad m => Consumer a m (Maybe a) +peek = undefined + +type Consumer i m r = forall o. ConduitM i o m r + +tag :: forall m a b c o . Monad m => + ConduitM Event o m (Maybe c) +tag = do + _ <- dropWS + return undefined + where +-- Add this and it works +-- dropWS :: Monad m => ConduitM Event o m (Maybe Event) + dropWS = do +-- Swap these two lines and it works + -- let x = undefined + x <- peek + let isWS = + case x of + -- Remove some of these and it works + Just EventBeginDocument -> True + Just EventEndDocument -> True + Just EventBeginDoctype{} -> True + Just EventEndDoctype -> True + Just EventInstruction{} -> True + Just EventBeginElement{} -> False + Just EventEndElement{} -> False + Just (EventContent (ContentText t)) + | all isSpace t -> True + | otherwise -> False + Just (EventContent ContentEntity{}) -> False + Just EventComment{} -> True + Just EventCDATA{} -> False + Nothing -> False + if isWS then dropWS else return x + + +-- Inlined Instances + +instance Functor (ConduitM i o m) where + fmap f (ConduitM c) = ConduitM $ \rest -> c (rest . f) + +instance Applicative (ConduitM i o m) where + pure x = ConduitM ($ x) + {-# INLINE pure #-} + (<*>) = ap + {-# INLINE (<*>) #-} + +instance Monad (ConduitM i o m) where + return = pure + ConduitM f >>= g = ConduitM $ \h -> f $ \a -> unConduitM (g a) h + +instance Monad m => Functor (Pipe l i o u m) where + fmap = liftM + {-# INLINE fmap #-} + +instance Monad m => Applicative (Pipe l i o u m) where + pure = Done + {-# INLINE pure #-} + (<*>) = ap + {-# INLINE (<*>) #-} + +instance Monad m => Monad (Pipe l i o u m) where + return = pure + {-# INLINE return #-} + + HaveOutput p c o >>= fp = HaveOutput (p >>= fp) c o + NeedInput p c >>= fp = NeedInput (p >=> fp) (c >=> fp) + Done x >>= fp = fp x + PipeM mp >>= fp = PipeM ((>>= fp) `liftM` mp) + Leftover p i >>= fp = Leftover (p >>= fp) i + +newtype ConduitM i o m r = ConduitM + { unConduitM :: forall b. + (r -> Pipe i i o () m b) -> Pipe i i o () m b + } + +data Pipe l i o u m r = + HaveOutput (Pipe l i o u m r) (m ()) o + | NeedInput (i -> Pipe l i o u m r) (u -> Pipe l i o u m r) + | Done r + | PipeM (m (Pipe l i o u m r)) + | Leftover (Pipe l i o u m r) l diff --git a/libraries/base/tests/IO/misc001.stdout b/testsuite/tests/pmcheck/should_compile/T11276.stderr similarity index 100% copy from libraries/base/tests/IO/misc001.stdout copy to testsuite/tests/pmcheck/should_compile/T11276.stderr diff --git a/testsuite/tests/pmcheck/should_compile/all.T b/testsuite/tests/pmcheck/should_compile/all.T index 292e9af..1f487ee 100644 --- a/testsuite/tests/pmcheck/should_compile/all.T +++ b/testsuite/tests/pmcheck/should_compile/all.T @@ -23,6 +23,7 @@ test('T8970', only_compiler_types(['ghc']), compile, ['-fwarn-incomplete-pattern test('T9951b',only_compiler_types(['ghc']), compile, ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns']) test('T9951', only_compiler_types(['ghc']), compile, ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns']) test('T11303', normal, compile, ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns +RTS -M1G -RTS']) +test('T11276', normal, compile, ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns']) # Other tests test('pmc001', only_compiler_types(['ghc']), compile, ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns']) From git at git.haskell.org Mon Jan 4 09:19:08 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 4 Jan 2016 09:19:08 +0000 (UTC) Subject: [commit: ghc] wip/gadtpm: Added some basic space and time limits for T11276 (3sec, 1GB) (d6d6f2e) Message-ID: <20160104091908.A79F63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/gadtpm Link : http://ghc.haskell.org/trac/ghc/changeset/d6d6f2e200f7e6d4603eff95818d9f08a188093b/ghc >--------------------------------------------------------------- commit d6d6f2e200f7e6d4603eff95818d9f08a188093b Author: George Karachalias Date: Mon Jan 4 02:18:08 2016 +0100 Added some basic space and time limits for T11276 (3sec, 1GB) >--------------------------------------------------------------- d6d6f2e200f7e6d4603eff95818d9f08a188093b testsuite/tests/pmcheck/should_compile/all.T | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/tests/pmcheck/should_compile/all.T b/testsuite/tests/pmcheck/should_compile/all.T index 1f487ee..521c221 100644 --- a/testsuite/tests/pmcheck/should_compile/all.T +++ b/testsuite/tests/pmcheck/should_compile/all.T @@ -23,7 +23,7 @@ test('T8970', only_compiler_types(['ghc']), compile, ['-fwarn-incomplete-pattern test('T9951b',only_compiler_types(['ghc']), compile, ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns']) test('T9951', only_compiler_types(['ghc']), compile, ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns']) test('T11303', normal, compile, ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns +RTS -M1G -RTS']) -test('T11276', normal, compile, ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns']) +test('T11276', compile_timeout_multiplier(0.01), compile, ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns +RTS -M1G -RTS']) # Other tests test('pmc001', only_compiler_types(['ghc']), compile, ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns']) From git at git.haskell.org Mon Jan 4 12:55:40 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 4 Jan 2016 12:55:40 +0000 (UTC) Subject: [commit: ghc] master: Update .mailmap [skip ci] (c7d84d2) Message-ID: <20160104125540.58ECA3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/c7d84d2603c1988125feaab54e0d776974e46f75/ghc >--------------------------------------------------------------- commit c7d84d2603c1988125feaab54e0d776974e46f75 Author: Thomas Miedema Date: Sat Dec 19 11:41:44 2015 +0100 Update .mailmap [skip ci] >--------------------------------------------------------------- c7d84d2603c1988125feaab54e0d776974e46f75 .mailmap | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.mailmap b/.mailmap index 4c52474..5ea062b 100644 --- a/.mailmap +++ b/.mailmap @@ -35,6 +35,7 @@ Ben Gamari Ben Gamari Ben Gamari Ben Gamari +Ben Gamari Ben Lippmeier Ben Lippmeier Ben Lippmeier Ben.Lippmeier.anu.edu.au @@ -63,7 +64,7 @@ Colin Watson # https://github.com/archblob Daan Leijen daan Dan Licata # Commit 6a05ec. -Dana N. Xu # TODO. Doesn't work (weird char?). +Dana N. Xu # Weird characters. Dana N. Xu # "Static Contract Checking for Haskell". Dana N. Xu nx Daniel Fischer @@ -171,6 +172,7 @@ Markus Gro?er Matt Chapman matthewc Matthew Farkas-Dyck Matthew Farkas-Dyck +Matthew Hyatt Matthias Kilian kili at outback.escape.de Michael D. Adams Michael Weber michaelw From git at git.haskell.org Mon Jan 4 16:18:58 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 4 Jan 2016 16:18:58 +0000 (UTC) Subject: [commit: ghc] master: Linker: Move helpers to #ifdef (7e599f5) Message-ID: <20160104161858.51D763A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/7e599f53e12e97a7e043919cd0d8b96f11bb18c0/ghc >--------------------------------------------------------------- commit 7e599f53e12e97a7e043919cd0d8b96f11bb18c0 Author: Ben Gamari Date: Mon Jan 4 16:36:33 2016 +0100 Linker: Move helpers to #ifdef Otherwise Clang seems to complain about unused static definitions. >--------------------------------------------------------------- 7e599f53e12e97a7e043919cd0d8b96f11bb18c0 rts/Linker.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/rts/Linker.c b/rts/Linker.c index 6561e05..d298179 100644 --- a/rts/Linker.c +++ b/rts/Linker.c @@ -2750,17 +2750,6 @@ static int ocAllocateSymbolExtras( ObjectCode* oc, int count, int first ) #endif #endif // NEED_SYMBOL_EXTRAS -// Signed extend a number to a 32-bit int. -static inline StgInt32 sign_extend32(nat bits, StgWord32 x) { - return ((StgInt32) (x << (32 - bits))) >> (32 - bits); -} - -// Does the given signed integer fit into the given bit width? -static inline StgBool is_int(nat bits, StgInt32 x) { - return bits > 32 || (-(1 << (bits-1)) <= x - && x < (1 << (bits-1))); -} - #if defined(arm_HOST_ARCH) static void @@ -4990,6 +4979,21 @@ end: return result; } +#ifdef arm_HOST_ARCH +// TODO: These likely belong in a library somewhere + +// Signed extend a number to a 32-bit int. +static inline StgInt32 sign_extend32(nat bits, StgWord32 x) { + return ((StgInt32) (x << (32 - bits))) >> (32 - bits); +} + +// Does the given signed integer fit into the given bit width? +static inline StgBool is_int(nat bits, StgInt32 x) { + return bits > 32 || (-(1 << (bits-1)) <= x + && x < (1 << (bits-1))); +} +#endif + /* Do ELF relocations which lack an explicit addend. All x86-linux and arm-linux relocations appear to be of this form. */ static int From git at git.haskell.org Mon Jan 4 16:19:01 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 4 Jan 2016 16:19:01 +0000 (UTC) Subject: [commit: ghc] master: Rewrite Haddocks for GHC.Base.const (da0f043) Message-ID: <20160104161901.023BD3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/da0f04305d7bdc172f7a7a7b73f171b83acca87f/ghc >--------------------------------------------------------------- commit da0f04305d7bdc172f7a7a7b73f171b83acca87f Author: Ben Gamari Date: Mon Jan 4 16:42:08 2016 +0100 Rewrite Haddocks for GHC.Base.const Test Plan: Read it Reviewers: austin, hvr, #core_libraries_committee Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1720 GHC Trac Issues: #11314 >--------------------------------------------------------------- da0f04305d7bdc172f7a7a7b73f171b83acca87f libraries/base/GHC/Base.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libraries/base/GHC/Base.hs b/libraries/base/GHC/Base.hs index 92a1ac3..1f989c4 100644 --- a/libraries/base/GHC/Base.hs +++ b/libraries/base/GHC/Base.hs @@ -1023,7 +1023,12 @@ breakpointCond _ r = r data Opaque = forall a. O a --- | Constant function. +-- | @const x@ is a unary function which evaluates to @x@ for all inputs. +-- +-- For instance, +-- +-- >>> map (const 42) [0..3] +-- [42,42,42,42] const :: a -> b -> a const x _ = x From git at git.haskell.org Mon Jan 4 16:19:03 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 4 Jan 2016 16:19:03 +0000 (UTC) Subject: [commit: ghc] master: users_guide: Add ghci-cmd directive (5c10f5c) Message-ID: <20160104161903.B3CA03A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/5c10f5ce8831a59f67f2c42ed5d7cf5be10c0860/ghc >--------------------------------------------------------------- commit 5c10f5ce8831a59f67f2c42ed5d7cf5be10c0860 Author: Ben Gamari Date: Mon Jan 4 16:43:02 2016 +0100 users_guide: Add ghci-cmd directive Note only does this make the markup cleaner and more semantic, but it clears up some warnings and enables proper hyperlinks. Yay Sphinx! While I was at it I generally cleaned up the markup Test Plan: Read it Reviewers: hvr, thomie, austin Differential Revision: https://phabricator.haskell.org/D1730 >--------------------------------------------------------------- 5c10f5ce8831a59f67f2c42ed5d7cf5be10c0860 docs/users_guide/conf.py | 14 + docs/users_guide/ghci.rst | 929 ++++++++++++++++++++-------------------------- 2 files changed, 423 insertions(+), 520 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 5c10f5ce8831a59f67f2c42ed5d7cf5be10c0860 From git at git.haskell.org Mon Jan 4 16:19:49 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 4 Jan 2016 16:19:49 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Linker: Move helpers to #ifdef (9c09d9a) Message-ID: <20160104161949.189E53A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/9c09d9a1b6b255cf8c368195167593f32f3425d4/ghc >--------------------------------------------------------------- commit 9c09d9a1b6b255cf8c368195167593f32f3425d4 Author: Ben Gamari Date: Mon Jan 4 16:36:33 2016 +0100 Linker: Move helpers to #ifdef Otherwise Clang seems to complain about unused static definitions. >--------------------------------------------------------------- 9c09d9a1b6b255cf8c368195167593f32f3425d4 rts/Linker.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/rts/Linker.c b/rts/Linker.c index 6561e05..d298179 100644 --- a/rts/Linker.c +++ b/rts/Linker.c @@ -2750,17 +2750,6 @@ static int ocAllocateSymbolExtras( ObjectCode* oc, int count, int first ) #endif #endif // NEED_SYMBOL_EXTRAS -// Signed extend a number to a 32-bit int. -static inline StgInt32 sign_extend32(nat bits, StgWord32 x) { - return ((StgInt32) (x << (32 - bits))) >> (32 - bits); -} - -// Does the given signed integer fit into the given bit width? -static inline StgBool is_int(nat bits, StgInt32 x) { - return bits > 32 || (-(1 << (bits-1)) <= x - && x < (1 << (bits-1))); -} - #if defined(arm_HOST_ARCH) static void @@ -4990,6 +4979,21 @@ end: return result; } +#ifdef arm_HOST_ARCH +// TODO: These likely belong in a library somewhere + +// Signed extend a number to a 32-bit int. +static inline StgInt32 sign_extend32(nat bits, StgWord32 x) { + return ((StgInt32) (x << (32 - bits))) >> (32 - bits); +} + +// Does the given signed integer fit into the given bit width? +static inline StgBool is_int(nat bits, StgInt32 x) { + return bits > 32 || (-(1 << (bits-1)) <= x + && x < (1 << (bits-1))); +} +#endif + /* Do ELF relocations which lack an explicit addend. All x86-linux and arm-linux relocations appear to be of this form. */ static int From git at git.haskell.org Mon Jan 4 16:19:51 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 4 Jan 2016 16:19:51 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Rewrite Haddocks for GHC.Base.const (e8b482c) Message-ID: <20160104161951.DDEA13A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/e8b482c535e223fcade94550d1b0377995356116/ghc >--------------------------------------------------------------- commit e8b482c535e223fcade94550d1b0377995356116 Author: Ben Gamari Date: Mon Jan 4 16:42:08 2016 +0100 Rewrite Haddocks for GHC.Base.const Test Plan: Read it Reviewers: austin, hvr, #core_libraries_committee Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1720 GHC Trac Issues: #11314 >--------------------------------------------------------------- e8b482c535e223fcade94550d1b0377995356116 libraries/base/GHC/Base.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libraries/base/GHC/Base.hs b/libraries/base/GHC/Base.hs index 92a1ac3..1f989c4 100644 --- a/libraries/base/GHC/Base.hs +++ b/libraries/base/GHC/Base.hs @@ -1023,7 +1023,12 @@ breakpointCond _ r = r data Opaque = forall a. O a --- | Constant function. +-- | @const x@ is a unary function which evaluates to @x@ for all inputs. +-- +-- For instance, +-- +-- >>> map (const 42) [0..3] +-- [42,42,42,42] const :: a -> b -> a const x _ = x From git at git.haskell.org Mon Jan 4 16:19:54 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 4 Jan 2016 16:19:54 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: users_guide: Add ghci-cmd directive (a096e2f) Message-ID: <20160104161954.A846C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/a096e2f2fab8bf813bac8ab03c10b09d494edead/ghc >--------------------------------------------------------------- commit a096e2f2fab8bf813bac8ab03c10b09d494edead Author: Ben Gamari Date: Mon Jan 4 16:43:02 2016 +0100 users_guide: Add ghci-cmd directive Note only does this make the markup cleaner and more semantic, but it clears up some warnings and enables proper hyperlinks. Yay Sphinx! While I was at it I generally cleaned up the markup Test Plan: Read it Reviewers: hvr, thomie, austin Differential Revision: https://phabricator.haskell.org/D1730 >--------------------------------------------------------------- a096e2f2fab8bf813bac8ab03c10b09d494edead docs/users_guide/conf.py | 14 + docs/users_guide/ghci.rst | 929 ++++++++++++++++++++-------------------------- 2 files changed, 423 insertions(+), 520 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc a096e2f2fab8bf813bac8ab03c10b09d494edead From git at git.haskell.org Mon Jan 4 20:01:44 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 4 Jan 2016 20:01:44 +0000 (UTC) Subject: [commit: ghc] master: Build system: delete ghc-pwd (4c56ad3) Message-ID: <20160104200144.2C5B53A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/4c56ad36ee0d1f8b6f1b2bc0d8fff1c9acd1a389/ghc >--------------------------------------------------------------- commit 4c56ad36ee0d1f8b6f1b2bc0d8fff1c9acd1a389 Author: Thomas Miedema Date: Mon Jan 4 18:29:49 2016 +0100 Build system: delete ghc-pwd On Windows, with msys2, `pwd` works (as can be seen by the use of `pwd` that slipped into the validate script), so there is really no need for `ghc-pwd` anymore. Test Plan: try it Reviewers: austin, bgamari, Phyx Reviewed By: Phyx Subscribers: Phyx, erikd Differential Revision: https://phabricator.haskell.org/D1731 >--------------------------------------------------------------- 4c56ad36ee0d1f8b6f1b2bc0d8fff1c9acd1a389 aclocal.m4 | 26 +------------------------- configure.ac | 6 ++---- distrib/configure.ac.in | 1 - ghc.mk | 6 ------ utils/ghc-pwd/Main.hs | 22 ---------------------- utils/ghc-pwd/Setup.hs | 2 -- utils/ghc-pwd/ghc-pwd.cabal | 19 ------------------- utils/ghc-pwd/ghc.mk | 9 --------- validate | 6 +++--- 9 files changed, 6 insertions(+), 91 deletions(-) diff --git a/aclocal.m4 b/aclocal.m4 index 8e97726..0c93de4 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1737,33 +1737,9 @@ AC_DEFUN([FP_CURSES], # Calculate absolute path to build tree # -------------------------------------------------------------- -AC_DEFUN([FP_INTREE_GHC_PWD],[ -AC_MSG_NOTICE(Building in-tree ghc-pwd) - dnl This would be - dnl make -C utils/ghc-pwd clean && make -C utils/ghc-pwd - dnl except we don't want to have to know what make is called. Sigh. - rm -rf utils/ghc-pwd/dist-boot - mkdir utils/ghc-pwd/dist-boot - dnl If special linker flags are needed to build things, then allow - dnl the user to pass them in via LDFLAGS. - changequote(, )dnl - GHC_LDFLAGS=`perl -e 'foreach (@ARGV) { print "-optl$_ " }' -- $LDFLAGS` - changequote([, ])dnl - if ! "$WithGhc" $GHC_LDFLAGS -v0 -no-user-$GHC_PACKAGE_DB_FLAG -hidir utils/ghc-pwd/dist-boot -odir utils/ghc-pwd/dist-boot -stubdir utils/ghc-pwd/dist-boot --make utils/ghc-pwd/Main.hs -o utils/ghc-pwd/dist-boot/ghc-pwd - then - AC_MSG_ERROR([Building ghc-pwd failed]) - fi - - GHC_PWD=utils/ghc-pwd/dist-boot/ghc-pwd -]) - -AC_DEFUN([FP_BINDIST_GHC_PWD],[ - GHC_PWD=utils/ghc-pwd/dist-install/build/tmp/ghc-pwd-bindist -]) - AC_DEFUN([FP_FIND_ROOT],[ AC_MSG_CHECKING(for path to top of build tree) - hardtop=`$GHC_PWD` + hardtop=`pwd` dnl Remove common automounter nonsense hardtop=`echo $hardtop | sed 's|^/tmp_mnt.*\(/local/.*\)$|\1|' | sed 's|^/tmp_mnt/|/|'` diff --git a/configure.ac b/configure.ac index 042b417..ab82bb0 100644 --- a/configure.ac +++ b/configure.ac @@ -26,6 +26,8 @@ AC_INIT([The Glorious Glasgow Haskell Compilation System], [8.1], [glasgow-haske # checkout), then we ship a file 'VERSION' containing the full version # when the source distribution was created. +FP_FIND_ROOT + if test ! -f mk/config.h.in; then echo "mk/config.h.in doesn't exist: perhaps you haven't run 'perl boot'?" exit 1 @@ -258,10 +260,6 @@ AC_ARG_WITH(hc, ) AC_SUBST(WithHc) -# This uses GHC, so put it after the "GHC is required" check above: -FP_INTREE_GHC_PWD -FP_FIND_ROOT - fail() { echo >&2 echo "$1" >&2 diff --git a/distrib/configure.ac.in b/distrib/configure.ac.in index 0f68a52..4d57cd8 100644 --- a/distrib/configure.ac.in +++ b/distrib/configure.ac.in @@ -6,7 +6,6 @@ dnl AC_INIT([The Glorious Glasgow Haskell Compilation System], [@ProjectVersion@], [glasgow-haskell-bugs at haskell.org], [ghc]) -FP_BINDIST_GHC_PWD FP_FIND_ROOT dnl-------------------------------------------------------------------- diff --git a/ghc.mk b/ghc.mk index ba708a1..3ccc496 100644 --- a/ghc.mk +++ b/ghc.mk @@ -516,7 +516,6 @@ $(foreach pkg,$(PACKAGES_STAGE1),$(eval $(call fixed_pkg_dep,$(pkg),dist-install # the stage1 packages, so we have to make sure those packages get configured # and registered before we can start with these. Note that they don't depend on # eachother, so we can configure them in parallel. -utils/ghc-pwd/dist-install/package-data.mk: $(fixed_pkg_prev) utils/ghc-cabal/dist-install/package-data.mk: $(fixed_pkg_prev) utils/hpc/dist-install/package-data.mk: $(fixed_pkg_prev) utils/ghc-pkg/dist-install/package-data.mk: $(fixed_pkg_prev) @@ -660,7 +659,6 @@ BUILD_DIRS += utils/testremove BUILD_DIRS += utils/ghctags BUILD_DIRS += utils/check-api-annotations BUILD_DIRS += utils/dll-split -BUILD_DIRS += utils/ghc-pwd BUILD_DIRS += utils/ghc-cabal BUILD_DIRS += utils/hpc BUILD_DIRS += utils/runghc @@ -1020,7 +1018,6 @@ $(eval $(call bindist-list,.,\ mk/config.mk.in \ $(INPLACE_BIN)/mkdirhier \ utils/ghc-cabal/dist-install/build/tmp/ghc-cabal \ - utils/ghc-pwd/dist-install/build/tmp/ghc-pwd \ $(BINDIST_WRAPPERS) \ $(BINDIST_PERL_SOURCES) \ $(BINDIST_LIBS) \ @@ -1366,9 +1363,6 @@ distclean : clean # Internal files generated by ./configure for itself. $(call removeFiles,config.cache config.status config.log) -# ./configure build ghc-pwd in utils/ghc-pwd/dist-boot, so clean it up. - $(call removeTrees,utils/ghc-pwd/dist-boot) - # The root Makefile makes .old versions of some files that configure # generates, so we clean those too. $(call removeFiles,mk/config.mk.old) diff --git a/utils/ghc-pwd/Main.hs b/utils/ghc-pwd/Main.hs deleted file mode 100644 index 91a5606..0000000 --- a/utils/ghc-pwd/Main.hs +++ /dev/null @@ -1,22 +0,0 @@ - -module Main where - -import System.Directory -import System.Environment -import System.Exit -import System.IO - -main :: IO () -main = do - args <- getArgs - case args of - [] -> do d <- getCurrentDirectory - putStr $ map forwardifySlashes d - _ -> do hPutStrLn stderr ("Bad args: " ++ show args) - hPutStrLn stderr "Usage: ghc-pwd" - exitFailure - -forwardifySlashes :: Char -> Char -forwardifySlashes '\\' = '/' -forwardifySlashes c = c - diff --git a/utils/ghc-pwd/Setup.hs b/utils/ghc-pwd/Setup.hs deleted file mode 100644 index 9a994af..0000000 --- a/utils/ghc-pwd/Setup.hs +++ /dev/null @@ -1,2 +0,0 @@ -import Distribution.Simple -main = defaultMain diff --git a/utils/ghc-pwd/ghc-pwd.cabal b/utils/ghc-pwd/ghc-pwd.cabal deleted file mode 100644 index dcd9529..0000000 --- a/utils/ghc-pwd/ghc-pwd.cabal +++ /dev/null @@ -1,19 +0,0 @@ -Name: ghc-pwd -Version: 0.1 -Copyright: XXX -License: BSD3 --- XXX License-File: LICENSE --- XXX Author: --- XXX Maintainer: -Synopsis: XXX -Description: - XXX -build-type: Simple -cabal-version: >=1.10 - -Executable ghc-pwd - Default-Language: Haskell2010 - Main-Is: Main.hs - Build-Depends: base >= 3 && < 5, - directory >= 1 && < 1.3 - diff --git a/utils/ghc-pwd/ghc.mk b/utils/ghc-pwd/ghc.mk deleted file mode 100644 index ac6bc76..0000000 --- a/utils/ghc-pwd/ghc.mk +++ /dev/null @@ -1,9 +0,0 @@ - -utils/ghc-pwd_USES_CABAL = YES -utils/ghc-pwd_PACKAGE = ghc-pwd -utils/ghc-pwd_dist-install_INSTALL_INPLACE = YES -utils/ghc-pwd_dist-install_WANT_BINDIST_WRAPPER = YES -utils/ghc-pwd_dist-install_PROGNAME = ghc-pwd - -$(eval $(call build-prog,utils/ghc-pwd,dist-install,1)) - diff --git a/validate b/validate index 3b21002..d6bc1bf 100755 --- a/validate +++ b/validate @@ -161,10 +161,12 @@ $make -C utils/checkUniques if [ $testsuite_only -eq 0 ]; then +thisdir=`pwd` + if [ $no_clean -eq 0 ]; then $make maintainer-clean NO_CLEAN_GMP=YES - INSTDIR=`pwd`/inst + INSTDIR="$thisdir/inst" if [ $use_dph -eq 1 ]; then perl -w boot --validate --required-tag=dph @@ -174,8 +176,6 @@ if [ $no_clean -eq 0 ]; then ./configure --prefix="$INSTDIR" $config_args fi -thisdir=`utils/ghc-pwd/dist-boot/ghc-pwd` - echo "Validating=YES" > mk/are-validating.mk echo "ValidateSpeed=$speed" >> mk/are-validating.mk echo "ValidateHpc=$hpc" >> mk/are-validating.mk From git at git.haskell.org Mon Jan 4 20:01:47 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 4 Jan 2016 20:01:47 +0000 (UTC) Subject: [commit: ghc] master: Avoid generating guards for CoPats if possible (Addresses #11276) (0acdcf2) Message-ID: <20160104200147.21BE13A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/0acdcf2482d24903b504e6b34fa745ef855ff00d/ghc >--------------------------------------------------------------- commit 0acdcf2482d24903b504e6b34fa745ef855ff00d Author: George Karachalias Date: Mon Jan 4 21:02:26 2016 +0100 Avoid generating guards for CoPats if possible (Addresses #11276) When translating a `CoPat` to `PmPat` check whether the wrapper is just a hole or a cast with refl. In these cases we can safely drop the wrapper and generate less guard patterns. Fixes T11276. Test Plan: validate Reviewers: bgamari, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1729 GHC Trac Issues: #11276 >--------------------------------------------------------------- 0acdcf2482d24903b504e6b34fa745ef855ff00d compiler/deSugar/Check.hs | 29 +++++- testsuite/tests/pmcheck/should_compile/T11276.hs | 105 +++++++++++++++++++++ .../tests/pmcheck/should_compile/T11276.stderr | 0 testsuite/tests/pmcheck/should_compile/all.T | 1 + 4 files changed, 130 insertions(+), 5 deletions(-) diff --git a/compiler/deSugar/Check.hs b/compiler/deSugar/Check.hs index fd0c6e0..5d8a171 100644 --- a/compiler/deSugar/Check.hs +++ b/compiler/deSugar/Check.hs @@ -52,6 +52,8 @@ import DsGRHSs -- isTrueLHsExpr import Data.List -- find import Data.Maybe -- isNothing, isJust, fromJust import Control.Monad -- liftM3, forM +import Coercion +import TcEvidence {- This module checks pattern matches for: @@ -281,11 +283,15 @@ translatePat pat = case pat of SigPatOut p _ty -> translatePat (unLoc p) - CoPat wrapper p ty -> do - ps <- translatePat p - (xp,xe) <- mkPmId2FormsSM ty - let g = mkGuard ps (HsWrap wrapper (unLoc xe)) - return [xp,g] + -- See Note [Translate CoPats] + CoPat wrapper p ty + | isIdHsWrapper wrapper -> translatePat p + | WpCast co <- wrapper, isReflexiveCo co -> translatePat p + | otherwise -> do + ps <- translatePat p + (xp,xe) <- mkPmId2FormsSM ty + let g = mkGuard ps (HsWrap wrapper (unLoc xe)) + return [xp,g] -- (n + k) ===> x (True <- x >= k) (n <- x-k) NPlusKPat (L _ n) k ge minus -> do @@ -616,6 +622,19 @@ Additionally, top-level guard translation (performed by @translateGuards@) replaces guards that cannot be reasoned about (like the ones we described in 1-4) with a single @fake_pat@ to record the possibility of failure to match. +Note [Translate CoPats] +~~~~~~~~~~~~~~~~~~~~~~~ +The pattern match checker did not know how to handle coerced patterns `CoPat` +efficiently, which gave rise to #11276. The original approach translated +`CoPat`s: + + pat |> co ===> x (pat <- (e |> co)) + +Instead, we now check whether the coercion is a hole or if it is just refl, in +which case we can drop it. Unfortunately, data families generate useful +coercions so guards are still generated in these cases and checking data +families is not really efficient. + %************************************************************************ %* * Main Pattern Matching Check diff --git a/testsuite/tests/pmcheck/should_compile/T11276.hs b/testsuite/tests/pmcheck/should_compile/T11276.hs new file mode 100644 index 0000000..16e0155 --- /dev/null +++ b/testsuite/tests/pmcheck/should_compile/T11276.hs @@ -0,0 +1,105 @@ +{-# LANGUAGE RankNTypes #-} +module Hang where +import Control.Monad +import Data.Char + +data Event + = EventBeginDocument + | EventEndDocument + | EventBeginDoctype + | EventEndDoctype + | EventInstruction + | EventBeginElement + | EventEndElement + | EventContent Content + | EventComment + | EventCDATA + +data Content + = ContentText String + | ContentEntity String + + +peek :: Monad m => Consumer a m (Maybe a) +peek = undefined + +type Consumer i m r = forall o. ConduitM i o m r + +tag :: forall m a b c o . Monad m => + ConduitM Event o m (Maybe c) +tag = do + _ <- dropWS + return undefined + where +-- Add this and it works +-- dropWS :: Monad m => ConduitM Event o m (Maybe Event) + dropWS = do +-- Swap these two lines and it works + -- let x = undefined + x <- peek + let isWS = + case x of + -- Remove some of these and it works + Just EventBeginDocument -> True + Just EventEndDocument -> True + Just EventBeginDoctype{} -> True + Just EventEndDoctype -> True + Just EventInstruction{} -> True + Just EventBeginElement{} -> False + Just EventEndElement{} -> False + Just (EventContent (ContentText t)) + | all isSpace t -> True + | otherwise -> False + Just (EventContent ContentEntity{}) -> False + Just EventComment{} -> True + Just EventCDATA{} -> False + Nothing -> False + if isWS then dropWS else return x + + +-- Inlined Instances + +instance Functor (ConduitM i o m) where + fmap f (ConduitM c) = ConduitM $ \rest -> c (rest . f) + +instance Applicative (ConduitM i o m) where + pure x = ConduitM ($ x) + {-# INLINE pure #-} + (<*>) = ap + {-# INLINE (<*>) #-} + +instance Monad (ConduitM i o m) where + return = pure + ConduitM f >>= g = ConduitM $ \h -> f $ \a -> unConduitM (g a) h + +instance Monad m => Functor (Pipe l i o u m) where + fmap = liftM + {-# INLINE fmap #-} + +instance Monad m => Applicative (Pipe l i o u m) where + pure = Done + {-# INLINE pure #-} + (<*>) = ap + {-# INLINE (<*>) #-} + +instance Monad m => Monad (Pipe l i o u m) where + return = pure + {-# INLINE return #-} + + HaveOutput p c o >>= fp = HaveOutput (p >>= fp) c o + NeedInput p c >>= fp = NeedInput (p >=> fp) (c >=> fp) + Done x >>= fp = fp x + PipeM mp >>= fp = PipeM ((>>= fp) `liftM` mp) + Leftover p i >>= fp = Leftover (p >>= fp) i + +newtype ConduitM i o m r = ConduitM + { unConduitM :: forall b. + (r -> Pipe i i o () m b) -> Pipe i i o () m b + } + +data Pipe l i o u m r = + HaveOutput (Pipe l i o u m r) (m ()) o + | NeedInput (i -> Pipe l i o u m r) (u -> Pipe l i o u m r) + | Done r + | PipeM (m (Pipe l i o u m r)) + | Leftover (Pipe l i o u m r) l diff --git a/libraries/base/tests/IO/misc001.stdout b/testsuite/tests/pmcheck/should_compile/T11276.stderr similarity index 100% copy from libraries/base/tests/IO/misc001.stdout copy to testsuite/tests/pmcheck/should_compile/T11276.stderr diff --git a/testsuite/tests/pmcheck/should_compile/all.T b/testsuite/tests/pmcheck/should_compile/all.T index 292e9af..521c221 100644 --- a/testsuite/tests/pmcheck/should_compile/all.T +++ b/testsuite/tests/pmcheck/should_compile/all.T @@ -23,6 +23,7 @@ test('T8970', only_compiler_types(['ghc']), compile, ['-fwarn-incomplete-pattern test('T9951b',only_compiler_types(['ghc']), compile, ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns']) test('T9951', only_compiler_types(['ghc']), compile, ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns']) test('T11303', normal, compile, ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns +RTS -M1G -RTS']) +test('T11276', compile_timeout_multiplier(0.01), compile, ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns +RTS -M1G -RTS']) # Other tests test('pmc001', only_compiler_types(['ghc']), compile, ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns']) From git at git.haskell.org Mon Jan 4 22:19:59 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 4 Jan 2016 22:19:59 +0000 (UTC) Subject: [commit: ghc] branch 'wip/libdw-unwind' created Message-ID: <20160104221959.EDC2C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/libdw-unwind Referencing: ad2a0a2ed1723bf7e7c758733c8b0f676de139eb From git at git.haskell.org Mon Jan 4 22:20:02 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 4 Jan 2016 22:20:02 +0000 (UTC) Subject: [commit: ghc] wip/libdw-unwind: StgCmmForeign: Push local register creation into code generation (13ffedd) Message-ID: <20160104222002.A63AF3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/libdw-unwind Link : http://ghc.haskell.org/trac/ghc/changeset/13ffedd6f593777b234556425751ac79782be135/ghc >--------------------------------------------------------------- commit 13ffedd6f593777b234556425751ac79782be135 Author: Ben Gamari Date: Sat Jan 2 13:31:04 2016 +0100 StgCmmForeign: Push local register creation into code generation The interfaces to {save,load}ThreadState were quite messy due to the need to pass in local registers (produced with draws from a unique supply) since they were used from both FCode and UniqSM. This, however, is entirely unnecessary as we already have an abstraction to capture this effect: MonadUnique. Use it. >--------------------------------------------------------------- 13ffedd6f593777b234556425751ac79782be135 compiler/cmm/CmmLayoutStack.hs | 15 ++---- compiler/codeGen/StgCmmForeign.hs | 106 ++++++++++++++++++-------------------- compiler/codeGen/StgCmmMonad.hs | 6 +++ compiler/codeGen/StgCmmUtils.hs | 5 +- 4 files changed, 64 insertions(+), 68 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 13ffedd6f593777b234556425751ac79782be135 From git at git.haskell.org Mon Jan 4 22:20:05 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 4 Jan 2016 22:20:05 +0000 (UTC) Subject: [commit: ghc] wip/libdw-unwind: Dwarf: Assume first block in a proc has an info table (d7be529) Message-ID: <20160104222005.52BBA3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/libdw-unwind Link : http://ghc.haskell.org/trac/ghc/changeset/d7be5290db82e2cdff172aab33af8fab2d01d92d/ghc >--------------------------------------------------------------- commit d7be5290db82e2cdff172aab33af8fab2d01d92d Author: Ben Gamari Date: Thu Nov 26 17:33:10 2015 +0100 Dwarf: Assume first block in a proc has an info table If a procedure has an info table we should also assume that its first block does lest it will not get the necessary offset to ensure that C-debugging tools find valid debug information. This was manifested as backtrace acquisition entering an infinite loop while attempting to unwind `stg_forceIO`, which had invalid call frame information on account this bug. Test Plan: Validate Reviewers: scpmw, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1532 >--------------------------------------------------------------- d7be5290db82e2cdff172aab33af8fab2d01d92d compiler/nativeGen/Dwarf.hs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/compiler/nativeGen/Dwarf.hs b/compiler/nativeGen/Dwarf.hs index 54422ec..7a7acfc 100644 --- a/compiler/nativeGen/Dwarf.hs +++ b/compiler/nativeGen/Dwarf.hs @@ -18,6 +18,7 @@ import UniqSupply import Dwarf.Constants import Dwarf.Types +import Control.Arrow ( first ) import Control.Monad ( mfilter ) import Data.Maybe import Data.List ( sortBy ) @@ -216,10 +217,15 @@ procToFrame :: UnwindTable -> DebugBlock -> DwarfFrameProc procToFrame initUws blk = DwarfFrameProc { dwFdeProc = dblCLabel blk , dwFdeHasInfo = dblHasInfoTbl blk - , dwFdeBlocks = map (uncurry blockToFrame) blockUws + , dwFdeBlocks = map (uncurry blockToFrame) + (first setHasInfo blockUw0 : blockUws) } where blockUws :: [(DebugBlock, UnwindTable)] - blockUws = map snd $ sortBy (comparing fst) $ flatten initUws blk + blockUw0:blockUws = map snd $ sortBy (comparing fst) + $ flatten initUws blk + + flatten :: UnwindTable -> DebugBlock + -> [(Int, (DebugBlock, UnwindTable))] flatten uws0 b at DebugBlock{ dblPosition=pos, dblUnwind=uws, dblBlocks=blocks } | Just p <- pos = (p, (b, uws')):nested @@ -227,6 +233,14 @@ procToFrame initUws blk where uws' = uws `Map.union` uws0 nested = concatMap (flatten uws') blocks + -- | If the current procedure has an info table, then we also say that + -- its first block has one to ensure that it gets the necessary -1 + -- offset applied to its start address. + -- See Note [Info Offset] in Dwarf.Types. + setHasInfo :: DebugBlock -> DebugBlock + setHasInfo child = + child { dblHasInfoTbl = dblHasInfoTbl child || dblHasInfoTbl blk } + blockToFrame :: DebugBlock -> UnwindTable -> DwarfFrameBlock blockToFrame blk uws = DwarfFrameBlock { dwFdeBlock = mkAsmTempLabel $ dblLabel blk From git at git.haskell.org Mon Jan 4 22:20:07 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 4 Jan 2016 22:20:07 +0000 (UTC) Subject: [commit: ghc] wip/libdw-unwind: Dwarf: Add support for labels in unwind expressions (26cede0) Message-ID: <20160104222007.F11D33A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/libdw-unwind Link : http://ghc.haskell.org/trac/ghc/changeset/26cede049997bd314e50cac528114a65a352c60b/ghc >--------------------------------------------------------------- commit 26cede049997bd314e50cac528114a65a352c60b Author: Ben Gamari Date: Sat Sep 5 13:33:02 2015 +0200 Dwarf: Add support for labels in unwind expressions >--------------------------------------------------------------- 26cede049997bd314e50cac528114a65a352c60b compiler/cmm/Debug.hs | 3 +++ compiler/nativeGen/Dwarf/Constants.hs | 3 ++- compiler/nativeGen/Dwarf/Types.hs | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/compiler/cmm/Debug.hs b/compiler/cmm/Debug.hs index fa4d645..7b93835 100644 --- a/compiler/cmm/Debug.hs +++ b/compiler/cmm/Debug.hs @@ -258,6 +258,7 @@ type UnwindTable = Map.Map GlobalReg UnwindExpr data UnwindExpr = UwConst Int -- ^ literal value | UwReg GlobalReg Int -- ^ register plus offset | UwDeref UnwindExpr -- ^ pointer dereferencing + | UwLabel CLabel | UwPlus UnwindExpr UnwindExpr | UwMinus UnwindExpr UnwindExpr | UwTimes UnwindExpr UnwindExpr @@ -268,6 +269,7 @@ instance Outputable UnwindExpr where pprPrec _ (UwReg g 0) = ppr g pprPrec p (UwReg g x) = pprPrec p (UwPlus (UwReg g 0) (UwConst x)) pprPrec _ (UwDeref e) = char '*' <> pprPrec 3 e + pprPrec _ (UwLabel l) = pprPrec 3 l pprPrec p (UwPlus e0 e1) | p <= 0 = pprPrec 0 e0 <> char '+' <> pprPrec 0 e1 pprPrec p (UwMinus e0 e1) | p <= 0 @@ -292,6 +294,7 @@ extractUnwind b = go $ blockToList mid -- possible. toUnwindExpr :: CmmExpr -> UnwindExpr toUnwindExpr (CmmLit (CmmInt i _)) = UwConst (fromIntegral i) +toUnwindExpr (CmmLit (CmmLabel l)) = UwLabel l toUnwindExpr (CmmRegOff (CmmGlobal g) i) = UwReg g i toUnwindExpr (CmmReg (CmmGlobal g)) = UwReg g 0 toUnwindExpr (CmmLoad e _) = UwDeref (toUnwindExpr e) diff --git a/compiler/nativeGen/Dwarf/Constants.hs b/compiler/nativeGen/Dwarf/Constants.hs index 6ba1f8a..a252066 100644 --- a/compiler/nativeGen/Dwarf/Constants.hs +++ b/compiler/nativeGen/Dwarf/Constants.hs @@ -130,9 +130,10 @@ dW_CFA_val_expression = 0x16 dW_CFA_offset = 0x80 -- * Operations -dW_OP_deref, dW_OP_consts, +dW_OP_addr, dW_OP_deref, dW_OP_consts, dW_OP_minus, dW_OP_mul, dW_OP_plus, dW_OP_lit0, dW_OP_breg0, dW_OP_call_frame_cfa :: Word8 +dW_OP_addr = 0x03 dW_OP_deref = 0x06 dW_OP_consts = 0x11 dW_OP_minus = 0x1c diff --git a/compiler/nativeGen/Dwarf/Types.hs b/compiler/nativeGen/Dwarf/Types.hs index e80f2a1..39009e3 100644 --- a/compiler/nativeGen/Dwarf/Types.hs +++ b/compiler/nativeGen/Dwarf/Types.hs @@ -446,6 +446,7 @@ pprUnwindExpr spIsCFA expr pprE (UwReg g i) = pprByte (dW_OP_breg0+dwarfGlobalRegNo plat g) $$ pprLEBInt i pprE (UwDeref u) = pprE u $$ pprByte dW_OP_deref + pprE (UwLabel l) = pprByte dW_OP_addr $$ pprWord (ppr l) pprE (UwPlus u1 u2) = pprE u1 $$ pprE u2 $$ pprByte dW_OP_plus pprE (UwMinus u1 u2) = pprE u1 $$ pprE u2 $$ pprByte dW_OP_minus pprE (UwTimes u1 u2) = pprE u1 $$ pprE u2 $$ pprByte dW_OP_mul From git at git.haskell.org Mon Jan 4 22:20:13 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 4 Jan 2016 22:20:13 +0000 (UTC) Subject: [commit: ghc] wip/libdw-unwind: CmmLayoutStack: Fix unwind information after Sp adjustment (a301594) Message-ID: <20160104222013.5C7063A301@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/libdw-unwind Link : http://ghc.haskell.org/trac/ghc/changeset/a30159465a4271c99e4bc3b5b319d0a259cfad0b/ghc >--------------------------------------------------------------- commit a30159465a4271c99e4bc3b5b319d0a259cfad0b Author: Ben Gamari Date: Sat Jan 2 14:55:41 2016 +0100 CmmLayoutStack: Fix unwind information after Sp adjustment Fixes #11337. >--------------------------------------------------------------- a30159465a4271c99e4bc3b5b319d0a259cfad0b compiler/cmm/CmmLayoutStack.hs | 70 ++++++++++++++++++++++++------------------ 1 file changed, 40 insertions(+), 30 deletions(-) diff --git a/compiler/cmm/CmmLayoutStack.hs b/compiler/cmm/CmmLayoutStack.hs index 10b7865..d4a1ceb 100644 --- a/compiler/cmm/CmmLayoutStack.hs +++ b/compiler/cmm/CmmLayoutStack.hs @@ -275,10 +275,10 @@ layout dflags procpoints liveness entry entry_args final_stackmaps final_sp_high -- let middle_pre = blockToList $ foldl blockSnoc middle1 middle2 - final_blocks = manifestSp dflags final_stackmaps stack0 sp0 final_sp_high entry0 - middle_pre sp_off last1 fixup_blocks + final_blocks <- manifestSp dflags final_stackmaps stack0 sp0 final_sp_high entry0 + middle_pre sp_off last1 fixup_blocks - acc_stackmaps' = mapUnion acc_stackmaps out + let acc_stackmaps' = mapUnion acc_stackmaps out -- If this block jumps to the GC, then we do not take its -- stack usage into account for the high-water mark. @@ -527,8 +527,9 @@ makeFixupBlock dflags sp0 l stack tscope assigs | otherwise = do tmp_lbl <- newBlockId let sp_off = sp0 - sm_sp stack - block = blockJoin (CmmEntry tmp_lbl tscope) - (maybeAddSpAdj dflags sp_off (blockFromList assigs)) + fixed_up <- maybeAddSpAdj dflags sp0 sp_off (blockFromList assigs) + let block = blockJoin (CmmEntry tmp_lbl tscope) + fixed_up (CmmBranch l) return (tmp_lbl, [block]) @@ -780,36 +781,37 @@ manifestSp -> ByteOff -- sp_off -> CmmNode O C -- last node -> [CmmBlock] -- new blocks - -> [CmmBlock] -- final blocks with Sp manifest + -> UniqSM [CmmBlock] -- final blocks with Sp manifest manifestSp dflags stackmaps stack0 sp0 sp_high first middle_pre sp_off last fixup_blocks - = final_block : fixup_blocks' - where - area_off = getAreaOff stackmaps + = do + let -- Add unwind pseudo-instructions to document Sp level for debugging + add_unwind_info block + | debugLevel dflags > 0 = CmmUnwind (ExistingLabel $ entryLabel first) Sp sp_unwind : block + | otherwise = block + sp_unwind = CmmRegOff (CmmGlobal Sp) (sp0 - wORD_SIZE dflags) - adj_pre_sp, adj_post_sp :: CmmNode e x -> CmmNode e x - adj_pre_sp = mapExpDeep (areaToSp dflags sp0 sp_high area_off) - adj_post_sp = mapExpDeep (areaToSp dflags (sp0 - sp_off) sp_high area_off) + final_middle <- maybeAddSpAdj dflags sp0 sp_off $ + blockFromList $ + add_unwind_info $ + map adj_pre_sp $ + elimStackStores stack0 stackmaps area_off $ + middle_pre - -- Add unwind pseudo-instructions to document Sp level for debugging - add_unwind_info block - | debugLevel dflags > 0 = CmmUnwind (ExistingLabel $ entryLabel first) Sp sp_unwind : block - | otherwise = block - sp_unwind = CmmRegOff (CmmGlobal Sp) (sp0 - wORD_SIZE dflags) + let final_last = optStackCheck (adj_post_sp last) - final_middle = maybeAddSpAdj dflags sp_off $ - blockFromList $ - add_unwind_info $ - map adj_pre_sp $ - elimStackStores stack0 stackmaps area_off $ - middle_pre + final_block = blockJoin first final_middle final_last - final_last = optStackCheck (adj_post_sp last) + fixup_blocks' = map (mapBlock3' (id, adj_post_sp, id)) fixup_blocks - final_block = blockJoin first final_middle final_last + pure $ final_block : fixup_blocks' + where + area_off = getAreaOff stackmaps - fixup_blocks' = map (mapBlock3' (id, adj_post_sp, id)) fixup_blocks + adj_pre_sp, adj_post_sp :: CmmNode e x -> CmmNode e x + adj_pre_sp = mapExpDeep (areaToSp dflags sp0 sp_high area_off) + adj_post_sp = mapExpDeep (areaToSp dflags (sp0 - sp_off) sp_high area_off) getAreaOff :: BlockEnv StackMap -> (Area -> StackLoc) @@ -820,10 +822,18 @@ getAreaOff stackmaps (Young l) = Nothing -> pprPanic "getAreaOff" (ppr l) -maybeAddSpAdj :: DynFlags -> ByteOff -> Block CmmNode O O -> Block CmmNode O O -maybeAddSpAdj _ 0 block = block -maybeAddSpAdj dflags sp_off block - = block `blockSnoc` CmmAssign spReg (cmmOffset dflags (CmmReg spReg) sp_off) +maybeAddSpAdj :: DynFlags + -> ByteOff -- ^ Sp on entry to the block + -> ByteOff -- ^ sp_off + -> Block CmmNode O O -- ^ the block to append the adjustment to + -> UniqSM (Block CmmNode O O) +maybeAddSpAdj _ _ 0 block = pure block +maybeAddSpAdj dflags sp0 sp_off block + = do + lbl <- newBlockId + pure $ block `blockSnoc` CmmAssign spReg (cmmOffset dflags (CmmReg spReg) sp_off) + `blockSnoc` CmmUnwind (NewLabel lbl) Sp + (cmmRegOff (CmmGlobal Sp) (sp0 - wORD_SIZE dflags - sp_off)) {- From git at git.haskell.org Mon Jan 4 22:20:10 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 4 Jan 2016 22:20:10 +0000 (UTC) Subject: [commit: ghc] wip/libdw-unwind: Debug: Allow Unwind nodes anywhere in a block (46b875e) Message-ID: <20160104222010.B547B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/libdw-unwind Link : http://ghc.haskell.org/trac/ghc/changeset/46b875eef96aee609b12a938d610b0f188bf1103/ghc >--------------------------------------------------------------- commit 46b875eef96aee609b12a938d610b0f188bf1103 Author: Ben Gamari Date: Fri Jan 1 22:51:51 2016 +0100 Debug: Allow Unwind nodes anywhere in a block Previously we can only use unwind information at the beginning of a block since we otherwise have no label to apply it to. This, of course, isn't nearly expressive enough to properly encode unwinding for general programs. For this reason, we want to be able to include unwind information at arbitrary points within a block. This is a first step in this direction, ensuring that all unwind nodes We accomplish this by making `CmmUnwind` carry a label, which the NCG will emit into the block and which the Dwarf generator can refer to in the unwind tables it produces. >--------------------------------------------------------------- 46b875eef96aee609b12a938d610b0f188bf1103 compiler/cmm/CmmCommonBlockElim.hs | 2 +- compiler/cmm/CmmLayoutStack.hs | 2 +- compiler/cmm/CmmNode.hs | 17 +++++++---- compiler/cmm/Debug.hs | 58 +++++++++++++++++++++++++------------- compiler/cmm/PprCmm.hs | 2 +- compiler/codeGen/StgCmmMonad.hs | 5 ++-- compiler/nativeGen/Dwarf.hs | 20 ++++++------- compiler/nativeGen/Dwarf/Types.hs | 48 +++++++++++++++++-------------- compiler/nativeGen/X86/CodeGen.hs | 7 +++-- compiler/nativeGen/X86/Instr.hs | 5 ++++ compiler/nativeGen/X86/Ppr.hs | 3 ++ 11 files changed, 104 insertions(+), 65 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 46b875eef96aee609b12a938d610b0f188bf1103 From git at git.haskell.org Mon Jan 4 22:20:16 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 4 Jan 2016 22:20:16 +0000 (UTC) Subject: [commit: ghc] wip/libdw-unwind: Use MonadUnique for newBlockId (62ed121) Message-ID: <20160104222016.014AA3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/libdw-unwind Link : http://ghc.haskell.org/trac/ghc/changeset/62ed121972bc09b60df5ad951ab17f70cf62c911/ghc >--------------------------------------------------------------- commit 62ed121972bc09b60df5ad951ab17f70cf62c911 Author: Ben Gamari Date: Sat Jan 2 15:28:14 2016 +0100 Use MonadUnique for newBlockId >--------------------------------------------------------------- 62ed121972bc09b60df5ad951ab17f70cf62c911 compiler/cmm/BlockId.hs | 5 +++++ compiler/cmm/CmmLayoutStack.hs | 3 +-- compiler/codeGen/StgCmmExtCode.hs | 11 +++++++---- compiler/codeGen/StgCmmMonad.hs | 3 +-- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/compiler/cmm/BlockId.hs b/compiler/cmm/BlockId.hs index e4cc0bc..49fc5a3 100644 --- a/compiler/cmm/BlockId.hs +++ b/compiler/cmm/BlockId.hs @@ -4,6 +4,7 @@ {- BlockId module should probably go away completely, being superseded by Label -} module BlockId ( BlockId, mkBlockId -- ToDo: BlockId should be abstract, but it isn't yet + , newBlockId , BlockSet, BlockEnv , IsSet(..), setInsertList, setDeleteList, setUnions , IsMap(..), mapInsertList, mapDeleteList, mapUnions @@ -16,6 +17,7 @@ import IdInfo import Name import Outputable import Unique +import UniqSupply import Compiler.Hoopl as Hoopl hiding (Unique) import Compiler.Hoopl.Internals (uniqueToLbl, lblToUnique) @@ -43,6 +45,9 @@ instance Outputable BlockId where mkBlockId :: Unique -> BlockId mkBlockId unique = uniqueToLbl $ intToUnique $ getKey unique +newBlockId :: MonadUnique m => m BlockId +newBlockId = mkBlockId <$> getUniqueM + retPtLbl :: BlockId -> CLabel retPtLbl label = mkReturnPtLabel $ getUnique label diff --git a/compiler/cmm/CmmLayoutStack.hs b/compiler/cmm/CmmLayoutStack.hs index a5daad1..10b7865 100644 --- a/compiler/cmm/CmmLayoutStack.hs +++ b/compiler/cmm/CmmLayoutStack.hs @@ -32,7 +32,6 @@ import Control.Monad.Fix import Data.Array as Array import Data.Bits import Data.List (nub) -import Control.Monad (liftM) import Prelude hiding ((<*>)) @@ -526,7 +525,7 @@ makeFixupBlock :: DynFlags -> ByteOff -> Label -> StackMap makeFixupBlock dflags sp0 l stack tscope assigs | null assigs && sp0 == sm_sp stack = return (l, []) | otherwise = do - tmp_lbl <- liftM mkBlockId $ getUniqueM + tmp_lbl <- newBlockId let sp_off = sp0 - sm_sp stack block = blockJoin (CmmEntry tmp_lbl tscope) (maybeAddSpAdj dflags sp_off (blockFromList assigs)) diff --git a/compiler/codeGen/StgCmmExtCode.hs b/compiler/codeGen/StgCmmExtCode.hs index f3bb6ee..f12ada2 100644 --- a/compiler/codeGen/StgCmmExtCode.hs +++ b/compiler/codeGen/StgCmmExtCode.hs @@ -43,13 +43,13 @@ import Cmm import CLabel import MkGraph --- import BasicTypes import BlockId import DynFlags import FastString import Module import UniqFM import Unique +import UniqSupply import Control.Monad (liftM, ap) @@ -90,6 +90,12 @@ instance Applicative CmmParse where instance Monad CmmParse where (>>=) = thenExtFC +instance MonadUnique CmmParse where + getUniqueSupplyM = code getUniqueSupplyM + getUniqueM = EC $ \_ _ decls -> do + u <- getUniqueM + return (decls, u) + instance HasDynFlags CmmParse where getDynFlags = EC (\_ _ d -> do dflags <- getDynFlags return (d, dflags)) @@ -155,9 +161,6 @@ newLabel name = do addLabel name (mkBlockId u) return (mkBlockId u) -newBlockId :: CmmParse BlockId -newBlockId = code F.newLabelC - -- | Add add a local function to the environment. newFunctionName :: FastString -- ^ name of the function diff --git a/compiler/codeGen/StgCmmMonad.hs b/compiler/codeGen/StgCmmMonad.hs index 175db2a..dac9082 100644 --- a/compiler/codeGen/StgCmmMonad.hs +++ b/compiler/codeGen/StgCmmMonad.hs @@ -749,8 +749,7 @@ emitStore l r = emitCgStmt (CgStmt (CmmStore l r)) newLabelC :: FCode BlockId -newLabelC = do { u <- newUnique - ; return $ mkBlockId u } +newLabelC = newBlockId emit :: CmmAGraph -> FCode () emit ag From git at git.haskell.org Mon Jan 4 22:20:18 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 4 Jan 2016 22:20:18 +0000 (UTC) Subject: [commit: ghc] wip/libdw-unwind: StgCmmForeign: Break up long line (f50d72c) Message-ID: <20160104222018.9E1563A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/libdw-unwind Link : http://ghc.haskell.org/trac/ghc/changeset/f50d72c74e89e9bb7ab39ca965ecf3ff9d4103ed/ghc >--------------------------------------------------------------- commit f50d72c74e89e9bb7ab39ca965ecf3ff9d4103ed Author: Ben Gamari Date: Sat Jan 2 17:22:11 2016 +0100 StgCmmForeign: Break up long line >--------------------------------------------------------------- f50d72c74e89e9bb7ab39ca965ecf3ff9d4103ed compiler/codeGen/StgCmmForeign.hs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/compiler/codeGen/StgCmmForeign.hs b/compiler/codeGen/StgCmmForeign.hs index f3311bb..cb185ea 100644 --- a/compiler/codeGen/StgCmmForeign.hs +++ b/compiler/codeGen/StgCmmForeign.hs @@ -295,7 +295,13 @@ saveThreadState dflags initialSp = do -- tso = CurrentTSO; mkAssign (CmmLocal tso) stgCurrentTSO, -- tso->stackobj->sp = Sp; - mkStore (cmmOffset dflags (CmmLoad (cmmOffset dflags (CmmReg (CmmLocal tso)) (tso_stackobj dflags)) (bWord dflags)) (stack_SP dflags)) stgSp, + mkStore (cmmOffset dflags + (CmmLoad (cmmOffset dflags + (CmmReg (CmmLocal tso)) + (tso_stackobj dflags)) + (bWord dflags)) + (stack_SP dflags)) + stgSp, -- unwind Sp = initialSp(tso->stackobj->sp) case initialSp of Just initial | debugLevel dflags > 0 -> From git at git.haskell.org Mon Jan 4 22:20:21 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 4 Jan 2016 22:20:21 +0000 (UTC) Subject: [commit: ghc] wip/libdw-unwind: StgCmmForeign: Produce unwind information in {load, save}ThreadState (b954e65) Message-ID: <20160104222021.4C18B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/libdw-unwind Link : http://ghc.haskell.org/trac/ghc/changeset/b954e65de5a214243eaf25355393081ef3475a41/ghc >--------------------------------------------------------------- commit b954e65de5a214243eaf25355393081ef3475a41 Author: Ben Gamari Date: Sat Jan 2 15:35:24 2016 +0100 StgCmmForeign: Produce unwind information in {load,save}ThreadState This actually just gives us the *ability* to produce unwind information. The unwind information itself will be implemented next. >--------------------------------------------------------------- b954e65de5a214243eaf25355393081ef3475a41 compiler/cmm/CmmLayoutStack.hs | 4 ++-- compiler/cmm/MkGraph.hs | 5 ++++- compiler/codeGen/StgCmmForeign.hs | 35 +++++++++++++++++++++++++++++------ 3 files changed, 35 insertions(+), 9 deletions(-) diff --git a/compiler/cmm/CmmLayoutStack.hs b/compiler/cmm/CmmLayoutStack.hs index d4a1ceb..9ea9f85 100644 --- a/compiler/cmm/CmmLayoutStack.hs +++ b/compiler/cmm/CmmLayoutStack.hs @@ -1008,8 +1008,8 @@ lowerSafeForeignCall dflags block id <- newTemp (bWord dflags) new_base <- newTemp (cmmRegType dflags (CmmGlobal BaseReg)) let (caller_save, caller_load) = callerSaveVolatileRegs dflags - save_state_code <- saveThreadState dflags - load_state_code <- loadThreadState dflags + save_state_code <- saveThreadState dflags Nothing + load_state_code <- loadThreadState dflags Nothing let suspend = save_state_code <*> caller_save <*> mkMiddle (callSuspendThread dflags id intrbl) diff --git a/compiler/cmm/MkGraph.hs b/compiler/cmm/MkGraph.hs index 657585e..64e9dfa 100644 --- a/compiler/cmm/MkGraph.hs +++ b/compiler/cmm/MkGraph.hs @@ -7,7 +7,7 @@ module MkGraph , lgraphOfAGraph, labelAGraph , stackStubExpr - , mkNop, mkAssign, mkStore, mkUnsafeCall, mkFinalCall, mkCallReturnsTo + , mkNop, mkAssign, mkStore, mkUnwind, mkUnsafeCall, mkFinalCall, mkCallReturnsTo , mkJumpReturnsTo , mkJump, mkJumpExtra , mkRawJump @@ -196,6 +196,9 @@ mkAssign l r = mkMiddle $ CmmAssign l r mkStore :: CmmExpr -> CmmExpr -> CmmAGraph mkStore l r = mkMiddle $ CmmStore l r +mkUnwind :: NewOrExistingLabel -> GlobalReg -> CmmExpr -> CmmAGraph +mkUnwind lbl r e = mkMiddle $ CmmUnwind lbl r e + ---------- Control transfer mkJump :: DynFlags -> Convention -> CmmExpr -> [CmmActual] diff --git a/compiler/codeGen/StgCmmForeign.hs b/compiler/codeGen/StgCmmForeign.hs index cbbf3b6..f3311bb 100644 --- a/compiler/codeGen/StgCmmForeign.hs +++ b/compiler/codeGen/StgCmmForeign.hs @@ -12,6 +12,7 @@ module StgCmmForeign ( cgForeignCall, emitPrimCall, emitCCall, emitForeignCall, -- For CmmParse + InitialSp, emitSaveThreadState, saveThreadState, emitLoadThreadState, @@ -30,6 +31,7 @@ import StgCmmUtils import StgCmmClosure import StgCmmLayout +import BlockId (newBlockId) import Cmm import CmmUtils import MkGraph @@ -275,19 +277,34 @@ maybe_assign_temp e = do emitSaveThreadState :: FCode () emitSaveThreadState = do dflags <- getDynFlags - code <- saveThreadState dflags + code <- saveThreadState dflags Nothing emit code +-- | Given a @initial :: InitialSp@, @initial (CmmReg sp)@ is an expression +-- of the current. +type InitialSp = CmmExpr -> CmmExpr + -- | Produce code to save the current thread state to @CurrentTSO@ -saveThreadState :: MonadUnique m => DynFlags -> m CmmAGraph -saveThreadState dflags = do +saveThreadState :: MonadUnique m => DynFlags -> Maybe InitialSp -> m CmmAGraph +saveThreadState dflags initialSp = do tso <- newTemp (gcWord dflags) close_nursery <- closeNursery dflags tso + lbl <- newBlockId + pure $ catAGraphs [ -- tso = CurrentTSO; mkAssign (CmmLocal tso) stgCurrentTSO, -- tso->stackobj->sp = Sp; mkStore (cmmOffset dflags (CmmLoad (cmmOffset dflags (CmmReg (CmmLocal tso)) (tso_stackobj dflags)) (bWord dflags)) (stack_SP dflags)) stgSp, + -- unwind Sp = initialSp(tso->stackobj->sp) + case initialSp of + Just initial | debugLevel dflags > 0 -> + let tsoValue = + CmmLoad (cmmOffset dflags stgCurrentTSO (tso_stackobj dflags)) + (bWord dflags) + spValue = cmmOffset dflags tsoValue (stack_SP dflags) + in mkUnwind (NewLabel lbl) Sp (initial $ CmmLoad spValue (bWord dflags)) + _ -> mkNop, close_nursery, -- and save the current cost centre stack in the TSO when profiling: if gopt Opt_SccProfilingOn dflags then @@ -351,15 +368,16 @@ closeNursery df tso = do emitLoadThreadState :: FCode () emitLoadThreadState = do dflags <- getDynFlags - code <- loadThreadState dflags + code <- loadThreadState dflags Nothing emit code -- | Produce code to load the current thread state from @CurrentTSO@ -loadThreadState :: MonadUnique m => DynFlags -> m CmmAGraph -loadThreadState dflags = do +loadThreadState :: MonadUnique m => DynFlags -> Maybe (CmmExpr -> CmmExpr) -> m CmmAGraph +loadThreadState dflags initialSp = do tso <- newTemp (gcWord dflags) stack <- newTemp (gcWord dflags) open_nursery <- openNursery dflags tso + lbl <- newBlockId pure $ catAGraphs [ -- tso = CurrentTSO; mkAssign (CmmLocal tso) stgCurrentTSO, @@ -367,6 +385,11 @@ loadThreadState dflags = do mkAssign (CmmLocal stack) (CmmLoad (cmmOffset dflags (CmmReg (CmmLocal tso)) (tso_stackobj dflags)) (bWord dflags)), -- Sp = stack->sp; mkAssign sp (CmmLoad (cmmOffset dflags (CmmReg (CmmLocal stack)) (stack_SP dflags)) (bWord dflags)), + -- unwind Sp = initialSp(Sp); + case initialSp of + Just initial | debugLevel dflags > 0 -> + mkUnwind (NewLabel lbl) Sp (initial (CmmReg sp)) + _ -> mkNop, -- SpLim = stack->stack + RESERVED_STACK_WORDS; mkAssign spLim (cmmOffsetW dflags (cmmOffset dflags (CmmReg (CmmLocal stack)) (stack_STACK dflags)) (rESERVED_STACK_WORDS dflags)), From git at git.haskell.org Mon Jan 4 22:20:23 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 4 Jan 2016 22:20:23 +0000 (UTC) Subject: [commit: ghc] wip/libdw-unwind: Produce unwind information in lowerSafeForeignCall (fd6e9a1) Message-ID: <20160104222023.F00663A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/libdw-unwind Link : http://ghc.haskell.org/trac/ghc/changeset/fd6e9a1565416a54234115614f4e476cfa68c7b7/ghc >--------------------------------------------------------------- commit fd6e9a1565416a54234115614f4e476cfa68c7b7 Author: Ben Gamari Date: Sat Jan 2 14:47:30 2016 +0100 Produce unwind information in lowerSafeForeignCall >--------------------------------------------------------------- fd6e9a1565416a54234115614f4e476cfa68c7b7 compiler/cmm/CmmLayoutStack.hs | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/compiler/cmm/CmmLayoutStack.hs b/compiler/cmm/CmmLayoutStack.hs index 9ea9f85..49503e9 100644 --- a/compiler/cmm/CmmLayoutStack.hs +++ b/compiler/cmm/CmmLayoutStack.hs @@ -4,7 +4,7 @@ module CmmLayoutStack ( ) where import StgCmmUtils ( callerSaveVolatileRegs ) -- XXX layering violation -import StgCmmForeign ( saveThreadState, loadThreadState ) -- XXX layering violation +import StgCmmForeign ( saveThreadState, loadThreadState, InitialSp ) -- XXX layering violation import BasicTypes import Cmm @@ -999,6 +999,32 @@ expecting them (see Note {safe foreign call convention]). Note also that safe foreign call is replace by an unsafe one in the Cmm graph. -} +findLastUnwinding :: GlobalReg -> CmmBlock -> Maybe CmmExpr +findLastUnwinding reg block = + case mapMaybe isUnwind $ blockToList mid of + [] -> Nothing + xs -> Just $ last xs + where + (_,mid,_) = blockSplit block + isUnwind (CmmUnwind _ reg' expr) + | reg == reg' = Just expr + isUnwind _ = Nothing + +-- | @substReg reg expr subst@ replaces all occurrences of @CmmReg reg@ in +-- @expr@ with @subst at . +substReg :: DynFlags -> CmmReg -> CmmExpr -> CmmExpr -> CmmExpr +substReg dflags reg = go + where + go (CmmReg reg') subst + | reg == reg' = subst + go (CmmRegOff reg' off) subst + | reg == reg' = + CmmMachOp (MO_Add rep) [subst, CmmLit (CmmInt (fromIntegral off) rep)] + where rep = typeWidth (cmmRegType dflags reg') + go (CmmLoad e ty) subst = CmmLoad (go e subst) ty + go (CmmMachOp op es) subst = CmmMachOp op (map (flip go subst) es) + go other _ = other + lowerSafeForeignCall :: DynFlags -> CmmBlock -> UniqSM CmmBlock lowerSafeForeignCall dflags block | (entry@(CmmEntry _ tscp), middle, CmmForeignCall { .. }) <- blockSplit block @@ -1008,8 +1034,11 @@ lowerSafeForeignCall dflags block id <- newTemp (bWord dflags) new_base <- newTemp (cmmRegType dflags (CmmGlobal BaseReg)) let (caller_save, caller_load) = callerSaveVolatileRegs dflags - save_state_code <- saveThreadState dflags Nothing - load_state_code <- loadThreadState dflags Nothing + let initialSp = findLastUnwinding Sp block + substSp :: Maybe InitialSp + substSp = substReg dflags (CmmGlobal Sp) <$> initialSp + save_state_code <- saveThreadState dflags substSp + load_state_code <- loadThreadState dflags substSp let suspend = save_state_code <*> caller_save <*> mkMiddle (callSuspendThread dflags id intrbl) From git at git.haskell.org Mon Jan 4 22:20:26 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 4 Jan 2016 22:20:26 +0000 (UTC) Subject: [commit: ghc] wip/libdw-unwind: iFix "Allow anywhere" (ed23b49) Message-ID: <20160104222026.9D8253A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/libdw-unwind Link : http://ghc.haskell.org/trac/ghc/changeset/ed23b494a51c6544da2061377e8e0b07671bd890/ghc >--------------------------------------------------------------- commit ed23b494a51c6544da2061377e8e0b07671bd890 Author: Ben Gamari Date: Sun Jan 3 02:22:31 2016 +0100 iFix "Allow anywhere" >--------------------------------------------------------------- ed23b494a51c6544da2061377e8e0b07671bd890 compiler/nativeGen/Dwarf.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/nativeGen/Dwarf.hs b/compiler/nativeGen/Dwarf.hs index e946a14..beb44b1 100644 --- a/compiler/nativeGen/Dwarf.hs +++ b/compiler/nativeGen/Dwarf.hs @@ -229,7 +229,7 @@ procToFrame initUws blk flatten b at DebugBlock{ dblPosition=pos, dblUnwind=uws, dblBlocks=blocks } | Just p <- pos = (p, (b, uws')):nested | otherwise = nested -- block was optimized out - where uws' = map (\(UnwindDecl lbl uw) -> UnwindDecl lbl (initUws `Map.union` uw)) uws + where uws' = map (\(UnwindDecl lbl uw) -> UnwindDecl lbl (uw `Map.union` initUws)) uws nested = concatMap flatten blocks -- | If the current procedure has an info table, then we also say that From git at git.haskell.org Mon Jan 4 22:20:29 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 4 Jan 2016 22:20:29 +0000 (UTC) Subject: [commit: ghc] wip/libdw-unwind: HACK: "Fix" labels (c45d744) Message-ID: <20160104222029.5C4853A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/libdw-unwind Link : http://ghc.haskell.org/trac/ghc/changeset/c45d7441d7b8ff2e41e83adfde176a300cb5b091/ghc >--------------------------------------------------------------- commit c45d7441d7b8ff2e41e83adfde176a300cb5b091 Author: Ben Gamari Date: Sun Jan 3 03:04:16 2016 +0100 HACK: "Fix" labels >--------------------------------------------------------------- c45d7441d7b8ff2e41e83adfde176a300cb5b091 compiler/cmm/Debug.hs | 11 ++++++++--- compiler/nativeGen/X86/Ppr.hs | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/compiler/cmm/Debug.hs b/compiler/cmm/Debug.hs index d8513d4..83eff7c 100644 --- a/compiler/cmm/Debug.hs +++ b/compiler/cmm/Debug.hs @@ -20,7 +20,7 @@ module Debug ( ) where -import BlockId ( blockLbl ) +import BlockId import CLabel import Cmm import CmmUtils @@ -32,6 +32,7 @@ import PprCore () import PprCmmExpr ( pprExpr ) import SrcLoc import Util +import Unique import Compiler.Hoopl @@ -269,7 +270,10 @@ type UnwindTable = Map.Map GlobalReg UnwindExpr -- | An unwinding table associated with a particular point in the generated -- code. -data UnwindDecl = UnwindDecl !Label !UnwindTable +data UnwindDecl = UnwindDecl !CLabel !UnwindTable + +instance Outputable UnwindDecl where + ppr (UnwindDecl lbl tbl) = parens $ ppr lbl <+> ppr tbl -- | Expressions, used for unwind information data UnwindExpr = UwConst Int -- ^ literal value @@ -302,7 +306,8 @@ extractUnwindTables b = mapMaybe nodeToUnwind $ blockToList mid nodeToUnwind :: CmmNode O O -> Maybe UnwindDecl nodeToUnwind (CmmUnwind lbl g so) = - Just $ UnwindDecl lbl' (Map.singleton g (toUnwindExpr so)) + -- FIXME: why a block label if this isn't a block? + Just $ UnwindDecl (mkAsmTempLabel $ getUnique lbl') (Map.singleton g (toUnwindExpr so)) where lbl' = case lbl of NewLabel l -> l diff --git a/compiler/nativeGen/X86/Ppr.hs b/compiler/nativeGen/X86/Ppr.hs index 8c1a336..44bb282 100644 --- a/compiler/nativeGen/X86/Ppr.hs +++ b/compiler/nativeGen/X86/Ppr.hs @@ -489,7 +489,7 @@ pprInstr (NEWBLOCK _) = panic "PprMach.pprInstr: NEWBLOCK" pprInstr (LABEL lbl) - = ppr lbl <> colon + = pprLabel $ mkAsmTempLabel $ getUnique lbl pprInstr (LDATA _ _) = panic "PprMach.pprInstr: LDATA" From git at git.haskell.org Mon Jan 4 22:20:32 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 4 Jan 2016 22:20:32 +0000 (UTC) Subject: [commit: ghc] wip/libdw-unwind: REVISIT: CmmLayoutStack: Always use new label (b7ed064) Message-ID: <20160104222032.046223A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/libdw-unwind Link : http://ghc.haskell.org/trac/ghc/changeset/b7ed064a2cd4c93abc8d8ad969d45df584664c73/ghc >--------------------------------------------------------------- commit b7ed064a2cd4c93abc8d8ad969d45df584664c73 Author: Ben Gamari Date: Mon Jan 4 12:57:52 2016 +0100 REVISIT: CmmLayoutStack: Always use new label Otherwise we might end up with a reference to a block that was eliminated during flow control. Ideally we would just ensure that these unwindings are dropped along with the block itself. >--------------------------------------------------------------- b7ed064a2cd4c93abc8d8ad969d45df584664c73 compiler/cmm/CmmLayoutStack.hs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/compiler/cmm/CmmLayoutStack.hs b/compiler/cmm/CmmLayoutStack.hs index 49503e9..2732470 100644 --- a/compiler/cmm/CmmLayoutStack.hs +++ b/compiler/cmm/CmmLayoutStack.hs @@ -28,6 +28,7 @@ import DynFlags import FastString import Outputable hiding ( isEmpty ) import qualified Data.Set as Set +import Control.Monad ((<=<)) import Control.Monad.Fix import Data.Array as Array import Data.Bits @@ -788,12 +789,13 @@ manifestSp dflags stackmaps stack0 sp0 sp_high = do let -- Add unwind pseudo-instructions to document Sp level for debugging add_unwind_info block - | debugLevel dflags > 0 = CmmUnwind (ExistingLabel $ entryLabel first) Sp sp_unwind : block - | otherwise = block + | debugLevel dflags > 0 = do lbl <- newBlockId + pure $ CmmUnwind (NewLabel lbl) Sp sp_unwind : block + | otherwise = pure block sp_unwind = CmmRegOff (CmmGlobal Sp) (sp0 - wORD_SIZE dflags) - final_middle <- maybeAddSpAdj dflags sp0 sp_off $ - blockFromList $ + final_middle <- maybeAddSpAdj dflags sp0 sp_off <=< + pure . blockFromList <=< add_unwind_info $ map adj_pre_sp $ elimStackStores stack0 stackmaps area_off $ From git at git.haskell.org Mon Jan 4 22:20:34 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 4 Jan 2016 22:20:34 +0000 (UTC) Subject: [commit: ghc] wip/libdw-unwind: CmmNode: Add Outputable for NewOrExistingLabel (855c291) Message-ID: <20160104222034.A6ECB3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/libdw-unwind Link : http://ghc.haskell.org/trac/ghc/changeset/855c291d9afbe29e815f5e58475a398ad3e96733/ghc >--------------------------------------------------------------- commit 855c291d9afbe29e815f5e58475a398ad3e96733 Author: Ben Gamari Date: Mon Jan 4 12:59:02 2016 +0100 CmmNode: Add Outputable for NewOrExistingLabel >--------------------------------------------------------------- 855c291d9afbe29e815f5e58475a398ad3e96733 compiler/cmm/CmmNode.hs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compiler/cmm/CmmNode.hs b/compiler/cmm/CmmNode.hs index 41ca932..f507fd5 100644 --- a/compiler/cmm/CmmNode.hs +++ b/compiler/cmm/CmmNode.hs @@ -248,6 +248,10 @@ type UpdFrameOffset = ByteOff data NewOrExistingLabel = NewLabel !Label | ExistingLabel !Label deriving (Eq) +instance Outputable NewOrExistingLabel where + ppr (NewLabel lbl) = text "NewLabel" <+> ppr lbl + ppr (ExistingLabel lbl) = text "ExistingLabel" <+> ppr lbl + -- | A convention maps a list of values (function arguments or return -- values) to registers or stack locations. data Convention From git at git.haskell.org Mon Jan 4 22:20:37 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 4 Jan 2016 22:20:37 +0000 (UTC) Subject: [commit: ghc] wip/libdw-unwind: Debug: Refactor handling of unwinding points (e82df20) Message-ID: <20160104222037.5ACFE3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/libdw-unwind Link : http://ghc.haskell.org/trac/ghc/changeset/e82df203d07e8cc879584aa339851df09edaab61/ghc >--------------------------------------------------------------- commit e82df203d07e8cc879584aa339851df09edaab61 Author: Ben Gamari Date: Mon Jan 4 12:59:49 2016 +0100 Debug: Refactor handling of unwinding points We now wrap the set of unwinding points within a block in a newtype to mark the fact that they must be sorted by the order that the labels occur in the block. Moreover, we fix an oversight in the previous design where unwind information would be duplicated while propagating unwinding information from predecessor blocks. >--------------------------------------------------------------- e82df203d07e8cc879584aa339851df09edaab61 compiler/cmm/Debug.hs | 70 +++++++++++++++++++++++++-------------- compiler/nativeGen/Dwarf.hs | 12 +++---- compiler/nativeGen/Dwarf/Types.hs | 14 +++++--- 3 files changed, 60 insertions(+), 36 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc e82df203d07e8cc879584aa339851df09edaab61 From git at git.haskell.org Mon Jan 4 22:20:39 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 4 Jan 2016 22:20:39 +0000 (UTC) Subject: [commit: ghc] wip/libdw-unwind: PprCmm: Print label in CmmUnwind output (6761a91) Message-ID: <20160104222040.000793A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/libdw-unwind Link : http://ghc.haskell.org/trac/ghc/changeset/6761a91083ca55f798b18c57f0fb0206d9934bcd/ghc >--------------------------------------------------------------- commit 6761a91083ca55f798b18c57f0fb0206d9934bcd Author: Ben Gamari Date: Mon Jan 4 13:01:31 2016 +0100 PprCmm: Print label in CmmUnwind output >--------------------------------------------------------------- 6761a91083ca55f798b18c57f0fb0206d9934bcd compiler/cmm/PprCmm.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/cmm/PprCmm.hs b/compiler/cmm/PprCmm.hs index 89cbc99..7b15e91 100644 --- a/compiler/cmm/PprCmm.hs +++ b/compiler/cmm/PprCmm.hs @@ -197,7 +197,8 @@ pprNode node = pp_node <+> pp_debug else empty -- unwind reg = expr; - CmmUnwind _ r e -> ptext (sLit "unwind ") <> ppr r <+> char '=' <+> ppr e + CmmUnwind lbl r e -> ptext (sLit "unwind ") <> ppr r <+> char '=' <+> ppr e + <+> text "//" <+> ppr lbl -- reg = expr; CmmAssign reg expr -> ppr reg <+> equals <+> ppr expr <> semi From git at git.haskell.org Mon Jan 4 22:20:42 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 4 Jan 2016 22:20:42 +0000 (UTC) Subject: [commit: ghc] wip/libdw-unwind: Encode multiple registers per CmmUnwind (b3ea026) Message-ID: <20160104222042.A9D9A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/libdw-unwind Link : http://ghc.haskell.org/trac/ghc/changeset/b3ea026ee03cd1525e53c98884f0b484bd68f922/ghc >--------------------------------------------------------------- commit b3ea026ee03cd1525e53c98884f0b484bd68f922 Author: Ben Gamari Date: Mon Jan 4 16:13:21 2016 +0100 Encode multiple registers per CmmUnwind This ends up being important since there is a subtle difference between two CmmUnwinds and one in the presence of the (-1) offset applied to frame information for blocks with info tables. This is because the offset will only be applied to the first CmmUnwind within a block, even if the two nodes apply to the same address. >--------------------------------------------------------------- b3ea026ee03cd1525e53c98884f0b484bd68f922 compiler/cmm/CmmCommonBlockElim.hs | 2 +- compiler/cmm/CmmLayoutStack.hs | 12 ++++++------ compiler/cmm/CmmNode.hs | 8 ++++---- compiler/cmm/CmmParse.y | 11 +++++++++-- compiler/cmm/Debug.hs | 4 ++-- compiler/cmm/MkGraph.hs | 2 +- compiler/cmm/PprCmm.hs | 2 +- compiler/codeGen/StgCmmMonad.hs | 6 +++--- compiler/nativeGen/X86/CodeGen.hs | 2 +- rts/StgStartup.cmm | 4 ++-- 10 files changed, 30 insertions(+), 23 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc b3ea026ee03cd1525e53c98884f0b484bd68f922 From git at git.haskell.org Mon Jan 4 22:20:45 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 4 Jan 2016 22:20:45 +0000 (UTC) Subject: [commit: ghc] wip/libdw-unwind: StgCmmForeign: Kill erroneous dereference (ad2a0a2) Message-ID: <20160104222045.60ADE3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/libdw-unwind Link : http://ghc.haskell.org/trac/ghc/changeset/ad2a0a2ed1723bf7e7c758733c8b0f676de139eb/ghc >--------------------------------------------------------------- commit ad2a0a2ed1723bf7e7c758733c8b0f676de139eb Author: Ben Gamari Date: Mon Jan 4 17:21:50 2016 +0100 StgCmmForeign: Kill erroneous dereference >--------------------------------------------------------------- ad2a0a2ed1723bf7e7c758733c8b0f676de139eb compiler/codeGen/StgCmmForeign.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/codeGen/StgCmmForeign.hs b/compiler/codeGen/StgCmmForeign.hs index cb185ea..0b870ec 100644 --- a/compiler/codeGen/StgCmmForeign.hs +++ b/compiler/codeGen/StgCmmForeign.hs @@ -309,7 +309,7 @@ saveThreadState dflags initialSp = do CmmLoad (cmmOffset dflags stgCurrentTSO (tso_stackobj dflags)) (bWord dflags) spValue = cmmOffset dflags tsoValue (stack_SP dflags) - in mkUnwind (NewLabel lbl) Sp (initial $ CmmLoad spValue (bWord dflags)) + in mkUnwind (NewLabel lbl) Sp (initial spValue) _ -> mkNop, close_nursery, -- and save the current cost centre stack in the TSO when profiling: From git at git.haskell.org Tue Jan 5 09:31:18 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 5 Jan 2016 09:31:18 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Avoid generating guards for CoPats if possible (Addresses #11276) (c1acc2a) Message-ID: <20160105093118.D8E203A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/c1acc2a92947f512b1a6a20019524af09266a2aa/ghc >--------------------------------------------------------------- commit c1acc2a92947f512b1a6a20019524af09266a2aa Author: George Karachalias Date: Mon Jan 4 21:02:26 2016 +0100 Avoid generating guards for CoPats if possible (Addresses #11276) When translating a `CoPat` to `PmPat` check whether the wrapper is just a hole or a cast with refl. In these cases we can safely drop the wrapper and generate less guard patterns. Fixes T11276. Differential Revision: https://phabricator.haskell.org/D1729 (cherry picked from commit 0acdcf2482d24903b504e6b34fa745ef855ff00d) >--------------------------------------------------------------- c1acc2a92947f512b1a6a20019524af09266a2aa compiler/deSugar/Check.hs | 29 +++++- testsuite/tests/pmcheck/should_compile/T11276.hs | 105 +++++++++++++++++++++ .../tests/pmcheck/should_compile/T11276.stderr | 0 testsuite/tests/pmcheck/should_compile/all.T | 1 + 4 files changed, 130 insertions(+), 5 deletions(-) diff --git a/compiler/deSugar/Check.hs b/compiler/deSugar/Check.hs index fd0c6e0..5d8a171 100644 --- a/compiler/deSugar/Check.hs +++ b/compiler/deSugar/Check.hs @@ -52,6 +52,8 @@ import DsGRHSs -- isTrueLHsExpr import Data.List -- find import Data.Maybe -- isNothing, isJust, fromJust import Control.Monad -- liftM3, forM +import Coercion +import TcEvidence {- This module checks pattern matches for: @@ -281,11 +283,15 @@ translatePat pat = case pat of SigPatOut p _ty -> translatePat (unLoc p) - CoPat wrapper p ty -> do - ps <- translatePat p - (xp,xe) <- mkPmId2FormsSM ty - let g = mkGuard ps (HsWrap wrapper (unLoc xe)) - return [xp,g] + -- See Note [Translate CoPats] + CoPat wrapper p ty + | isIdHsWrapper wrapper -> translatePat p + | WpCast co <- wrapper, isReflexiveCo co -> translatePat p + | otherwise -> do + ps <- translatePat p + (xp,xe) <- mkPmId2FormsSM ty + let g = mkGuard ps (HsWrap wrapper (unLoc xe)) + return [xp,g] -- (n + k) ===> x (True <- x >= k) (n <- x-k) NPlusKPat (L _ n) k ge minus -> do @@ -616,6 +622,19 @@ Additionally, top-level guard translation (performed by @translateGuards@) replaces guards that cannot be reasoned about (like the ones we described in 1-4) with a single @fake_pat@ to record the possibility of failure to match. +Note [Translate CoPats] +~~~~~~~~~~~~~~~~~~~~~~~ +The pattern match checker did not know how to handle coerced patterns `CoPat` +efficiently, which gave rise to #11276. The original approach translated +`CoPat`s: + + pat |> co ===> x (pat <- (e |> co)) + +Instead, we now check whether the coercion is a hole or if it is just refl, in +which case we can drop it. Unfortunately, data families generate useful +coercions so guards are still generated in these cases and checking data +families is not really efficient. + %************************************************************************ %* * Main Pattern Matching Check diff --git a/testsuite/tests/pmcheck/should_compile/T11276.hs b/testsuite/tests/pmcheck/should_compile/T11276.hs new file mode 100644 index 0000000..16e0155 --- /dev/null +++ b/testsuite/tests/pmcheck/should_compile/T11276.hs @@ -0,0 +1,105 @@ +{-# LANGUAGE RankNTypes #-} +module Hang where +import Control.Monad +import Data.Char + +data Event + = EventBeginDocument + | EventEndDocument + | EventBeginDoctype + | EventEndDoctype + | EventInstruction + | EventBeginElement + | EventEndElement + | EventContent Content + | EventComment + | EventCDATA + +data Content + = ContentText String + | ContentEntity String + + +peek :: Monad m => Consumer a m (Maybe a) +peek = undefined + +type Consumer i m r = forall o. ConduitM i o m r + +tag :: forall m a b c o . Monad m => + ConduitM Event o m (Maybe c) +tag = do + _ <- dropWS + return undefined + where +-- Add this and it works +-- dropWS :: Monad m => ConduitM Event o m (Maybe Event) + dropWS = do +-- Swap these two lines and it works + -- let x = undefined + x <- peek + let isWS = + case x of + -- Remove some of these and it works + Just EventBeginDocument -> True + Just EventEndDocument -> True + Just EventBeginDoctype{} -> True + Just EventEndDoctype -> True + Just EventInstruction{} -> True + Just EventBeginElement{} -> False + Just EventEndElement{} -> False + Just (EventContent (ContentText t)) + | all isSpace t -> True + | otherwise -> False + Just (EventContent ContentEntity{}) -> False + Just EventComment{} -> True + Just EventCDATA{} -> False + Nothing -> False + if isWS then dropWS else return x + + +-- Inlined Instances + +instance Functor (ConduitM i o m) where + fmap f (ConduitM c) = ConduitM $ \rest -> c (rest . f) + +instance Applicative (ConduitM i o m) where + pure x = ConduitM ($ x) + {-# INLINE pure #-} + (<*>) = ap + {-# INLINE (<*>) #-} + +instance Monad (ConduitM i o m) where + return = pure + ConduitM f >>= g = ConduitM $ \h -> f $ \a -> unConduitM (g a) h + +instance Monad m => Functor (Pipe l i o u m) where + fmap = liftM + {-# INLINE fmap #-} + +instance Monad m => Applicative (Pipe l i o u m) where + pure = Done + {-# INLINE pure #-} + (<*>) = ap + {-# INLINE (<*>) #-} + +instance Monad m => Monad (Pipe l i o u m) where + return = pure + {-# INLINE return #-} + + HaveOutput p c o >>= fp = HaveOutput (p >>= fp) c o + NeedInput p c >>= fp = NeedInput (p >=> fp) (c >=> fp) + Done x >>= fp = fp x + PipeM mp >>= fp = PipeM ((>>= fp) `liftM` mp) + Leftover p i >>= fp = Leftover (p >>= fp) i + +newtype ConduitM i o m r = ConduitM + { unConduitM :: forall b. + (r -> Pipe i i o () m b) -> Pipe i i o () m b + } + +data Pipe l i o u m r = + HaveOutput (Pipe l i o u m r) (m ()) o + | NeedInput (i -> Pipe l i o u m r) (u -> Pipe l i o u m r) + | Done r + | PipeM (m (Pipe l i o u m r)) + | Leftover (Pipe l i o u m r) l diff --git a/libraries/base/tests/IO/misc001.stdout b/testsuite/tests/pmcheck/should_compile/T11276.stderr similarity index 100% copy from libraries/base/tests/IO/misc001.stdout copy to testsuite/tests/pmcheck/should_compile/T11276.stderr diff --git a/testsuite/tests/pmcheck/should_compile/all.T b/testsuite/tests/pmcheck/should_compile/all.T index 9278fde..59795b3 100644 --- a/testsuite/tests/pmcheck/should_compile/all.T +++ b/testsuite/tests/pmcheck/should_compile/all.T @@ -23,6 +23,7 @@ test('T8970', only_compiler_types(['ghc']), compile, ['-fwarn-incomplete-pattern test('T9951b',only_compiler_types(['ghc']), compile, ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns']) test('T9951', only_compiler_types(['ghc']), compile, ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns']) test('T11303', normal, compile, ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns +RTS -M1G -RTS']) +test('T11276', compile_timeout_multiplier(0.01), compile, ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns +RTS -M1G -RTS']) # Other tests test('pmc001', only_compiler_types(['ghc']), compile, ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns']) From git at git.haskell.org Tue Jan 5 09:56:45 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 5 Jan 2016 09:56:45 +0000 (UTC) Subject: [commit: ghc] master: Add (failing) test case for #11347 (1a8b752) Message-ID: <20160105095645.91AC13A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/1a8b752d8b03266aca3e83f79c311056d6c43e00/ghc >--------------------------------------------------------------- commit 1a8b752d8b03266aca3e83f79c311056d6c43e00 Author: Joachim Breitner Date: Tue Jan 5 10:56:47 2016 +0100 Add (failing) test case for #11347 Unfortunately, I could not add the expected error message, so if someone accidentally fixes this bug, this test will still be failing (no harm). But maybe someone stumbles over it then and can update the expected output. >--------------------------------------------------------------- 1a8b752d8b03266aca3e83f79c311056d6c43e00 testsuite/tests/typecheck/should_fail/T11347.hs | 19 +++++++++++++++++++ testsuite/tests/typecheck/should_fail/T11347.stderr | 2 ++ testsuite/tests/typecheck/should_fail/all.T | 1 + 3 files changed, 22 insertions(+) diff --git a/testsuite/tests/typecheck/should_fail/T11347.hs b/testsuite/tests/typecheck/should_fail/T11347.hs new file mode 100644 index 0000000..eaffdfd --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T11347.hs @@ -0,0 +1,19 @@ +-- Should AllowAmbiguousTypes relaly be needed here? +{-# LANGUAGE TypeFamilies, GeneralizedNewtypeDeriving, MultiParamTypeClasses, FlexibleInstances, AllowAmbiguousTypes #-} +module T11347 where + +newtype Id1 a = MkId1 a +newtype Id2 a = MkId2 (Id1 a) deriving (UnsafeCast b) + +type family Discern a b +type instance Discern (Id1 a) b = a +type instance Discern (Id2 a) b = b + +class UnsafeCast to from where + unsafe :: from -> Discern from to + +instance UnsafeCast b (Id1 a) where + unsafe (MkId1 x) = x + +unsafeCoerce :: a -> b +unsafeCoerce x = unsafe (MkId2 (MkId1 x)) diff --git a/testsuite/tests/typecheck/should_fail/T11347.stderr b/testsuite/tests/typecheck/should_fail/T11347.stderr new file mode 100644 index 0000000..1de61cd --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T11347.stderr @@ -0,0 +1,2 @@ +dummy stderr: +here should be something about roles _not_ "No skolem info" diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T index 4279950..93dd0c7 100644 --- a/testsuite/tests/typecheck/should_fail/all.T +++ b/testsuite/tests/typecheck/should_fail/all.T @@ -398,3 +398,4 @@ test('T11112', normal, compile_fail, ['']) test('ClassOperator', normal, compile_fail, ['']) test('T11274', normal, compile_fail, ['']) test('T10619', normal, compile_fail, ['']) +test('T11347', expect_broken(11347), compile_fail, ['']) From git at git.haskell.org Tue Jan 5 12:28:07 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 5 Jan 2016 12:28:07 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: relnotes: Remove redundant entry (1cff3ca) Message-ID: <20160105122807.6F0E33A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/1cff3cac8d0ee36bdf681e42d70c4f5b9e886723/ghc >--------------------------------------------------------------- commit 1cff3cac8d0ee36bdf681e42d70c4f5b9e886723 Author: Ben Gamari Date: Tue Jan 5 13:27:01 2016 +0100 relnotes: Remove redundant entry >--------------------------------------------------------------- 1cff3cac8d0ee36bdf681e42d70c4f5b9e886723 docs/users_guide/8.0.1-notes.rst | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/docs/users_guide/8.0.1-notes.rst b/docs/users_guide/8.0.1-notes.rst index 013b7b8..795f909 100644 --- a/docs/users_guide/8.0.1-notes.rst +++ b/docs/users_guide/8.0.1-notes.rst @@ -436,7 +436,7 @@ See ``changelog.md`` in the ``base`` package for full release notes. - ``forever``, ``filterM``, ``mapAndUnzipM``, ``zipWithM``, ``zipWithM_``, ``replicateM``, and ``replicateM`` were generalized from ``Monad`` to ``Applicative``. If this causes performance regressions, try to make the - implementation of ``(*>)`` match that of ``(>>)``. + implementation of ``(*>)`` match that of ``(>>)`` (see :ghc-ticket:`10168`). - Add ``URec``, ``UAddr``, ``UChar``, ``UDouble``, ``UFloat``, ``UInt``, and ``UWord`` to ``GHC.Generics`` as part of making GHC generics capable of handling unlifted @@ -450,10 +450,6 @@ See ``changelog.md`` in the ``base`` package for full release notes. super-class of ``Monoid`` in the future). These modules were provided by the ``semigroups`` package previously. (:ghc-ticket:`10365`) -- The constraints of various functions in ``Control.Monad`` have been - generalized from ``Monad`` to ``Applicative`` including ``filterM``, - ``zipWithM`` and ``replicateM_`` (see :ghc-ticket:`10168`). - - Add ``GHC.TypeLits.TypeError`` and ``ErrorMessage`` to allow users to define custom compile-time error messages. From git at git.haskell.org Tue Jan 5 21:07:14 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 5 Jan 2016 21:07:14 +0000 (UTC) Subject: [commit: ghc] master: Release notes: Mention remote GHCi (1f526d2) Message-ID: <20160105210714.20B223A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/1f526d2ad22494d4428f90dbfce7d7224f6b2d1d/ghc >--------------------------------------------------------------- commit 1f526d2ad22494d4428f90dbfce7d7224f6b2d1d Author: Ben Gamari Date: Tue Jan 5 14:21:01 2016 +0100 Release notes: Mention remote GHCi >--------------------------------------------------------------- 1f526d2ad22494d4428f90dbfce7d7224f6b2d1d docs/users_guide/8.0.1-notes.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/users_guide/8.0.1-notes.rst b/docs/users_guide/8.0.1-notes.rst index 013b7b8..1e47d19 100644 --- a/docs/users_guide/8.0.1-notes.rst +++ b/docs/users_guide/8.0.1-notes.rst @@ -279,6 +279,11 @@ GHCi (such as Emacs' ``haskell-mode``) originally premiered by ``ghci-ng`` have been integrated into GHCi (:ghc-ticket:`10874`). +- GHCi now supports decoupled operation between the interpreter and the + shell. While this is largely an implementation detail, it opens up a few + interesting possibilities in the future. See :ghc-wiki:`RemoteGHCi` for + details. + Template Haskell ~~~~~~~~~~~~~~~~ From git at git.haskell.org Tue Jan 5 21:07:16 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 5 Jan 2016 21:07:16 +0000 (UTC) Subject: [commit: ghc] master: ghc.mk: Add reference to Trac #5987 (cdeefa4) Message-ID: <20160105210716.B9EDD3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/cdeefa44ac8e2452a691708715bd2157a7bf3f0e/ghc >--------------------------------------------------------------- commit cdeefa44ac8e2452a691708715bd2157a7bf3f0e Author: Ben Gamari Date: Tue Jan 5 15:09:57 2016 +0100 ghc.mk: Add reference to Trac #5987 >--------------------------------------------------------------- cdeefa44ac8e2452a691708715bd2157a7bf3f0e compiler/ghc.mk | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/compiler/ghc.mk b/compiler/ghc.mk index f9ca71c..e4d9ee4 100644 --- a/compiler/ghc.mk +++ b/compiler/ghc.mk @@ -441,9 +441,10 @@ compiler_stage1_SplitSections = NO compiler_stage2_SplitSections = NO compiler_stage3_SplitSections = NO -# There are too many symbols in the ghc package for a Windows DLL. -# We therefore need to split some of the modules off into a separate -# DLL. This clump are the modules reachable from DynFlags: +# There are too many symbols in the ghc package for a Windows DLL +# (due to a limitation of bfd ld, see Trac #5987). We therefore need to split +# some of the modules off into a separate DLL. This clump are the modules +# reachable from DynFlags: compiler_stage2_dll0_START_MODULE = DynFlags compiler_stage2_dll0_MODULES = \ Annotations \ From git at git.haskell.org Tue Jan 5 21:07:19 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 5 Jan 2016 21:07:19 +0000 (UTC) Subject: [commit: ghc] master: Remove -Wtoo-many-guards from default flags (fixes #11316) (77494fa) Message-ID: <20160105210719.788FA3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/77494fa9fa34c1a831caabc194e855167de0c2d9/ghc >--------------------------------------------------------------- commit 77494fa9fa34c1a831caabc194e855167de0c2d9 Author: George Karachalias Date: Tue Jan 5 15:59:49 2016 +0100 Remove -Wtoo-many-guards from default flags (fixes #11316) Since #11316 indicates that having flag `-Wtoo-many-guards` enabled by default causes issues, the simplest thing is to remove it. This patch removes it from the default list, it updates the docs and removes the suppression flags for `T783` and `types/OptCoercion.hs` Test Plan: validate Reviewers: bgamari, austin, goldfire Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1737 GHC Trac Issues: #11316 >--------------------------------------------------------------- 77494fa9fa34c1a831caabc194e855167de0c2d9 compiler/main/DynFlags.hs | 1 - compiler/types/OptCoercion.hs | 6 +----- docs/users_guide/8.0.1-notes.rst | 3 +-- docs/users_guide/using-warnings.rst | 11 ++++++----- testsuite/tests/perf/compiler/T783.hs | 5 ----- 5 files changed, 8 insertions(+), 18 deletions(-) diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index fcb954e..29c1423 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -3400,7 +3400,6 @@ optLevelFlags -- see Note [Documenting optimisation flags] standardWarnings :: [WarningFlag] standardWarnings -- see Note [Documenting warning flags] = [ Opt_WarnOverlappingPatterns, - Opt_WarnTooManyGuards, Opt_WarnWarningsDeprecations, Opt_WarnDeprecatedFlags, Opt_WarnDeferredTypeErrors, diff --git a/compiler/types/OptCoercion.hs b/compiler/types/OptCoercion.hs index 41cec21..1038851 100644 --- a/compiler/types/OptCoercion.hs +++ b/compiler/types/OptCoercion.hs @@ -1,14 +1,10 @@ -- (c) The University of Glasgow 2006 {-# LANGUAGE CPP #-} -#if __GLASGOW_HASKELL__ > 710 -{-# OPTIONS_GHC -Wno-too-many-guards #-} -#endif -- 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). + -- (default behaviour when guards are too many). module OptCoercion ( optCoercion, checkAxInstCo ) where diff --git a/docs/users_guide/8.0.1-notes.rst b/docs/users_guide/8.0.1-notes.rst index 1e47d19..08f4800 100644 --- a/docs/users_guide/8.0.1-notes.rst +++ b/docs/users_guide/8.0.1-notes.rst @@ -248,8 +248,7 @@ Compiler - Added the ``-Wtoo-many-guards`` flag. When enabled, this will issue a warning if a pattern match contains too many guards (over 20 at the - moment). It is enabled by default but makes a difference only if pattern - match checking is also enabled. + moment). Makes a difference only if pattern match checking is also enabled. - Added the ``-ffull-guard-reasoning`` flag. When enabled, pattern match checking tries its best to reason about guards. Since the additional diff --git a/docs/users_guide/using-warnings.rst b/docs/users_guide/using-warnings.rst index 619f701..bc12688 100644 --- a/docs/users_guide/using-warnings.rst +++ b/docs/users_guide/using-warnings.rst @@ -545,14 +545,15 @@ of ``-W(no-)*``. The option ``-Wtoo-many-guards`` warns about places where a pattern match contains too many guards (over 20 at the moment). - It is enabled by default but has an effect only if any form of - exhaustivness/overlapping checking is enabled (one of + It has an effect only if any form of exhaustivness/overlapping + checking is enabled (one of ``-Wincomplete-patterns``, ``-Wincomplete-uni-patterns``, ``-Wincomplete-record-updates``, - ``-Woverlapping-patterns``). The warning can be suppressed by - enabling either ``-Wno-too-many-guards``, which just hides the - warning, or ``-ffull-guard-reasoning``. + ``-Woverlapping-patterns``). When enabled, the warning can be + suppressed by enabling either ``-Wno-too-many-guards``, which just + hides the warning, or ``-ffull-guard-reasoning`` which runs the + full check, independently of the number of guards. ``-ffull-guard-reasoning`` .. index:: diff --git a/testsuite/tests/perf/compiler/T783.hs b/testsuite/tests/perf/compiler/T783.hs index cfd6b62..c3ea08d 100644 --- a/testsuite/tests/perf/compiler/T783.hs +++ b/testsuite/tests/perf/compiler/T783.hs @@ -1,8 +1,3 @@ -{-# LANGUAGE CPP #-} -#if __GLASGOW_HASKELL__ > 710 -{-# OPTIONS_GHC -Wno-too-many-guards #-} -#endif - module Test where foo :: Double -> Int From git at git.haskell.org Tue Jan 5 21:49:25 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 5 Jan 2016 21:49:25 +0000 (UTC) Subject: [commit: ghc] master: Add Cabal synopses and descriptions (e32a6e1) Message-ID: <20160105214925.E09053A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e32a6e1f4ac847272598776fd15f4a98069690e5/ghc >--------------------------------------------------------------- commit e32a6e1f4ac847272598776fd15f4a98069690e5 Author: Ben Gamari Date: Tue Jan 5 22:10:01 2016 +0100 Add Cabal synopses and descriptions Various people (myself included) have complained about the lack of useful descriptions for the various packages included in GHC's source tree. Fix this. Test Plan: Validate Reviewers: austin, thomie Reviewed By: thomie Subscribers: angerman, ezyang Differential Revision: https://phabricator.haskell.org/D1736 >--------------------------------------------------------------- e32a6e1f4ac847272598776fd15f4a98069690e5 ghc/ghc-bin.cabal.in | 7 ++++--- libraries/ghc-prim/ghc-prim.cabal | 2 +- libraries/ghci/ghci.cabal.in | 6 ++++-- utils/check-api-annotations/check-api-annotations.cabal | 8 ++++++-- utils/compare_sizes/compareSizes.cabal | 5 +++-- utils/deriveConstants/deriveConstants.cabal | 7 +++++-- utils/dll-split/dll-split.cabal | 10 ++++++++-- utils/genapply/genapply.cabal | 7 +++++-- utils/genprimopcode/genprimopcode.cabal | 10 ++++++++-- utils/ghc-cabal/Main.hs | 2 +- utils/ghc-cabal/ghc-cabal.cabal | 8 ++++++-- utils/ghc-pkg/ghc-pkg.cabal | 7 +++++-- utils/ghctags/ghctags.cabal | 2 +- utils/mkUserGuidePart/mkUserGuidePart.cabal | 5 +++-- utils/runghc/runghc.cabal.in | 14 ++++++++++++-- 15 files changed, 72 insertions(+), 28 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc e32a6e1f4ac847272598776fd15f4a98069690e5 From git at git.haskell.org Tue Jan 5 21:49:28 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 5 Jan 2016 21:49:28 +0000 (UTC) Subject: [commit: ghc] master: StgCmmForeign: Push local register creation into code generation (bbee3e1) Message-ID: <20160105214928.9F6C83A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/bbee3e167b79d66d4a5973ea1242e2f02c2ddf13/ghc >--------------------------------------------------------------- commit bbee3e167b79d66d4a5973ea1242e2f02c2ddf13 Author: Ben Gamari Date: Tue Jan 5 22:10:28 2016 +0100 StgCmmForeign: Push local register creation into code generation The interfaces to {save,load}ThreadState were quite messy due to the need to pass in local registers (produced with draws from a unique supply) since they were used from both FCode and UniqSM. This, however, is entirely unnecessary as we already have an abstraction to capture this effect: MonadUnique. Use it. This is part of an effort to properly represent stack unwinding information for foreign calls. Test Plan: validate Reviewers: austin, simonmar Reviewed By: simonmar Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1733 >--------------------------------------------------------------- bbee3e167b79d66d4a5973ea1242e2f02c2ddf13 compiler/cmm/CmmLayoutStack.hs | 15 ++---- compiler/codeGen/StgCmmForeign.hs | 106 ++++++++++++++++++-------------------- compiler/codeGen/StgCmmMonad.hs | 6 +++ compiler/codeGen/StgCmmUtils.hs | 5 +- 4 files changed, 64 insertions(+), 68 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc bbee3e167b79d66d4a5973ea1242e2f02c2ddf13 From git at git.haskell.org Tue Jan 5 21:49:31 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 5 Jan 2016 21:49:31 +0000 (UTC) Subject: [commit: ghc] master: StgCmmForeign: Break up long line (bd702f4) Message-ID: <20160105214931.516BC3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/bd702f496c1dfdb5a5cf5c1c8c59cce37ed1beda/ghc >--------------------------------------------------------------- commit bd702f496c1dfdb5a5cf5c1c8c59cce37ed1beda Author: Ben Gamari Date: Sat Jan 2 17:22:11 2016 +0100 StgCmmForeign: Break up long line >--------------------------------------------------------------- bd702f496c1dfdb5a5cf5c1c8c59cce37ed1beda compiler/codeGen/StgCmmForeign.hs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/compiler/codeGen/StgCmmForeign.hs b/compiler/codeGen/StgCmmForeign.hs index cbbf3b6..c8db864 100644 --- a/compiler/codeGen/StgCmmForeign.hs +++ b/compiler/codeGen/StgCmmForeign.hs @@ -287,7 +287,13 @@ saveThreadState dflags = do -- tso = CurrentTSO; mkAssign (CmmLocal tso) stgCurrentTSO, -- tso->stackobj->sp = Sp; - mkStore (cmmOffset dflags (CmmLoad (cmmOffset dflags (CmmReg (CmmLocal tso)) (tso_stackobj dflags)) (bWord dflags)) (stack_SP dflags)) stgSp, + mkStore (cmmOffset dflags + (CmmLoad (cmmOffset dflags + (CmmReg (CmmLocal tso)) + (tso_stackobj dflags)) + (bWord dflags)) + (stack_SP dflags)) + stgSp, close_nursery, -- and save the current cost centre stack in the TSO when profiling: if gopt Opt_SccProfilingOn dflags then From git at git.haskell.org Tue Jan 5 21:49:34 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 5 Jan 2016 21:49:34 +0000 (UTC) Subject: [commit: ghc] master: Extend ghc environment file features (aa699b9) Message-ID: <20160105214934.0400B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/aa699b94e3a8ec92bcfa8ba3dbd6b0de15de8873/ghc >--------------------------------------------------------------- commit aa699b94e3a8ec92bcfa8ba3dbd6b0de15de8873 Author: Duncan Coutts Date: Tue Jan 5 22:13:26 2016 +0100 Extend ghc environment file features A set of changes to enable local ghc env files to be useful for tools like cabal. Ultimately it will allow cabal to maintain a ghc env file so that users can simple run ghc or ghci in a project directory and get the expected environment of the project. Change the name of .ghc.environment files to include the platform and ghc version, e.g. .ghc.environment.x86_64-linux-7.6.3, since their content is version specific. Strictly speaking this is not backwards compatible, but we think this feature is not widely used yet. "Look up" for a local env file, like the behaviour of git/darcs etc. So you can be anywhere within a project and get the expected environment. Don't look for local env files when -hide-all-packages is given. Extend the syntax of env files to allow specifying package dbs too. Test Plan: Currently completely untested. Compiles, that is all. Sorry, have to disappear for the hols. Reviewers: hvr, ezyang, austin, bgamari Reviewed By: ezyang, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1668 GHC Trac Issues: #11268 >--------------------------------------------------------------- aa699b94e3a8ec92bcfa8ba3dbd6b0de15de8873 compiler/main/DynFlags.hs | 109 ++++++++++++++++++++++++++++++++---------- docs/users_guide/packages.rst | 45 +++++++++++++---- 2 files changed, 120 insertions(+), 34 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc aa699b94e3a8ec92bcfa8ba3dbd6b0de15de8873 From git at git.haskell.org Tue Jan 5 22:34:10 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 5 Jan 2016 22:34:10 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Add Cabal synopses and descriptions (8270536) Message-ID: <20160105223410.EA0CB3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/8270536cbdd2643149fb80c5309cb20818b12a46/ghc >--------------------------------------------------------------- commit 8270536cbdd2643149fb80c5309cb20818b12a46 Author: Ben Gamari Date: Tue Jan 5 22:10:01 2016 +0100 Add Cabal synopses and descriptions Various people (myself included) have complained about the lack of useful descriptions for the various packages included in GHC's source tree. Fix this. Test Plan: Validate Reviewers: austin, thomie Reviewed By: thomie Subscribers: angerman, ezyang Differential Revision: https://phabricator.haskell.org/D1736 >--------------------------------------------------------------- 8270536cbdd2643149fb80c5309cb20818b12a46 ghc/ghc-bin.cabal.in | 7 ++++--- libraries/ghc-prim/ghc-prim.cabal | 2 +- libraries/ghci/ghci.cabal.in | 6 ++++-- utils/check-api-annotations/check-api-annotations.cabal | 8 ++++++-- utils/compare_sizes/compareSizes.cabal | 5 +++-- utils/deriveConstants/deriveConstants.cabal | 7 +++++-- utils/dll-split/dll-split.cabal | 10 ++++++++-- utils/genapply/genapply.cabal | 7 +++++-- utils/genprimopcode/genprimopcode.cabal | 10 ++++++++-- utils/ghc-cabal/Main.hs | 2 +- utils/ghc-cabal/ghc-cabal.cabal | 8 ++++++-- utils/ghc-pkg/ghc-pkg.cabal | 7 +++++-- utils/ghctags/ghctags.cabal | 2 +- utils/mkUserGuidePart/mkUserGuidePart.cabal | 5 +++-- utils/runghc/runghc.cabal.in | 14 ++++++++++++-- 15 files changed, 72 insertions(+), 28 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 8270536cbdd2643149fb80c5309cb20818b12a46 From git at git.haskell.org Tue Jan 5 22:34:13 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 5 Jan 2016 22:34:13 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Extend ghc environment file features (57fa4c5) Message-ID: <20160105223413.997A73A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/57fa4c59bb92c12845e5d313c015bac1af657b55/ghc >--------------------------------------------------------------- commit 57fa4c59bb92c12845e5d313c015bac1af657b55 Author: Duncan Coutts Date: Tue Jan 5 22:13:26 2016 +0100 Extend ghc environment file features A set of changes to enable local ghc env files to be useful for tools like cabal. Ultimately it will allow cabal to maintain a ghc env file so that users can simple run ghc or ghci in a project directory and get the expected environment of the project. Change the name of .ghc.environment files to include the platform and ghc version, e.g. .ghc.environment.x86_64-linux-7.6.3, since their content is version specific. Strictly speaking this is not backwards compatible, but we think this feature is not widely used yet. "Look up" for a local env file, like the behaviour of git/darcs etc. So you can be anywhere within a project and get the expected environment. Don't look for local env files when -hide-all-packages is given. Extend the syntax of env files to allow specifying package dbs too. Test Plan: Currently completely untested. Compiles, that is all. Sorry, have to disappear for the hols. Reviewers: hvr, ezyang, austin, bgamari Reviewed By: ezyang, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1668 GHC Trac Issues: #11268 >--------------------------------------------------------------- 57fa4c59bb92c12845e5d313c015bac1af657b55 compiler/main/DynFlags.hs | 109 ++++++++++++++++++++++++++++++++---------- docs/users_guide/packages.rst | 45 +++++++++++++---- 2 files changed, 120 insertions(+), 34 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 57fa4c59bb92c12845e5d313c015bac1af657b55 From git at git.haskell.org Wed Jan 6 11:05:21 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 6 Jan 2016 11:05:21 +0000 (UTC) Subject: [commit: ghc] master: relnotes: Note dropped support for Windows XP and earlier (4dc4b84) Message-ID: <20160106110521.70E683A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/4dc4b8445710d92d23505b875a8d666217bc932d/ghc >--------------------------------------------------------------- commit 4dc4b8445710d92d23505b875a8d666217bc932d Author: Ben Gamari Date: Wed Jan 6 12:02:32 2016 +0100 relnotes: Note dropped support for Windows XP and earlier >--------------------------------------------------------------- 4dc4b8445710d92d23505b875a8d666217bc932d docs/users_guide/8.0.1-notes.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/users_guide/8.0.1-notes.rst b/docs/users_guide/8.0.1-notes.rst index 08f4800..be1f65b 100644 --- a/docs/users_guide/8.0.1-notes.rst +++ b/docs/users_guide/8.0.1-notes.rst @@ -48,6 +48,7 @@ The highlights, since the 7.10 branch, are: - The reworked users guide you are now reading +- Support for Windows XP and earlier has been dropped. Full details ------------ From git at git.haskell.org Wed Jan 6 11:05:24 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 6 Jan 2016 11:05:24 +0000 (UTC) Subject: [commit: ghc] master: Restore old GHC generics behavior vis-à-vis Fixity (852b603) Message-ID: <20160106110524.7E7253A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/852b603029a047609a54453b1f9cd65035a43afe/ghc >--------------------------------------------------------------- commit 852b603029a047609a54453b1f9cd65035a43afe Author: RyanGlScott Date: Wed Jan 6 12:05:05 2016 +0100 Restore old GHC generics behavior vis-?-vis Fixity Phab:D493 accidentally changed the way GHC generics looks up `Fixity` information when deriving `Generic` or `Generic1`. Before, a `Fixity` of `Infix` would be given only if a data constructor was declared infix, but now, `Infix` is given to any data constructor that has a fixity declaration (not to be confused with being declared infix!). This commit reverts back to the original behavior for consistency's sake. Fixes #11358. Test Plan: ./validate Reviewers: kosmikus, dreixel, austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1740 GHC Trac Issues: #11358 >--------------------------------------------------------------- 852b603029a047609a54453b1f9cd65035a43afe compiler/typecheck/TcGenGenerics.hs | 18 +++++++----------- testsuite/tests/generics/T11358.hs | 32 ++++++++++++++++++++++++++++++++ testsuite/tests/generics/T11358.stdout | 1 + testsuite/tests/generics/all.T | 1 + 4 files changed, 41 insertions(+), 11 deletions(-) diff --git a/compiler/typecheck/TcGenGenerics.hs b/compiler/typecheck/TcGenGenerics.hs index 8c44467..43433da 100644 --- a/compiler/typecheck/TcGenGenerics.hs +++ b/compiler/typecheck/TcGenGenerics.hs @@ -25,7 +25,6 @@ import Module ( Module, moduleName, moduleNameFS , moduleUnitId, unitIdFS ) import IfaceEnv ( newGlobalBinder ) import Name hiding ( varName ) -import NameEnv ( lookupNameEnv ) import RdrName import BasicTypes import TysPrim @@ -574,19 +573,16 @@ tc_mkRepTy gk_ tycon = else promotedFalseDataCon ctName = mkStrLitTy . occNameFS . nameOccName . dataConName - ctFix c = case myLookupFixity fix_env (dataConName c) of - Just (Fixity n InfixL) -> buildFix n pLA - Just (Fixity n InfixR) -> buildFix n pRA - Just (Fixity n InfixN) -> buildFix n pNA - Nothing -> mkTyConTy pPrefix + ctFix c + | dataConIsInfix c + = case lookupFixity fix_env (dataConName c) of + Fixity n InfixL -> buildFix n pLA + Fixity n InfixR -> buildFix n pRA + Fixity n InfixN -> buildFix n pNA + | otherwise = mkTyConTy pPrefix buildFix n assoc = mkTyConApp pInfix [ mkTyConTy assoc , mkNumLitTy (fromIntegral n)] - myLookupFixity :: FixityEnv -> Name -> Maybe Fixity - myLookupFixity env n = case lookupNameEnv env n of - Just (FixItem _ fix) -> Just fix - Nothing -> Nothing - isRec c = mkTyConTy $ if length (dataConFieldLabels c) > 0 then promotedTrueDataCon else promotedFalseDataCon diff --git a/testsuite/tests/generics/T11358.hs b/testsuite/tests/generics/T11358.hs new file mode 100644 index 0000000..8f52d5c --- /dev/null +++ b/testsuite/tests/generics/T11358.hs @@ -0,0 +1,32 @@ +{-# LANGUAGE DefaultSignatures #-} +{-# LANGUAGE DeriveGeneric #-} +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE FlexibleInstances #-} +module Main (main) where + +import GHC.Generics + +infixr 1 `T` +data T a = T a a deriving Generic +instance HasFixity (T a) + +data I a = a `I` a deriving Generic +instance HasFixity (I a) + +class HasFixity a where + fixity :: a -> Fixity + default fixity :: (Generic a, GHasFixity (Rep a)) => a -> Fixity + fixity = gfixity . from + +class GHasFixity f where + gfixity :: f a -> Fixity + +instance GHasFixity f => GHasFixity (D1 d f) where + gfixity (M1 x) = gfixity x + +instance Constructor c => GHasFixity (C1 c f) where + gfixity c = conFixity c + +main :: IO () +main = do + putStrLn $ show (fixity (T "a" "b")) ++ ", " ++ show (fixity ("a" `I` "b")) diff --git a/testsuite/tests/generics/T11358.stdout b/testsuite/tests/generics/T11358.stdout new file mode 100644 index 0000000..f7b347d --- /dev/null +++ b/testsuite/tests/generics/T11358.stdout @@ -0,0 +1 @@ +Prefix, Infix LeftAssociative 9 diff --git a/testsuite/tests/generics/all.T b/testsuite/tests/generics/all.T index 3253483..cae975c 100644 --- a/testsuite/tests/generics/all.T +++ b/testsuite/tests/generics/all.T @@ -44,3 +44,4 @@ test('T9563', normal, compile, ['']) test('T10030', normal, compile_and_run, ['']) test('T10361a', normal, compile, ['']) test('T10361b', normal, compile, ['']) +test('T11358', normal, compile_and_run, ['']) From git at git.haskell.org Wed Jan 6 11:05:28 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 6 Jan 2016 11:05:28 +0000 (UTC) Subject: [commit: ghc] master: relnotes: Note dropped support for Windows XP and earlier (4dc4b84) Message-ID: <20160106110528.291FA3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/4dc4b8445710d92d23505b875a8d666217bc932d/ghc >--------------------------------------------------------------- commit 4dc4b8445710d92d23505b875a8d666217bc932d Author: Ben Gamari Date: Wed Jan 6 12:02:32 2016 +0100 relnotes: Note dropped support for Windows XP and earlier >--------------------------------------------------------------- 4dc4b8445710d92d23505b875a8d666217bc932d docs/users_guide/8.0.1-notes.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/users_guide/8.0.1-notes.rst b/docs/users_guide/8.0.1-notes.rst index 08f4800..be1f65b 100644 --- a/docs/users_guide/8.0.1-notes.rst +++ b/docs/users_guide/8.0.1-notes.rst @@ -48,6 +48,7 @@ The highlights, since the 7.10 branch, are: - The reworked users guide you are now reading +- Support for Windows XP and earlier has been dropped. Full details ------------ From git at git.haskell.org Wed Jan 6 11:05:31 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 6 Jan 2016 11:05:31 +0000 (UTC) Subject: [commit: ghc] master: Restore old GHC generics behavior vis-à-vis Fixity (852b603) Message-ID: <20160106110531.3FF253A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/852b603029a047609a54453b1f9cd65035a43afe/ghc >--------------------------------------------------------------- commit 852b603029a047609a54453b1f9cd65035a43afe Author: RyanGlScott Date: Wed Jan 6 12:05:05 2016 +0100 Restore old GHC generics behavior vis-?-vis Fixity Phab:D493 accidentally changed the way GHC generics looks up `Fixity` information when deriving `Generic` or `Generic1`. Before, a `Fixity` of `Infix` would be given only if a data constructor was declared infix, but now, `Infix` is given to any data constructor that has a fixity declaration (not to be confused with being declared infix!). This commit reverts back to the original behavior for consistency's sake. Fixes #11358. Test Plan: ./validate Reviewers: kosmikus, dreixel, austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1740 GHC Trac Issues: #11358 >--------------------------------------------------------------- 852b603029a047609a54453b1f9cd65035a43afe compiler/typecheck/TcGenGenerics.hs | 18 +++++++----------- testsuite/tests/generics/T11358.hs | 32 ++++++++++++++++++++++++++++++++ testsuite/tests/generics/T11358.stdout | 1 + testsuite/tests/generics/all.T | 1 + 4 files changed, 41 insertions(+), 11 deletions(-) diff --git a/compiler/typecheck/TcGenGenerics.hs b/compiler/typecheck/TcGenGenerics.hs index 8c44467..43433da 100644 --- a/compiler/typecheck/TcGenGenerics.hs +++ b/compiler/typecheck/TcGenGenerics.hs @@ -25,7 +25,6 @@ import Module ( Module, moduleName, moduleNameFS , moduleUnitId, unitIdFS ) import IfaceEnv ( newGlobalBinder ) import Name hiding ( varName ) -import NameEnv ( lookupNameEnv ) import RdrName import BasicTypes import TysPrim @@ -574,19 +573,16 @@ tc_mkRepTy gk_ tycon = else promotedFalseDataCon ctName = mkStrLitTy . occNameFS . nameOccName . dataConName - ctFix c = case myLookupFixity fix_env (dataConName c) of - Just (Fixity n InfixL) -> buildFix n pLA - Just (Fixity n InfixR) -> buildFix n pRA - Just (Fixity n InfixN) -> buildFix n pNA - Nothing -> mkTyConTy pPrefix + ctFix c + | dataConIsInfix c + = case lookupFixity fix_env (dataConName c) of + Fixity n InfixL -> buildFix n pLA + Fixity n InfixR -> buildFix n pRA + Fixity n InfixN -> buildFix n pNA + | otherwise = mkTyConTy pPrefix buildFix n assoc = mkTyConApp pInfix [ mkTyConTy assoc , mkNumLitTy (fromIntegral n)] - myLookupFixity :: FixityEnv -> Name -> Maybe Fixity - myLookupFixity env n = case lookupNameEnv env n of - Just (FixItem _ fix) -> Just fix - Nothing -> Nothing - isRec c = mkTyConTy $ if length (dataConFieldLabels c) > 0 then promotedTrueDataCon else promotedFalseDataCon diff --git a/testsuite/tests/generics/T11358.hs b/testsuite/tests/generics/T11358.hs new file mode 100644 index 0000000..8f52d5c --- /dev/null +++ b/testsuite/tests/generics/T11358.hs @@ -0,0 +1,32 @@ +{-# LANGUAGE DefaultSignatures #-} +{-# LANGUAGE DeriveGeneric #-} +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE FlexibleInstances #-} +module Main (main) where + +import GHC.Generics + +infixr 1 `T` +data T a = T a a deriving Generic +instance HasFixity (T a) + +data I a = a `I` a deriving Generic +instance HasFixity (I a) + +class HasFixity a where + fixity :: a -> Fixity + default fixity :: (Generic a, GHasFixity (Rep a)) => a -> Fixity + fixity = gfixity . from + +class GHasFixity f where + gfixity :: f a -> Fixity + +instance GHasFixity f => GHasFixity (D1 d f) where + gfixity (M1 x) = gfixity x + +instance Constructor c => GHasFixity (C1 c f) where + gfixity c = conFixity c + +main :: IO () +main = do + putStrLn $ show (fixity (T "a" "b")) ++ ", " ++ show (fixity ("a" `I` "b")) diff --git a/testsuite/tests/generics/T11358.stdout b/testsuite/tests/generics/T11358.stdout new file mode 100644 index 0000000..f7b347d --- /dev/null +++ b/testsuite/tests/generics/T11358.stdout @@ -0,0 +1 @@ +Prefix, Infix LeftAssociative 9 diff --git a/testsuite/tests/generics/all.T b/testsuite/tests/generics/all.T index 3253483..cae975c 100644 --- a/testsuite/tests/generics/all.T +++ b/testsuite/tests/generics/all.T @@ -44,3 +44,4 @@ test('T9563', normal, compile, ['']) test('T10030', normal, compile_and_run, ['']) test('T10361a', normal, compile, ['']) test('T10361b', normal, compile, ['']) +test('T11358', normal, compile_and_run, ['']) From git at git.haskell.org Wed Jan 6 11:05:33 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 6 Jan 2016 11:05:33 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: relnotes: Note dropped support for Windows XP and earlier (5e92a08) Message-ID: <20160106110533.D69FD3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/5e92a088d0460406056405e236af72b267dfc472/ghc >--------------------------------------------------------------- commit 5e92a088d0460406056405e236af72b267dfc472 Author: Ben Gamari Date: Wed Jan 6 12:02:32 2016 +0100 relnotes: Note dropped support for Windows XP and earlier (cherry picked from commit 4dc4b8445710d92d23505b875a8d666217bc932d) >--------------------------------------------------------------- 5e92a088d0460406056405e236af72b267dfc472 docs/users_guide/8.0.1-notes.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/users_guide/8.0.1-notes.rst b/docs/users_guide/8.0.1-notes.rst index 795f909..5938ffd 100644 --- a/docs/users_guide/8.0.1-notes.rst +++ b/docs/users_guide/8.0.1-notes.rst @@ -48,6 +48,7 @@ The highlights, since the 7.10 branch, are: - The reworked users guide you are now reading +- Support for Windows XP and earlier has been dropped. Full details ------------ From git at git.haskell.org Wed Jan 6 11:05:36 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 6 Jan 2016 11:05:36 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Restore old GHC generics behavior vis-à-vis Fixity (138e501) Message-ID: <20160106110536.ECF593A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/138e501a62ccbe54f279d5ba11da6a1dd69311fd/ghc >--------------------------------------------------------------- commit 138e501a62ccbe54f279d5ba11da6a1dd69311fd Author: RyanGlScott Date: Wed Jan 6 12:05:05 2016 +0100 Restore old GHC generics behavior vis-?-vis Fixity Phab:D493 accidentally changed the way GHC generics looks up `Fixity` information when deriving `Generic` or `Generic1`. Before, a `Fixity` of `Infix` would be given only if a data constructor was declared infix, but now, `Infix` is given to any data constructor that has a fixity declaration (not to be confused with being declared infix!). This commit reverts back to the original behavior for consistency's sake. Fixes #11358. Test Plan: ./validate Reviewers: kosmikus, dreixel, austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1740 GHC Trac Issues: #11358 (cherry picked from commit 852b603029a047609a54453b1f9cd65035a43afe) >--------------------------------------------------------------- 138e501a62ccbe54f279d5ba11da6a1dd69311fd compiler/typecheck/TcGenGenerics.hs | 18 +++++++----------- testsuite/tests/generics/T11358.hs | 32 ++++++++++++++++++++++++++++++++ testsuite/tests/generics/T11358.stdout | 1 + testsuite/tests/generics/all.T | 1 + 4 files changed, 41 insertions(+), 11 deletions(-) diff --git a/compiler/typecheck/TcGenGenerics.hs b/compiler/typecheck/TcGenGenerics.hs index 8c44467..43433da 100644 --- a/compiler/typecheck/TcGenGenerics.hs +++ b/compiler/typecheck/TcGenGenerics.hs @@ -25,7 +25,6 @@ import Module ( Module, moduleName, moduleNameFS , moduleUnitId, unitIdFS ) import IfaceEnv ( newGlobalBinder ) import Name hiding ( varName ) -import NameEnv ( lookupNameEnv ) import RdrName import BasicTypes import TysPrim @@ -574,19 +573,16 @@ tc_mkRepTy gk_ tycon = else promotedFalseDataCon ctName = mkStrLitTy . occNameFS . nameOccName . dataConName - ctFix c = case myLookupFixity fix_env (dataConName c) of - Just (Fixity n InfixL) -> buildFix n pLA - Just (Fixity n InfixR) -> buildFix n pRA - Just (Fixity n InfixN) -> buildFix n pNA - Nothing -> mkTyConTy pPrefix + ctFix c + | dataConIsInfix c + = case lookupFixity fix_env (dataConName c) of + Fixity n InfixL -> buildFix n pLA + Fixity n InfixR -> buildFix n pRA + Fixity n InfixN -> buildFix n pNA + | otherwise = mkTyConTy pPrefix buildFix n assoc = mkTyConApp pInfix [ mkTyConTy assoc , mkNumLitTy (fromIntegral n)] - myLookupFixity :: FixityEnv -> Name -> Maybe Fixity - myLookupFixity env n = case lookupNameEnv env n of - Just (FixItem _ fix) -> Just fix - Nothing -> Nothing - isRec c = mkTyConTy $ if length (dataConFieldLabels c) > 0 then promotedTrueDataCon else promotedFalseDataCon diff --git a/testsuite/tests/generics/T11358.hs b/testsuite/tests/generics/T11358.hs new file mode 100644 index 0000000..8f52d5c --- /dev/null +++ b/testsuite/tests/generics/T11358.hs @@ -0,0 +1,32 @@ +{-# LANGUAGE DefaultSignatures #-} +{-# LANGUAGE DeriveGeneric #-} +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE FlexibleInstances #-} +module Main (main) where + +import GHC.Generics + +infixr 1 `T` +data T a = T a a deriving Generic +instance HasFixity (T a) + +data I a = a `I` a deriving Generic +instance HasFixity (I a) + +class HasFixity a where + fixity :: a -> Fixity + default fixity :: (Generic a, GHasFixity (Rep a)) => a -> Fixity + fixity = gfixity . from + +class GHasFixity f where + gfixity :: f a -> Fixity + +instance GHasFixity f => GHasFixity (D1 d f) where + gfixity (M1 x) = gfixity x + +instance Constructor c => GHasFixity (C1 c f) where + gfixity c = conFixity c + +main :: IO () +main = do + putStrLn $ show (fixity (T "a" "b")) ++ ", " ++ show (fixity ("a" `I` "b")) diff --git a/testsuite/tests/generics/T11358.stdout b/testsuite/tests/generics/T11358.stdout new file mode 100644 index 0000000..f7b347d --- /dev/null +++ b/testsuite/tests/generics/T11358.stdout @@ -0,0 +1 @@ +Prefix, Infix LeftAssociative 9 diff --git a/testsuite/tests/generics/all.T b/testsuite/tests/generics/all.T index 3253483..cae975c 100644 --- a/testsuite/tests/generics/all.T +++ b/testsuite/tests/generics/all.T @@ -44,3 +44,4 @@ test('T9563', normal, compile, ['']) test('T10030', normal, compile_and_run, ['']) test('T10361a', normal, compile, ['']) test('T10361b', normal, compile, ['']) +test('T11358', normal, compile_and_run, ['']) From git at git.haskell.org Wed Jan 6 12:49:07 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 6 Jan 2016 12:49:07 +0000 (UTC) Subject: [commit: ghc] master: Change Template Haskell representation of GADTs. (cac0795) Message-ID: <20160106124907.B4D2C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/cac0795af33d622e4c6ebae6ae1f206969287088/ghc >--------------------------------------------------------------- commit cac0795af33d622e4c6ebae6ae1f206969287088 Author: Jan Stolarek Date: Tue Jan 5 19:18:44 2016 +0100 Change Template Haskell representation of GADTs. Previous representation of GADTs in TH was not expressive enough to express possible GADT return types. See #11341 Test Plan: ./validate Reviewers: goldfire, austin, bgamari Subscribers: thomie, RyanGlScott Differential Revision: https://phabricator.haskell.org/D1738 GHC Trac Issues: #11341 >--------------------------------------------------------------- cac0795af33d622e4c6ebae6ae1f206969287088 compiler/deSugar/DsMeta.hs | 24 ++----- compiler/hsSyn/Convert.hs | 28 ++++---- compiler/typecheck/TcSplice.hs | 50 ++++++------- .../template-haskell/Language/Haskell/TH/Lib.hs | 12 ++-- .../template-haskell/Language/Haskell/TH/Ppr.hs | 43 +++++------ .../template-haskell/Language/Haskell/TH/Syntax.hs | 27 +++++-- testsuite/tests/th/T10828.hs | 8 +-- testsuite/tests/th/T10828.stderr | 83 ---------------------- testsuite/tests/th/T10828b.hs | 4 +- testsuite/tests/th/T11341.hs | 30 ++++++++ testsuite/tests/th/T11341.stderr | 6 ++ testsuite/tests/th/T4188.hs | 2 - testsuite/tests/th/TH_RichKinds2.stderr | 2 +- testsuite/tests/th/all.T | 7 +- 14 files changed, 139 insertions(+), 187 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc cac0795af33d622e4c6ebae6ae1f206969287088 From git at git.haskell.org Wed Jan 6 16:39:46 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 6 Jan 2016 16:39:46 +0000 (UTC) Subject: [commit: ghc] master: Bump Cabal and Haddock to fix #11308 (89ba83d) Message-ID: <20160106163946.489763A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/89ba83d981df3e56809440764cf81773bc33d00a/ghc >--------------------------------------------------------------- commit 89ba83d981df3e56809440764cf81773bc33d00a Author: Ben Gamari Date: Wed Jan 6 14:42:22 2016 +0100 Bump Cabal and Haddock to fix #11308 Bump Cabal and Haddock submodules such that they both support GCC-style response files on Windows. >--------------------------------------------------------------- 89ba83d981df3e56809440764cf81773bc33d00a libraries/Cabal | 2 +- testsuite/tests/driver/T4437.hs | 8 +------- utils/haddock | 2 +- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/libraries/Cabal b/libraries/Cabal index bf4d05e..a8a121e 160000 --- a/libraries/Cabal +++ b/libraries/Cabal @@ -1 +1 @@ -Subproject commit bf4d05efa79a41a819e3d9278d5e9e1e5a055ce7 +Subproject commit a8a121ea4d78783dd303dd2992d8e73ef337e7ed diff --git a/testsuite/tests/driver/T4437.hs b/testsuite/tests/driver/T4437.hs index 4120e91..f345ce6 100644 --- a/testsuite/tests/driver/T4437.hs +++ b/testsuite/tests/driver/T4437.hs @@ -32,13 +32,7 @@ check title expected got expectedGhcOnlyExtensions :: [String] expectedGhcOnlyExtensions = ["RelaxedLayout", "AlternativeLayoutRule", - "AlternativeLayoutRuleTransitional", - "OverloadedLabels", - "UndecidableSuperClasses", - "TemplateHaskellQuotes", - "MonadFailDesugaring", - "TypeInType", - "TypeApplications"] + "AlternativeLayoutRuleTransitional"] expectedCabalOnlyExtensions :: [String] expectedCabalOnlyExtensions = ["Generics", diff --git a/utils/haddock b/utils/haddock index 6ddd758..a13d21c 160000 --- a/utils/haddock +++ b/utils/haddock @@ -1 +1 @@ -Subproject commit 6ddd758be0e7b50bd19d33400b3c3013d60786cb +Subproject commit a13d21c688cae176be4505a5a6e9d64739845ea3 From git at git.haskell.org Wed Jan 6 22:09:23 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 6 Jan 2016 22:09:23 +0000 (UTC) Subject: [commit: ghc] master: Add a note describing the protocol for adding a language extension (7861a22) Message-ID: <20160106220923.A19E43A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/7861a22561846eef9a6415a93d79e121dca9c05f/ghc >--------------------------------------------------------------- commit 7861a22561846eef9a6415a93d79e121dca9c05f Author: Ben Gamari Date: Wed Jan 6 20:00:16 2016 +0100 Add a note describing the protocol for adding a language extension Reviewers: hvr, thomie, austin Reviewed By: austin Subscribers: duncan Differential Revision: https://phabricator.haskell.org/D1741 GHC Trac Issues: #8176, #4437 >--------------------------------------------------------------- 7861a22561846eef9a6415a93d79e121dca9c05f compiler/main/DynFlags.hs | 54 +++++++++++++++++++++++++++++++++++++++++ testsuite/tests/driver/T4437.hs | 6 +++++ testsuite/tests/driver/all.T | 5 ++++ 3 files changed, 65 insertions(+) diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index d2b46c1..f8d759a 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -233,6 +233,59 @@ import qualified GHC.LanguageExtensions as LangExt -- have effect, and annotate it accordingly. For Flags use defFlag, defGhcFlag, -- defGhciFlag, and for FlagSpec use flagSpec or flagGhciSpec. +-- Note [Adding a language extension] +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-- +-- There are a few steps to adding (or removing) a language extension, +-- +-- * Adding the extension to GHC.LanguageExtensions +-- +-- The LangExt type in libraries/ghc-boot/GHC/LanguageExtensions.hs is +-- the canonical list of language extensions known by GHC. +-- +-- * Adding a flag to DynFlags.xFlags +-- +-- This is fairly self-explanatory. The name should be concise, memorable, +-- and consistent with any previous implementations of the similar idea in +-- other Haskell compilers. +-- +-- * Adding the flag to the documentation +-- +-- This is the same as any other flag. See +-- Note [Updating flag description in the User's Guide] +-- +-- * Adding the flag to Cabal +-- +-- The Cabal library has its own list of all language extensions supported +-- by all major compilers. This is the list that user code being uploaded +-- to Hackage is checked against to ensure language extension validity. +-- Consequently, it is very important that this list remains up-to-date. +-- +-- To this end, there is a testsuite test (testsuite/tests/driver/T4437.hs) +-- whose job it is to ensure these GHC's extensions are consistent with +-- Cabal. +-- +-- The recommended workflow is, +-- +-- 1. Temporarily add your new language extension to the +-- expectedGhcOnlyExtensions list in T4437 to ensure the test doesn't +-- break while Cabal is updated. +-- +-- 2. After your GHC change is accepted, submit a Cabal pull request adding +-- your new extension to Cabal's list (found in +-- Cabal/Language/Haskell/Extension.hs). +-- +-- 3. After your Cabal change is accepted, let the GHC developers know so +-- they can update the Cabal submodule and remove the extensions from +-- expectedGhcOnlyExtensions. +-- +-- * Adding the flag to the GHC Wiki +-- +-- There is a change log tracking language extension additions and removals +-- on the GHC wiki: https://ghc.haskell.org/trac/ghc/wiki/LanguagePragmaHistory +-- +-- See Trac #4437 and #8176. + -- ----------------------------------------------------------------------------- -- DynFlags @@ -3103,6 +3156,7 @@ xFlags :: [FlagSpec LangExt.Extension] xFlags = [ -- See Note [Updating flag description in the User's Guide] -- See Note [Supporting CLI completion] +-- See Note [Adding a language extension] -- Please keep the list of flags below sorted alphabetically flagSpec "AllowAmbiguousTypes" LangExt.AllowAmbiguousTypes, flagSpec "AlternativeLayoutRule" LangExt.AlternativeLayoutRule, diff --git a/testsuite/tests/driver/T4437.hs b/testsuite/tests/driver/T4437.hs index f345ce6..5f14da1 100644 --- a/testsuite/tests/driver/T4437.hs +++ b/testsuite/tests/driver/T4437.hs @@ -1,3 +1,8 @@ +-- | A test for ensuring that GHC's supporting language extensions remains in +-- sync with Cabal's own extension list. +-- +-- If you have ended up here due to a test failure, please see +-- Note [Adding a language extension] in compiler/main/DynFlags.hs. module Main (main) where @@ -29,6 +34,7 @@ check title expected got showProblems "Unexpected flags" unexpected showProblems "Missing flags" missing +-- See Note [Adding a language extension] in compiler/main/DynFlags.hs. expectedGhcOnlyExtensions :: [String] expectedGhcOnlyExtensions = ["RelaxedLayout", "AlternativeLayoutRule", diff --git a/testsuite/tests/driver/all.T b/testsuite/tests/driver/all.T index 12522df..8493aa4 100644 --- a/testsuite/tests/driver/all.T +++ b/testsuite/tests/driver/all.T @@ -352,6 +352,11 @@ test('withRtsOpts', [ extra_clean(['withRtsOpts', 'withRtsOpts.exe', test('T3389', normal, compile_and_run, ['']) test('T3364', normalise_fun(normalise_errmsg), run_command, ['$MAKE -s --no-print-directory T3364']) + +# T4437: A test to ensure that Cabal's language extension list remains +# consistent with those known by GHC. +# +# See Note [Adding a language extension] in DynFlags.hs for details. test('T4437', only_ways(['normal']), compile_and_run, ['-package ghc']) test('werror', normal, compile_fail, ['']) From git at git.haskell.org Wed Jan 6 22:10:50 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 6 Jan 2016 22:10:50 +0000 (UTC) Subject: [commit: ghc] master: Fall back on ghc-stage2 when using Windows' GHCi driver (f01eb54) Message-ID: <20160106221050.2DBA43A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/f01eb5410d7980567bf2731b9cded9a4894a3ef5/ghc >--------------------------------------------------------------- commit f01eb5410d7980567bf2731b9cded9a4894a3ef5 Author: RyanGlScott Date: Wed Jan 6 23:10:54 2016 +0100 Fall back on ghc-stage2 when using Windows' GHCi driver Reviewers: austin, hvr, bgamari, thomie Reviewed By: thomie Differential Revision: https://phabricator.haskell.org/D1721 >--------------------------------------------------------------- f01eb5410d7980567bf2731b9cded9a4894a3ef5 driver/ghci/ghci.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/driver/ghci/ghci.c b/driver/ghci/ghci.c index 414521f..f358d96 100644 --- a/driver/ghci/ghci.c +++ b/driver/ghci/ghci.c @@ -3,6 +3,12 @@ #include "getLocation.h" #include #include +#include + +BOOL fileExists(const char *path) { + const DWORD r = GetFileAttributesA(path); + return r != INVALID_FILE_ATTRIBUTES && !(r & FILE_ATTRIBUTE_DIRECTORY); +} int main(int argc, char** argv) { char *binDir; @@ -19,6 +25,13 @@ int main(int argc, char** argv) { exePath = mkString("%s/ghc.exe", binDir); preArgv[0] = "--interactive"; + /* If ghc.exe can't be found, we assume that we're building ghc from + * source, in which case we fall back on ghc-stage2. + */ + if (!fileExists(exePath)) { + exePath = mkString("%s/ghc-stage2.exe", binDir); + } + run(exePath, 1, preArgv, argc - 1, argv + 1); } From git at git.haskell.org Thu Jan 7 00:20:45 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 7 Jan 2016 00:20:45 +0000 (UTC) Subject: [commit: ghc] master: users guide: Add documentation for custom compile-time errors (568736d) Message-ID: <20160107002045.193E23A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/568736d757d3e0883b0250e0b948aeed646c20b5/ghc >--------------------------------------------------------------- commit 568736d757d3e0883b0250e0b948aeed646c20b5 Author: Ben Gamari Date: Wed Jan 6 23:56:44 2016 +0100 users guide: Add documentation for custom compile-time errors >--------------------------------------------------------------- 568736d757d3e0883b0250e0b948aeed646c20b5 docs/users_guide/glasgow_exts.rst | 66 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 64 insertions(+), 2 deletions(-) diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index 51f84d6..372a033 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -9599,13 +9599,75 @@ splices. supported either. - Type splices: only anonymous wildcards are supported in type splices. - Named and extra-constraints wildcards are not. - :: + Named and extra-constraints wildcards are not. :: {-# LANGUAGE TemplateHaskell #-} foo :: $( [t| _ |] ) -> a foo x = x +.. _custom-errors: + +Custom compile-time errors +========================== + +When designing embedded domain specific languages in Haskell, it is useful to +have something like ``error`` at the type level. In this way, the EDSL designer +may show a type error that is specific to the DSL, rather than the standard GHC +type error. + +For example, consider a type class that is not intended to be used with +functions, but the user accidentally used it at a function type, perhaps +because they missed an argument to some function. Then, instead of getting the +standard GHC message about a missing instance, it would be nicer to emit a more +friendly message specific to the EDSL. Similarly, the reduction of a type-level +function may get stuck due to an error, at which point it would be nice to +report an EDSL specific error, rather than a generic error about an ambiguous +type. + +To solve this, GHC provides a single type-level function, :: + + type family TypeError (msg :: ErrorMessage) :: k + +along with a small type-level language (via +``DataKinds`` :ref:`promotion `) +for constructing pretty-printed error messages, :: + + -- ErrorMessage is intended to be used as a kind + data ErrorMessage = + Text Symbol -- Show this text as is + | forall t. ShowType t -- Pretty print a type + | ErrorMessage :<>: ErrorMessage -- Put two chunks of error message next to each other + | ErrorMessage :$$: ErrorMessage -- Put two chunks of error message above each other + +in the ``GHC.TypeLits`` :base-ref:`module `. + +For instance, we might use this interface to provide a more useful error +message for applications of ``show`` on unsaturated functions like this, :: + + {-# LANGUAGE DataKinds #-} + {-# LANGUAGE TypeOperators #-} + {-# LANGUAGE UndecidableInstances #-} + + import GHC.TypeLits + + instance TypeError (Text "Cannot 'Show' functions." :$$: + Text "Perhaps there is a missing argument?") + => Show (a -> b) where + showsPrec = error "unreachable" + + main = print negate + +Which will produce the following compile-time error, + +.. code-block:: none + + Test.hs:12:8: error: + ? Cannot 'Show' functions. + Perhaps there is a missing argument? + ? In the expression: print negate + In an equation for ?main?: main = print negate + + .. _defer-type-errors: Deferring type errors to runtime From git at git.haskell.org Thu Jan 7 00:20:47 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 7 Jan 2016 00:20:47 +0000 (UTC) Subject: [commit: ghc] master: users guide: Add links to release notes (5040686) Message-ID: <20160107002047.D18583A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/5040686532d15a11a2ff52a020fc77de9374b7e3/ghc >--------------------------------------------------------------- commit 5040686532d15a11a2ff52a020fc77de9374b7e3 Author: Ben Gamari Date: Wed Jan 6 23:59:30 2016 +0100 users guide: Add links to release notes >--------------------------------------------------------------- 5040686532d15a11a2ff52a020fc77de9374b7e3 docs/users_guide/8.0.1-notes.rst | 18 ++++++++++-------- docs/users_guide/glasgow_exts.rst | 2 ++ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/docs/users_guide/8.0.1-notes.rst b/docs/users_guide/8.0.1-notes.rst index be1f65b..33a5c39 100644 --- a/docs/users_guide/8.0.1-notes.rst +++ b/docs/users_guide/8.0.1-notes.rst @@ -16,25 +16,26 @@ The highlights, since the 7.10 branch, are: - nokinds -- Record pattern synonyms +- Support for :ref:`record pattern synonyms ` -- ``-XDeriveAnyClass`` +- ``-XDeriveAnyClass`` to conveniently derive default instances (see :ref:`derive-any-class`) - More reliable DWARF debugging information -- Injective type classes +- Support for :ref:`injective type classes :ref:`injective-ty-fams` -- Applicative ``do`` notation +- Applicative ``do`` notation (see :ref:`applicative-do`) - Support for wildcards in data and type family instances - ``Strict`` and ``StrictData`` extensions, allowing modules to be compiled with - strict-by-default bindings. + strict-by-default bindings (see :ref:`strict-haskell`) - ``DuplicateRecordFields``, allowing multiple datatypes to declare the same - record field names provided they are used unambiguously + record field names provided they are used unambiguously (see :ref:`duplicate-record-fields`) -- Support for implicit parameters providing light-weight callstacks and source locations +- Support for implicit parameters providing light-weight + :ref:`callstacks and source locations ` - User-defined error messages for type errors @@ -460,7 +461,8 @@ See ``changelog.md`` in the ``base`` package for full release notes. ``zipWithM`` and ``replicateM_`` (see :ghc-ticket:`10168`). - Add ``GHC.TypeLits.TypeError`` and ``ErrorMessage`` to allow users - to define custom compile-time error messages. + to define custom compile-time error messages. (see :ref:`custom-errors` and + the original :ghc-wiki:`proposal `). - The ``Generic`` instance for ``Proxy`` is now poly-kinded (see :ghc-ticket:`10775`) diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index 372a033..5808d52 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -784,6 +784,8 @@ The table below summarises where each kind of pattern synonym can be used. | Expression | No | Yes (Inferred)| Yes (Explicit) | +---------------+----------------+---------------+---------------------------+ +.. _record-patsyns: + Record Pattern Synonyms ~~~~~~~~~~~~~~~~~~~~~~~ From git at git.haskell.org Thu Jan 7 00:20:50 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 7 Jan 2016 00:20:50 +0000 (UTC) Subject: [commit: ghc] master: users guide: Tweak wording of RTS -Nmax description (0a04837) Message-ID: <20160107002050.7DE773A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/0a04837a98a8226aa68ff95efd693db126b2d027/ghc >--------------------------------------------------------------- commit 0a04837a98a8226aa68ff95efd693db126b2d027 Author: Ben Gamari Date: Thu Jan 7 00:08:52 2016 +0100 users guide: Tweak wording of RTS -Nmax description >--------------------------------------------------------------- 0a04837a98a8226aa68ff95efd693db126b2d027 docs/users_guide/8.0.1-notes.rst | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/users_guide/8.0.1-notes.rst b/docs/users_guide/8.0.1-notes.rst index 33a5c39..b4957ab 100644 --- a/docs/users_guide/8.0.1-notes.rst +++ b/docs/users_guide/8.0.1-notes.rst @@ -41,8 +41,6 @@ The highlights, since the 7.10 branch, are: - A rewritten (and greatly improved) pattern exhaustiveness checker -- ``-maxN(x)`` added to compliment ``-N`` - - GHC can run the interpreter in a separate process (see :ref:`external-interpreter`), and the interpreter can now run profiled code. @@ -360,8 +358,8 @@ Runtime system - Support for performance monitoring with PAPI has been dropped. -- ``-maxN(x)`` flag added to compliment ``-N``, it will choose to use at most - (x) capabilities, limited by the number of processors as ``-N`` is. +- ``-maxN?x?`` flag added to complement ``-N``. It will choose to use at most + ?x? capabilities, limited by the number of processors as ``-N`` is. Build system ~~~~~~~~~~~~ From git at git.haskell.org Thu Jan 7 00:20:53 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 7 Jan 2016 00:20:53 +0000 (UTC) Subject: [commit: ghc] master: Rewrite announce file (47367e0) Message-ID: <20160107002053.2A8453A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/47367e0f2f00456dfe6757698413e223a72710f7/ghc >--------------------------------------------------------------- commit 47367e0f2f00456dfe6757698413e223a72710f7 Author: Ben Gamari Date: Fri Jul 17 19:47:56 2015 +0200 Rewrite announce file Incredibly enough this hasn't been touched since 6.10.1 >--------------------------------------------------------------- 47367e0f2f00456dfe6757698413e223a72710f7 ANNOUNCE | 67 +++++++++++++++++++++++++++++++++++++++------------------------- 1 file changed, 41 insertions(+), 26 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index f9f1c57..24cddb3 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,35 +1,51 @@ - ============================================================== - The (Interactive) Glasgow Haskell Compiler -- version 6.10.1 - ============================================================== + =============================================== + The Glasgow Haskell Compiler -- version 8.0.1 + =============================================== -The GHC Team is pleased to announce a new major release of GHC. There -have been a number of significant changes since the last major release, -including: +The GHC Team is pleased to announce a new super-major release of GHC. This is +the most significant GHC release in quite some time, including both a number +of major features and numerous bug fixes. These include, - * Some new language features have been implemented: - * Record syntax: wild-card patterns, punning, and field disambiguation - * Generalised quasi-quotes - * Generalised list comprehensions - * View patterns + * The TypeInType extension, which unifies types and kinds, allowing GHC + to reason about kind equality and enabling promotion of GADTs to the type + level. - * Type families have been completely re-implemented + * Support for record pattern synonyms - * Now comes with Haddock 2, which supports all GHC extensions + * The DeriveAnyClass extension to conveniently derive default instances - * Parallel garbage collection + * More reliable DWARF debugging information - * Base provides extensible exceptions + * Support for injective type classes - * The GHC API is easier to use + * Applicative do-notation - * External core (output only) now works again + * Support for wildcards in data and type family instances - * Data Parallel Haskell (DPH) comes as part of GHC + * Strict and StrictData extensions, allowing modules to be compiled with + strict-by-default bindings -The full release notes are here: + * The DuplicateRecordFields extensions, allowing multiple datatypes to declare + the same record field names provided they are used unambiguously + + * Support for implicit parameters providing light-weight callstacks and source + locations + + * User-defined error messages for type errors + + * A rewritten (and greatly improved) pattern exhaustiveness checker + + * GHCi can run the interpreter in a separate process, and the interpreter can + now run profiled code. + + * and more! + +A more thorough list of the changes in the release can be found in the release +notes, + + http://haskell.org/ghc/docs/8.0.1/html/users_guide/release-8-0-1.html - http://haskell.org/ghc/docs/6.10.1/html/users_guide/release-6-10-1.html How to get it ~~~~~~~~~~~~~ @@ -52,13 +68,12 @@ Background Haskell is a standard lazy functional programming language. GHC is a state-of-the-art programming suite for Haskell. Included is -an optimising compiler generating good code for a variety of +an optimising compiler generating efficient code for a variety of platforms, together with an interactive system for convenient, quick development. The distribution includes space and time profiling facilities, a large collection of libraries, and support for various language extensions, including concurrency, exceptions, and foreign -language interfaces (C, whatever). GHC is distributed under a -BSD-style open source license. +language interfaces. GHC is distributed under a BSD-style open source license. A wide variety of Haskell related resources (tutorials, libraries, specifications, documentation, compilers, interpreters, references, @@ -107,13 +122,13 @@ Mailing lists We run mailing lists for GHC users and bug reports; to subscribe, use the web interfaces at - http://www.haskell.org/mailman/listinfo/glasgow-haskell-users - http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs + http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users + http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets There are several other haskell and ghc-related mailing lists on www.haskell.org; for the full list, see - http://www.haskell.org/mailman/listinfo/ + https://mail.haskell.org/cgi-bin/mailman/listinfo Some GHC developers hang out on #haskell on IRC, too: From git at git.haskell.org Thu Jan 7 08:36:29 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 7 Jan 2016 08:36:29 +0000 (UTC) Subject: [commit: ghc] master: Comment wibble (4dda4ed) Message-ID: <20160107083629.8C0183A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/4dda4edb34af321ac966c0b45d06ccf52ad8104e/ghc >--------------------------------------------------------------- commit 4dda4edb34af321ac966c0b45d06ccf52ad8104e Author: Simon Peyton Jones Date: Wed Jan 6 17:14:41 2016 +0000 Comment wibble >--------------------------------------------------------------- 4dda4edb34af321ac966c0b45d06ccf52ad8104e compiler/typecheck/TcValidity.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/typecheck/TcValidity.hs b/compiler/typecheck/TcValidity.hs index 98b78db..2f5ccc3 100644 --- a/compiler/typecheck/TcValidity.hs +++ b/compiler/typecheck/TcValidity.hs @@ -1022,7 +1022,7 @@ It checks for three things Note that 'b' isn't a parameter of T. This gives rise to all sorts of problems; in particular, it's hard to compare solutions for equality when finding the fixpoint, and that means the inferContext loop does - not converge. See Trac #5287. + not converge. See Trac #5287. Note [Equality class instances] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From git at git.haskell.org Thu Jan 7 08:36:32 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 7 Jan 2016 08:36:32 +0000 (UTC) Subject: [commit: ghc] master: Inline solveTopConstraints (29b4632) Message-ID: <20160107083632.384793A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/29b463278bf59809a929ef9cad4a3fcacc12c0da/ghc >--------------------------------------------------------------- commit 29b463278bf59809a929ef9cad4a3fcacc12c0da Author: Simon Peyton Jones Date: Wed Jan 6 17:15:47 2016 +0000 Inline solveTopConstraints It was only called in one place; easier to inline it >--------------------------------------------------------------- 29b463278bf59809a929ef9cad4a3fcacc12c0da compiler/typecheck/TcSimplify.hs | 10 +--------- compiler/typecheck/TcSplice.hs | 3 ++- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/compiler/typecheck/TcSimplify.hs b/compiler/typecheck/TcSimplify.hs index 6114e13..4a5d131 100644 --- a/compiler/typecheck/TcSimplify.hs +++ b/compiler/typecheck/TcSimplify.hs @@ -1,7 +1,7 @@ {-# LANGUAGE CPP #-} module TcSimplify( - simplifyInfer, solveTopConstraints, + simplifyInfer, growThetaTyVars, simplifyAmbiguityCheck, simplifyDefault, @@ -187,14 +187,6 @@ defaultCallStacks wanteds = return (Just ct) --- | Type-check a thing, returning the result and any EvBinds produced --- during solving. Emits errors -- but does not fail -- if there is trouble. -solveTopConstraints :: TcM a -> TcM (a, Bag EvBind) -solveTopConstraints thing_inside - = do { (result, wanted) <- captureConstraints thing_inside - ; ev_binds <- simplifyTop wanted - ; return (result, ev_binds) } - {- Note [When to do type-class defaulting] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/compiler/typecheck/TcSplice.hs b/compiler/typecheck/TcSplice.hs index 2de83c4..63a3371 100644 --- a/compiler/typecheck/TcSplice.hs +++ b/compiler/typecheck/TcSplice.hs @@ -528,7 +528,8 @@ tcTopSpliceExpr isTypedSplice tc_action -- is expected (Trac #7276) setStage (Splice isTypedSplice) $ do { -- Typecheck the expression - (expr', const_binds) <- solveTopConstraints tc_action + (expr', wanted) <- captureConstraints tc_action + ; const_binds <- simplifyTop wanted -- Zonk it and tie the knot of dictionary bindings ; zonkTopLExpr (mkHsDictLet (EvBinds const_binds) expr') } From git at git.haskell.org Thu Jan 7 08:36:35 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 7 Jan 2016 08:36:35 +0000 (UTC) Subject: [commit: ghc] master: Turn AThing into ATcTyCon, in TcTyThing (a5cea73) Message-ID: <20160107083635.E48703A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a5cea73c658888e01c162723d3e0e1439514ecdb/ghc >--------------------------------------------------------------- commit a5cea73c658888e01c162723d3e0e1439514ecdb Author: Simon Peyton Jones Date: Wed Jan 6 17:33:42 2016 +0000 Turn AThing into ATcTyCon, in TcTyThing This change tidies up and simplifies (a bit) the knot-tying when kind-checking groups of type and class declarations. The trouble (shown by Trac #11356) was that we wanted an error message (a kind-mismatch) that involved a type mentioned a (AThing k), which blew up. Since we now seem to have TcTyCons, I decided to use them here. It's still not great, but it's easier to understand and more robust. >--------------------------------------------------------------- a5cea73c658888e01c162723d3e0e1439514ecdb compiler/typecheck/TcEnv.hs | 13 +++--- compiler/typecheck/TcHsType.hs | 26 +++++++----- compiler/typecheck/TcRnTypes.hs | 9 +++-- compiler/typecheck/TcTyClsDecls.hs | 46 +++++++++++----------- testsuite/tests/typecheck/should_fail/T11356.hs | 6 +++ .../tests/typecheck/should_fail/T11356.stderr | 5 +++ testsuite/tests/typecheck/should_fail/all.T | 3 +- 7 files changed, 62 insertions(+), 46 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc a5cea73c658888e01c162723d3e0e1439514ecdb From git at git.haskell.org Thu Jan 7 08:36:38 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 7 Jan 2016 08:36:38 +0000 (UTC) Subject: [commit: ghc] master: Spelling in a comment (97c49e9) Message-ID: <20160107083638.8F0383A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/97c49e9e78e6e0d385b8fd0b8a7de38ba6f10e76/ghc >--------------------------------------------------------------- commit 97c49e9e78e6e0d385b8fd0b8a7de38ba6f10e76 Author: Simon Peyton Jones Date: Wed Jan 6 17:04:47 2016 +0000 Spelling in a comment >--------------------------------------------------------------- 97c49e9e78e6e0d385b8fd0b8a7de38ba6f10e76 compiler/typecheck/TcBinds.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/typecheck/TcBinds.hs b/compiler/typecheck/TcBinds.hs index 113a561..12dec4c 100644 --- a/compiler/typecheck/TcBinds.hs +++ b/compiler/typecheck/TcBinds.hs @@ -1999,7 +1999,7 @@ decideGeneralisationPlan dflags type_env bndr_names lbinds sig_fn | otherwise = Nothing - -- The Haskell 98 monomorphism resetriction + -- The Haskell 98 monomorphism restriction restricted (PatBind {}) = True restricted (VarBind { var_id = v }) = no_sig v restricted (FunBind { fun_id = v, fun_matches = m }) = restricted_match m From git at git.haskell.org Thu Jan 7 08:36:41 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 7 Jan 2016 08:36:41 +0000 (UTC) Subject: [commit: ghc] master: Use an Implication in 'deriving' error (02c1c57) Message-ID: <20160107083641.4C7033A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/02c1c5735aff0cce2b04a6b3e4732d62bb0a4f3c/ghc >--------------------------------------------------------------- commit 02c1c5735aff0cce2b04a6b3e4732d62bb0a4f3c Author: Simon Peyton Jones Date: Wed Jan 6 17:22:02 2016 +0000 Use an Implication in 'deriving' error Trac #11437 showed that erroneous constraints from a 'deriving' clause need to be wrapped in an Implication to properly scope their skolems. The main change is in TcDeriv.simplifyDeriv; the call to buildImplicationFor is new. >--------------------------------------------------------------- 02c1c5735aff0cce2b04a6b3e4732d62bb0a4f3c compiler/typecheck/TcDeriv.hs | 23 +++++++++++++++------ compiler/typecheck/TcInstDcls.hs | 2 +- compiler/typecheck/TcPatSyn.hs | 2 +- compiler/typecheck/TcRnTypes.hs | 11 +++++++++- .../tests/deriving/should_compile/T10561.stderr | 8 +++++--- testsuite/tests/deriving/should_fail/T7148.stderr | 24 +++++++++++++--------- .../tests/typecheck/should_fail/T11347.stderr | 13 ++++++++++-- 7 files changed, 59 insertions(+), 24 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 02c1c5735aff0cce2b04a6b3e4732d62bb0a4f3c From git at git.haskell.org Thu Jan 7 08:36:44 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 7 Jan 2016 08:36:44 +0000 (UTC) Subject: [commit: ghc] master: Make demand analysis understand catch (9915b65) Message-ID: <20160107083644.1008B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/9915b6564403a6d17651e9969e9ea5d7d7e78e7f/ghc >--------------------------------------------------------------- commit 9915b6564403a6d17651e9969e9ea5d7d7e78e7f Author: Simon Peyton Jones Date: Wed Jan 6 17:40:09 2016 +0000 Make demand analysis understand catch As Trac #11222, and #10712 note, the strictness analyser needs to be rather careful about exceptions. Previously it treated them as identical to divergence, but that won't quite do. See Note [Exceptions and strictness] in Demand, which explains the deal. Getting more strictness in 'catch' and friends is a very good thing. Here is the nofib summary, keeping only the big ones. -------------------------------------------------------------------------------- Program Size Allocs Runtime Elapsed TotalMem -------------------------------------------------------------------------------- fasta -0.1% -6.9% -3.0% -3.0% +0.0% hpg -0.1% -2.0% -6.2% -6.2% +0.0% maillist -0.1% -0.3% 0.08 0.09 +1.2% reverse-complem -0.1% -10.9% -6.0% -5.9% +0.0% sphere -0.1% -4.3% 0.08 0.08 +0.0% x2n1 -0.1% -0.0% 0.00 0.00 +0.0% -------------------------------------------------------------------------------- Min -0.2% -10.9% -17.4% -17.3% +0.0% Max -0.0% +0.0% +4.3% +4.4% +1.2% Geometric Mean -0.1% -0.3% -2.9% -3.0% +0.0% On the way I did quite a bit of refactoring in Demand.hs >--------------------------------------------------------------- 9915b6564403a6d17651e9969e9ea5d7d7e78e7f compiler/basicTypes/Demand.hs | 870 ++++++++++++--------- compiler/coreSyn/CoreArity.hs | 3 +- compiler/coreSyn/MkCore.hs | 7 +- compiler/prelude/primops.txt.pp | 47 +- compiler/stgSyn/CoreToStg.hs | 6 +- compiler/stranal/DmdAnal.hs | 14 +- compiler/stranal/WorkWrap.hs | 5 +- .../tests/deSugar/should_compile/T2431.stderr | 2 +- .../tests/numeric/should_compile/T7116.stdout | 8 +- .../tests/simplCore/should_compile/T3772.stdout | 2 +- .../tests/simplCore/should_compile/T4930.stderr | 4 +- .../simplCore/should_compile/spec-inline.stderr | 2 +- testsuite/tests/stranal/sigs/HyperStrUse.stderr | 2 +- testsuite/tests/stranal/sigs/T8598.stderr | 2 +- testsuite/tests/stranal/sigs/UnsatFun.stderr | 4 +- 15 files changed, 550 insertions(+), 428 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 9915b6564403a6d17651e9969e9ea5d7d7e78e7f From git at git.haskell.org Thu Jan 7 08:36:46 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 7 Jan 2016 08:36:46 +0000 (UTC) Subject: [commit: ghc] master: Refactor simpl_top (dc97096) Message-ID: <20160107083646.C98C43A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/dc970966da5c2059bd91577f8d83a9d4f9fe4d3a/ghc >--------------------------------------------------------------- commit dc970966da5c2059bd91577f8d83a9d4f9fe4d3a Author: Simon Peyton Jones Date: Wed Jan 6 17:17:11 2016 +0000 Refactor simpl_top simpl_top was being polluted with Safe Haskell stuff which was only used in one of its four calls. This moves the Safe Haskell stuff to the place it is actually used >--------------------------------------------------------------- dc970966da5c2059bd91577f8d83a9d4f9fe4d3a compiler/typecheck/TcSimplify.hs | 127 +++++++++++++++++++-------------------- 1 file changed, 62 insertions(+), 65 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc dc970966da5c2059bd91577f8d83a9d4f9fe4d3a From git at git.haskell.org Thu Jan 7 08:36:49 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 7 Jan 2016 08:36:49 +0000 (UTC) Subject: [commit: ghc] master: Tiny refactor (3f98045) Message-ID: <20160107083649.8847B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/3f9804578b7aef879d757d8f5d22df437a072dbf/ghc >--------------------------------------------------------------- commit 3f9804578b7aef879d757d8f5d22df437a072dbf Author: Simon Peyton Jones Date: Wed Jan 6 08:17:01 2016 +0000 Tiny refactor >--------------------------------------------------------------- 3f9804578b7aef879d757d8f5d22df437a072dbf compiler/iface/MkIface.hs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/compiler/iface/MkIface.hs b/compiler/iface/MkIface.hs index 644bea9..98f08fd 100644 --- a/compiler/iface/MkIface.hs +++ b/compiler/iface/MkIface.hs @@ -353,14 +353,15 @@ mkHashFun hsc_env eps let mod = ASSERT2( isExternalName name, ppr name ) nameModule name occ = nameOccName name - iface = lookupIfaceByModule (hsc_dflags hsc_env) hpt pit mod `orElse` + iface = lookupIfaceByModule dflags hpt pit mod `orElse` pprPanic "lookupVers2" (ppr mod <+> ppr occ) in snd (mi_hash_fn iface occ `orElse` pprPanic "lookupVers1" (ppr mod <+> ppr occ)) where - hpt = hsc_HPT hsc_env - pit = eps_PIT eps + dflags = hsc_dflags hsc_env + hpt = hsc_HPT hsc_env + pit = eps_PIT eps -- --------------------------------------------------------------------------- -- Compute fingerprints for the interface From git at git.haskell.org Thu Jan 7 08:36:52 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 7 Jan 2016 08:36:52 +0000 (UTC) Subject: [commit: ghc] master: Remove unused export (0839a66) Message-ID: <20160107083652.497FE3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/0839a6686be4378ad0140a678f4de065d4fc140b/ghc >--------------------------------------------------------------- commit 0839a6686be4378ad0140a678f4de065d4fc140b Author: Simon Peyton Jones Date: Wed Jan 6 08:16:34 2016 +0000 Remove unused export >--------------------------------------------------------------- 0839a6686be4378ad0140a678f4de065d4fc140b compiler/iface/LoadIface.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/iface/LoadIface.hs b/compiler/iface/LoadIface.hs index f4a6a3d..b0da64c 100644 --- a/compiler/iface/LoadIface.hs +++ b/compiler/iface/LoadIface.hs @@ -19,7 +19,7 @@ module LoadIface ( loadInterfaceForName, loadInterfaceForModule, -- IfM functions - loadInterface, loadWiredInHomeIface, + loadInterface, loadSysInterface, loadUserInterface, loadPluginInterface, findAndReadIface, readIface, -- Used when reading the module's old interface loadDecls, -- Should move to TcIface and be renamed From git at git.haskell.org Thu Jan 7 08:36:55 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 7 Jan 2016 08:36:55 +0000 (UTC) Subject: [commit: ghc] master: Tidy up tidySkolemInfo (290a553) Message-ID: <20160107083655.0E84E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/290a553e9bd98ed43765cf8e7a70ebc95c187253/ghc >--------------------------------------------------------------- commit 290a553e9bd98ed43765cf8e7a70ebc95c187253 Author: Simon Peyton Jones Date: Wed Jan 6 17:11:34 2016 +0000 Tidy up tidySkolemInfo Previously tidySkolemInfo used tidyOpenType, and returned a new TidyEnv. But that's not needed any more, because all the skolems should be in scope in the constraint tree. I also removed a (now-unnecessary) field of UnifyForAllSkol >--------------------------------------------------------------- 290a553e9bd98ed43765cf8e7a70ebc95c187253 compiler/typecheck/TcErrors.hs | 6 ++-- compiler/typecheck/TcMType.hs | 32 ++++++---------------- compiler/typecheck/TcRnTypes.hs | 3 +- compiler/typecheck/TcSMonad.hs | 4 ++- testsuite/tests/deriving/should_fail/T7148a.stderr | 17 ++++++------ .../tests/typecheck/should_fail/tcfail174.stderr | 4 +-- 6 files changed, 26 insertions(+), 40 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 290a553e9bd98ed43765cf8e7a70ebc95c187253 From git at git.haskell.org Thu Jan 7 09:33:16 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 7 Jan 2016 09:33:16 +0000 (UTC) Subject: [commit: ghc] master: Test Trac #10625 (1ee9229) Message-ID: <20160107093316.4FFD93A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/1ee92293651c0cc70504df1a4450febb986ad891/ghc >--------------------------------------------------------------- commit 1ee92293651c0cc70504df1a4450febb986ad891 Author: Simon Peyton Jones Date: Thu Jan 7 09:03:29 2016 +0000 Test Trac #10625 >--------------------------------------------------------------- 1ee92293651c0cc70504df1a4450febb986ad891 testsuite/tests/rename/should_compile/T10625.hs | 6 ++++++ testsuite/tests/rename/should_compile/all.T | 1 + 2 files changed, 7 insertions(+) diff --git a/testsuite/tests/rename/should_compile/T10625.hs b/testsuite/tests/rename/should_compile/T10625.hs new file mode 100644 index 0000000..5229fbe --- /dev/null +++ b/testsuite/tests/rename/should_compile/T10625.hs @@ -0,0 +1,6 @@ +{-# LANGUAGE ExistentialQuantification #-} +{-# OPTIONS_GHC -Wall -Wno-name-shadowing #-} + +module T10625 where + +data Ex a = forall a. Ex a diff --git a/testsuite/tests/rename/should_compile/all.T b/testsuite/tests/rename/should_compile/all.T index 8c120cd..65f92e2 100644 --- a/testsuite/tests/rename/should_compile/all.T +++ b/testsuite/tests/rename/should_compile/all.T @@ -232,3 +232,4 @@ test('T11164', multimod_compile, ['T11164', '-v0']) test('T11167', normal, compile, ['']) test('T11167_ambig', normal, compile, ['']) +test('T10625', normal, compile, ['']) From git at git.haskell.org Thu Jan 7 11:54:46 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 7 Jan 2016 11:54:46 +0000 (UTC) Subject: [commit: ghc] master: Typos in docs and comments (c78fedd) Message-ID: <20160107115446.344D53A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/c78fedde7055490ca6f6210ada797190f3c35d87/ghc >--------------------------------------------------------------- commit c78fedde7055490ca6f6210ada797190f3c35d87 Author: Gabor Greif Date: Thu Jan 7 11:48:16 2016 +0100 Typos in docs and comments >--------------------------------------------------------------- c78fedde7055490ca6f6210ada797190f3c35d87 compiler/basicTypes/IdInfo.hs | 2 +- compiler/basicTypes/OccName.hs | 2 +- compiler/parser/Parser.y | 4 ++-- compiler/rename/RnSource.hs | 2 +- compiler/simplCore/SimplUtils.hs | 4 ++-- compiler/typecheck/TcInteract.hs | 2 +- docs/users_guide/glasgow_exts.rst | 2 +- mk/config.mk.in | 2 +- mk/warnings.mk | 8 ++++---- testsuite/tests/typecheck/should_compile/PolyRec.hs | 2 +- 10 files changed, 15 insertions(+), 15 deletions(-) diff --git a/compiler/basicTypes/IdInfo.hs b/compiler/basicTypes/IdInfo.hs index 450644d..db32f05 100644 --- a/compiler/basicTypes/IdInfo.hs +++ b/compiler/basicTypes/IdInfo.hs @@ -146,7 +146,7 @@ data IdDetails -- e.g. $trModule, or $tcT | PatSynId -- ^ A top-level Id to support pattern synonyms; - -- the builder or matcher for the patern synonym + -- the builder or matcher for the pattern synonym data RecSelParent = RecSelData TyCon | RecSelPatSyn PatSyn deriving Eq -- Either `TyCon` or `PatSyn` depending diff --git a/compiler/basicTypes/OccName.hs b/compiler/basicTypes/OccName.hs index 9f162d5..ad19f1f 100644 --- a/compiler/basicTypes/OccName.hs +++ b/compiler/basicTypes/OccName.hs @@ -549,7 +549,7 @@ a user-written type or function name $f... Dict-fun identifiers (from inst decls) $dmop Default method for 'op' $pnC n'th superclass selector for class C - $wf Worker for functtoin 'f' + $wf Worker for function 'f' $sf.. Specialised version of f T:C Tycon for dictionary for class C D:C Data constructor for dictionary for class C diff --git a/compiler/parser/Parser.y b/compiler/parser/Parser.y index 4732956..380fd3c 100644 --- a/compiler/parser/Parser.y +++ b/compiler/parser/Parser.y @@ -1773,9 +1773,9 @@ varids0 :: { Located [Located RdrName] } Note [Parsing ~] ~~~~~~~~~~~~~~~~ -Due to parsing conflicts between lazyness annotations in data type +Due to parsing conflicts between laziness annotations in data type declarations (see strict_mark) and equality types ~'s are always -parsed as lazyness annotations, and turned into HsEqTy's in the +parsed as laziness annotations, and turned into HsEqTy's in the correct places using RdrHsSyn.splitTilde. Since strict_mark is parsed as part of atype which is part of type, diff --git a/compiler/rename/RnSource.hs b/compiler/rename/RnSource.hs index 0dd5d7d..bfb2527 100644 --- a/compiler/rename/RnSource.hs +++ b/compiler/rename/RnSource.hs @@ -667,7 +667,7 @@ rnFamInstDecl doc mb_cls tycon (HsIB { hsib_body = pats }) payload rnPayload (L loc _ : ps) -> combineSrcSpans loc (getLoc (last ps)) ; pat_kity_vars_with_dups <- extractHsTysRdrTyVarsDups pats - -- Use the "...Dups" form becuase it's needed + -- Use the "...Dups" form because it's needed -- below to report unsed binder on the LHS ; var_names <- mapM (newTyVarNameRn mb_cls . L loc . unLoc) $ freeKiTyVarsAllVars $ diff --git a/compiler/simplCore/SimplUtils.hs b/compiler/simplCore/SimplUtils.hs index 09fd1e4..846d1cc 100644 --- a/compiler/simplCore/SimplUtils.hs +++ b/compiler/simplCore/SimplUtils.hs @@ -1023,7 +1023,7 @@ preInlineUnconditionally :: DynFlags -> SimplEnv -> TopLevelFlag -> InId -> InEx -- Precondition: rhs satisfies the let/app invariant -- See Note [CoreSyn let/app invariant] in CoreSyn -- Reason: we don't want to inline single uses, or discard dead bindings, --- for unlifted, side-effect-full bindings +-- for unlifted, side-effect-ful bindings preInlineUnconditionally dflags env top_lvl bndr rhs | not active = False | isStableUnfolding (idUnfolding bndr) = False -- Note [Stable unfoldings and preInlineUnconditionally] @@ -1136,7 +1136,7 @@ postInlineUnconditionally -- Precondition: rhs satisfies the let/app invariant -- See Note [CoreSyn let/app invariant] in CoreSyn -- Reason: we don't want to inline single uses, or discard dead bindings, --- for unlifted, side-effect-full bindings +-- for unlifted, side-effect-ful bindings postInlineUnconditionally dflags env top_lvl bndr occ_info rhs unfolding | not active = False | isWeakLoopBreaker occ_info = False -- If it's a loop-breaker of any kind, don't inline diff --git a/compiler/typecheck/TcInteract.hs b/compiler/typecheck/TcInteract.hs index 78bf845..6d85671 100644 --- a/compiler/typecheck/TcInteract.hs +++ b/compiler/typecheck/TcInteract.hs @@ -593,7 +593,7 @@ we keep? More subtle than you might think! 8% performance improvement in nofib cryptarithm2, compared to just rolling the dice. I didn't investigate why. - * Constaints coming from the same level (i.e. same implication) + * Constraints coming from the same level (i.e. same implication) - Always get rid of InstSC ones if possible, since they are less useful for solving. If both are InstSC, choose the one with diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index 5808d52..836b188 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -8770,7 +8770,7 @@ monomorphic type (one with no foralls). For example, The definition of ``foo`` is rejected because one would have to instantiate ``id``\'s type with ``b := (forall s. ST s a) -> a``, and -that is not allowed. Instanting polymorpic type variables with +that is not allowed. Instantiating polymorphic type variables with polymorphic types is called *impredicative polymorphism*. GHC has extremely flaky support for *impredicative polymorphism*, diff --git a/mk/config.mk.in b/mk/config.mk.in index e1259e5..9fff715 100644 --- a/mk/config.mk.in +++ b/mk/config.mk.in @@ -440,7 +440,7 @@ SRC_HC_OPTS_STAGE0 = SRC_HC_OPTS_STAGE1 = SRC_HC_OPTS_STAGE2 = -# Warning supression flags. See mk/warnings.mk. +# Warning suppression flags. See mk/warnings.mk. SRC_CC_WARNING_OPTS = SRC_HC_WARNING_OPTS = diff --git a/mk/warnings.mk b/mk/warnings.mk index cf22042..abbee68 100644 --- a/mk/warnings.mk +++ b/mk/warnings.mk @@ -123,10 +123,10 @@ GhcBootLibExtraHcOpts += -fno-warn-deprecated-flags # * Most .cabal files specify -Wall. But not all, and not all building we # do relies on .cabal files. So we have to add -Wall ourselves somewhere. # -# * Some .cabal also specify warning supression flags. Because -Wall -# overrides any warning supression flags that come before it, we have to -# make sure -Wall comes before any warning supression flags. So we add it +# * Some .cabal also specify warning suppression flags. Because -Wall +# overrides any warning suppression flags that come before it, we have to +# make sure -Wall comes before any warning suppression flags. So we add it # to SRC_HC_OPTS. # -# * Similarly, our own warning supression should come after the -Wall from +# * Similarly, our own warning suppression should come after the -Wall from # the .cabal files, so we do *not* add them to SRC_HC_OPTS. diff --git a/testsuite/tests/typecheck/should_compile/PolyRec.hs b/testsuite/tests/typecheck/should_compile/PolyRec.hs index ddb9115..6ca859b 100644 --- a/testsuite/tests/typecheck/should_compile/PolyRec.hs +++ b/testsuite/tests/typecheck/should_compile/PolyRec.hs @@ -24,6 +24,6 @@ f (Y x) = g maybeToInt x -- g :: Functor f => (f Int -> b) -> f (Y Maybe) -> b g h x = h $ fmap f x --- 'test' checks that g's type is polymophic enough +-- 'test' checks that g's type is polymorphic enough test :: Functor f => (f Int -> b) -> f (Y Maybe) -> b test = g From git at git.haskell.org Fri Jan 8 08:50:45 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 8 Jan 2016 08:50:45 +0000 (UTC) Subject: [commit: ghc] master: Enable stack traces with ghci -fexternal-interpreter -prof (6be09e8) Message-ID: <20160108085045.299923A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/6be09e884730f19da6c24fc565980f515300e53c/ghc >--------------------------------------------------------------- commit 6be09e884730f19da6c24fc565980f515300e53c Author: Simon Marlow Date: Thu Jan 7 11:36:41 2016 +0000 Enable stack traces with ghci -fexternal-interpreter -prof Summary: The main goal here is enable stack traces in GHCi. After this change, if you start GHCi like this: ghci -fexternal-interpreter -prof (which requires packages to be built for profiling, but not GHC itself) then the interpreter manages cost-centre stacks during execution and can produce a stack trace on request. Call locations are available for all interpreted code, and any compiled code that was built with the `-fprof-auto` familiy of flags. There are a couple of ways to get a stack trace: * `error`/`undefined` automatically get one attached * `Debug.Trace.traceStack` can be used anywhere, and prints the current stack Because the interpreter is running in a separate process, only the interpreted code is running in profiled mode and the compiler itself isn't slowed down by profiling. The GHCi debugger still doesn't work with -fexternal-interpreter, although this patch gets it a step closer. Most of the functionality of breakpoints is implemented, but the runtime value introspection is still not supported. Along the way I also did some refactoring and added type arguments to the various remote pointer types in `GHCi.RemotePtr`, so there's better type safety and documentation in the bridge code between GHC and ghc-iserv. Test Plan: validate Reviewers: bgamari, ezyang, austin, hvr, goldfire, erikd Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1747 GHC Trac Issues: #11047, #11100 >--------------------------------------------------------------- 6be09e884730f19da6c24fc565980f515300e53c compiler/deSugar/Coverage.hs | 43 ++--- compiler/deSugar/Desugar.hs | 2 +- compiler/ghc.cabal.in | 1 - compiler/ghc.mk | 1 - compiler/ghci/ByteCodeAsm.hs | 33 ++-- compiler/ghci/ByteCodeGen.hs | 64 ++++---- compiler/ghci/ByteCodeInstr.hs | 10 +- compiler/ghci/ByteCodeItbls.hs | 3 +- compiler/ghci/ByteCodeLink.hs | 43 ++--- compiler/ghci/ByteCodeTypes.hs | 99 +++++++++--- compiler/ghci/Debugger.hs | 4 +- compiler/ghci/GHCi.hs | 74 ++++++--- compiler/ghci/Linker.hs | 52 +++--- compiler/main/DriverPipeline.hs | 4 +- compiler/main/GHC.hs | 3 +- compiler/main/HscMain.hs | 6 +- compiler/main/HscTypes.hs | 73 ++------- compiler/main/InteractiveEval.hs | 121 +++++++------- compiler/main/InteractiveEvalTypes.hs | 41 +++-- compiler/typecheck/TcRnTypes.hs | 3 +- compiler/typecheck/TcSplice.hs | 8 +- ghc.mk | 5 +- ghc/GHCi/UI.hs | 52 +++--- ghc/GHCi/UI/Monad.hs | 2 +- .../main => libraries/ghci/GHCi}/BreakArray.hs | 22 +-- libraries/ghci/GHCi/CreateBCO.hs | 14 +- libraries/ghci/GHCi/FFI.hsc | 5 +- libraries/ghci/GHCi/InfoTable.hsc | 2 +- libraries/ghci/GHCi/Message.hs | 177 +++++++++++++-------- libraries/ghci/GHCi/ObjLink.hs | 2 +- libraries/ghci/GHCi/RemoteTypes.hs | 87 +++++----- libraries/ghci/GHCi/ResolvedBCO.hs | 28 +--- libraries/ghci/GHCi/Run.hs | 77 +++++---- libraries/ghci/GHCi/TH.hs | 32 ++-- libraries/ghci/ghci.cabal.in | 1 + rts/Exception.cmm | 17 +- rts/Interpreter.c | 43 +++-- rules/build-prog.mk | 6 +- .../tests/ghci.debugger/scripts/break021.stdout | 4 +- 39 files changed, 680 insertions(+), 584 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 6be09e884730f19da6c24fc565980f515300e53c From git at git.haskell.org Fri Jan 8 08:50:47 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 8 Jan 2016 08:50:47 +0000 (UTC) Subject: [commit: ghc] master: Support for qRecover in TH with -fexternal-interpreter (09425cb) Message-ID: <20160108085047.EFC7A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/09425cbe4fb93ac3af4932937478d46972ecf91f/ghc >--------------------------------------------------------------- commit 09425cbe4fb93ac3af4932937478d46972ecf91f Author: Simon Marlow Date: Thu Jan 7 14:53:43 2016 +0000 Support for qRecover in TH with -fexternal-interpreter Summary: This completes the support for TH with -fexternal-interpreter. Test Plan: validate Reviewers: bgamari, ezyang, austin, niteria, goldfire, erikd Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1748 GHC Trac Issues: #11100 >--------------------------------------------------------------- 09425cbe4fb93ac3af4932937478d46972ecf91f compiler/main/ErrUtils.hs | 7 +++++- compiler/typecheck/TcRnMonad.hs | 9 +++---- compiler/typecheck/TcSplice.hs | 56 +++++++++++++++++++++++++++++++++++++---- libraries/ghci/GHCi/Message.hs | 17 +++++++++---- libraries/ghci/GHCi/TH.hs | 36 +++++++++++++------------- 5 files changed, 92 insertions(+), 33 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 09425cbe4fb93ac3af4932937478d46972ecf91f From git at git.haskell.org Fri Jan 8 10:43:41 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 8 Jan 2016 10:43:41 +0000 (UTC) Subject: [commit: ghc] master: User's Guide: injective type families section (6f2e722) Message-ID: <20160108104341.95C353A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/6f2e722973b39b7ef423f6a6b96725395d561836/ghc >--------------------------------------------------------------- commit 6f2e722973b39b7ef423f6a6b96725395d561836 Author: Jan Stolarek Date: Fri Jan 8 11:44:18 2016 +0100 User's Guide: injective type families section >--------------------------------------------------------------- 6f2e722973b39b7ef423f6a6b96725395d561836 docs/users_guide/glasgow_exts.rst | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index 836b188..377c1b5 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -7022,7 +7022,25 @@ Injective type families Starting with GHC 8.0 type families can be annotated with injectivity information. This information is then used by GHC during type checking to resolve type ambiguities in situations where a type variable appears -only under type family applications. +only under type family applications. Consider this contrived example: + +:: + + type family Id a + type instance Id Int = Int + type instance Id Bool = Bool + + id :: Id t -> Id t + id x = x + +Here the definition of ``id`` will be rejected because type variable ``t`` +appears only under type family applications and is thus ambiguous. But this +code will be accepted if we tell GHC that ``Id`` is injective, which means it +will be possible to infer ``t`` at call sites from the type of the argument: + +:: + + type family Id a = r | r -> a For full details on injective type families refer to Haskell Symposium 2015 paper `Injective type families for From git at git.haskell.org Fri Jan 8 11:24:42 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 8 Jan 2016 11:24:42 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Bump haskeline submodule (907cfd4) Message-ID: <20160108112442.7389F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/907cfd47ed008015ca34706f3aed17fd25873a0f/ghc >--------------------------------------------------------------- commit 907cfd47ed008015ca34706f3aed17fd25873a0f Author: Ben Gamari Date: Wed Jan 6 19:49:23 2016 +0100 Bump haskeline submodule >--------------------------------------------------------------- 907cfd47ed008015ca34706f3aed17fd25873a0f libraries/haskeline | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/haskeline b/libraries/haskeline index 2c69d65..5e53651 160000 --- a/libraries/haskeline +++ b/libraries/haskeline @@ -1 +1 @@ -Subproject commit 2c69d656e2ed163b20cdf4905ff398345d62f006 +Subproject commit 5e53651b2683f31bf5efc842c33f07afc05ec287 From git at git.haskell.org Fri Jan 8 11:24:45 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 8 Jan 2016 11:24:45 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Bump Cabal and Haddock to fix #11308 (ff1ce4c) Message-ID: <20160108112445.1976A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/ff1ce4c3f0728dc23e7949bd066ca80b3ab2914a/ghc >--------------------------------------------------------------- commit ff1ce4c3f0728dc23e7949bd066ca80b3ab2914a Author: Ben Gamari Date: Wed Jan 6 14:42:22 2016 +0100 Bump Cabal and Haddock to fix #11308 Bump Cabal and Haddock submodules such that they both support GCC-style response files on Windows. >--------------------------------------------------------------- ff1ce4c3f0728dc23e7949bd066ca80b3ab2914a libraries/Cabal | 2 +- testsuite/tests/driver/T4437.hs | 8 +------- utils/haddock | 2 +- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/libraries/Cabal b/libraries/Cabal index bf4d05e..a8a121e 160000 --- a/libraries/Cabal +++ b/libraries/Cabal @@ -1 +1 @@ -Subproject commit bf4d05efa79a41a819e3d9278d5e9e1e5a055ce7 +Subproject commit a8a121ea4d78783dd303dd2992d8e73ef337e7ed diff --git a/testsuite/tests/driver/T4437.hs b/testsuite/tests/driver/T4437.hs index 4120e91..f345ce6 100644 --- a/testsuite/tests/driver/T4437.hs +++ b/testsuite/tests/driver/T4437.hs @@ -32,13 +32,7 @@ check title expected got expectedGhcOnlyExtensions :: [String] expectedGhcOnlyExtensions = ["RelaxedLayout", "AlternativeLayoutRule", - "AlternativeLayoutRuleTransitional", - "OverloadedLabels", - "UndecidableSuperClasses", - "TemplateHaskellQuotes", - "MonadFailDesugaring", - "TypeInType", - "TypeApplications"] + "AlternativeLayoutRuleTransitional"] expectedCabalOnlyExtensions :: [String] expectedCabalOnlyExtensions = ["Generics", diff --git a/utils/haddock b/utils/haddock index 80f2f98..13e1eaf 160000 --- a/utils/haddock +++ b/utils/haddock @@ -1 +1 @@ -Subproject commit 80f2f9805b61e8cea291bae8ce22db626dc11f21 +Subproject commit 13e1eaf3ca897ffcf1b37d96e2867bc80d4ca64a From git at git.haskell.org Fri Jan 8 11:24:48 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 8 Jan 2016 11:24:48 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Change Template Haskell representation of GADTs. (e1c6a19) Message-ID: <20160108112448.E2EBC3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/e1c6a19af097e241065e74366654cf3007e836e0/ghc >--------------------------------------------------------------- commit e1c6a19af097e241065e74366654cf3007e836e0 Author: Jan Stolarek Date: Tue Jan 5 19:18:44 2016 +0100 Change Template Haskell representation of GADTs. Previous representation of GADTs in TH was not expressive enough to express possible GADT return types. See #11341 Test Plan: ./validate Reviewers: goldfire, austin, bgamari Subscribers: thomie, RyanGlScott Differential Revision: https://phabricator.haskell.org/D1738 GHC Trac Issues: #11341 (cherry picked from commit cac0795af33d622e4c6ebae6ae1f206969287088) >--------------------------------------------------------------- e1c6a19af097e241065e74366654cf3007e836e0 compiler/deSugar/DsMeta.hs | 24 ++----- compiler/hsSyn/Convert.hs | 28 ++++---- compiler/typecheck/TcSplice.hs | 50 ++++++------- .../template-haskell/Language/Haskell/TH/Lib.hs | 12 ++-- .../template-haskell/Language/Haskell/TH/Ppr.hs | 43 +++++------ .../template-haskell/Language/Haskell/TH/Syntax.hs | 27 +++++-- testsuite/tests/th/T10828.hs | 8 +-- testsuite/tests/th/T10828.stderr | 83 ---------------------- testsuite/tests/th/T10828b.hs | 4 +- testsuite/tests/th/T11341.hs | 30 ++++++++ testsuite/tests/th/T11341.stderr | 6 ++ testsuite/tests/th/T4188.hs | 2 - testsuite/tests/th/TH_RichKinds2.stderr | 2 +- testsuite/tests/th/all.T | 7 +- 14 files changed, 139 insertions(+), 187 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc e1c6a19af097e241065e74366654cf3007e836e0 From git at git.haskell.org Fri Jan 8 11:24:51 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 8 Jan 2016 11:24:51 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Remove -Wtoo-many-guards from default flags (fixes #11316) (5716c0d) Message-ID: <20160108112451.9173B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/5716c0d62cb4be00767be63f0e54bc9f02299884/ghc >--------------------------------------------------------------- commit 5716c0d62cb4be00767be63f0e54bc9f02299884 Author: George Karachalias Date: Tue Jan 5 15:59:49 2016 +0100 Remove -Wtoo-many-guards from default flags (fixes #11316) Since #11316 indicates that having flag `-Wtoo-many-guards` enabled by default causes issues, the simplest thing is to remove it. This patch removes it from the default list, it updates the docs and removes the suppression flags for `T783` and `types/OptCoercion.hs` Test Plan: validate Reviewers: bgamari, austin, goldfire Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1737 GHC Trac Issues: #11316 (cherry picked from commit 77494fa9fa34c1a831caabc194e855167de0c2d9) >--------------------------------------------------------------- 5716c0d62cb4be00767be63f0e54bc9f02299884 compiler/main/DynFlags.hs | 1 - compiler/types/OptCoercion.hs | 6 +----- docs/users_guide/8.0.1-notes.rst | 3 +-- docs/users_guide/using-warnings.rst | 11 ++++++----- testsuite/tests/perf/compiler/T783.hs | 5 ----- 5 files changed, 8 insertions(+), 18 deletions(-) diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 213c946..54b7b01 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -3413,7 +3413,6 @@ optLevelFlags -- see Note [Documenting optimisation flags] standardWarnings :: [WarningFlag] standardWarnings -- see Note [Documenting warning flags] = [ Opt_WarnOverlappingPatterns, - Opt_WarnTooManyGuards, Opt_WarnWarningsDeprecations, Opt_WarnDeprecatedFlags, Opt_WarnDeferredTypeErrors, diff --git a/compiler/types/OptCoercion.hs b/compiler/types/OptCoercion.hs index 41cec21..1038851 100644 --- a/compiler/types/OptCoercion.hs +++ b/compiler/types/OptCoercion.hs @@ -1,14 +1,10 @@ -- (c) The University of Glasgow 2006 {-# LANGUAGE CPP #-} -#if __GLASGOW_HASKELL__ > 710 -{-# OPTIONS_GHC -Wno-too-many-guards #-} -#endif -- 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). + -- (default behaviour when guards are too many). module OptCoercion ( optCoercion, checkAxInstCo ) where diff --git a/docs/users_guide/8.0.1-notes.rst b/docs/users_guide/8.0.1-notes.rst index 5938ffd..a3b114e 100644 --- a/docs/users_guide/8.0.1-notes.rst +++ b/docs/users_guide/8.0.1-notes.rst @@ -249,8 +249,7 @@ Compiler - Added the ``-Wtoo-many-guards`` flag. When enabled, this will issue a warning if a pattern match contains too many guards (over 20 at the - moment). It is enabled by default but makes a difference only if pattern - match checking is also enabled. + moment). Makes a difference only if pattern match checking is also enabled. - Added the ``-ffull-guard-reasoning`` flag. When enabled, pattern match checking tries its best to reason about guards. Since the additional diff --git a/docs/users_guide/using-warnings.rst b/docs/users_guide/using-warnings.rst index 619f701..bc12688 100644 --- a/docs/users_guide/using-warnings.rst +++ b/docs/users_guide/using-warnings.rst @@ -545,14 +545,15 @@ of ``-W(no-)*``. The option ``-Wtoo-many-guards`` warns about places where a pattern match contains too many guards (over 20 at the moment). - It is enabled by default but has an effect only if any form of - exhaustivness/overlapping checking is enabled (one of + It has an effect only if any form of exhaustivness/overlapping + checking is enabled (one of ``-Wincomplete-patterns``, ``-Wincomplete-uni-patterns``, ``-Wincomplete-record-updates``, - ``-Woverlapping-patterns``). The warning can be suppressed by - enabling either ``-Wno-too-many-guards``, which just hides the - warning, or ``-ffull-guard-reasoning``. + ``-Woverlapping-patterns``). When enabled, the warning can be + suppressed by enabling either ``-Wno-too-many-guards``, which just + hides the warning, or ``-ffull-guard-reasoning`` which runs the + full check, independently of the number of guards. ``-ffull-guard-reasoning`` .. index:: diff --git a/testsuite/tests/perf/compiler/T783.hs b/testsuite/tests/perf/compiler/T783.hs index cfd6b62..c3ea08d 100644 --- a/testsuite/tests/perf/compiler/T783.hs +++ b/testsuite/tests/perf/compiler/T783.hs @@ -1,8 +1,3 @@ -{-# LANGUAGE CPP #-} -#if __GLASGOW_HASKELL__ > 710 -{-# OPTIONS_GHC -Wno-too-many-guards #-} -#endif - module Test where foo :: Double -> Int From git at git.haskell.org Fri Jan 8 11:24:54 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 8 Jan 2016 11:24:54 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Rewrite announce file (d191ca7) Message-ID: <20160108112454.3B3B73A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/d191ca723b57e0851001193cd8d3d8b98078b153/ghc >--------------------------------------------------------------- commit d191ca723b57e0851001193cd8d3d8b98078b153 Author: Ben Gamari Date: Fri Jul 17 19:47:56 2015 +0200 Rewrite announce file Incredibly enough this hasn't been touched since 6.10.1 (cherry picked from commit 47367e0f2f00456dfe6757698413e223a72710f7) >--------------------------------------------------------------- d191ca723b57e0851001193cd8d3d8b98078b153 ANNOUNCE | 67 +++++++++++++++++++++++++++++++++++++++------------------------- 1 file changed, 41 insertions(+), 26 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index f9f1c57..24cddb3 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,35 +1,51 @@ - ============================================================== - The (Interactive) Glasgow Haskell Compiler -- version 6.10.1 - ============================================================== + =============================================== + The Glasgow Haskell Compiler -- version 8.0.1 + =============================================== -The GHC Team is pleased to announce a new major release of GHC. There -have been a number of significant changes since the last major release, -including: +The GHC Team is pleased to announce a new super-major release of GHC. This is +the most significant GHC release in quite some time, including both a number +of major features and numerous bug fixes. These include, - * Some new language features have been implemented: - * Record syntax: wild-card patterns, punning, and field disambiguation - * Generalised quasi-quotes - * Generalised list comprehensions - * View patterns + * The TypeInType extension, which unifies types and kinds, allowing GHC + to reason about kind equality and enabling promotion of GADTs to the type + level. - * Type families have been completely re-implemented + * Support for record pattern synonyms - * Now comes with Haddock 2, which supports all GHC extensions + * The DeriveAnyClass extension to conveniently derive default instances - * Parallel garbage collection + * More reliable DWARF debugging information - * Base provides extensible exceptions + * Support for injective type classes - * The GHC API is easier to use + * Applicative do-notation - * External core (output only) now works again + * Support for wildcards in data and type family instances - * Data Parallel Haskell (DPH) comes as part of GHC + * Strict and StrictData extensions, allowing modules to be compiled with + strict-by-default bindings -The full release notes are here: + * The DuplicateRecordFields extensions, allowing multiple datatypes to declare + the same record field names provided they are used unambiguously + + * Support for implicit parameters providing light-weight callstacks and source + locations + + * User-defined error messages for type errors + + * A rewritten (and greatly improved) pattern exhaustiveness checker + + * GHCi can run the interpreter in a separate process, and the interpreter can + now run profiled code. + + * and more! + +A more thorough list of the changes in the release can be found in the release +notes, + + http://haskell.org/ghc/docs/8.0.1/html/users_guide/release-8-0-1.html - http://haskell.org/ghc/docs/6.10.1/html/users_guide/release-6-10-1.html How to get it ~~~~~~~~~~~~~ @@ -52,13 +68,12 @@ Background Haskell is a standard lazy functional programming language. GHC is a state-of-the-art programming suite for Haskell. Included is -an optimising compiler generating good code for a variety of +an optimising compiler generating efficient code for a variety of platforms, together with an interactive system for convenient, quick development. The distribution includes space and time profiling facilities, a large collection of libraries, and support for various language extensions, including concurrency, exceptions, and foreign -language interfaces (C, whatever). GHC is distributed under a -BSD-style open source license. +language interfaces. GHC is distributed under a BSD-style open source license. A wide variety of Haskell related resources (tutorials, libraries, specifications, documentation, compilers, interpreters, references, @@ -107,13 +122,13 @@ Mailing lists We run mailing lists for GHC users and bug reports; to subscribe, use the web interfaces at - http://www.haskell.org/mailman/listinfo/glasgow-haskell-users - http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs + http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users + http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets There are several other haskell and ghc-related mailing lists on www.haskell.org; for the full list, see - http://www.haskell.org/mailman/listinfo/ + https://mail.haskell.org/cgi-bin/mailman/listinfo Some GHC developers hang out on #haskell on IRC, too: From git at git.haskell.org Fri Jan 8 11:24:56 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 8 Jan 2016 11:24:56 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: users guide: Add documentation for custom compile-time errors (91eddc1) Message-ID: <20160108112456.DAB5B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/91eddc13bb2340b32d7642a2d045fc76e150f29d/ghc >--------------------------------------------------------------- commit 91eddc13bb2340b32d7642a2d045fc76e150f29d Author: Ben Gamari Date: Wed Jan 6 23:56:44 2016 +0100 users guide: Add documentation for custom compile-time errors (cherry picked from commit 568736d757d3e0883b0250e0b948aeed646c20b5) >--------------------------------------------------------------- 91eddc13bb2340b32d7642a2d045fc76e150f29d docs/users_guide/glasgow_exts.rst | 66 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 64 insertions(+), 2 deletions(-) diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index 51f84d6..372a033 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -9599,13 +9599,75 @@ splices. supported either. - Type splices: only anonymous wildcards are supported in type splices. - Named and extra-constraints wildcards are not. - :: + Named and extra-constraints wildcards are not. :: {-# LANGUAGE TemplateHaskell #-} foo :: $( [t| _ |] ) -> a foo x = x +.. _custom-errors: + +Custom compile-time errors +========================== + +When designing embedded domain specific languages in Haskell, it is useful to +have something like ``error`` at the type level. In this way, the EDSL designer +may show a type error that is specific to the DSL, rather than the standard GHC +type error. + +For example, consider a type class that is not intended to be used with +functions, but the user accidentally used it at a function type, perhaps +because they missed an argument to some function. Then, instead of getting the +standard GHC message about a missing instance, it would be nicer to emit a more +friendly message specific to the EDSL. Similarly, the reduction of a type-level +function may get stuck due to an error, at which point it would be nice to +report an EDSL specific error, rather than a generic error about an ambiguous +type. + +To solve this, GHC provides a single type-level function, :: + + type family TypeError (msg :: ErrorMessage) :: k + +along with a small type-level language (via +``DataKinds`` :ref:`promotion `) +for constructing pretty-printed error messages, :: + + -- ErrorMessage is intended to be used as a kind + data ErrorMessage = + Text Symbol -- Show this text as is + | forall t. ShowType t -- Pretty print a type + | ErrorMessage :<>: ErrorMessage -- Put two chunks of error message next to each other + | ErrorMessage :$$: ErrorMessage -- Put two chunks of error message above each other + +in the ``GHC.TypeLits`` :base-ref:`module `. + +For instance, we might use this interface to provide a more useful error +message for applications of ``show`` on unsaturated functions like this, :: + + {-# LANGUAGE DataKinds #-} + {-# LANGUAGE TypeOperators #-} + {-# LANGUAGE UndecidableInstances #-} + + import GHC.TypeLits + + instance TypeError (Text "Cannot 'Show' functions." :$$: + Text "Perhaps there is a missing argument?") + => Show (a -> b) where + showsPrec = error "unreachable" + + main = print negate + +Which will produce the following compile-time error, + +.. code-block:: none + + Test.hs:12:8: error: + ? Cannot 'Show' functions. + Perhaps there is a missing argument? + ? In the expression: print negate + In an equation for ?main?: main = print negate + + .. _defer-type-errors: Deferring type errors to runtime From git at git.haskell.org Fri Jan 8 11:24:59 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 8 Jan 2016 11:24:59 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Add a note describing the protocol for adding a language extension (c6190c7) Message-ID: <20160108112459.A28A93A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/c6190c73d0399643d0151e5f7ca8e682ac52fffb/ghc >--------------------------------------------------------------- commit c6190c73d0399643d0151e5f7ca8e682ac52fffb Author: Ben Gamari Date: Wed Jan 6 20:00:16 2016 +0100 Add a note describing the protocol for adding a language extension Reviewers: hvr, thomie, austin Reviewed By: austin Subscribers: duncan Differential Revision: https://phabricator.haskell.org/D1741 GHC Trac Issues: #8176, #4437 (cherry picked from commit 7861a22561846eef9a6415a93d79e121dca9c05f) >--------------------------------------------------------------- c6190c73d0399643d0151e5f7ca8e682ac52fffb compiler/main/DynFlags.hs | 54 +++++++++++++++++++++++++++++++++++++++++ testsuite/tests/driver/T4437.hs | 6 +++++ testsuite/tests/driver/all.T | 5 ++++ 3 files changed, 65 insertions(+) diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 54b7b01..3caff63 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -236,6 +236,59 @@ import qualified GHC.LanguageExtensions as LangExt -- have effect, and annotate it accordingly. For Flags use defFlag, defGhcFlag, -- defGhciFlag, and for FlagSpec use flagSpec or flagGhciSpec. +-- Note [Adding a language extension] +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-- +-- There are a few steps to adding (or removing) a language extension, +-- +-- * Adding the extension to GHC.LanguageExtensions +-- +-- The LangExt type in libraries/ghc-boot/GHC/LanguageExtensions.hs is +-- the canonical list of language extensions known by GHC. +-- +-- * Adding a flag to DynFlags.xFlags +-- +-- This is fairly self-explanatory. The name should be concise, memorable, +-- and consistent with any previous implementations of the similar idea in +-- other Haskell compilers. +-- +-- * Adding the flag to the documentation +-- +-- This is the same as any other flag. See +-- Note [Updating flag description in the User's Guide] +-- +-- * Adding the flag to Cabal +-- +-- The Cabal library has its own list of all language extensions supported +-- by all major compilers. This is the list that user code being uploaded +-- to Hackage is checked against to ensure language extension validity. +-- Consequently, it is very important that this list remains up-to-date. +-- +-- To this end, there is a testsuite test (testsuite/tests/driver/T4437.hs) +-- whose job it is to ensure these GHC's extensions are consistent with +-- Cabal. +-- +-- The recommended workflow is, +-- +-- 1. Temporarily add your new language extension to the +-- expectedGhcOnlyExtensions list in T4437 to ensure the test doesn't +-- break while Cabal is updated. +-- +-- 2. After your GHC change is accepted, submit a Cabal pull request adding +-- your new extension to Cabal's list (found in +-- Cabal/Language/Haskell/Extension.hs). +-- +-- 3. After your Cabal change is accepted, let the GHC developers know so +-- they can update the Cabal submodule and remove the extensions from +-- expectedGhcOnlyExtensions. +-- +-- * Adding the flag to the GHC Wiki +-- +-- There is a change log tracking language extension additions and removals +-- on the GHC wiki: https://ghc.haskell.org/trac/ghc/wiki/LanguagePragmaHistory +-- +-- See Trac #4437 and #8176. + -- ----------------------------------------------------------------------------- -- DynFlags @@ -3108,6 +3161,7 @@ xFlags :: [FlagSpec LangExt.Extension] xFlags = [ -- See Note [Updating flag description in the User's Guide] -- See Note [Supporting CLI completion] +-- See Note [Adding a language extension] -- Please keep the list of flags below sorted alphabetically flagSpec "AllowAmbiguousTypes" LangExt.AllowAmbiguousTypes, flagSpec "AlternativeLayoutRule" LangExt.AlternativeLayoutRule, diff --git a/testsuite/tests/driver/T4437.hs b/testsuite/tests/driver/T4437.hs index f345ce6..5f14da1 100644 --- a/testsuite/tests/driver/T4437.hs +++ b/testsuite/tests/driver/T4437.hs @@ -1,3 +1,8 @@ +-- | A test for ensuring that GHC's supporting language extensions remains in +-- sync with Cabal's own extension list. +-- +-- If you have ended up here due to a test failure, please see +-- Note [Adding a language extension] in compiler/main/DynFlags.hs. module Main (main) where @@ -29,6 +34,7 @@ check title expected got showProblems "Unexpected flags" unexpected showProblems "Missing flags" missing +-- See Note [Adding a language extension] in compiler/main/DynFlags.hs. expectedGhcOnlyExtensions :: [String] expectedGhcOnlyExtensions = ["RelaxedLayout", "AlternativeLayoutRule", diff --git a/testsuite/tests/driver/all.T b/testsuite/tests/driver/all.T index 12522df..8493aa4 100644 --- a/testsuite/tests/driver/all.T +++ b/testsuite/tests/driver/all.T @@ -352,6 +352,11 @@ test('withRtsOpts', [ extra_clean(['withRtsOpts', 'withRtsOpts.exe', test('T3389', normal, compile_and_run, ['']) test('T3364', normalise_fun(normalise_errmsg), run_command, ['$MAKE -s --no-print-directory T3364']) + +# T4437: A test to ensure that Cabal's language extension list remains +# consistent with those known by GHC. +# +# See Note [Adding a language extension] in DynFlags.hs for details. test('T4437', only_ways(['normal']), compile_and_run, ['-package ghc']) test('werror', normal, compile_fail, ['']) From git at git.haskell.org Fri Jan 8 11:25:02 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 8 Jan 2016 11:25:02 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: users guide: Add links to release notes (7319008) Message-ID: <20160108112502.513AD3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/7319008f7141129d5de6dafdd8d39156e6864015/ghc >--------------------------------------------------------------- commit 7319008f7141129d5de6dafdd8d39156e6864015 Author: Ben Gamari Date: Wed Jan 6 23:59:30 2016 +0100 users guide: Add links to release notes (cherry picked from commit 5040686532d15a11a2ff52a020fc77de9374b7e3) >--------------------------------------------------------------- 7319008f7141129d5de6dafdd8d39156e6864015 docs/users_guide/8.0.1-notes.rst | 18 ++++++++++-------- docs/users_guide/glasgow_exts.rst | 2 ++ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/docs/users_guide/8.0.1-notes.rst b/docs/users_guide/8.0.1-notes.rst index a3b114e..252244d 100644 --- a/docs/users_guide/8.0.1-notes.rst +++ b/docs/users_guide/8.0.1-notes.rst @@ -16,25 +16,26 @@ The highlights, since the 7.10 branch, are: - nokinds -- Record pattern synonyms +- Support for :ref:`record pattern synonyms ` -- ``-XDeriveAnyClass`` +- ``-XDeriveAnyClass`` to conveniently derive default instances (see :ref:`derive-any-class`) - More reliable DWARF debugging information -- Injective type classes +- Support for :ref:`injective type classes :ref:`injective-ty-fams` -- Applicative ``do`` notation +- Applicative ``do`` notation (see :ref:`applicative-do`) - Support for wildcards in data and type family instances - ``Strict`` and ``StrictData`` extensions, allowing modules to be compiled with - strict-by-default bindings. + strict-by-default bindings (see :ref:`strict-haskell`) - ``DuplicateRecordFields``, allowing multiple datatypes to declare the same - record field names provided they are used unambiguously + record field names provided they are used unambiguously (see :ref:`duplicate-record-fields`) -- Support for implicit parameters providing light-weight callstacks and source locations +- Support for implicit parameters providing light-weight + :ref:`callstacks and source locations ` - User-defined error messages for type errors @@ -451,7 +452,8 @@ See ``changelog.md`` in the ``base`` package for full release notes. provided by the ``semigroups`` package previously. (:ghc-ticket:`10365`) - Add ``GHC.TypeLits.TypeError`` and ``ErrorMessage`` to allow users - to define custom compile-time error messages. + to define custom compile-time error messages. (see :ref:`custom-errors` and + the original :ghc-wiki:`proposal `). - The ``Generic`` instance for ``Proxy`` is now poly-kinded (see :ghc-ticket:`10775`) diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index 372a033..5808d52 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -784,6 +784,8 @@ The table below summarises where each kind of pattern synonym can be used. | Expression | No | Yes (Inferred)| Yes (Explicit) | +---------------+----------------+---------------+---------------------------+ +.. _record-patsyns: + Record Pattern Synonyms ~~~~~~~~~~~~~~~~~~~~~~~ From git at git.haskell.org Fri Jan 8 11:25:04 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 8 Jan 2016 11:25:04 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Fall back on ghc-stage2 when using Windows' GHCi driver (595eb24) Message-ID: <20160108112504.F2E683A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/595eb24f2ffb06dfac6ad619bb3abe75b59bbf44/ghc >--------------------------------------------------------------- commit 595eb24f2ffb06dfac6ad619bb3abe75b59bbf44 Author: RyanGlScott Date: Wed Jan 6 23:10:54 2016 +0100 Fall back on ghc-stage2 when using Windows' GHCi driver Reviewers: austin, hvr, bgamari, thomie Reviewed By: thomie Differential Revision: https://phabricator.haskell.org/D1721 (cherry picked from commit f01eb5410d7980567bf2731b9cded9a4894a3ef5) >--------------------------------------------------------------- 595eb24f2ffb06dfac6ad619bb3abe75b59bbf44 driver/ghci/ghci.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/driver/ghci/ghci.c b/driver/ghci/ghci.c index 414521f..f358d96 100644 --- a/driver/ghci/ghci.c +++ b/driver/ghci/ghci.c @@ -3,6 +3,12 @@ #include "getLocation.h" #include #include +#include + +BOOL fileExists(const char *path) { + const DWORD r = GetFileAttributesA(path); + return r != INVALID_FILE_ATTRIBUTES && !(r & FILE_ATTRIBUTE_DIRECTORY); +} int main(int argc, char** argv) { char *binDir; @@ -19,6 +25,13 @@ int main(int argc, char** argv) { exePath = mkString("%s/ghc.exe", binDir); preArgv[0] = "--interactive"; + /* If ghc.exe can't be found, we assume that we're building ghc from + * source, in which case we fall back on ghc-stage2. + */ + if (!fileExists(exePath)) { + exePath = mkString("%s/ghc-stage2.exe", binDir); + } + run(exePath, 1, preArgv, argc - 1, argv + 1); } From git at git.haskell.org Fri Jan 8 11:25:07 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 8 Jan 2016 11:25:07 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: users guide: Tweak wording of RTS -Nmax description (b37472b) Message-ID: <20160108112507.9A0573A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/b37472bcf77c75ce506a1189ee4a9e4ef6f33f3f/ghc >--------------------------------------------------------------- commit b37472bcf77c75ce506a1189ee4a9e4ef6f33f3f Author: Ben Gamari Date: Thu Jan 7 00:08:52 2016 +0100 users guide: Tweak wording of RTS -Nmax description (cherry picked from commit 0a04837a98a8226aa68ff95efd693db126b2d027) >--------------------------------------------------------------- b37472bcf77c75ce506a1189ee4a9e4ef6f33f3f docs/users_guide/8.0.1-notes.rst | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/users_guide/8.0.1-notes.rst b/docs/users_guide/8.0.1-notes.rst index 252244d..f79da4f 100644 --- a/docs/users_guide/8.0.1-notes.rst +++ b/docs/users_guide/8.0.1-notes.rst @@ -41,8 +41,6 @@ The highlights, since the 7.10 branch, are: - A rewritten (and greatly improved) pattern exhaustiveness checker -- ``-maxN(x)`` added to compliment ``-N`` - - GHC can run the interpreter in a separate process (see :ref:`external-interpreter`), and the interpreter can now run profiled code. @@ -355,8 +353,8 @@ Runtime system - Support for performance monitoring with PAPI has been dropped. -- ``-maxN(x)`` flag added to compliment ``-N``, it will choose to use at most - (x) capabilities, limited by the number of processors as ``-N`` is. +- ``-maxN?x?`` flag added to complement ``-N``. It will choose to use at most + ?x? capabilities, limited by the number of processors as ``-N`` is. Build system ~~~~~~~~~~~~ From git at git.haskell.org Fri Jan 8 11:25:11 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 8 Jan 2016 11:25:11 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Fix Template Haskell's handling of infix GADT constructors (9578cb2) Message-ID: <20160108112511.1B7C13A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/9578cb21275b85f5f80e01d7ea70157d8b71e9eb/ghc >--------------------------------------------------------------- commit 9578cb21275b85f5f80e01d7ea70157d8b71e9eb Author: RyanGlScott Date: Fri Jan 8 11:46:10 2016 +0100 Fix Template Haskell's handling of infix GADT constructors This is the second (and hopefully last) fix needed to make TH handle GADTs properly (after D1465). This Diff addresses some issues with infix GADT constructors, specifically: * Before, you could not determine if a GADT constructor was declared infix because TH did not give you the ability to determine if there is a //user-specified// fixity declaration for that constructor. The return type of `reifyFixity` was changed to `Maybe Fixity` so that it yields `Just` the fixity is there is a fixity declaration, and `Nothing` otherwise (indicating it has `defaultFixity`). * `DsMeta`/`Convert` were changed so that infix GADT constructors are turned into `GadtC`, not `InfixC` (which should be reserved for Haskell98 datatype declarations). * Some minor fixes to the TH pretty-printer so that infix GADT constructors will be parenthesized in GADT signatures. Fixes #11345. Test Plan: ./validate Reviewers: goldfire, austin, bgamari, jstolarek Reviewed By: jstolarek Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1744 GHC Trac Issues: #11345 (cherry picked from commit a701a813dcfe7850bbc3c8a220c80e1dada93f49) >--------------------------------------------------------------- 9578cb21275b85f5f80e01d7ea70157d8b71e9eb compiler/deSugar/DsMeta.hs | 6 ++- compiler/typecheck/TcSplice.hs | 29 ++++++++++++-- libraries/ghci/GHCi/Message.hs | 2 +- .../template-haskell/Language/Haskell/TH/Ppr.hs | 21 +++++++--- .../template-haskell/Language/Haskell/TH/Syntax.hs | 11 ++++-- libraries/template-haskell/changelog.md | 6 +++ testsuite/tests/th/T10704.stdout | 32 +++++++-------- testsuite/tests/th/T11345.hs | 45 ++++++++++++++++++++++ testsuite/tests/th/T11345.stdout | 10 +++++ testsuite/tests/th/all.T | 1 + 10 files changed, 130 insertions(+), 33 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 9578cb21275b85f5f80e01d7ea70157d8b71e9eb From git at git.haskell.org Fri Jan 8 11:25:13 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 8 Jan 2016 11:25:13 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Improve GHC.Event.IntTable performance (91bd13c) Message-ID: <20160108112513.BA3843A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/91bd13cda793858dfe682867db93cf945a54fc78/ghc >--------------------------------------------------------------- commit 91bd13cda793858dfe682867db93cf945a54fc78 Author: Jonas Scholl Date: Fri Jan 8 11:46:42 2016 +0100 Improve GHC.Event.IntTable performance Speed up GHC.Event.IntTable.lookup by removing the IO context from the go helper function. This generates a little bit better code as we can avoid repeating the stack check. Remove unused parameter from GHC.Event.IntTable.updateWith.go and directly return a bool instead of a maybe and then checking that whether it is a Nothing. Test Plan: validate Reviewers: austin, hvr, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1742 GHC Trac Issues: #8793 (cherry picked from commit 9034824055964e32140f95267a70e4b9e9171db6) >--------------------------------------------------------------- 91bd13cda793858dfe682867db93cf945a54fc78 libraries/base/GHC/Event/IntTable.hs | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/libraries/base/GHC/Event/IntTable.hs b/libraries/base/GHC/Event/IntTable.hs index ea487d5..7ae2e1a 100644 --- a/libraries/base/GHC/Event/IntTable.hs +++ b/libraries/base/GHC/Event/IntTable.hs @@ -15,10 +15,10 @@ module GHC.Event.IntTable import Data.Bits ((.&.), shiftL, shiftR) import Data.IORef (IORef, newIORef, readIORef, writeIORef) -import Data.Maybe (Maybe(..), isJust, isNothing) +import Data.Maybe (Maybe(..), isJust) import Foreign.ForeignPtr (ForeignPtr, mallocForeignPtr, withForeignPtr) import Foreign.Storable (peek, poke) -import GHC.Base (Monad(..), (=<<), ($), const, liftM, otherwise, when) +import GHC.Base (Monad(..), (=<<), ($), ($!), const, liftM, otherwise, when) import GHC.Classes (Eq(..), Ord(..)) import GHC.Event.Arr (Arr) import GHC.Num (Num(..)) @@ -47,11 +47,12 @@ data Bucket a = Empty lookup :: Int -> IntTable a -> IO (Maybe a) lookup k (IntTable ref) = do let go Bucket{..} - | bucketKey == k = return (Just bucketValue) + | bucketKey == k = Just bucketValue | otherwise = go bucketNext - go _ = return Nothing + go _ = Nothing it at IT{..} <- readIORef ref - go =<< Arr.read tabArr (indexOf k it) + bkt <- Arr.read tabArr (indexOf k it) + return $! go bkt new :: Int -> IO (IntTable a) new capacity = IntTable `liftM` (newIORef =<< new_ capacity) @@ -125,20 +126,18 @@ updateWith :: (a -> Maybe a) -> Int -> IntTable a -> IO (Maybe a) updateWith f k (IntTable ref) = do it at IT{..} <- readIORef ref let idx = indexOf k it - go changed bkt at Bucket{..} - | bucketKey == k = - let fbv = f bucketValue - !nb = case fbv of - Just val -> bkt { bucketValue = val } - Nothing -> bucketNext - in (fbv, Just bucketValue, nb) - | otherwise = case go changed bucketNext of + go bkt at Bucket{..} + | bucketKey == k = case f bucketValue of + Just val -> let !nb = bkt { bucketValue = val } + in (False, Just bucketValue, nb) + Nothing -> (True, Just bucketValue, bucketNext) + | otherwise = case go bucketNext of (fbv, ov, nb) -> (fbv, ov, bkt { bucketNext = nb }) - go _ e = (Nothing, Nothing, e) - (fbv, oldVal, newBucket) <- go False `liftM` Arr.read tabArr idx + go e = (False, Nothing, e) + (del, oldVal, newBucket) <- go `liftM` Arr.read tabArr idx when (isJust oldVal) $ do Arr.write tabArr idx newBucket - when (isNothing fbv) $ + when del $ withForeignPtr tabSize $ \ptr -> do size <- peek ptr poke ptr (size - 1) From git at git.haskell.org Fri Jan 8 11:25:34 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 8 Jan 2016 11:25:34 +0000 (UTC) Subject: [commit: ghc] master: Fix Template Haskell's handling of infix GADT constructors (0163427) Message-ID: <20160108112534.DB1BD3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/0163427761c0e72a3acf09f854b3447f2e553f1b/ghc >--------------------------------------------------------------- commit 0163427761c0e72a3acf09f854b3447f2e553f1b Author: RyanGlScott Date: Fri Jan 8 11:46:10 2016 +0100 Fix Template Haskell's handling of infix GADT constructors This is the second (and hopefully last) fix needed to make TH handle GADTs properly (after D1465). This Diff addresses some issues with infix GADT constructors, specifically: * Before, you could not determine if a GADT constructor was declared infix because TH did not give you the ability to determine if there is a //user-specified// fixity declaration for that constructor. The return type of `reifyFixity` was changed to `Maybe Fixity` so that it yields `Just` the fixity is there is a fixity declaration, and `Nothing` otherwise (indicating it has `defaultFixity`). * `DsMeta`/`Convert` were changed so that infix GADT constructors are turned into `GadtC`, not `InfixC` (which should be reserved for Haskell98 datatype declarations). * Some minor fixes to the TH pretty-printer so that infix GADT constructors will be parenthesized in GADT signatures. Fixes #11345. Test Plan: ./validate Reviewers: goldfire, austin, bgamari, jstolarek Reviewed By: jstolarek Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1744 GHC Trac Issues: #11345 >--------------------------------------------------------------- 0163427761c0e72a3acf09f854b3447f2e553f1b compiler/deSugar/DsMeta.hs | 6 ++- compiler/typecheck/TcSplice.hs | 29 ++++++++++++-- libraries/ghci/GHCi/Message.hs | 2 +- .../template-haskell/Language/Haskell/TH/Ppr.hs | 21 +++++++--- .../template-haskell/Language/Haskell/TH/Syntax.hs | 11 ++++-- libraries/template-haskell/changelog.md | 6 +++ testsuite/tests/th/T10704.stdout | 32 +++++++-------- testsuite/tests/th/T11345.hs | 45 ++++++++++++++++++++++ testsuite/tests/th/T11345.stdout | 10 +++++ testsuite/tests/th/all.T | 1 + 10 files changed, 130 insertions(+), 33 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 0163427761c0e72a3acf09f854b3447f2e553f1b From git at git.haskell.org Fri Jan 8 11:25:37 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 8 Jan 2016 11:25:37 +0000 (UTC) Subject: [commit: ghc] master: Improve GHC.Event.IntTable performance (1abb700) Message-ID: <20160108112537.7D01F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/1abb7005067e22039807de34cd60bed55316e925/ghc >--------------------------------------------------------------- commit 1abb7005067e22039807de34cd60bed55316e925 Author: Jonas Scholl Date: Fri Jan 8 11:46:42 2016 +0100 Improve GHC.Event.IntTable performance Speed up GHC.Event.IntTable.lookup by removing the IO context from the go helper function. This generates a little bit better code as we can avoid repeating the stack check. Remove unused parameter from GHC.Event.IntTable.updateWith.go and directly return a bool instead of a maybe and then checking that whether it is a Nothing. Test Plan: validate Reviewers: austin, hvr, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1742 GHC Trac Issues: #8793 >--------------------------------------------------------------- 1abb7005067e22039807de34cd60bed55316e925 libraries/base/GHC/Event/IntTable.hs | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/libraries/base/GHC/Event/IntTable.hs b/libraries/base/GHC/Event/IntTable.hs index ea487d5..7ae2e1a 100644 --- a/libraries/base/GHC/Event/IntTable.hs +++ b/libraries/base/GHC/Event/IntTable.hs @@ -15,10 +15,10 @@ module GHC.Event.IntTable import Data.Bits ((.&.), shiftL, shiftR) import Data.IORef (IORef, newIORef, readIORef, writeIORef) -import Data.Maybe (Maybe(..), isJust, isNothing) +import Data.Maybe (Maybe(..), isJust) import Foreign.ForeignPtr (ForeignPtr, mallocForeignPtr, withForeignPtr) import Foreign.Storable (peek, poke) -import GHC.Base (Monad(..), (=<<), ($), const, liftM, otherwise, when) +import GHC.Base (Monad(..), (=<<), ($), ($!), const, liftM, otherwise, when) import GHC.Classes (Eq(..), Ord(..)) import GHC.Event.Arr (Arr) import GHC.Num (Num(..)) @@ -47,11 +47,12 @@ data Bucket a = Empty lookup :: Int -> IntTable a -> IO (Maybe a) lookup k (IntTable ref) = do let go Bucket{..} - | bucketKey == k = return (Just bucketValue) + | bucketKey == k = Just bucketValue | otherwise = go bucketNext - go _ = return Nothing + go _ = Nothing it at IT{..} <- readIORef ref - go =<< Arr.read tabArr (indexOf k it) + bkt <- Arr.read tabArr (indexOf k it) + return $! go bkt new :: Int -> IO (IntTable a) new capacity = IntTable `liftM` (newIORef =<< new_ capacity) @@ -125,20 +126,18 @@ updateWith :: (a -> Maybe a) -> Int -> IntTable a -> IO (Maybe a) updateWith f k (IntTable ref) = do it at IT{..} <- readIORef ref let idx = indexOf k it - go changed bkt at Bucket{..} - | bucketKey == k = - let fbv = f bucketValue - !nb = case fbv of - Just val -> bkt { bucketValue = val } - Nothing -> bucketNext - in (fbv, Just bucketValue, nb) - | otherwise = case go changed bucketNext of + go bkt at Bucket{..} + | bucketKey == k = case f bucketValue of + Just val -> let !nb = bkt { bucketValue = val } + in (False, Just bucketValue, nb) + Nothing -> (True, Just bucketValue, bucketNext) + | otherwise = case go bucketNext of (fbv, ov, nb) -> (fbv, ov, bkt { bucketNext = nb }) - go _ e = (Nothing, Nothing, e) - (fbv, oldVal, newBucket) <- go False `liftM` Arr.read tabArr idx + go e = (False, Nothing, e) + (del, oldVal, newBucket) <- go `liftM` Arr.read tabArr idx when (isJust oldVal) $ do Arr.write tabArr idx newBucket - when (isNothing fbv) $ + when del $ withForeignPtr tabSize $ \ptr -> do size <- peek ptr poke ptr (size - 1) From git at git.haskell.org Fri Jan 8 13:31:27 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 8 Jan 2016 13:31:27 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Enable stack traces with ghci -fexternal-interpreter -prof (4eba0c5) Message-ID: <20160108133127.2EFA23A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/4eba0c548413b73e76b8aa2f6957ba4a961dcf66/ghc >--------------------------------------------------------------- commit 4eba0c548413b73e76b8aa2f6957ba4a961dcf66 Author: Simon Marlow Date: Thu Jan 7 11:36:41 2016 +0000 Enable stack traces with ghci -fexternal-interpreter -prof Summary: The main goal here is enable stack traces in GHCi. After this change, if you start GHCi like this: ghci -fexternal-interpreter -prof (which requires packages to be built for profiling, but not GHC itself) then the interpreter manages cost-centre stacks during execution and can produce a stack trace on request. Call locations are available for all interpreted code, and any compiled code that was built with the `-fprof-auto` familiy of flags. There are a couple of ways to get a stack trace: * `error`/`undefined` automatically get one attached * `Debug.Trace.traceStack` can be used anywhere, and prints the current stack Because the interpreter is running in a separate process, only the interpreted code is running in profiled mode and the compiler itself isn't slowed down by profiling. The GHCi debugger still doesn't work with -fexternal-interpreter, although this patch gets it a step closer. Most of the functionality of breakpoints is implemented, but the runtime value introspection is still not supported. Along the way I also did some refactoring and added type arguments to the various remote pointer types in `GHCi.RemotePtr`, so there's better type safety and documentation in the bridge code between GHC and ghc-iserv. Test Plan: validate Reviewers: bgamari, ezyang, austin, hvr, goldfire, erikd Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1747 GHC Trac Issues: #11047, #11100 >--------------------------------------------------------------- 4eba0c548413b73e76b8aa2f6957ba4a961dcf66 compiler/deSugar/Coverage.hs | 43 ++--- compiler/deSugar/Desugar.hs | 2 +- compiler/ghc.cabal.in | 1 - compiler/ghc.mk | 1 - compiler/ghci/ByteCodeAsm.hs | 33 ++-- compiler/ghci/ByteCodeGen.hs | 64 ++++---- compiler/ghci/ByteCodeInstr.hs | 10 +- compiler/ghci/ByteCodeItbls.hs | 3 +- compiler/ghci/ByteCodeLink.hs | 43 ++--- compiler/ghci/ByteCodeTypes.hs | 99 +++++++++--- compiler/ghci/Debugger.hs | 4 +- compiler/ghci/GHCi.hs | 74 ++++++--- compiler/ghci/Linker.hs | 52 +++--- compiler/main/DriverPipeline.hs | 4 +- compiler/main/GHC.hs | 3 +- compiler/main/HscMain.hs | 6 +- compiler/main/HscTypes.hs | 73 ++------- compiler/main/InteractiveEval.hs | 121 +++++++------- compiler/main/InteractiveEvalTypes.hs | 41 +++-- compiler/typecheck/TcRnTypes.hs | 3 +- compiler/typecheck/TcSplice.hs | 8 +- ghc.mk | 5 +- ghc/GHCi/UI.hs | 52 +++--- ghc/GHCi/UI/Monad.hs | 2 +- .../main => libraries/ghci/GHCi}/BreakArray.hs | 22 +-- libraries/ghci/GHCi/CreateBCO.hs | 14 +- libraries/ghci/GHCi/FFI.hsc | 5 +- libraries/ghci/GHCi/InfoTable.hsc | 2 +- libraries/ghci/GHCi/Message.hs | 177 +++++++++++++-------- libraries/ghci/GHCi/ObjLink.hs | 2 +- libraries/ghci/GHCi/RemoteTypes.hs | 87 +++++----- libraries/ghci/GHCi/ResolvedBCO.hs | 28 +--- libraries/ghci/GHCi/Run.hs | 77 +++++---- libraries/ghci/GHCi/TH.hs | 32 ++-- libraries/ghci/ghci.cabal.in | 1 + rts/Exception.cmm | 17 +- rts/Interpreter.c | 43 +++-- rules/build-prog.mk | 6 +- .../tests/ghci.debugger/scripts/break021.stdout | 4 +- 39 files changed, 680 insertions(+), 584 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 4eba0c548413b73e76b8aa2f6957ba4a961dcf66 From git at git.haskell.org Fri Jan 8 13:31:29 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 8 Jan 2016 13:31:29 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: User's Guide: injective type families section (f66dbdd) Message-ID: <20160108133129.D04303A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/f66dbdd1183a7f8e1e66272850390f4658e23ec7/ghc >--------------------------------------------------------------- commit f66dbdd1183a7f8e1e66272850390f4658e23ec7 Author: Jan Stolarek Date: Fri Jan 8 11:44:18 2016 +0100 User's Guide: injective type families section (cherry picked from commit 6f2e722973b39b7ef423f6a6b96725395d561836) >--------------------------------------------------------------- f66dbdd1183a7f8e1e66272850390f4658e23ec7 docs/users_guide/glasgow_exts.rst | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index 5808d52..adaf672 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -7022,7 +7022,25 @@ Injective type families Starting with GHC 8.0 type families can be annotated with injectivity information. This information is then used by GHC during type checking to resolve type ambiguities in situations where a type variable appears -only under type family applications. +only under type family applications. Consider this contrived example: + +:: + + type family Id a + type instance Id Int = Int + type instance Id Bool = Bool + + id :: Id t -> Id t + id x = x + +Here the definition of ``id`` will be rejected because type variable ``t`` +appears only under type family applications and is thus ambiguous. But this +code will be accepted if we tell GHC that ``Id`` is injective, which means it +will be possible to infer ``t`` at call sites from the type of the argument: + +:: + + type family Id a = r | r -> a For full details on injective type families refer to Haskell Symposium 2015 paper `Injective type families for From git at git.haskell.org Fri Jan 8 13:31:32 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 8 Jan 2016 13:31:32 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Support for qRecover in TH with -fexternal-interpreter (4d5caf1) Message-ID: <20160108133132.8078B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/4d5caf1c3c0c4e6d5f28ddcf0cee68920f780778/ghc >--------------------------------------------------------------- commit 4d5caf1c3c0c4e6d5f28ddcf0cee68920f780778 Author: Simon Marlow Date: Thu Jan 7 14:53:43 2016 +0000 Support for qRecover in TH with -fexternal-interpreter Summary: This completes the support for TH with -fexternal-interpreter. Test Plan: validate Reviewers: bgamari, ezyang, austin, niteria, goldfire, erikd Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1748 GHC Trac Issues: #11100 (cherry picked from commit 09425cbe4fb93ac3af4932937478d46972ecf91f) >--------------------------------------------------------------- 4d5caf1c3c0c4e6d5f28ddcf0cee68920f780778 compiler/main/ErrUtils.hs | 7 +++++- compiler/typecheck/TcRnMonad.hs | 9 +++---- compiler/typecheck/TcSplice.hs | 56 +++++++++++++++++++++++++++++++++++++---- libraries/ghci/GHCi/Message.hs | 17 +++++++++---- libraries/ghci/GHCi/TH.hs | 36 +++++++++++++------------- 5 files changed, 92 insertions(+), 33 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 4d5caf1c3c0c4e6d5f28ddcf0cee68920f780778 From git at git.haskell.org Fri Jan 8 14:04:42 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 8 Jan 2016 14:04:42 +0000 (UTC) Subject: [commit: ghc] master: Fix +RTS -h when compiling without -prof (c33e7c2) Message-ID: <20160108140442.48AE83A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/c33e7c2b1a62f340432c752fb37ca1374e3e982a/ghc >--------------------------------------------------------------- commit c33e7c2b1a62f340432c752fb37ca1374e3e982a Author: Simon Marlow Date: Thu Jan 7 06:23:14 2016 -0800 Fix +RTS -h when compiling without -prof Summary: Was broken by ce1f1607ed7f8fedd2f63c8610cafefd59baaf32. I've added a test so that hopefully it won't break again. Test Plan: validate & new test case Reviewers: bgamari, austin, erikd Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1746 GHC Trac Issues: #11304 >--------------------------------------------------------------- c33e7c2b1a62f340432c752fb37ca1374e3e982a rts/ProfHeap.c | 6 +----- testsuite/config/ghc | 5 +++-- testsuite/tests/profiling/should_run/all.T | 11 +++++++++-- .../should_run/{heapprof001.stdout => heapprof002.stdout} | 0 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/rts/ProfHeap.c b/rts/ProfHeap.c index 43bd7b4..e7f6417 100644 --- a/rts/ProfHeap.c +++ b/rts/ProfHeap.c @@ -311,15 +311,11 @@ nextEra( void ) FILE *hp_file; static char *hp_filename; -void initProfiling (void) -{ -} - void freeProfiling (void) { } -void initProfiling2 (void) +void initProfiling (void) { char *prog; diff --git a/testsuite/config/ghc b/testsuite/config/ghc index dc00adb..77dfa98 100644 --- a/testsuite/config/ghc +++ b/testsuite/config/ghc @@ -23,7 +23,7 @@ config.compile_ways = ['normal', 'hpc'] config.run_ways = ['normal', 'hpc'] # ways that are not enabled by default, but can always be invoked explicitly -config.other_ways = ['prof', +config.other_ways = ['prof', 'prof_h', 'prof_hc_hb','prof_hb', 'prof_hd','prof_hy','prof_hr', 'threaded1_ls', 'threaded2_hT', @@ -99,6 +99,7 @@ config.way_flags = lambda name : { 'threaded2' : ['-O', '-threaded', '-eventlog'], 'threaded2_hT' : ['-O', '-threaded'], 'hpc' : ['-O', '-fhpc', '-hpcdir', '.hpc.' + name ], + 'prof_h' : [], 'prof_hc_hb' : ['-O', '-prof', '-static', '-auto-all'], 'prof_hb' : ['-O', '-prof', '-static', '-auto-all'], 'prof_hd' : ['-O', '-prof', '-static', '-auto-all'], @@ -130,6 +131,7 @@ config.way_rts_flags = { 'threaded2' : ['-N2 -ls'], 'threaded2_hT' : ['-N2', '-hT'], 'hpc' : [], + 'prof_h' : ['-h'], # works without -prof 'prof_hc_hb' : ['-hc -hbvoid'], 'prof_hb' : ['-hb'], 'prof_hd' : ['-hd'], @@ -216,4 +218,3 @@ def get_compiler_info(): config.ghci_way_flags = "-static" config.ghc_th_way = "normal" config.ghc_plugin_way = "normal" - diff --git a/testsuite/tests/profiling/should_run/all.T b/testsuite/tests/profiling/should_run/all.T index 4e4bd09..840b251 100644 --- a/testsuite/tests/profiling/should_run/all.T +++ b/testsuite/tests/profiling/should_run/all.T @@ -4,11 +4,18 @@ extra_prof_ways = ['prof', 'prof_hc_hb', 'prof_hb', 'prof_hd', 'prof_hy', 'prof_ test('heapprof001', [only_ways(prof_ways), - extra_ways(extra_prof_ways), - req_profiling, + when(have_profiling(), extra_ways(extra_prof_ways)), extra_run_opts('7')], compile_and_run, ['']) +test('heapprof002', + [ pre_cmd('cp heapprof001.hs heapprof002.hs') + , extra_clean(['heapprof002.hs']) + , extra_ways(['prof_h']) + , extra_run_opts('7') + ], + compile_and_run, ['']) + test('T2592', [only_ways(['profasm']), req_profiling, extra_run_opts('+RTS -M1m -RTS'), exit_code(251)], diff --git a/testsuite/tests/profiling/should_run/heapprof001.stdout b/testsuite/tests/profiling/should_run/heapprof002.stdout similarity index 100% copy from testsuite/tests/profiling/should_run/heapprof001.stdout copy to testsuite/tests/profiling/should_run/heapprof002.stdout From git at git.haskell.org Fri Jan 8 14:10:28 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 8 Jan 2016 14:10:28 +0000 (UTC) Subject: [commit: ghc] master: Rename the test-way prof_h to normal_h (10769a1) Message-ID: <20160108141028.221C73A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/10769a1baafc799a80185bc74af9dfe68dc6a2c1/ghc >--------------------------------------------------------------- commit 10769a1baafc799a80185bc74af9dfe68dc6a2c1 Author: Simon Marlow Date: Fri Jan 8 14:11:03 2016 +0000 Rename the test-way prof_h to normal_h >--------------------------------------------------------------- 10769a1baafc799a80185bc74af9dfe68dc6a2c1 testsuite/config/ghc | 6 +++--- testsuite/tests/profiling/should_run/all.T | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/testsuite/config/ghc b/testsuite/config/ghc index 77dfa98..63488dd 100644 --- a/testsuite/config/ghc +++ b/testsuite/config/ghc @@ -23,7 +23,7 @@ config.compile_ways = ['normal', 'hpc'] config.run_ways = ['normal', 'hpc'] # ways that are not enabled by default, but can always be invoked explicitly -config.other_ways = ['prof', 'prof_h', +config.other_ways = ['prof', 'normal_h', 'prof_hc_hb','prof_hb', 'prof_hd','prof_hy','prof_hr', 'threaded1_ls', 'threaded2_hT', @@ -85,6 +85,7 @@ config.clean_only = clean_only config.way_flags = lambda name : { 'normal' : [], + 'normal_h' : [], 'g1' : [], 'optasm' : ['-O', '-fasm'], 'llvm' : ['-fllvm'], @@ -99,7 +100,6 @@ config.way_flags = lambda name : { 'threaded2' : ['-O', '-threaded', '-eventlog'], 'threaded2_hT' : ['-O', '-threaded'], 'hpc' : ['-O', '-fhpc', '-hpcdir', '.hpc.' + name ], - 'prof_h' : [], 'prof_hc_hb' : ['-O', '-prof', '-static', '-auto-all'], 'prof_hb' : ['-O', '-prof', '-static', '-auto-all'], 'prof_hd' : ['-O', '-prof', '-static', '-auto-all'], @@ -117,6 +117,7 @@ config.way_flags = lambda name : { config.way_rts_flags = { 'normal' : [], + 'normal_h' : ['-h'], # works without -prof 'g1' : ['-G1'], 'optasm' : [], 'llvm' : [], @@ -131,7 +132,6 @@ config.way_rts_flags = { 'threaded2' : ['-N2 -ls'], 'threaded2_hT' : ['-N2', '-hT'], 'hpc' : [], - 'prof_h' : ['-h'], # works without -prof 'prof_hc_hb' : ['-hc -hbvoid'], 'prof_hb' : ['-hb'], 'prof_hd' : ['-hd'], diff --git a/testsuite/tests/profiling/should_run/all.T b/testsuite/tests/profiling/should_run/all.T index 840b251..7804d46 100644 --- a/testsuite/tests/profiling/should_run/all.T +++ b/testsuite/tests/profiling/should_run/all.T @@ -11,7 +11,7 @@ test('heapprof001', test('heapprof002', [ pre_cmd('cp heapprof001.hs heapprof002.hs') , extra_clean(['heapprof002.hs']) - , extra_ways(['prof_h']) + , extra_ways(['normal_h']) , extra_run_opts('7') ], compile_and_run, ['']) From git at git.haskell.org Fri Jan 8 14:26:57 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 8 Jan 2016 14:26:57 +0000 (UTC) Subject: [commit: ghc] master: Add a pointer to the relevant paper for InScopeSet (47ccf4d) Message-ID: <20160108142657.CC1433A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/47ccf4d2a0df33f26e66f340e89ca516b4597ed0/ghc >--------------------------------------------------------------- commit 47ccf4d2a0df33f26e66f340e89ca516b4597ed0 Author: Bartosz Nitka Date: Fri Jan 8 15:26:49 2016 +0100 Add a pointer to the relevant paper for InScopeSet This was non-obvious to me when reading the sources and the paper provides the motivation and explores the design space. Test Plan: just a comment Reviewers: simonpj, austin, ezyang, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1749 >--------------------------------------------------------------- 47ccf4d2a0df33f26e66f340e89ca516b4597ed0 compiler/basicTypes/VarEnv.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/basicTypes/VarEnv.hs b/compiler/basicTypes/VarEnv.hs index bdc451a..08c7965 100644 --- a/compiler/basicTypes/VarEnv.hs +++ b/compiler/basicTypes/VarEnv.hs @@ -80,6 +80,8 @@ import FastString -} -- | A set of variables that are in scope at some point +-- "Secrets of the Glasgow Haskell Compiler inliner" Section 3. provides +-- the motivation for this abstraction. data InScopeSet = InScope (VarEnv Var) {-# UNPACK #-} !Int -- The (VarEnv Var) is just a VarSet. But we write it like -- this to remind ourselves that you can look up a Var in From git at git.haskell.org Fri Jan 8 16:15:16 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 8 Jan 2016 16:15:16 +0000 (UTC) Subject: [commit: ghc] master: Docs for stack traces in GHCi (2bd05b8) Message-ID: <20160108161516.F18303A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/2bd05b889f39e5ddf43a723b817b92fc6f4fc6d4/ghc >--------------------------------------------------------------- commit 2bd05b889f39e5ddf43a723b817b92fc6f4fc6d4 Author: Simon Marlow Date: Fri Jan 8 16:15:46 2016 +0000 Docs for stack traces in GHCi >--------------------------------------------------------------- 2bd05b889f39e5ddf43a723b817b92fc6f4fc6d4 docs/users_guide/8.0.1-notes.rst | 3 ++ docs/users_guide/ghci.rst | 61 ++++++++++++++++++++++++++++++++++++---- 2 files changed, 58 insertions(+), 6 deletions(-) diff --git a/docs/users_guide/8.0.1-notes.rst b/docs/users_guide/8.0.1-notes.rst index b4957ab..1d7fcd7 100644 --- a/docs/users_guide/8.0.1-notes.rst +++ b/docs/users_guide/8.0.1-notes.rst @@ -45,6 +45,9 @@ The highlights, since the 7.10 branch, are: :ref:`external-interpreter`), and the interpreter can now run profiled code. +- GHCi now provides access to stack traces when used with + ``-fexternal-interpreter`` and ``-prof`` (see :ref:`ghci-stack-traces`). + - The reworked users guide you are now reading - Support for Windows XP and earlier has been dropped. diff --git a/docs/users_guide/ghci.rst b/docs/users_guide/ghci.rst index d4136ab..c299fb2 100644 --- a/docs/users_guide/ghci.rst +++ b/docs/users_guide/ghci.rst @@ -1102,6 +1102,53 @@ The ``-interactive-print`` flag can also be used when running GHC in % ghc -e "[1,2,3]" -interactive-print=SpecPrinter.sprint SpecPrinter [1,2,3]! +.. _ghci-stack-traces: + +Stack Traces in GHCi +~~~~~~~~~~~~~~~~~~~~ + +.. index:: + simple: stack trace; in GHCi + +[ This is an experimental feature enabled by the new +``-fexternal-interpreter`` flag that was introduced in GHC 8.0.1. It +is currently not supported on Windows.] + +GHCi can use the profiling system to collect stack trace information +when running interpreted code. To gain access to stack traces, start +GHCi like this: + +.. code-block:: none + + ghci -fexternal-interpreter -prof + +This runs the interpreted code in a separate process (see +:ref:`external-interpreter`) and runs it in profiling mode to collect +call stack information. Note that because we're running the +interpreted code in profiling mode, all packages that you use must be +compiled for profiling. The ``-prof`` flag to GHCi only works in +conjunction with ``-fexternal-interpreter``. + +There are three ways to get access to the current call stack. + +- ``error`` and ``undefined`` automatically attach the current stack + to the error message. This often complements the implicit stack + stack (see :ref:`implicit-callstacks`), so both call stacks are + shown. + +- ``Debug.Trace.traceStack`` is a version of ``Debug.Trace.trace`` + that also prints the current call stack. + +- Functions in the module ``GHC.Stack`` can be used to get the current + stack and render it. + +You don't need to use ``-fprof-auto`` for interpreted modules, +annotations are automatically added at a granularity fine enough to +distinguish individual call sites. However, you won't see any call +stack information for compiled code unless it was compiled with +``-fprof-auto`` or has explicit ``SCC`` annotations (see +:ref:`scc-pragma`). + .. _ghci-debugger: The GHCi Debugger @@ -2942,12 +2989,14 @@ using messages over a pipe. Why might we want to do this? The main reason is that the RTS running the interpreted code can be a different flavour (profiling or -dynamically-linked) from GHC itself. So for example, when compiling -Template Haskell code with ``-prof``, we don't need to compile the -modules without ``-prof`` first (see :ref:`th-profiling`) because we -can run the profiled object code in the interpreter. GHCi can also -load and run profiled object code when run with -``-fexternal-interpreter`` and ``-prof``. +dynamically-linked) from GHC itself. So for example: + +- We can use the profiler to collect stack traces when using GHCi (see + :ref:`ghci-stack-traces`). + +- When compiling Template Haskell code with ``-prof`` we don't need to + compile the modules without ``-prof`` first (see :ref:`th-profiling`) + because we can run the profiled object code in the interpreter. This feature is experimental in GHC 8.0.x, but it may become the default in future releases. From git at git.haskell.org Fri Jan 8 16:17:31 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 8 Jan 2016 16:17:31 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Docs for stack traces in GHCi (50658d2) Message-ID: <20160108161731.6FE823A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/50658d255bed49630772fdda3c4875913e9e1d57/ghc >--------------------------------------------------------------- commit 50658d255bed49630772fdda3c4875913e9e1d57 Author: Simon Marlow Date: Fri Jan 8 16:15:46 2016 +0000 Docs for stack traces in GHCi (cherry picked from commit 2bd05b889f39e5ddf43a723b817b92fc6f4fc6d4) >--------------------------------------------------------------- 50658d255bed49630772fdda3c4875913e9e1d57 docs/users_guide/8.0.1-notes.rst | 3 ++ docs/users_guide/ghci.rst | 61 ++++++++++++++++++++++++++++++++++++---- 2 files changed, 58 insertions(+), 6 deletions(-) diff --git a/docs/users_guide/8.0.1-notes.rst b/docs/users_guide/8.0.1-notes.rst index f79da4f..67cf72c 100644 --- a/docs/users_guide/8.0.1-notes.rst +++ b/docs/users_guide/8.0.1-notes.rst @@ -45,6 +45,9 @@ The highlights, since the 7.10 branch, are: :ref:`external-interpreter`), and the interpreter can now run profiled code. +- GHCi now provides access to stack traces when used with + ``-fexternal-interpreter`` and ``-prof`` (see :ref:`ghci-stack-traces`). + - The reworked users guide you are now reading - Support for Windows XP and earlier has been dropped. diff --git a/docs/users_guide/ghci.rst b/docs/users_guide/ghci.rst index d4136ab..c299fb2 100644 --- a/docs/users_guide/ghci.rst +++ b/docs/users_guide/ghci.rst @@ -1102,6 +1102,53 @@ The ``-interactive-print`` flag can also be used when running GHC in % ghc -e "[1,2,3]" -interactive-print=SpecPrinter.sprint SpecPrinter [1,2,3]! +.. _ghci-stack-traces: + +Stack Traces in GHCi +~~~~~~~~~~~~~~~~~~~~ + +.. index:: + simple: stack trace; in GHCi + +[ This is an experimental feature enabled by the new +``-fexternal-interpreter`` flag that was introduced in GHC 8.0.1. It +is currently not supported on Windows.] + +GHCi can use the profiling system to collect stack trace information +when running interpreted code. To gain access to stack traces, start +GHCi like this: + +.. code-block:: none + + ghci -fexternal-interpreter -prof + +This runs the interpreted code in a separate process (see +:ref:`external-interpreter`) and runs it in profiling mode to collect +call stack information. Note that because we're running the +interpreted code in profiling mode, all packages that you use must be +compiled for profiling. The ``-prof`` flag to GHCi only works in +conjunction with ``-fexternal-interpreter``. + +There are three ways to get access to the current call stack. + +- ``error`` and ``undefined`` automatically attach the current stack + to the error message. This often complements the implicit stack + stack (see :ref:`implicit-callstacks`), so both call stacks are + shown. + +- ``Debug.Trace.traceStack`` is a version of ``Debug.Trace.trace`` + that also prints the current call stack. + +- Functions in the module ``GHC.Stack`` can be used to get the current + stack and render it. + +You don't need to use ``-fprof-auto`` for interpreted modules, +annotations are automatically added at a granularity fine enough to +distinguish individual call sites. However, you won't see any call +stack information for compiled code unless it was compiled with +``-fprof-auto`` or has explicit ``SCC`` annotations (see +:ref:`scc-pragma`). + .. _ghci-debugger: The GHCi Debugger @@ -2942,12 +2989,14 @@ using messages over a pipe. Why might we want to do this? The main reason is that the RTS running the interpreted code can be a different flavour (profiling or -dynamically-linked) from GHC itself. So for example, when compiling -Template Haskell code with ``-prof``, we don't need to compile the -modules without ``-prof`` first (see :ref:`th-profiling`) because we -can run the profiled object code in the interpreter. GHCi can also -load and run profiled object code when run with -``-fexternal-interpreter`` and ``-prof``. +dynamically-linked) from GHC itself. So for example: + +- We can use the profiler to collect stack traces when using GHCi (see + :ref:`ghci-stack-traces`). + +- When compiling Template Haskell code with ``-prof`` we don't need to + compile the modules without ``-prof`` first (see :ref:`th-profiling`) + because we can run the profiled object code in the interpreter. This feature is experimental in GHC 8.0.x, but it may become the default in future releases. From git at git.haskell.org Fri Jan 8 22:46:14 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 8 Jan 2016 22:46:14 +0000 (UTC) Subject: [commit: ghc] master: Build system: fix `pwd` issues on Windows (f7b45c3) Message-ID: <20160108224614.A91783A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/f7b45c31f07daa4c3dca39f6ccc1a52c86900b7c/ghc >--------------------------------------------------------------- commit f7b45c31f07daa4c3dca39f6ccc1a52c86900b7c Author: Thomas Miedema Date: Fri Jan 8 20:59:28 2016 +0100 Build system: fix `pwd` issues on Windows Some parts of the build system require that paths are what msys2 calls "mixed style": * forwards slashes * absolute paths starting with a drive letter followed by a colon (e.g. "C:") The removal of ghc-pwd in 4c56ad3 changed $(TOP) from mixed style to unix style, resulting in a broken Windows build for some. Differential Revision: https://phabricator.haskell.org/D1752 >--------------------------------------------------------------- f7b45c31f07daa4c3dca39f6ccc1a52c86900b7c aclocal.m4 | 10 +++++++++- configure.ac | 5 +++-- distrib/configure.ac.in | 5 +++-- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/aclocal.m4 b/aclocal.m4 index 0c93de4..933aee9 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1739,7 +1739,15 @@ AC_DEFUN([FP_CURSES], AC_DEFUN([FP_FIND_ROOT],[ AC_MSG_CHECKING(for path to top of build tree) - hardtop=`pwd` + if test "$windows" = YES + then + dnl Make sure this is a c:/foo/bar (mixed) style path. Some parts of + dnl the build system might depend on it (such as the sed expression + dnl `"s|$(TOP)/||i"` in addCFileDeps in rules/build-dependencies.mk). + hardtop=$(cygpath -m "$(pwd)") + else + hardtop=$(pwd) + fi dnl Remove common automounter nonsense hardtop=`echo $hardtop | sed 's|^/tmp_mnt.*\(/local/.*\)$|\1|' | sed 's|^/tmp_mnt/|/|'` diff --git a/configure.ac b/configure.ac index ab82bb0..e9bdeec 100644 --- a/configure.ac +++ b/configure.ac @@ -26,8 +26,6 @@ AC_INIT([The Glorious Glasgow Haskell Compilation System], [8.1], [glasgow-haske # checkout), then we ship a file 'VERSION' containing the full version # when the source distribution was created. -FP_FIND_ROOT - if test ! -f mk/config.h.in; then echo "mk/config.h.in doesn't exist: perhaps you haven't run 'perl boot'?" exit 1 @@ -260,6 +258,9 @@ AC_ARG_WITH(hc, ) AC_SUBST(WithHc) +# Requires FPTOOLS_SET_PLATFORM_VARS to be run first. +FP_FIND_ROOT + fail() { echo >&2 echo "$1" >&2 diff --git a/distrib/configure.ac.in b/distrib/configure.ac.in index 4d57cd8..99b51f5 100644 --- a/distrib/configure.ac.in +++ b/distrib/configure.ac.in @@ -6,8 +6,6 @@ dnl AC_INIT([The Glorious Glasgow Haskell Compilation System], [@ProjectVersion@], [glasgow-haskell-bugs at haskell.org], [ghc]) -FP_FIND_ROOT - dnl-------------------------------------------------------------------- dnl * Deal with arguments telling us gmp is somewhere odd dnl-------------------------------------------------------------------- @@ -17,6 +15,9 @@ FP_GMP bootstrap_target=@TargetPlatform@ FPTOOLS_SET_PLATFORM_VARS +# Requires FPTOOLS_SET_PLATFORM_VARS to be run first. +FP_FIND_ROOT + # ToDo: if Stage1Only=YES, should be YES CrossCompiling=NO CrossCompilePrefix="" From git at git.haskell.org Fri Jan 8 22:51:07 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 8 Jan 2016 22:51:07 +0000 (UTC) Subject: [commit: ghc] master: Fix test for T9367 (Windows) (1cdf12c) Message-ID: <20160108225107.B1C113A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/1cdf12c4f435262b93cb0173f9872f3f0f0da60a/ghc >--------------------------------------------------------------- commit 1cdf12c4f435262b93cb0173f9872f3f0f0da60a Author: Rik Steenkamp Date: Fri Jan 8 23:50:24 2016 +0100 Fix test for T9367 (Windows) See c8c44fd91b509b9eb644c826497ed5268e89363a. Reviewed By: thomie, bgamari Differential Revision: https://phabricator.haskell.org/D1745 >--------------------------------------------------------------- 1cdf12c4f435262b93cb0173f9872f3f0f0da60a testsuite/tests/ghci/scripts/T9367-raw.stdout | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/tests/ghci/scripts/T9367-raw.stdout b/testsuite/tests/ghci/scripts/T9367-raw.stdout index 69da032..6e5e998 100644 --- a/testsuite/tests/ghci/scripts/T9367-raw.stdout +++ b/testsuite/tests/ghci/scripts/T9367-raw.stdout @@ -1,5 +1,5 @@ Breakpoint 0 activated at T9367.hs:1:5-9 -"Stopped at T9367.hs:1:5-9 +"Stopped in Main.x, T9367.hs:1:5-9 _result :: [Char] = _ 1 x = "abc" ^^^^^ From git at git.haskell.org Sat Jan 9 03:38:10 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 9 Jan 2016 03:38:10 +0000 (UTC) Subject: [commit: ghc] master: users_guide: Use semantic directive/role for command line options (a6c3289) Message-ID: <20160109033810.98F433A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a6c3289d0aa0c520656e918dfc9f152548d940a4/ghc >--------------------------------------------------------------- commit a6c3289d0aa0c520656e918dfc9f152548d940a4 Author: Ben Gamari Date: Sat Jan 9 04:38:16 2016 +0100 users_guide: Use semantic directive/role for command line options And GHCi commands. This makes cross-referencing much easier. Also normalize markup a bit and add some missing flags. >--------------------------------------------------------------- a6c3289d0aa0c520656e918dfc9f152548d940a4 docs/users_guide/8.0.1-notes.rst | 4 +- docs/users_guide/bugs.rst | 83 +- docs/users_guide/conf.py | 49 +- docs/users_guide/debugging.rst | 227 +- docs/users_guide/editing-guide.rst | 67 +- docs/users_guide/extending_ghc.rst | 50 +- docs/users_guide/ffi-chap.rst | 40 +- docs/users_guide/ghci.rst | 156 +- docs/users_guide/glasgow_exts.rst | 3350 ++++++++++++----------------- docs/users_guide/packages.rst | 208 +- docs/users_guide/phases.rst | 346 +-- docs/users_guide/profiling.rst | 393 ++-- docs/users_guide/runtime_control.rst | 478 ++-- docs/users_guide/safe_haskell.rst | 148 +- docs/users_guide/separate_compilation.rst | 263 +-- docs/users_guide/shared_libs.rst | 28 +- docs/users_guide/sooner.rst | 70 +- docs/users_guide/using-concurrent.rst | 50 +- docs/users_guide/using-optimisation.rst | 449 ++-- docs/users_guide/using-warnings.rst | 529 ++--- docs/users_guide/using.rst | 277 +-- docs/users_guide/win32-dlls.rst | 26 +- 22 files changed, 3179 insertions(+), 4112 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc a6c3289d0aa0c520656e918dfc9f152548d940a4 From git at git.haskell.org Sat Jan 9 16:50:40 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 9 Jan 2016 16:50:40 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: users_guide: Use semantic directive/role for command line options (cd9f37c) Message-ID: <20160109165040.3D4FA3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/cd9f37c5b8d88eba2d349d8362248534b5fc842f/ghc >--------------------------------------------------------------- commit cd9f37c5b8d88eba2d349d8362248534b5fc842f Author: Ben Gamari Date: Sat Jan 9 04:38:16 2016 +0100 users_guide: Use semantic directive/role for command line options And GHCi commands. This makes cross-referencing much easier. Also normalize markup a bit and add some missing flags. (cherry picked from commit a6c3289d0aa0c520656e918dfc9f152548d940a4) >--------------------------------------------------------------- cd9f37c5b8d88eba2d349d8362248534b5fc842f docs/users_guide/8.0.1-notes.rst | 4 +- docs/users_guide/bugs.rst | 83 +- docs/users_guide/conf.py | 49 +- docs/users_guide/debugging.rst | 227 +- docs/users_guide/editing-guide.rst | 67 +- docs/users_guide/extending_ghc.rst | 50 +- docs/users_guide/ffi-chap.rst | 40 +- docs/users_guide/ghci.rst | 156 +- docs/users_guide/glasgow_exts.rst | 3350 ++++++++++++----------------- docs/users_guide/packages.rst | 208 +- docs/users_guide/phases.rst | 346 +-- docs/users_guide/profiling.rst | 393 ++-- docs/users_guide/runtime_control.rst | 478 ++-- docs/users_guide/safe_haskell.rst | 148 +- docs/users_guide/separate_compilation.rst | 263 +-- docs/users_guide/shared_libs.rst | 28 +- docs/users_guide/sooner.rst | 70 +- docs/users_guide/using-concurrent.rst | 50 +- docs/users_guide/using-optimisation.rst | 449 ++-- docs/users_guide/using-warnings.rst | 529 ++--- docs/users_guide/using.rst | 277 +-- docs/users_guide/win32-dlls.rst | 26 +- 22 files changed, 3179 insertions(+), 4112 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc cd9f37c5b8d88eba2d349d8362248534b5fc842f From git at git.haskell.org Sat Jan 9 16:50:42 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 9 Jan 2016 16:50:42 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Fix test for T9367 (Windows) (eaf8d53) Message-ID: <20160109165042.D9D2A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/eaf8d53deffabfd99d8e35c2c19558d64fcbff7d/ghc >--------------------------------------------------------------- commit eaf8d53deffabfd99d8e35c2c19558d64fcbff7d Author: Rik Steenkamp Date: Fri Jan 8 23:50:24 2016 +0100 Fix test for T9367 (Windows) See c8c44fd91b509b9eb644c826497ed5268e89363a. Reviewed By: thomie, bgamari Differential Revision: https://phabricator.haskell.org/D1745 (cherry picked from commit 1cdf12c4f435262b93cb0173f9872f3f0f0da60a) >--------------------------------------------------------------- eaf8d53deffabfd99d8e35c2c19558d64fcbff7d testsuite/tests/ghci/scripts/T9367-raw.stdout | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/tests/ghci/scripts/T9367-raw.stdout b/testsuite/tests/ghci/scripts/T9367-raw.stdout index 69da032..6e5e998 100644 --- a/testsuite/tests/ghci/scripts/T9367-raw.stdout +++ b/testsuite/tests/ghci/scripts/T9367-raw.stdout @@ -1,5 +1,5 @@ Breakpoint 0 activated at T9367.hs:1:5-9 -"Stopped at T9367.hs:1:5-9 +"Stopped in Main.x, T9367.hs:1:5-9 _result :: [Char] = _ 1 x = "abc" ^^^^^ From git at git.haskell.org Sat Jan 9 16:50:45 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 9 Jan 2016 16:50:45 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Fix +RTS -h when compiling without -prof (d699446) Message-ID: <20160109165045.99FBB3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/d699446a50f92005a8b6515633a3c8937962e225/ghc >--------------------------------------------------------------- commit d699446a50f92005a8b6515633a3c8937962e225 Author: Simon Marlow Date: Thu Jan 7 06:23:14 2016 -0800 Fix +RTS -h when compiling without -prof Summary: Was broken by ce1f1607ed7f8fedd2f63c8610cafefd59baaf32. I've added a test so that hopefully it won't break again. Test Plan: validate & new test case Reviewers: bgamari, austin, erikd Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1746 GHC Trac Issues: #11304 (cherry picked from commit c33e7c2b1a62f340432c752fb37ca1374e3e982a) >--------------------------------------------------------------- d699446a50f92005a8b6515633a3c8937962e225 rts/ProfHeap.c | 6 +----- testsuite/config/ghc | 5 +++-- testsuite/tests/profiling/should_run/all.T | 11 +++++++++-- .../should_run/{heapprof001.stdout => heapprof002.stdout} | 0 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/rts/ProfHeap.c b/rts/ProfHeap.c index 43bd7b4..e7f6417 100644 --- a/rts/ProfHeap.c +++ b/rts/ProfHeap.c @@ -311,15 +311,11 @@ nextEra( void ) FILE *hp_file; static char *hp_filename; -void initProfiling (void) -{ -} - void freeProfiling (void) { } -void initProfiling2 (void) +void initProfiling (void) { char *prog; diff --git a/testsuite/config/ghc b/testsuite/config/ghc index dc00adb..77dfa98 100644 --- a/testsuite/config/ghc +++ b/testsuite/config/ghc @@ -23,7 +23,7 @@ config.compile_ways = ['normal', 'hpc'] config.run_ways = ['normal', 'hpc'] # ways that are not enabled by default, but can always be invoked explicitly -config.other_ways = ['prof', +config.other_ways = ['prof', 'prof_h', 'prof_hc_hb','prof_hb', 'prof_hd','prof_hy','prof_hr', 'threaded1_ls', 'threaded2_hT', @@ -99,6 +99,7 @@ config.way_flags = lambda name : { 'threaded2' : ['-O', '-threaded', '-eventlog'], 'threaded2_hT' : ['-O', '-threaded'], 'hpc' : ['-O', '-fhpc', '-hpcdir', '.hpc.' + name ], + 'prof_h' : [], 'prof_hc_hb' : ['-O', '-prof', '-static', '-auto-all'], 'prof_hb' : ['-O', '-prof', '-static', '-auto-all'], 'prof_hd' : ['-O', '-prof', '-static', '-auto-all'], @@ -130,6 +131,7 @@ config.way_rts_flags = { 'threaded2' : ['-N2 -ls'], 'threaded2_hT' : ['-N2', '-hT'], 'hpc' : [], + 'prof_h' : ['-h'], # works without -prof 'prof_hc_hb' : ['-hc -hbvoid'], 'prof_hb' : ['-hb'], 'prof_hd' : ['-hd'], @@ -216,4 +218,3 @@ def get_compiler_info(): config.ghci_way_flags = "-static" config.ghc_th_way = "normal" config.ghc_plugin_way = "normal" - diff --git a/testsuite/tests/profiling/should_run/all.T b/testsuite/tests/profiling/should_run/all.T index 4e4bd09..840b251 100644 --- a/testsuite/tests/profiling/should_run/all.T +++ b/testsuite/tests/profiling/should_run/all.T @@ -4,11 +4,18 @@ extra_prof_ways = ['prof', 'prof_hc_hb', 'prof_hb', 'prof_hd', 'prof_hy', 'prof_ test('heapprof001', [only_ways(prof_ways), - extra_ways(extra_prof_ways), - req_profiling, + when(have_profiling(), extra_ways(extra_prof_ways)), extra_run_opts('7')], compile_and_run, ['']) +test('heapprof002', + [ pre_cmd('cp heapprof001.hs heapprof002.hs') + , extra_clean(['heapprof002.hs']) + , extra_ways(['prof_h']) + , extra_run_opts('7') + ], + compile_and_run, ['']) + test('T2592', [only_ways(['profasm']), req_profiling, extra_run_opts('+RTS -M1m -RTS'), exit_code(251)], diff --git a/testsuite/tests/profiling/should_run/heapprof001.stdout b/testsuite/tests/profiling/should_run/heapprof002.stdout similarity index 100% copy from testsuite/tests/profiling/should_run/heapprof001.stdout copy to testsuite/tests/profiling/should_run/heapprof002.stdout From git at git.haskell.org Sat Jan 9 16:50:48 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 9 Jan 2016 16:50:48 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Rename the test-way prof_h to normal_h (313e1b3) Message-ID: <20160109165048.7F20E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/313e1b3a250ff45d9389385e37f301f6eed21309/ghc >--------------------------------------------------------------- commit 313e1b3a250ff45d9389385e37f301f6eed21309 Author: Simon Marlow Date: Fri Jan 8 14:11:03 2016 +0000 Rename the test-way prof_h to normal_h (cherry picked from commit 10769a1baafc799a80185bc74af9dfe68dc6a2c1) >--------------------------------------------------------------- 313e1b3a250ff45d9389385e37f301f6eed21309 testsuite/config/ghc | 6 +++--- testsuite/tests/profiling/should_run/all.T | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/testsuite/config/ghc b/testsuite/config/ghc index 77dfa98..63488dd 100644 --- a/testsuite/config/ghc +++ b/testsuite/config/ghc @@ -23,7 +23,7 @@ config.compile_ways = ['normal', 'hpc'] config.run_ways = ['normal', 'hpc'] # ways that are not enabled by default, but can always be invoked explicitly -config.other_ways = ['prof', 'prof_h', +config.other_ways = ['prof', 'normal_h', 'prof_hc_hb','prof_hb', 'prof_hd','prof_hy','prof_hr', 'threaded1_ls', 'threaded2_hT', @@ -85,6 +85,7 @@ config.clean_only = clean_only config.way_flags = lambda name : { 'normal' : [], + 'normal_h' : [], 'g1' : [], 'optasm' : ['-O', '-fasm'], 'llvm' : ['-fllvm'], @@ -99,7 +100,6 @@ config.way_flags = lambda name : { 'threaded2' : ['-O', '-threaded', '-eventlog'], 'threaded2_hT' : ['-O', '-threaded'], 'hpc' : ['-O', '-fhpc', '-hpcdir', '.hpc.' + name ], - 'prof_h' : [], 'prof_hc_hb' : ['-O', '-prof', '-static', '-auto-all'], 'prof_hb' : ['-O', '-prof', '-static', '-auto-all'], 'prof_hd' : ['-O', '-prof', '-static', '-auto-all'], @@ -117,6 +117,7 @@ config.way_flags = lambda name : { config.way_rts_flags = { 'normal' : [], + 'normal_h' : ['-h'], # works without -prof 'g1' : ['-G1'], 'optasm' : [], 'llvm' : [], @@ -131,7 +132,6 @@ config.way_rts_flags = { 'threaded2' : ['-N2 -ls'], 'threaded2_hT' : ['-N2', '-hT'], 'hpc' : [], - 'prof_h' : ['-h'], # works without -prof 'prof_hc_hb' : ['-hc -hbvoid'], 'prof_hb' : ['-hb'], 'prof_hd' : ['-hd'], diff --git a/testsuite/tests/profiling/should_run/all.T b/testsuite/tests/profiling/should_run/all.T index 840b251..7804d46 100644 --- a/testsuite/tests/profiling/should_run/all.T +++ b/testsuite/tests/profiling/should_run/all.T @@ -11,7 +11,7 @@ test('heapprof001', test('heapprof002', [ pre_cmd('cp heapprof001.hs heapprof002.hs') , extra_clean(['heapprof002.hs']) - , extra_ways(['prof_h']) + , extra_ways(['normal_h']) , extra_run_opts('7') ], compile_and_run, ['']) From git at git.haskell.org Sat Jan 9 16:50:51 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 9 Jan 2016 16:50:51 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Add a pointer to the relevant paper for InScopeSet (c4e7c1d) Message-ID: <20160109165051.2AFB03A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/c4e7c1da605e8c9c8f295b7942b25534cd8fc85b/ghc >--------------------------------------------------------------- commit c4e7c1da605e8c9c8f295b7942b25534cd8fc85b Author: Bartosz Nitka Date: Fri Jan 8 15:26:49 2016 +0100 Add a pointer to the relevant paper for InScopeSet This was non-obvious to me when reading the sources and the paper provides the motivation and explores the design space. Test Plan: just a comment Reviewers: simonpj, austin, ezyang, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1749 (cherry picked from commit 47ccf4d2a0df33f26e66f340e89ca516b4597ed0) >--------------------------------------------------------------- c4e7c1da605e8c9c8f295b7942b25534cd8fc85b compiler/basicTypes/VarEnv.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/basicTypes/VarEnv.hs b/compiler/basicTypes/VarEnv.hs index bdc451a..08c7965 100644 --- a/compiler/basicTypes/VarEnv.hs +++ b/compiler/basicTypes/VarEnv.hs @@ -80,6 +80,8 @@ import FastString -} -- | A set of variables that are in scope at some point +-- "Secrets of the Glasgow Haskell Compiler inliner" Section 3. provides +-- the motivation for this abstraction. data InScopeSet = InScope (VarEnv Var) {-# UNPACK #-} !Int -- The (VarEnv Var) is just a VarSet. But we write it like -- this to remind ourselves that you can look up a Var in From git at git.haskell.org Sat Jan 9 16:50:53 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 9 Jan 2016 16:50:53 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: docs: Fix DeriveAnyClass reference in release notes and ANNOUNCE (2840bc1) Message-ID: <20160109165053.CF4093A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/2840bc1ba2c5cf872f20a94281e15caafccb3162/ghc >--------------------------------------------------------------- commit 2840bc1ba2c5cf872f20a94281e15caafccb3162 Author: Ben Gamari Date: Sat Jan 9 13:48:23 2016 +0100 docs: Fix DeriveAnyClass reference in release notes and ANNOUNCE (cherry picked from commit 8f60fd46172623b6ccdfd51a306f9ebd2172fdfd) >--------------------------------------------------------------- 2840bc1ba2c5cf872f20a94281e15caafccb3162 ANNOUNCE | 3 ++- docs/users_guide/8.0.1-notes.rst | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index 24cddb3..2db475e 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -13,7 +13,8 @@ of major features and numerous bug fixes. These include, * Support for record pattern synonyms - * The DeriveAnyClass extension to conveniently derive default instances + * The -XDeriveAnyClass extension learned to derive instances for classes with + associated types * More reliable DWARF debugging information diff --git a/docs/users_guide/8.0.1-notes.rst b/docs/users_guide/8.0.1-notes.rst index 2a00e78..5ac7a17 100644 --- a/docs/users_guide/8.0.1-notes.rst +++ b/docs/users_guide/8.0.1-notes.rst @@ -18,7 +18,7 @@ The highlights, since the 7.10 branch, are: - Support for :ref:`record pattern synonyms ` -- ``-XDeriveAnyClass`` to conveniently derive default instances (see :ref:`derive-any-class`) +- The ``-XDeriveAnyClass`` extension learned to derive instances for classes with associated types (see :ref:`derive-any-class`) - More reliable DWARF debugging information From git at git.haskell.org Sat Jan 9 16:50:56 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 9 Jan 2016 16:50:56 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: users-guide: A few fixes (29bce35) Message-ID: <20160109165056.9A50F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/29bce356b8af255eeb3f07af077fb971d39f7c7c/ghc >--------------------------------------------------------------- commit 29bce356b8af255eeb3f07af077fb971d39f7c7c Author: Ben Gamari Date: Sat Jan 9 12:36:07 2016 +0100 users-guide: A few fixes (cherry picked from commit 86d06571f5ec4b9bfa24663c47adcbf3dc406480) >--------------------------------------------------------------- 29bce356b8af255eeb3f07af077fb971d39f7c7c docs/users_guide/glasgow_exts.rst | 8 +++++++- docs/users_guide/using-warnings.rst | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index 0dd4d69..9368660 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -2546,7 +2546,7 @@ Existentially quantified data constructors .. ghc-flag:: -XExistentialQuantification - Allow the use of ``forall`` syntax. + Allow existentially quantified type variables in types. The idea of using existential quantification in data type declarations was suggested by Perry, and implemented in Hope+ (Nigel Perry, *The @@ -4958,6 +4958,8 @@ Relaxed rules for the instance head .. ghc-flag:: -XFlexibleInstances + :implies: :ghc-flag:`-XTypeSynonymInstances` + Allow definition of type class instances with arbitrary nested types in the instance head. @@ -8443,6 +8445,8 @@ Lexically scoped type variables .. ghc-flag:: -XScopedTypeVariables + :implies: :ghc-flag:`-XRelaxedPolyRec` + Enable lexical scoping of type variables explicitly introduced with ``forall``. @@ -12517,6 +12521,8 @@ Strict-by-default pattern bindings .. ghc-flag:: -XStrict + :implies: :ghc-flag:`-XStrictData` + Make bindings in the current module strict by default. Informally the ``Strict`` language extension switches functions, data diff --git a/docs/users_guide/using-warnings.rst b/docs/users_guide/using-warnings.rst index 7c9c944..0ba36aa 100644 --- a/docs/users_guide/using-warnings.rst +++ b/docs/users_guide/using-warnings.rst @@ -105,6 +105,8 @@ of ``-W(no-)*``. .. ghc-flag:: -fdefer-type-errors + :implies: :ghc-flag:`-fdefer-typed-holes` + Defer as many type errors as possible until runtime. At compile time you get a warning (instead of an error). At runtime, if you use a value that depends on a type error, you get a runtime error; but you @@ -492,6 +494,8 @@ of ``-W(no-)*``. .. ghc-flag:: -ffull-guard-reasoning + :implies: :ghc-flag:`-Wno-too-many-guards` + .. index:: single: guard reasoning, warning From git at git.haskell.org Sat Jan 9 16:50:59 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 9 Jan 2016 16:50:59 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: user-guide: More semantic markup (fa114f7) Message-ID: <20160109165059.49BB53A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/fa114f77a3c03a6c9a09f8b1deeec49a11334e3e/ghc >--------------------------------------------------------------- commit fa114f77a3c03a6c9a09f8b1deeec49a11334e3e Author: Ben Gamari Date: Sat Jan 9 13:58:27 2016 +0100 user-guide: More semantic markup (cherry picked from commit 67b5cecec2257a7b146923c04c8c103e65fe36f7) >--------------------------------------------------------------- fa114f77a3c03a6c9a09f8b1deeec49a11334e3e docs/users_guide/8.0.1-notes.rst | 133 ++++++++++++++++++++------------------- 1 file changed, 70 insertions(+), 63 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc fa114f77a3c03a6c9a09f8b1deeec49a11334e3e From git at git.haskell.org Sat Jan 9 16:51:01 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 9 Jan 2016 16:51:01 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: user-guide/safe_haskell: Fix typos (a8ab34a) Message-ID: <20160109165101.EA9033A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/a8ab34a1f131af57c3b8619fdde760491e9cf329/ghc >--------------------------------------------------------------- commit a8ab34a1f131af57c3b8619fdde760491e9cf329 Author: Ben Gamari Date: Sat Jan 9 14:35:00 2016 +0100 user-guide/safe_haskell: Fix typos (cherry picked from commit 0dc230879ae2f8b7f6d97779631ba0847e415f24) >--------------------------------------------------------------- a8ab34a1f131af57c3b8619fdde760491e9cf329 docs/users_guide/safe_haskell.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/users_guide/safe_haskell.rst b/docs/users_guide/safe_haskell.rst index efa6188..9fab563 100644 --- a/docs/users_guide/safe_haskell.rst +++ b/docs/users_guide/safe_haskell.rst @@ -661,10 +661,10 @@ In summary, Safe Haskell consists of the following three language flags: `. It also allows the use of the safe import keyword. - - *Module Truste* ? Yes. - - *Module Truste* (:ghc-flag:`-fpackage-trust` enabled) ? Yes but only if the package - the module resides in is also trusted. - - *Haskell Languag* ? Unrestricted, except only safe overlapping instances + - *Module Trusted* ? Yes. + - *Module Trusted* (:ghc-flag:`-fpackage-trust` enabled) ? Yes but only if the package + the module resides in is also trusted. + - *Haskell Language* ? Unrestricted, except only safe overlapping instances allowed. - *Imported Modules* ? Under control of module author which ones must be trusted. From git at git.haskell.org Sat Jan 9 17:15:06 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 9 Jan 2016 17:15:06 +0000 (UTC) Subject: [commit: ghc] master: docs: Fix DeriveAnyClass reference in release notes and ANNOUNCE (8f60fd4) Message-ID: <20160109171506.390063A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/8f60fd46172623b6ccdfd51a306f9ebd2172fdfd/ghc >--------------------------------------------------------------- commit 8f60fd46172623b6ccdfd51a306f9ebd2172fdfd Author: Ben Gamari Date: Sat Jan 9 13:48:23 2016 +0100 docs: Fix DeriveAnyClass reference in release notes and ANNOUNCE >--------------------------------------------------------------- 8f60fd46172623b6ccdfd51a306f9ebd2172fdfd ANNOUNCE | 3 ++- docs/users_guide/8.0.1-notes.rst | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index 24cddb3..2db475e 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -13,7 +13,8 @@ of major features and numerous bug fixes. These include, * Support for record pattern synonyms - * The DeriveAnyClass extension to conveniently derive default instances + * The -XDeriveAnyClass extension learned to derive instances for classes with + associated types * More reliable DWARF debugging information diff --git a/docs/users_guide/8.0.1-notes.rst b/docs/users_guide/8.0.1-notes.rst index d3cdcdc..872db8b 100644 --- a/docs/users_guide/8.0.1-notes.rst +++ b/docs/users_guide/8.0.1-notes.rst @@ -18,7 +18,7 @@ The highlights, since the 7.10 branch, are: - Support for :ref:`record pattern synonyms ` -- ``-XDeriveAnyClass`` to conveniently derive default instances (see :ref:`derive-any-class`) +- The ``-XDeriveAnyClass`` extension learned to derive instances for classes with associated types (see :ref:`derive-any-class`) - More reliable DWARF debugging information From git at git.haskell.org Sat Jan 9 17:15:08 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 9 Jan 2016 17:15:08 +0000 (UTC) Subject: [commit: ghc] master: users-guide: A few fixes (86d0657) Message-ID: <20160109171508.D89F63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/86d06571f5ec4b9bfa24663c47adcbf3dc406480/ghc >--------------------------------------------------------------- commit 86d06571f5ec4b9bfa24663c47adcbf3dc406480 Author: Ben Gamari Date: Sat Jan 9 12:36:07 2016 +0100 users-guide: A few fixes >--------------------------------------------------------------- 86d06571f5ec4b9bfa24663c47adcbf3dc406480 docs/users_guide/glasgow_exts.rst | 8 +++++++- docs/users_guide/using-warnings.rst | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index 9b57770..6a7dd2c 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -2546,7 +2546,7 @@ Existentially quantified data constructors .. ghc-flag:: -XExistentialQuantification - Allow the use of ``forall`` syntax. + Allow existentially quantified type variables in types. The idea of using existential quantification in data type declarations was suggested by Perry, and implemented in Hope+ (Nigel Perry, *The @@ -4958,6 +4958,8 @@ Relaxed rules for the instance head .. ghc-flag:: -XFlexibleInstances + :implies: :ghc-flag:`-XTypeSynonymInstances` + Allow definition of type class instances with arbitrary nested types in the instance head. @@ -8443,6 +8445,8 @@ Lexically scoped type variables .. ghc-flag:: -XScopedTypeVariables + :implies: :ghc-flag:`-XRelaxedPolyRec` + Enable lexical scoping of type variables explicitly introduced with ``forall``. @@ -12517,6 +12521,8 @@ Strict-by-default pattern bindings .. ghc-flag:: -XStrict + :implies: :ghc-flag:`-XStrictData` + Make bindings in the current module strict by default. Informally the ``Strict`` language extension switches functions, data diff --git a/docs/users_guide/using-warnings.rst b/docs/users_guide/using-warnings.rst index 7c9c944..0ba36aa 100644 --- a/docs/users_guide/using-warnings.rst +++ b/docs/users_guide/using-warnings.rst @@ -105,6 +105,8 @@ of ``-W(no-)*``. .. ghc-flag:: -fdefer-type-errors + :implies: :ghc-flag:`-fdefer-typed-holes` + Defer as many type errors as possible until runtime. At compile time you get a warning (instead of an error). At runtime, if you use a value that depends on a type error, you get a runtime error; but you @@ -492,6 +494,8 @@ of ``-W(no-)*``. .. ghc-flag:: -ffull-guard-reasoning + :implies: :ghc-flag:`-Wno-too-many-guards` + .. index:: single: guard reasoning, warning From git at git.haskell.org Sat Jan 9 17:15:11 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 9 Jan 2016 17:15:11 +0000 (UTC) Subject: [commit: ghc] master: user-guide: More semantic markup (67b5cec) Message-ID: <20160109171511.84FFA3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/67b5cecec2257a7b146923c04c8c103e65fe36f7/ghc >--------------------------------------------------------------- commit 67b5cecec2257a7b146923c04c8c103e65fe36f7 Author: Ben Gamari Date: Sat Jan 9 13:58:27 2016 +0100 user-guide: More semantic markup >--------------------------------------------------------------- 67b5cecec2257a7b146923c04c8c103e65fe36f7 docs/users_guide/8.0.1-notes.rst | 133 ++++++++++++++++++++------------------- 1 file changed, 70 insertions(+), 63 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 67b5cecec2257a7b146923c04c8c103e65fe36f7 From git at git.haskell.org Sat Jan 9 17:15:14 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 9 Jan 2016 17:15:14 +0000 (UTC) Subject: [commit: ghc] master: user-guide/safe_haskell: Fix typos (0dc2308) Message-ID: <20160109171514.2D6C43A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/0dc230879ae2f8b7f6d97779631ba0847e415f24/ghc >--------------------------------------------------------------- commit 0dc230879ae2f8b7f6d97779631ba0847e415f24 Author: Ben Gamari Date: Sat Jan 9 14:35:00 2016 +0100 user-guide/safe_haskell: Fix typos >--------------------------------------------------------------- 0dc230879ae2f8b7f6d97779631ba0847e415f24 docs/users_guide/safe_haskell.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/users_guide/safe_haskell.rst b/docs/users_guide/safe_haskell.rst index efa6188..9fab563 100644 --- a/docs/users_guide/safe_haskell.rst +++ b/docs/users_guide/safe_haskell.rst @@ -661,10 +661,10 @@ In summary, Safe Haskell consists of the following three language flags: `. It also allows the use of the safe import keyword. - - *Module Truste* ? Yes. - - *Module Truste* (:ghc-flag:`-fpackage-trust` enabled) ? Yes but only if the package - the module resides in is also trusted. - - *Haskell Languag* ? Unrestricted, except only safe overlapping instances + - *Module Trusted* ? Yes. + - *Module Trusted* (:ghc-flag:`-fpackage-trust` enabled) ? Yes but only if the package + the module resides in is also trusted. + - *Haskell Language* ? Unrestricted, except only safe overlapping instances allowed. - *Imported Modules* ? Under control of module author which ones must be trusted. From git at git.haskell.org Sat Jan 9 17:15:17 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 9 Jan 2016 17:15:17 +0000 (UTC) Subject: [commit: ghc] master: Reject import declaration with semicolon in GHCi (a84c21e) Message-ID: <20160109171517.154B63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a84c21ebaa5c56a222d69f245ef4daa77054fdcb/ghc >--------------------------------------------------------------- commit a84c21ebaa5c56a222d69f245ef4daa77054fdcb Author: Rik Steenkamp Date: Sat Jan 9 18:15:45 2016 +0100 Reject import declaration with semicolon in GHCi Now GHCi rejects input containing an import declaration and semicolon, and prints an appropriate error message. Before, the stuff after an import declaration and semicolon got ignored (most of the time), without telling the user about it. As the default behaviour of GHCi is to reject multiple commands in a single input, we extend this behaviour to import commands. This patch fixes #10663. (See https://phabricator.haskell.org/D1518 for the introduction of `is_import` and `is_decl`.) Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1726 GHC Trac Issues: #10663 >--------------------------------------------------------------- a84c21ebaa5c56a222d69f245ef4daa77054fdcb compiler/main/GHC.hs | 2 +- compiler/main/InteractiveEval.hs | 17 ++++++++++++----- ghc/GHCi/UI.hs | 17 +++++++++++++---- testsuite/tests/ghci/scripts/T10663.script | 1 + testsuite/tests/ghci/scripts/T10663.stderr | 1 + testsuite/tests/ghci/scripts/all.T | 1 + 6 files changed, 29 insertions(+), 10 deletions(-) diff --git a/compiler/main/GHC.hs b/compiler/main/GHC.hs index 31f809c..2dad92a 100644 --- a/compiler/main/GHC.hs +++ b/compiler/main/GHC.hs @@ -132,7 +132,7 @@ module GHC ( -- ** Other runTcInteractive, -- Desired by some clients (Trac #8878) - isStmt, isImport, isDecl, + isStmt, hasImport, isImport, isDecl, -- ** The debugger SingleStep(..), diff --git a/compiler/main/InteractiveEval.hs b/compiler/main/InteractiveEval.hs index e1f2cfc..013be3c 100644 --- a/compiler/main/InteractiveEval.hs +++ b/compiler/main/InteractiveEval.hs @@ -14,7 +14,7 @@ module InteractiveEval ( Resume(..), History(..), execStmt, ExecOptions(..), execOptions, ExecResult(..), resumeExec, runDecls, runDeclsWithLocation, - isStmt, isImport, isDecl, + isStmt, hasImport, isImport, isDecl, parseImportDecl, SingleStep(..), resume, abandon, abandonAll, @@ -89,7 +89,7 @@ import Outputable import FastString import Bag import qualified Lexer (P (..), ParseResult(..), unP, mkPState) -import qualified Parser (parseStmt, parseModule, parseDeclaration) +import qualified Parser (parseStmt, parseModule, parseDeclaration, parseImport) import System.Directory import Data.Dynamic @@ -821,15 +821,22 @@ isStmt dflags stmt = Lexer.POk _ _ -> True Lexer.PFailed _ _ -> False --- | Returns @True@ if passed string is an import declaration. -isImport :: DynFlags -> String -> Bool -isImport dflags stmt = +-- | Returns @True@ if passed string has an import declaration. +hasImport :: DynFlags -> String -> Bool +hasImport dflags stmt = case parseThing Parser.parseModule dflags stmt of Lexer.POk _ thing -> hasImports thing Lexer.PFailed _ _ -> False where hasImports = not . null . hsmodImports . unLoc +-- | Returns @True@ if passed string is an import declaration. +isImport :: DynFlags -> String -> Bool +isImport dflags stmt = + case parseThing Parser.parseImport dflags stmt of + Lexer.POk _ _ -> True + Lexer.PFailed _ _ -> False + -- | Returns @True@ if passed string is a declaration but __/not a splice/__. isDecl :: DynFlags -> String -> Bool isDecl dflags stmt = do diff --git a/ghc/GHCi/UI.hs b/ghc/GHCi/UI.hs index 7bd9bbe..1303af5 100644 --- a/ghc/GHCi/UI.hs +++ b/ghc/GHCi/UI.hs @@ -933,12 +933,21 @@ enqueueCommands cmds = do runStmt :: String -> SingleStep -> GHCi (Maybe GHC.ExecResult) runStmt stmt step = do dflags <- GHC.getInteractiveDynFlags - if | GHC.isStmt dflags stmt -> run_stmt - | GHC.isImport dflags stmt -> run_imports - | otherwise -> run_decl + if | GHC.isStmt dflags stmt -> run_stmt + | GHC.isImport dflags stmt -> run_import + -- Every import declaration should be handled by `run_import`. As GHCi + -- in general only accepts one command at a time, we simply throw an + -- exception when the input contains multiple commands of which at least + -- one is an import command (see #10663). + | GHC.hasImport dflags stmt -> throwGhcException + (CmdLineError "error: expecting a single import declaration") + -- Note: `GHC.isDecl` returns False on input like + -- `data Infix a b = a :@: b; infixl 4 :@:` + -- and should therefore not be used here. + | otherwise -> run_decl where - run_imports = do + run_import = do addImportToContext stmt return (Just (GHC.ExecComplete (Right []) 0)) diff --git a/testsuite/tests/ghci/scripts/T10663.script b/testsuite/tests/ghci/scripts/T10663.script new file mode 100644 index 0000000..10be57f --- /dev/null +++ b/testsuite/tests/ghci/scripts/T10663.script @@ -0,0 +1 @@ +import Data.List; sort [2, 1] \ No newline at end of file diff --git a/testsuite/tests/ghci/scripts/T10663.stderr b/testsuite/tests/ghci/scripts/T10663.stderr new file mode 100644 index 0000000..7170dbf --- /dev/null +++ b/testsuite/tests/ghci/scripts/T10663.stderr @@ -0,0 +1 @@ +error: expecting a single import declaration \ No newline at end of file diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T index da0ea0d..06a9125 100755 --- a/testsuite/tests/ghci/scripts/all.T +++ b/testsuite/tests/ghci/scripts/all.T @@ -225,6 +225,7 @@ test('T10466', normal, ghci_script, ['T10466.script']) test('T10501', normal, ghci_script, ['T10501.script']) test('T10508', normal, ghci_script, ['T10508.script']) test('T10520', normal, ghci_script, ['T10520.script']) +test('T10663', normal, ghci_script, ['T10663.script']) test('T10989', [ extra_clean(['dummy.hs', 'dummy.lhs', 'dummy.tags']) From git at git.haskell.org Sat Jan 9 17:41:53 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 9 Jan 2016 17:41:53 +0000 (UTC) Subject: [commit: ghc] master: Parser: delete rule numbers + validate shift/reduce conlicts (831102f) Message-ID: <20160109174153.5B5DE3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/831102f004b1314ff3a0a7bf807f73cc5d0da16c/ghc >--------------------------------------------------------------- commit 831102f004b1314ff3a0a7bf807f73cc5d0da16c Author: Thomas Miedema Date: Mon Jan 4 15:48:54 2016 +0100 Parser: delete rule numbers + validate shift/reduce conlicts Rule numbers tend to go out-of-date, and aren't useful. And during validate, the actual number of shift/reduce conflicts is now checked against the number stated in Parser.y. Reviewed by: bgamari Differential Revision: https://phabricator.haskell.org/D1754 >--------------------------------------------------------------- 831102f004b1314ff3a0a7bf807f73cc5d0da16c compiler/parser/Parser.y | 99 ++++++++++++++++++++++++------------------------ 1 file changed, 49 insertions(+), 50 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 831102f004b1314ff3a0a7bf807f73cc5d0da16c From git at git.haskell.org Sat Jan 9 17:48:32 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 9 Jan 2016 17:48:32 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Reject import declaration with semicolon in GHCi (4c8e203) Message-ID: <20160109174832.D20B43A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/4c8e2032cd7d9b9f2c4eef431b4ceb7eae7b655d/ghc >--------------------------------------------------------------- commit 4c8e2032cd7d9b9f2c4eef431b4ceb7eae7b655d Author: Rik Steenkamp Date: Sat Jan 9 18:15:45 2016 +0100 Reject import declaration with semicolon in GHCi Now GHCi rejects input containing an import declaration and semicolon, and prints an appropriate error message. Before, the stuff after an import declaration and semicolon got ignored (most of the time), without telling the user about it. As the default behaviour of GHCi is to reject multiple commands in a single input, we extend this behaviour to import commands. This patch fixes #10663. (See https://phabricator.haskell.org/D1518 for the introduction of `is_import` and `is_decl`.) Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1726 GHC Trac Issues: #10663 (cherry picked from commit a84c21ebaa5c56a222d69f245ef4daa77054fdcb) >--------------------------------------------------------------- 4c8e2032cd7d9b9f2c4eef431b4ceb7eae7b655d compiler/main/GHC.hs | 2 +- compiler/main/InteractiveEval.hs | 17 ++++++++++++----- ghc/GHCi/UI.hs | 17 +++++++++++++---- testsuite/tests/ghci/scripts/T10663.script | 1 + testsuite/tests/ghci/scripts/T10663.stderr | 1 + testsuite/tests/ghci/scripts/all.T | 1 + 6 files changed, 29 insertions(+), 10 deletions(-) diff --git a/compiler/main/GHC.hs b/compiler/main/GHC.hs index bbbc4a9..ee13976 100644 --- a/compiler/main/GHC.hs +++ b/compiler/main/GHC.hs @@ -132,7 +132,7 @@ module GHC ( -- ** Other runTcInteractive, -- Desired by some clients (Trac #8878) - isStmt, isImport, isDecl, + isStmt, hasImport, isImport, isDecl, -- ** The debugger SingleStep(..), diff --git a/compiler/main/InteractiveEval.hs b/compiler/main/InteractiveEval.hs index e1f2cfc..013be3c 100644 --- a/compiler/main/InteractiveEval.hs +++ b/compiler/main/InteractiveEval.hs @@ -14,7 +14,7 @@ module InteractiveEval ( Resume(..), History(..), execStmt, ExecOptions(..), execOptions, ExecResult(..), resumeExec, runDecls, runDeclsWithLocation, - isStmt, isImport, isDecl, + isStmt, hasImport, isImport, isDecl, parseImportDecl, SingleStep(..), resume, abandon, abandonAll, @@ -89,7 +89,7 @@ import Outputable import FastString import Bag import qualified Lexer (P (..), ParseResult(..), unP, mkPState) -import qualified Parser (parseStmt, parseModule, parseDeclaration) +import qualified Parser (parseStmt, parseModule, parseDeclaration, parseImport) import System.Directory import Data.Dynamic @@ -821,15 +821,22 @@ isStmt dflags stmt = Lexer.POk _ _ -> True Lexer.PFailed _ _ -> False --- | Returns @True@ if passed string is an import declaration. -isImport :: DynFlags -> String -> Bool -isImport dflags stmt = +-- | Returns @True@ if passed string has an import declaration. +hasImport :: DynFlags -> String -> Bool +hasImport dflags stmt = case parseThing Parser.parseModule dflags stmt of Lexer.POk _ thing -> hasImports thing Lexer.PFailed _ _ -> False where hasImports = not . null . hsmodImports . unLoc +-- | Returns @True@ if passed string is an import declaration. +isImport :: DynFlags -> String -> Bool +isImport dflags stmt = + case parseThing Parser.parseImport dflags stmt of + Lexer.POk _ _ -> True + Lexer.PFailed _ _ -> False + -- | Returns @True@ if passed string is a declaration but __/not a splice/__. isDecl :: DynFlags -> String -> Bool isDecl dflags stmt = do diff --git a/ghc/GHCi/UI.hs b/ghc/GHCi/UI.hs index 7bd9bbe..1303af5 100644 --- a/ghc/GHCi/UI.hs +++ b/ghc/GHCi/UI.hs @@ -933,12 +933,21 @@ enqueueCommands cmds = do runStmt :: String -> SingleStep -> GHCi (Maybe GHC.ExecResult) runStmt stmt step = do dflags <- GHC.getInteractiveDynFlags - if | GHC.isStmt dflags stmt -> run_stmt - | GHC.isImport dflags stmt -> run_imports - | otherwise -> run_decl + if | GHC.isStmt dflags stmt -> run_stmt + | GHC.isImport dflags stmt -> run_import + -- Every import declaration should be handled by `run_import`. As GHCi + -- in general only accepts one command at a time, we simply throw an + -- exception when the input contains multiple commands of which at least + -- one is an import command (see #10663). + | GHC.hasImport dflags stmt -> throwGhcException + (CmdLineError "error: expecting a single import declaration") + -- Note: `GHC.isDecl` returns False on input like + -- `data Infix a b = a :@: b; infixl 4 :@:` + -- and should therefore not be used here. + | otherwise -> run_decl where - run_imports = do + run_import = do addImportToContext stmt return (Just (GHC.ExecComplete (Right []) 0)) diff --git a/testsuite/tests/ghci/scripts/T10663.script b/testsuite/tests/ghci/scripts/T10663.script new file mode 100644 index 0000000..10be57f --- /dev/null +++ b/testsuite/tests/ghci/scripts/T10663.script @@ -0,0 +1 @@ +import Data.List; sort [2, 1] \ No newline at end of file diff --git a/testsuite/tests/ghci/scripts/T10663.stderr b/testsuite/tests/ghci/scripts/T10663.stderr new file mode 100644 index 0000000..7170dbf --- /dev/null +++ b/testsuite/tests/ghci/scripts/T10663.stderr @@ -0,0 +1 @@ +error: expecting a single import declaration \ No newline at end of file diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T index da0ea0d..06a9125 100755 --- a/testsuite/tests/ghci/scripts/all.T +++ b/testsuite/tests/ghci/scripts/all.T @@ -225,6 +225,7 @@ test('T10466', normal, ghci_script, ['T10466.script']) test('T10501', normal, ghci_script, ['T10501.script']) test('T10508', normal, ghci_script, ['T10508.script']) test('T10520', normal, ghci_script, ['T10520.script']) +test('T10663', normal, ghci_script, ['T10663.script']) test('T10989', [ extra_clean(['dummy.hs', 'dummy.lhs', 'dummy.tags']) From git at git.haskell.org Sat Jan 9 17:48:35 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 9 Jan 2016 17:48:35 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Use an Implication in 'deriving' error (6c956b6) Message-ID: <20160109174835.938093A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/6c956b6d7e7b282a70a91019f017527892c7566d/ghc >--------------------------------------------------------------- commit 6c956b6d7e7b282a70a91019f017527892c7566d Author: Simon Peyton Jones Date: Wed Jan 6 17:22:02 2016 +0000 Use an Implication in 'deriving' error Trac #11437 showed that erroneous constraints from a 'deriving' clause need to be wrapped in an Implication to properly scope their skolems. The main change is in TcDeriv.simplifyDeriv; the call to buildImplicationFor is new. (cherry picked from commit 02c1c5735aff0cce2b04a6b3e4732d62bb0a4f3c) >--------------------------------------------------------------- 6c956b6d7e7b282a70a91019f017527892c7566d compiler/typecheck/TcDeriv.hs | 23 +++++++++++++++------ compiler/typecheck/TcInstDcls.hs | 2 +- compiler/typecheck/TcPatSyn.hs | 2 +- compiler/typecheck/TcRnTypes.hs | 11 +++++++++- .../tests/deriving/should_compile/T10561.stderr | 8 +++++--- testsuite/tests/deriving/should_fail/T7148.stderr | 24 +++++++++++++--------- .../tests/typecheck/should_fail/T11347.stderr | 13 ++++++++++-- 7 files changed, 59 insertions(+), 24 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 6c956b6d7e7b282a70a91019f017527892c7566d From git at git.haskell.org Sat Jan 9 17:48:38 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 9 Jan 2016 17:48:38 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Add (failing) test case for #11347 (3deb446) Message-ID: <20160109174838.E36C73A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/3deb446e9cf96eba3f2de092449e1ac88923fb19/ghc >--------------------------------------------------------------- commit 3deb446e9cf96eba3f2de092449e1ac88923fb19 Author: Joachim Breitner Date: Tue Jan 5 10:56:47 2016 +0100 Add (failing) test case for #11347 Unfortunately, I could not add the expected error message, so if someone accidentally fixes this bug, this test will still be failing (no harm). But maybe someone stumbles over it then and can update the expected output. (cherry picked from commit 1a8b752d8b03266aca3e83f79c311056d6c43e00) >--------------------------------------------------------------- 3deb446e9cf96eba3f2de092449e1ac88923fb19 testsuite/tests/typecheck/should_fail/T11347.hs | 19 +++++++++++++++++++ testsuite/tests/typecheck/should_fail/T11347.stderr | 2 ++ testsuite/tests/typecheck/should_fail/all.T | 1 + 3 files changed, 22 insertions(+) diff --git a/testsuite/tests/typecheck/should_fail/T11347.hs b/testsuite/tests/typecheck/should_fail/T11347.hs new file mode 100644 index 0000000..eaffdfd --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T11347.hs @@ -0,0 +1,19 @@ +-- Should AllowAmbiguousTypes relaly be needed here? +{-# LANGUAGE TypeFamilies, GeneralizedNewtypeDeriving, MultiParamTypeClasses, FlexibleInstances, AllowAmbiguousTypes #-} +module T11347 where + +newtype Id1 a = MkId1 a +newtype Id2 a = MkId2 (Id1 a) deriving (UnsafeCast b) + +type family Discern a b +type instance Discern (Id1 a) b = a +type instance Discern (Id2 a) b = b + +class UnsafeCast to from where + unsafe :: from -> Discern from to + +instance UnsafeCast b (Id1 a) where + unsafe (MkId1 x) = x + +unsafeCoerce :: a -> b +unsafeCoerce x = unsafe (MkId2 (MkId1 x)) diff --git a/testsuite/tests/typecheck/should_fail/T11347.stderr b/testsuite/tests/typecheck/should_fail/T11347.stderr new file mode 100644 index 0000000..1de61cd --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T11347.stderr @@ -0,0 +1,2 @@ +dummy stderr: +here should be something about roles _not_ "No skolem info" diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T index 4279950..93dd0c7 100644 --- a/testsuite/tests/typecheck/should_fail/all.T +++ b/testsuite/tests/typecheck/should_fail/all.T @@ -398,3 +398,4 @@ test('T11112', normal, compile_fail, ['']) test('ClassOperator', normal, compile_fail, ['']) test('T11274', normal, compile_fail, ['']) test('T10619', normal, compile_fail, ['']) +test('T11347', expect_broken(11347), compile_fail, ['']) From git at git.haskell.org Sat Jan 9 17:48:42 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 9 Jan 2016 17:48:42 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Turn AThing into ATcTyCon, in TcTyThing (d60b89b) Message-ID: <20160109174842.671813A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/d60b89b9a0f5212e35210f6e66d119ca025f7a5c/ghc >--------------------------------------------------------------- commit d60b89b9a0f5212e35210f6e66d119ca025f7a5c Author: Simon Peyton Jones Date: Wed Jan 6 17:33:42 2016 +0000 Turn AThing into ATcTyCon, in TcTyThing This change tidies up and simplifies (a bit) the knot-tying when kind-checking groups of type and class declarations. The trouble (shown by Trac #11356) was that we wanted an error message (a kind-mismatch) that involved a type mentioned a (AThing k), which blew up. Since we now seem to have TcTyCons, I decided to use them here. It's still not great, but it's easier to understand and more robust. (cherry picked from commit a5cea73c658888e01c162723d3e0e1439514ecdb) >--------------------------------------------------------------- d60b89b9a0f5212e35210f6e66d119ca025f7a5c compiler/typecheck/TcEnv.hs | 13 +++--- compiler/typecheck/TcHsType.hs | 26 +++++++----- compiler/typecheck/TcRnTypes.hs | 9 +++-- compiler/typecheck/TcTyClsDecls.hs | 46 +++++++++++----------- testsuite/tests/typecheck/should_fail/T11356.hs | 6 +++ .../tests/typecheck/should_fail/T11356.stderr | 5 +++ testsuite/tests/typecheck/should_fail/all.T | 3 +- 7 files changed, 62 insertions(+), 46 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc d60b89b9a0f5212e35210f6e66d119ca025f7a5c From git at git.haskell.org Sat Jan 9 18:26:54 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 9 Jan 2016 18:26:54 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Add failing testcase for #10603 (279f080) Message-ID: <20160109182654.65F8B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/279f08012b4109f891900856b8c819f7340ad63e/ghc >--------------------------------------------------------------- commit 279f08012b4109f891900856b8c819f7340ad63e Author: Ben Gamari Date: Sat Jan 9 18:57:40 2016 +0100 Add failing testcase for #10603 (cherry picked from commit 987f563f1a682a059eee5ab5c63e91561d6bd4dc) >--------------------------------------------------------------- 279f08012b4109f891900856b8c819f7340ad63e testsuite/tests/th/T10603.hs | 5 +++++ testsuite/tests/th/T10603.stderr | 6 ++++++ testsuite/tests/th/all.T | 1 + 3 files changed, 12 insertions(+) diff --git a/testsuite/tests/th/T10603.hs b/testsuite/tests/th/T10603.hs new file mode 100644 index 0000000..be42b49 --- /dev/null +++ b/testsuite/tests/th/T10603.hs @@ -0,0 +1,5 @@ +{-# LANGUAGE TemplateHaskell #-} + +module T10603 where + +main = print $ $([| case Just 'a' of Just a -> Just ((\x -> x) a) |]) diff --git a/testsuite/tests/th/T10603.stderr b/testsuite/tests/th/T10603.stderr new file mode 100644 index 0000000..47f2a7a --- /dev/null +++ b/testsuite/tests/th/T10603.stderr @@ -0,0 +1,6 @@ +T10603.hs:5:18-68: Splicing expression + [| case Just 'a' of { + Just a_atn -> Just ((\ x_ato -> x_ato) a_atn) } |] + ======> + case Just 'a' of { + Just a_a4uM -> Just ((\ x_a4uN -> x_a4uN) a_a4uM) } diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index b881933..39a0aa9 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -397,3 +397,4 @@ test('T11341', normal, compile, ['-v0 -dsuppress-uniques']) test('T11345', normal, compile_and_run, ['-v0 -dsuppress-uniques']) test('TH_finalizer', normal, compile, ['-v0']) +test('T10603', expect_broken(10603), compile, ['-ddump-splices']) \ No newline at end of file From git at git.haskell.org Sat Jan 9 18:26:54 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 9 Jan 2016 18:26:54 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Add failing testcase for #10603 (279f080) Message-ID: <20160109182654.E472D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/279f08012b4109f891900856b8c819f7340ad63e/ghc >--------------------------------------------------------------- commit 279f08012b4109f891900856b8c819f7340ad63e Author: Ben Gamari Date: Sat Jan 9 18:57:40 2016 +0100 Add failing testcase for #10603 (cherry picked from commit 987f563f1a682a059eee5ab5c63e91561d6bd4dc) >--------------------------------------------------------------- 279f08012b4109f891900856b8c819f7340ad63e testsuite/tests/th/T10603.hs | 5 +++++ testsuite/tests/th/T10603.stderr | 6 ++++++ testsuite/tests/th/all.T | 1 + 3 files changed, 12 insertions(+) diff --git a/testsuite/tests/th/T10603.hs b/testsuite/tests/th/T10603.hs new file mode 100644 index 0000000..be42b49 --- /dev/null +++ b/testsuite/tests/th/T10603.hs @@ -0,0 +1,5 @@ +{-# LANGUAGE TemplateHaskell #-} + +module T10603 where + +main = print $ $([| case Just 'a' of Just a -> Just ((\x -> x) a) |]) diff --git a/testsuite/tests/th/T10603.stderr b/testsuite/tests/th/T10603.stderr new file mode 100644 index 0000000..47f2a7a --- /dev/null +++ b/testsuite/tests/th/T10603.stderr @@ -0,0 +1,6 @@ +T10603.hs:5:18-68: Splicing expression + [| case Just 'a' of { + Just a_atn -> Just ((\ x_ato -> x_ato) a_atn) } |] + ======> + case Just 'a' of { + Just a_a4uM -> Just ((\ x_a4uN -> x_a4uN) a_a4uM) } diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index b881933..39a0aa9 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -397,3 +397,4 @@ test('T11341', normal, compile, ['-v0 -dsuppress-uniques']) test('T11345', normal, compile_and_run, ['-v0 -dsuppress-uniques']) test('TH_finalizer', normal, compile, ['-v0']) +test('T10603', expect_broken(10603), compile, ['-ddump-splices']) \ No newline at end of file From git at git.haskell.org Sat Jan 9 18:26:57 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 9 Jan 2016 18:26:57 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: fix -ddump-splices to parenthesize ((\x -> x) a) correctly (707b2be) Message-ID: <20160109182657.146C13A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/707b2be97539b83efb91cd9f17f94c91397ad2b4/ghc >--------------------------------------------------------------- commit 707b2be97539b83efb91cd9f17f94c91397ad2b4 Author: Yuri de Wit Date: Sat Jan 9 18:58:30 2016 +0100 fix -ddump-splices to parenthesize ((\x -> x) a) correctly Test Plan: ./validate Reviewers: goldfire, austin, bgamari Subscribers: goldfire, osa1, thomie Differential Revision: https://phabricator.haskell.org/D1114 GHC Trac Issues: #10603 (cherry picked from commit a3ff934f5225d7a98b73f3c067b5feda44f28ad1) >--------------------------------------------------------------- 707b2be97539b83efb91cd9f17f94c91397ad2b4 compiler/hsSyn/Convert.hs | 6 ++++-- testsuite/tests/th/T10603.stderr | 6 ++---- testsuite/tests/th/all.T | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/compiler/hsSyn/Convert.hs b/compiler/hsSyn/Convert.hs index 9e96e89..0b9295f 100644 --- a/compiler/hsSyn/Convert.hs +++ b/compiler/hsSyn/Convert.hs @@ -717,8 +717,10 @@ cvtl e = wrapL (cvt e) cvt (LitE l) | overloadedLit l = do { l' <- cvtOverLit l; return $ HsOverLit l' } | otherwise = do { l' <- cvtLit l; return $ HsLit l' } - - cvt (AppE x y) = do { x' <- cvtl x; y' <- cvtl y; return $ HsApp x' y' } + cvt (AppE x@(LamE _ _) y) = do { x' <- cvtl x; y' <- cvtl y + ; return $ HsApp (mkLHsPar x') y' } + cvt (AppE x y) = do { x' <- cvtl x; y' <- cvtl y + ; return $ HsApp x' y' } cvt (LamE ps e) = do { ps' <- cvtPats ps; e' <- cvtl e ; return $ HsLam (mkMatchGroup FromSource [mkSimpleMatch ps' e']) } cvt (LamCaseE ms) = do { ms' <- mapM cvtMatch ms diff --git a/testsuite/tests/th/T10603.stderr b/testsuite/tests/th/T10603.stderr index 47f2a7a..c294e74 100644 --- a/testsuite/tests/th/T10603.stderr +++ b/testsuite/tests/th/T10603.stderr @@ -1,6 +1,4 @@ T10603.hs:5:18-68: Splicing expression - [| case Just 'a' of { - Just a_atn -> Just ((\ x_ato -> x_ato) a_atn) } |] + [| case Just 'a' of { Just a -> Just ((\ x -> x) a) } |] ======> - case Just 'a' of { - Just a_a4uM -> Just ((\ x_a4uN -> x_a4uN) a_a4uM) } + case Just 'a' of { Just a -> Just ((\ x -> x) a) } diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index 39a0aa9..88b6a12 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -397,4 +397,4 @@ test('T11341', normal, compile, ['-v0 -dsuppress-uniques']) test('T11345', normal, compile_and_run, ['-v0 -dsuppress-uniques']) test('TH_finalizer', normal, compile, ['-v0']) -test('T10603', expect_broken(10603), compile, ['-ddump-splices']) \ No newline at end of file +test('T10603', normal, compile, ['-ddump-splices -dsuppress-uniques']) From git at git.haskell.org Sat Jan 9 18:26:57 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 9 Jan 2016 18:26:57 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: fix -ddump-splices to parenthesize ((\x -> x) a) correctly (707b2be) Message-ID: <20160109182657.93FB53A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/707b2be97539b83efb91cd9f17f94c91397ad2b4/ghc >--------------------------------------------------------------- commit 707b2be97539b83efb91cd9f17f94c91397ad2b4 Author: Yuri de Wit Date: Sat Jan 9 18:58:30 2016 +0100 fix -ddump-splices to parenthesize ((\x -> x) a) correctly Test Plan: ./validate Reviewers: goldfire, austin, bgamari Subscribers: goldfire, osa1, thomie Differential Revision: https://phabricator.haskell.org/D1114 GHC Trac Issues: #10603 (cherry picked from commit a3ff934f5225d7a98b73f3c067b5feda44f28ad1) >--------------------------------------------------------------- 707b2be97539b83efb91cd9f17f94c91397ad2b4 compiler/hsSyn/Convert.hs | 6 ++++-- testsuite/tests/th/T10603.stderr | 6 ++---- testsuite/tests/th/all.T | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/compiler/hsSyn/Convert.hs b/compiler/hsSyn/Convert.hs index 9e96e89..0b9295f 100644 --- a/compiler/hsSyn/Convert.hs +++ b/compiler/hsSyn/Convert.hs @@ -717,8 +717,10 @@ cvtl e = wrapL (cvt e) cvt (LitE l) | overloadedLit l = do { l' <- cvtOverLit l; return $ HsOverLit l' } | otherwise = do { l' <- cvtLit l; return $ HsLit l' } - - cvt (AppE x y) = do { x' <- cvtl x; y' <- cvtl y; return $ HsApp x' y' } + cvt (AppE x@(LamE _ _) y) = do { x' <- cvtl x; y' <- cvtl y + ; return $ HsApp (mkLHsPar x') y' } + cvt (AppE x y) = do { x' <- cvtl x; y' <- cvtl y + ; return $ HsApp x' y' } cvt (LamE ps e) = do { ps' <- cvtPats ps; e' <- cvtl e ; return $ HsLam (mkMatchGroup FromSource [mkSimpleMatch ps' e']) } cvt (LamCaseE ms) = do { ms' <- mapM cvtMatch ms diff --git a/testsuite/tests/th/T10603.stderr b/testsuite/tests/th/T10603.stderr index 47f2a7a..c294e74 100644 --- a/testsuite/tests/th/T10603.stderr +++ b/testsuite/tests/th/T10603.stderr @@ -1,6 +1,4 @@ T10603.hs:5:18-68: Splicing expression - [| case Just 'a' of { - Just a_atn -> Just ((\ x_ato -> x_ato) a_atn) } |] + [| case Just 'a' of { Just a -> Just ((\ x -> x) a) } |] ======> - case Just 'a' of { - Just a_a4uM -> Just ((\ x_a4uN -> x_a4uN) a_a4uM) } + case Just 'a' of { Just a -> Just ((\ x -> x) a) } diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index 39a0aa9..88b6a12 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -397,4 +397,4 @@ test('T11341', normal, compile, ['-v0 -dsuppress-uniques']) test('T11345', normal, compile_and_run, ['-v0 -dsuppress-uniques']) test('TH_finalizer', normal, compile, ['-v0']) -test('T10603', expect_broken(10603), compile, ['-ddump-splices']) \ No newline at end of file +test('T10603', normal, compile, ['-ddump-splices -dsuppress-uniques']) From git at git.haskell.org Sat Jan 9 18:27:00 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 9 Jan 2016 18:27:00 +0000 (UTC) Subject: [commit: ghc] master: Add failing testcase for #10603 (4405f9d) Message-ID: <20160109182700.643823A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/4405f9de855bdd37117e8bdef2da550ac398d81e/ghc >--------------------------------------------------------------- commit 4405f9de855bdd37117e8bdef2da550ac398d81e Author: Ben Gamari Date: Sat Jan 9 18:57:40 2016 +0100 Add failing testcase for #10603 >--------------------------------------------------------------- 4405f9de855bdd37117e8bdef2da550ac398d81e testsuite/tests/th/T10603.hs | 5 +++++ testsuite/tests/th/T10603.stderr | 6 ++++++ testsuite/tests/th/all.T | 1 + 3 files changed, 12 insertions(+) diff --git a/testsuite/tests/th/T10603.hs b/testsuite/tests/th/T10603.hs new file mode 100644 index 0000000..be42b49 --- /dev/null +++ b/testsuite/tests/th/T10603.hs @@ -0,0 +1,5 @@ +{-# LANGUAGE TemplateHaskell #-} + +module T10603 where + +main = print $ $([| case Just 'a' of Just a -> Just ((\x -> x) a) |]) diff --git a/testsuite/tests/th/T10603.stderr b/testsuite/tests/th/T10603.stderr new file mode 100644 index 0000000..47f2a7a --- /dev/null +++ b/testsuite/tests/th/T10603.stderr @@ -0,0 +1,6 @@ +T10603.hs:5:18-68: Splicing expression + [| case Just 'a' of { + Just a_atn -> Just ((\ x_ato -> x_ato) a_atn) } |] + ======> + case Just 'a' of { + Just a_a4uM -> Just ((\ x_a4uN -> x_a4uN) a_a4uM) } diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index b007bb3..1124360 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -397,3 +397,4 @@ test('T11341', normal, compile, ['-v0 -dsuppress-uniques']) test('T11345', normal, compile_and_run, ['-v0 -dsuppress-uniques']) test('TH_finalizer', normal, compile, ['-v0']) +test('T10603', expect_broken(10603), compile, ['-ddump-splices']) \ No newline at end of file From git at git.haskell.org Sat Jan 9 18:27:00 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 9 Jan 2016 18:27:00 +0000 (UTC) Subject: [commit: ghc] master: Add failing testcase for #10603 (4405f9d) Message-ID: <20160109182700.E3B813A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/4405f9de855bdd37117e8bdef2da550ac398d81e/ghc >--------------------------------------------------------------- commit 4405f9de855bdd37117e8bdef2da550ac398d81e Author: Ben Gamari Date: Sat Jan 9 18:57:40 2016 +0100 Add failing testcase for #10603 >--------------------------------------------------------------- 4405f9de855bdd37117e8bdef2da550ac398d81e testsuite/tests/th/T10603.hs | 5 +++++ testsuite/tests/th/T10603.stderr | 6 ++++++ testsuite/tests/th/all.T | 1 + 3 files changed, 12 insertions(+) diff --git a/testsuite/tests/th/T10603.hs b/testsuite/tests/th/T10603.hs new file mode 100644 index 0000000..be42b49 --- /dev/null +++ b/testsuite/tests/th/T10603.hs @@ -0,0 +1,5 @@ +{-# LANGUAGE TemplateHaskell #-} + +module T10603 where + +main = print $ $([| case Just 'a' of Just a -> Just ((\x -> x) a) |]) diff --git a/testsuite/tests/th/T10603.stderr b/testsuite/tests/th/T10603.stderr new file mode 100644 index 0000000..47f2a7a --- /dev/null +++ b/testsuite/tests/th/T10603.stderr @@ -0,0 +1,6 @@ +T10603.hs:5:18-68: Splicing expression + [| case Just 'a' of { + Just a_atn -> Just ((\ x_ato -> x_ato) a_atn) } |] + ======> + case Just 'a' of { + Just a_a4uM -> Just ((\ x_a4uN -> x_a4uN) a_a4uM) } diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index b007bb3..1124360 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -397,3 +397,4 @@ test('T11341', normal, compile, ['-v0 -dsuppress-uniques']) test('T11345', normal, compile_and_run, ['-v0 -dsuppress-uniques']) test('TH_finalizer', normal, compile, ['-v0']) +test('T10603', expect_broken(10603), compile, ['-ddump-splices']) \ No newline at end of file From git at git.haskell.org Sat Jan 9 18:27:03 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 9 Jan 2016 18:27:03 +0000 (UTC) Subject: [commit: ghc] master: fix -ddump-splices to parenthesize ((\x -> x) a) correctly (5cb236d) Message-ID: <20160109182703.0FF0F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/5cb236dd6b497da0b9072b20ca74c298477f7a61/ghc >--------------------------------------------------------------- commit 5cb236dd6b497da0b9072b20ca74c298477f7a61 Author: Yuri de Wit Date: Sat Jan 9 18:58:30 2016 +0100 fix -ddump-splices to parenthesize ((\x -> x) a) correctly Test Plan: ./validate Reviewers: goldfire, austin, bgamari Subscribers: goldfire, osa1, thomie Differential Revision: https://phabricator.haskell.org/D1114 GHC Trac Issues: #10603 >--------------------------------------------------------------- 5cb236dd6b497da0b9072b20ca74c298477f7a61 compiler/hsSyn/Convert.hs | 6 ++++-- testsuite/tests/th/T10603.stderr | 6 ++---- testsuite/tests/th/all.T | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/compiler/hsSyn/Convert.hs b/compiler/hsSyn/Convert.hs index 398958d..251fa19 100644 --- a/compiler/hsSyn/Convert.hs +++ b/compiler/hsSyn/Convert.hs @@ -712,8 +712,10 @@ cvtl e = wrapL (cvt e) cvt (LitE l) | overloadedLit l = do { l' <- cvtOverLit l; return $ HsOverLit l' } | otherwise = do { l' <- cvtLit l; return $ HsLit l' } - - cvt (AppE x y) = do { x' <- cvtl x; y' <- cvtl y; return $ HsApp x' y' } + cvt (AppE x@(LamE _ _) y) = do { x' <- cvtl x; y' <- cvtl y + ; return $ HsApp (mkLHsPar x') y' } + cvt (AppE x y) = do { x' <- cvtl x; y' <- cvtl y + ; return $ HsApp x' y' } cvt (LamE ps e) = do { ps' <- cvtPats ps; e' <- cvtl e ; return $ HsLam (mkMatchGroup FromSource [mkSimpleMatch ps' e']) } cvt (LamCaseE ms) = do { ms' <- mapM cvtMatch ms diff --git a/testsuite/tests/th/T10603.stderr b/testsuite/tests/th/T10603.stderr index 47f2a7a..c294e74 100644 --- a/testsuite/tests/th/T10603.stderr +++ b/testsuite/tests/th/T10603.stderr @@ -1,6 +1,4 @@ T10603.hs:5:18-68: Splicing expression - [| case Just 'a' of { - Just a_atn -> Just ((\ x_ato -> x_ato) a_atn) } |] + [| case Just 'a' of { Just a -> Just ((\ x -> x) a) } |] ======> - case Just 'a' of { - Just a_a4uM -> Just ((\ x_a4uN -> x_a4uN) a_a4uM) } + case Just 'a' of { Just a -> Just ((\ x -> x) a) } diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index 1124360..8b38e3f 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -397,4 +397,4 @@ test('T11341', normal, compile, ['-v0 -dsuppress-uniques']) test('T11345', normal, compile_and_run, ['-v0 -dsuppress-uniques']) test('TH_finalizer', normal, compile, ['-v0']) -test('T10603', expect_broken(10603), compile, ['-ddump-splices']) \ No newline at end of file +test('T10603', normal, compile, ['-ddump-splices -dsuppress-uniques']) From git at git.haskell.org Sat Jan 9 18:27:03 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 9 Jan 2016 18:27:03 +0000 (UTC) Subject: [commit: ghc] master: fix -ddump-splices to parenthesize ((\x -> x) a) correctly (5cb236d) Message-ID: <20160109182703.99A513A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/5cb236dd6b497da0b9072b20ca74c298477f7a61/ghc >--------------------------------------------------------------- commit 5cb236dd6b497da0b9072b20ca74c298477f7a61 Author: Yuri de Wit Date: Sat Jan 9 18:58:30 2016 +0100 fix -ddump-splices to parenthesize ((\x -> x) a) correctly Test Plan: ./validate Reviewers: goldfire, austin, bgamari Subscribers: goldfire, osa1, thomie Differential Revision: https://phabricator.haskell.org/D1114 GHC Trac Issues: #10603 >--------------------------------------------------------------- 5cb236dd6b497da0b9072b20ca74c298477f7a61 compiler/hsSyn/Convert.hs | 6 ++++-- testsuite/tests/th/T10603.stderr | 6 ++---- testsuite/tests/th/all.T | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/compiler/hsSyn/Convert.hs b/compiler/hsSyn/Convert.hs index 398958d..251fa19 100644 --- a/compiler/hsSyn/Convert.hs +++ b/compiler/hsSyn/Convert.hs @@ -712,8 +712,10 @@ cvtl e = wrapL (cvt e) cvt (LitE l) | overloadedLit l = do { l' <- cvtOverLit l; return $ HsOverLit l' } | otherwise = do { l' <- cvtLit l; return $ HsLit l' } - - cvt (AppE x y) = do { x' <- cvtl x; y' <- cvtl y; return $ HsApp x' y' } + cvt (AppE x@(LamE _ _) y) = do { x' <- cvtl x; y' <- cvtl y + ; return $ HsApp (mkLHsPar x') y' } + cvt (AppE x y) = do { x' <- cvtl x; y' <- cvtl y + ; return $ HsApp x' y' } cvt (LamE ps e) = do { ps' <- cvtPats ps; e' <- cvtl e ; return $ HsLam (mkMatchGroup FromSource [mkSimpleMatch ps' e']) } cvt (LamCaseE ms) = do { ms' <- mapM cvtMatch ms diff --git a/testsuite/tests/th/T10603.stderr b/testsuite/tests/th/T10603.stderr index 47f2a7a..c294e74 100644 --- a/testsuite/tests/th/T10603.stderr +++ b/testsuite/tests/th/T10603.stderr @@ -1,6 +1,4 @@ T10603.hs:5:18-68: Splicing expression - [| case Just 'a' of { - Just a_atn -> Just ((\ x_ato -> x_ato) a_atn) } |] + [| case Just 'a' of { Just a -> Just ((\ x -> x) a) } |] ======> - case Just 'a' of { - Just a_a4uM -> Just ((\ x_a4uN -> x_a4uN) a_a4uM) } + case Just 'a' of { Just a -> Just ((\ x -> x) a) } diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index 1124360..8b38e3f 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -397,4 +397,4 @@ test('T11341', normal, compile, ['-v0 -dsuppress-uniques']) test('T11345', normal, compile_and_run, ['-v0 -dsuppress-uniques']) test('TH_finalizer', normal, compile, ['-v0']) -test('T10603', expect_broken(10603), compile, ['-ddump-splices']) \ No newline at end of file +test('T10603', normal, compile, ['-ddump-splices -dsuppress-uniques']) From git at git.haskell.org Sat Jan 9 19:58:04 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 9 Jan 2016 19:58:04 +0000 (UTC) Subject: [commit: ghc] master: Add InjectiveTypeFamilies language extension (fbd6de2) Message-ID: <20160109195804.B08913A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/fbd6de2f0761b63a5f0a88ce0590f515d63790a4/ghc >--------------------------------------------------------------- commit fbd6de2f0761b63a5f0a88ce0590f515d63790a4 Author: Jan Stolarek Date: Sat Jan 9 20:58:52 2016 +0100 Add InjectiveTypeFamilies language extension Previously injective type families were part of TypeFamilies. Now they are in a separate language extension. Test Plan: ./validate Reviewers: austin, bgamari, goldfire Reviewed By: bgamari Subscribers: goldfire, thomie Differential Revision: https://phabricator.haskell.org/D1750 GHC Trac Issues: #11381 >--------------------------------------------------------------- fbd6de2f0761b63a5f0a88ce0590f515d63790a4 compiler/main/DynFlags.hs | 4 +++- compiler/typecheck/TcTyClsDecls.hs | 6 +++++- compiler/typecheck/TcValidity.hs | 2 +- docs/users_guide/glasgow_exts.rst | 3 +++ libraries/ghc-boot/GHC/LanguageExtensions.hs | 1 + testsuite/tests/driver/T11381.hs | 9 +++++++++ testsuite/tests/driver/T11381.stderr | 5 +++++ testsuite/tests/driver/T4437.hs | 3 ++- testsuite/tests/driver/all.T | 1 + testsuite/tests/ghci/scripts/T6018ghci.script | 2 +- testsuite/tests/ghci/scripts/T6018ghcifail.script | 2 +- testsuite/tests/ghci/scripts/T6018ghcirnfail.script | 2 +- testsuite/tests/th/T6018th.hs | 4 ++-- testsuite/tests/th/T8884.hs | 2 +- testsuite/tests/typecheck/should_compile/T6018.hs | 2 +- testsuite/tests/typecheck/should_compile/T6018.hs-boot | 2 +- testsuite/tests/typecheck/should_compile/T6018a.hs | 2 +- testsuite/tests/typecheck/should_fail/T10836.hs | 2 +- testsuite/tests/typecheck/should_fail/T6018Afail.hs | 2 +- testsuite/tests/typecheck/should_fail/T6018Bfail.hs | 2 +- testsuite/tests/typecheck/should_fail/T6018fail.hs | 2 +- testsuite/tests/typecheck/should_fail/T6018failclosed.hs | 4 ++-- testsuite/tests/typecheck/should_fail/T6018failclosed2.hs | 2 +- utils/mkUserGuidePart/Options/Language.hs | 8 ++++++++ 24 files changed, 54 insertions(+), 20 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc fbd6de2f0761b63a5f0a88ce0590f515d63790a4 From git at git.haskell.org Sat Jan 9 19:58:19 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 9 Jan 2016 19:58:19 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Add InjectiveTypeFamilies language extension (62ce23f) Message-ID: <20160109195819.D31503A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/62ce23f785fc735fa80f563d66db65e48bb0610d/ghc >--------------------------------------------------------------- commit 62ce23f785fc735fa80f563d66db65e48bb0610d Author: Jan Stolarek Date: Sat Jan 9 20:58:52 2016 +0100 Add InjectiveTypeFamilies language extension Previously injective type families were part of TypeFamilies. Now they are in a separate language extension. Test Plan: ./validate Reviewers: austin, bgamari, goldfire Reviewed By: bgamari Subscribers: goldfire, thomie Differential Revision: https://phabricator.haskell.org/D1750 GHC Trac Issues: #11381 (cherry picked from commit fbd6de2f0761b63a5f0a88ce0590f515d63790a4) >--------------------------------------------------------------- 62ce23f785fc735fa80f563d66db65e48bb0610d compiler/main/DynFlags.hs | 4 +++- compiler/typecheck/TcTyClsDecls.hs | 6 +++++- compiler/typecheck/TcValidity.hs | 2 +- docs/users_guide/glasgow_exts.rst | 3 +++ libraries/ghc-boot/GHC/LanguageExtensions.hs | 1 + testsuite/tests/driver/T11381.hs | 9 +++++++++ testsuite/tests/driver/T11381.stderr | 5 +++++ testsuite/tests/driver/T4437.hs | 3 ++- testsuite/tests/driver/all.T | 1 + testsuite/tests/ghci/scripts/T6018ghci.script | 2 +- testsuite/tests/ghci/scripts/T6018ghcifail.script | 2 +- testsuite/tests/ghci/scripts/T6018ghcirnfail.script | 2 +- testsuite/tests/th/T6018th.hs | 4 ++-- testsuite/tests/th/T8884.hs | 2 +- testsuite/tests/typecheck/should_compile/T6018.hs | 2 +- testsuite/tests/typecheck/should_compile/T6018.hs-boot | 2 +- testsuite/tests/typecheck/should_compile/T6018a.hs | 2 +- testsuite/tests/typecheck/should_fail/T10836.hs | 2 +- testsuite/tests/typecheck/should_fail/T6018Afail.hs | 2 +- testsuite/tests/typecheck/should_fail/T6018Bfail.hs | 2 +- testsuite/tests/typecheck/should_fail/T6018fail.hs | 2 +- testsuite/tests/typecheck/should_fail/T6018failclosed.hs | 4 ++-- testsuite/tests/typecheck/should_fail/T6018failclosed2.hs | 2 +- utils/mkUserGuidePart/Options/Language.hs | 8 ++++++++ 24 files changed, 54 insertions(+), 20 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 62ce23f785fc735fa80f563d66db65e48bb0610d From git at git.haskell.org Sat Jan 9 21:12:31 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 9 Jan 2016 21:12:31 +0000 (UTC) Subject: [commit: ghc] master: TrieMap: Minor documentation fix (4c9620f) Message-ID: <20160109211231.329713A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/4c9620fc0fd4d2fee7920633a8b03776a8f0948d/ghc >--------------------------------------------------------------- commit 4c9620fc0fd4d2fee7920633a8b03776a8f0948d Author: ?mer Sinan A?acan Date: Sat Jan 9 16:12:42 2016 -0500 TrieMap: Minor documentation fix >--------------------------------------------------------------- 4c9620fc0fd4d2fee7920633a8b03776a8f0948d compiler/coreSyn/TrieMap.hs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/compiler/coreSyn/TrieMap.hs b/compiler/coreSyn/TrieMap.hs index 5b34c9a..2b23b25 100644 --- a/compiler/coreSyn/TrieMap.hs +++ b/compiler/coreSyn/TrieMap.hs @@ -140,7 +140,7 @@ instance TrieMap UniqFM where {- ************************************************************************ * * - Lists + Maybes * * ************************************************************************ @@ -176,7 +176,14 @@ fdMaybe :: TrieMap m => (a -> b -> b) -> MaybeMap m a -> b -> b fdMaybe k m = foldMaybe k (mm_nothing m) . foldTM k (mm_just m) --------------------- +{- +************************************************************************ +* * + Lists +* * +************************************************************************ +-} + data ListMap m a = LM { lm_nil :: Maybe a , lm_cons :: m (ListMap m a) } From git at git.haskell.org Sun Jan 10 08:59:50 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 10 Jan 2016 08:59:50 +0000 (UTC) Subject: [commit: ghc] master: ghc.mk: Use Windows_Target instead of Windows_Host (b1c063b) Message-ID: <20160110085950.D8DE83A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/b1c063b47a6a4d078626f9a2d4b07cbb244de340/ghc >--------------------------------------------------------------- commit b1c063b47a6a4d078626f9a2d4b07cbb244de340 Author: Erik de Castro Lopo Date: Sun Jan 10 09:28:47 2016 +1000 ghc.mk: Use Windows_Target instead of Windows_Host This is a step towards building a Linux to Windows cross-compiler. Test Plan: Build on Linux and Windows Reviewers: bgamari, hvr, austin, Phyx Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1758 GHC Trac Issues: #10070 >--------------------------------------------------------------- b1c063b47a6a4d078626f9a2d4b07cbb244de340 ghc.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ghc.mk b/ghc.mk index 878ddc8..1d6f02b 100644 --- a/ghc.mk +++ b/ghc.mk @@ -428,11 +428,11 @@ PACKAGES_STAGE1 += deepseq PACKAGES_STAGE1 += bytestring PACKAGES_STAGE1 += containers -ifeq "$(Windows_Host)" "YES" +ifeq "$(Windows_Target)" "YES" PACKAGES_STAGE1 += Win32 endif PACKAGES_STAGE1 += time -ifeq "$(Windows_Host)" "NO" +ifeq "$(Windows_Target)" "NO" PACKAGES_STAGE1 += unix endif From git at git.haskell.org Sun Jan 10 12:41:50 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 10 Jan 2016 12:41:50 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: configure.ac: Bump version to 8.0.1 (a8568e0) Message-ID: <20160110124150.5FECE3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/a8568e0edfbfa0e05bb317dd60cf9a2a09f8fbf1/ghc >--------------------------------------------------------------- commit a8568e0edfbfa0e05bb317dd60cf9a2a09f8fbf1 Author: Ben Gamari Date: Sun Jan 10 13:38:54 2016 +0100 configure.ac: Bump version to 8.0.1 Was previously 8.0.0 >--------------------------------------------------------------- a8568e0edfbfa0e05bb317dd60cf9a2a09f8fbf1 configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 637d3cb..ea08cdc 100644 --- a/configure.ac +++ b/configure.ac @@ -13,7 +13,7 @@ dnl # see what flags are available. (Better yet, read the documentation!) # -AC_INIT([The Glorious Glasgow Haskell Compilation System], [8.0.0], [glasgow-haskell-bugs at haskell.org], [ghc]) +AC_INIT([The Glorious Glasgow Haskell Compilation System], [8.0.1], [glasgow-haskell-bugs at haskell.org], [ghc]) # Set this to YES for a released version, otherwise NO : ${RELEASE=NO} From git at git.haskell.org Mon Jan 11 10:22:21 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 11 Jan 2016 10:22:21 +0000 (UTC) Subject: [commit: ghc] master: Linker: Define ELF_64BIT for aarch64_HOST_ARCH (8e0c658) Message-ID: <20160111102221.BC4C33A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/8e0c658c7af47a9211e5bffdf36b09d7700427bb/ghc >--------------------------------------------------------------- commit 8e0c658c7af47a9211e5bffdf36b09d7700427bb Author: Erik de Castro Lopo Date: Mon Jan 11 08:55:56 2016 +1100 Linker: Define ELF_64BIT for aarch64_HOST_ARCH Test Plan: Build on x86_64 and AArch64 Reviewers: hvr, austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1759 >--------------------------------------------------------------- 8e0c658c7af47a9211e5bffdf36b09d7700427bb rts/Linker.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rts/Linker.c b/rts/Linker.c index d298179..6e20984 100644 --- a/rts/Linker.c +++ b/rts/Linker.c @@ -4181,6 +4181,8 @@ ocRunInit_PEi386 ( ObjectCode *oc ) # define ELF_64BIT #elif defined(ia64_HOST_ARCH) # define ELF_64BIT +#elif defined(aarch64_HOST_ARCH) +# define ELF_64BIT #endif #if !defined(openbsd_HOST_OS) From git at git.haskell.org Mon Jan 11 19:56:46 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 11 Jan 2016 19:56:46 +0000 (UTC) Subject: [commit: ghc] wip/rae: Fix #11355. (39532be) Message-ID: <20160111195646.DBEBC3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/rae Link : http://ghc.haskell.org/trac/ghc/changeset/39532bed3c8c81406cf00e544ac1db33ce94a3f3/ghc >--------------------------------------------------------------- commit 39532bed3c8c81406cf00e544ac1db33ce94a3f3 Author: Richard Eisenberg Date: Sat Jan 9 11:18:53 2016 -0500 Fix #11355. Previously, the check for impredicative type applications was in the wrong spot. Test case: typecheck/should_fail/T11355 >--------------------------------------------------------------- 39532bed3c8c81406cf00e544ac1db33ce94a3f3 compiler/typecheck/TcValidity.hs | 8 +++++++- testsuite/tests/typecheck/should_fail/T11355.hs | 5 +++++ testsuite/tests/typecheck/should_fail/T11355.stderr | 9 +++++++++ testsuite/tests/typecheck/should_fail/all.T | 1 + 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/compiler/typecheck/TcValidity.hs b/compiler/typecheck/TcValidity.hs index 79d3702..63118d0 100644 --- a/compiler/typecheck/TcValidity.hs +++ b/compiler/typecheck/TcValidity.hs @@ -291,6 +291,7 @@ checkValidType :: UserTypeCtxt -> Type -> TcM () checkValidType ctxt ty = do { traceTc "checkValidType" (ppr ty <+> text "::" <+> ppr (typeKind ty)) ; rankn_flag <- xoptM LangExt.RankNTypes + ; impred_flag <- xoptM LangExt.ImpredicativeTypes ; let gen_rank :: Rank -> Rank gen_rank r | rankn_flag = ArbitraryRank | otherwise = r @@ -310,7 +311,12 @@ checkValidType ctxt ty TySynCtxt _ -> rank0 ExprSigCtxt -> rank1 - TypeAppCtxt -> rank0 + TypeAppCtxt | impred_flag -> ArbitraryRank + | otherwise -> tyConArgMonoType + -- Normally, ImpredicativeTypes is handled in check_arg_type, + -- but visible type applications don't go through there. + -- So we do this check here. + FunSigCtxt {} -> rank1 InfSigCtxt _ -> ArbitraryRank -- Inferred type ConArgCtxt _ -> rank1 -- We are given the type of the entire diff --git a/testsuite/tests/typecheck/should_fail/T11355.hs b/testsuite/tests/typecheck/should_fail/T11355.hs new file mode 100644 index 0000000..4ec11d0 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T11355.hs @@ -0,0 +1,5 @@ +{-# LANGUAGE TypeApplications, RankNTypes #-} + +module T11355 where + +foo = const @_ @((forall a. a) -> forall a. a) () (id @(forall a. a)) diff --git a/testsuite/tests/typecheck/should_fail/T11355.stderr b/testsuite/tests/typecheck/should_fail/T11355.stderr new file mode 100644 index 0000000..cd3cc73 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T11355.stderr @@ -0,0 +1,9 @@ + +T11355.hs:5:7: error: + ? Illegal polymorphic or qualified type: forall (a1 :: TYPE t0). a1 + GHC doesn't yet support impredicative polymorphism + ? In the expression: + const @_ @((forall a. a) -> forall a. a) () (id @(forall a. a)) + In an equation for ?foo?: + foo + = const @_ @((forall a. a) -> forall a. a) () (id @(forall a. a)) diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T index 753708d..9e37227 100644 --- a/testsuite/tests/typecheck/should_fail/all.T +++ b/testsuite/tests/typecheck/should_fail/all.T @@ -400,3 +400,4 @@ test('T11274', normal, compile_fail, ['']) test('T10619', normal, compile_fail, ['']) test('T11347', normal, compile_fail, ['']) test('T11356', normal, compile_fail, ['']) +test('T11355', normal, compile_fail, ['']) From git at git.haskell.org Mon Jan 11 19:56:50 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 11 Jan 2016 19:56:50 +0000 (UTC) Subject: [commit: ghc] wip/rae: Test #11252 in ghci/scripts/T11252 (60b8d29) Message-ID: <20160111195650.196723A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/rae Link : http://ghc.haskell.org/trac/ghc/changeset/60b8d297e4d6358af761ff7ee25df9e7c111dac2/ghc >--------------------------------------------------------------- commit 60b8d297e4d6358af761ff7ee25df9e7c111dac2 Author: Richard Eisenberg Date: Sat Jan 9 11:26:14 2016 -0500 Test #11252 in ghci/scripts/T11252 This one worked for me out of the box. >--------------------------------------------------------------- 60b8d297e4d6358af761ff7ee25df9e7c111dac2 testsuite/tests/ghci/scripts/T11252.script | 3 +++ testsuite/tests/ghci/scripts/T11252.stdout | 1 + testsuite/tests/ghci/scripts/all.T | 1 + 3 files changed, 5 insertions(+) diff --git a/testsuite/tests/ghci/scripts/T11252.script b/testsuite/tests/ghci/scripts/T11252.script new file mode 100644 index 0000000..485cd8f --- /dev/null +++ b/testsuite/tests/ghci/scripts/T11252.script @@ -0,0 +1,3 @@ +:set -XTypeInType +data Proxy1 k (a :: k) = Proxy1 +:kind Proxy1 diff --git a/testsuite/tests/ghci/scripts/T11252.stdout b/testsuite/tests/ghci/scripts/T11252.stdout new file mode 100644 index 0000000..eddba45 --- /dev/null +++ b/testsuite/tests/ghci/scripts/T11252.stdout @@ -0,0 +1 @@ +Proxy1 :: forall k -> k -> * diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T index 06a9125..4618281 100755 --- a/testsuite/tests/ghci/scripts/all.T +++ b/testsuite/tests/ghci/scripts/all.T @@ -233,3 +233,4 @@ test('T10989', ghci_script, ['T10989.script']) test('T11098', normal, ghci_script, ['T11098.script']) test('T8316', expect_broken(8316), ghci_script, ['T8316.script']) +test('T11252', normal, ghci_script, ['T11252.script']) From git at git.haskell.org Mon Jan 11 19:56:52 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 11 Jan 2016 19:56:52 +0000 (UTC) Subject: [commit: ghc] wip/rae: Clarify topological sorting of spec vars in manual (9e59c7a) Message-ID: <20160111195652.C198B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/rae Link : http://ghc.haskell.org/trac/ghc/changeset/9e59c7a0c8d6a195bee9172b6cddb9dc6d3547e8/ghc >--------------------------------------------------------------- commit 9e59c7a0c8d6a195bee9172b6cddb9dc6d3547e8 Author: Richard Eisenberg Date: Sun Jan 10 19:10:03 2016 -0500 Clarify topological sorting of spec vars in manual This is mentioned in #11376. >--------------------------------------------------------------- 9e59c7a0c8d6a195bee9172b6cddb9dc6d3547e8 docs/users_guide/glasgow_exts.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index f53478d..4cbc36a 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -2215,6 +2215,15 @@ Here are the details: will have its type variables ordered as ``m, a, b, c``. +- If any of the variables depend on other variables (that is, if some + of the variables are *kind* variables), the variables are reordered + so that kind variables come before type variables, preserving the + left-to-right order as much as possible. That is, GHC performs a + stable topological sort on the variables. + + For example: if we have ``bar :: Proxy (a :: (j, k)) -> b``, then + the variables are ordered ``j``, ``k``, ``a``, ``b``. + - Class methods' type arguments include the class type variables, followed by any variables an individual method is polymorphic in. So, ``class Monad m where return :: a -> m a`` means From git at git.haskell.org Mon Jan 11 19:56:55 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 11 Jan 2016 19:56:55 +0000 (UTC) Subject: [commit: ghc] wip/rae: Fix #10872. (c51cd2f) Message-ID: <20160111195655.749133A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/rae Link : http://ghc.haskell.org/trac/ghc/changeset/c51cd2f425911836a853e385b23a150bf5434b69/ghc >--------------------------------------------------------------- commit c51cd2f425911836a853e385b23a150bf5434b69 Author: Richard Eisenberg Date: Sat Jan 9 16:59:05 2016 -0500 Fix #10872. This moves the duplicate-unique check from knownKeyNames (which omits TH) to allKnownKeyNames (which includes TH). >--------------------------------------------------------------- c51cd2f425911836a853e385b23a150bf5434b69 compiler/main/HscMain.hs | 33 ++++++++++++++++++++++++++++++--- compiler/prelude/PrelInfo.hs | 32 ++------------------------------ 2 files changed, 32 insertions(+), 33 deletions(-) diff --git a/compiler/main/HscMain.hs b/compiler/main/HscMain.hs index 7807f65..f8945b2 100644 --- a/compiler/main/HscMain.hs +++ b/compiler/main/HscMain.hs @@ -148,6 +148,8 @@ import DynFlags import ErrUtils import Outputable +import UniqFM +import NameEnv import HscStats ( ppSourceStats ) import HscTypes import FastString @@ -199,12 +201,37 @@ newHscEnv dflags = do allKnownKeyNames :: [Name] -- Put here to avoid loops involving DsMeta, -allKnownKeyNames = -- where templateHaskellNames are defined - knownKeyNames +allKnownKeyNames -- where templateHaskellNames are defined + | debugIsOn + , not (isNullUFM badNamesEnv) + = panic ("badAllKnownKeyNames:\n" ++ badNamesStr) + -- NB: We can't use ppr here, because this is sometimes evaluated in a + -- context where there are no DynFlags available, leading to a cryptic + -- "<
>" error. (This seems to happen only in the + -- stage 2 compiler, for reasons I [Richard] have no clue of.) + + | otherwise + = all_names + where + all_names = knownKeyNames #ifdef GHCI - ++ templateHaskellNames + ++ templateHaskellNames #endif + namesEnv = foldl (\m n -> extendNameEnv_Acc (:) singleton m n n) + emptyUFM all_names + badNamesEnv = filterNameEnv (\ns -> length ns > 1) namesEnv + badNamesPairs = nameEnvUniqueElts badNamesEnv + badNamesStrs = map pairToStr badNamesPairs + badNamesStr = unlines badNamesStrs + + pairToStr (uniq, ns) = " " ++ + show uniq ++ + ": [" ++ + intercalate ", " (map (occNameString . nameOccName) ns) ++ + "]" + + -- ----------------------------------------------------------------------------- getWarnings :: Hsc WarningMessages diff --git a/compiler/prelude/PrelInfo.hs b/compiler/prelude/PrelInfo.hs index 0651a2c..74005ed 100644 --- a/compiler/prelude/PrelInfo.hs +++ b/compiler/prelude/PrelInfo.hs @@ -34,18 +34,14 @@ import DataCon import Id import Name import MkId -import NameEnv import TysPrim import TysWiredIn import HscTypes -import UniqFM import Class import TyCon import Util -import Panic ( panic ) import {-# SOURCE #-} TcTypeNats ( typeNatTyCons ) -import Data.List ( intercalate ) import Data.Array {- @@ -81,19 +77,7 @@ knownKeyNames :: [Name] -- you get a Name with the correct known key -- (See Note [Known-key names] in PrelNames) knownKeyNames - | debugIsOn - , not (isNullUFM badNamesEnv) - = panic ("badKnownKeyNames:\n" ++ badNamesStr) - -- NB: We can't use ppr here, because this is sometimes evaluated in a - -- context where there are no DynFlags available, leading to a cryptic - -- "<
>" error. (This seems to happen only in the - -- stage 2 compiler, for reasons I [Richard] have no clue of.) - - | otherwise - = names - where - names = - concat [ tycon_kk_names funTyCon + = concat [ tycon_kk_names funTyCon , concatMap tycon_kk_names primTyCons , concatMap tycon_kk_names wiredInTyCons @@ -112,6 +96,7 @@ knownKeyNames , map (idName . primOpId) allThePrimOps , basicKnownKeyNames ] + where -- "kk" short for "known-key" tycon_kk_names :: TyCon -> [Name] tycon_kk_names tc = tyConName tc : (rep_names tc ++ concatMap thing_kk_names (implicitTyConThings tc)) @@ -133,19 +118,6 @@ knownKeyNames Just n -> [n] Nothing -> [] - namesEnv = foldl (\m n -> extendNameEnv_Acc (:) singleton m n n) - emptyUFM names - badNamesEnv = filterNameEnv (\ns -> length ns > 1) namesEnv - badNamesPairs = nameEnvUniqueElts badNamesEnv - badNamesStrs = map pairToStr badNamesPairs - badNamesStr = unlines badNamesStrs - - pairToStr (uniq, ns) = " " ++ - show uniq ++ - ": [" ++ - intercalate ", " (map (occNameString . nameOccName) ns) ++ - "]" - {- We let a lot of "non-standard" values be visible, so that we can make sense of them in interface pragmas. It's cool, though they all have From git at git.haskell.org Mon Jan 11 19:56:58 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 11 Jan 2016 19:56:58 +0000 (UTC) Subject: [commit: ghc] wip/rae: Test #11311 in dependent/should_run/T11311 (2b9c696) Message-ID: <20160111195658.A4A343A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/rae Link : http://ghc.haskell.org/trac/ghc/changeset/2b9c696af4fa960a5afa1b49f1982ba9e87ab5aa/ghc >--------------------------------------------------------------- commit 2b9c696af4fa960a5afa1b49f1982ba9e87ab5aa Author: Richard Eisenberg Date: Sat Jan 9 17:11:52 2016 -0500 Test #11311 in dependent/should_run/T11311 >--------------------------------------------------------------- 2b9c696af4fa960a5afa1b49f1982ba9e87ab5aa .../{annotations/should_compile => dependent/should_run}/Makefile | 0 testsuite/tests/dependent/should_run/T11311.hs | 8 ++++++++ testsuite/tests/dependent/should_run/all.T | 2 ++ 3 files changed, 10 insertions(+) diff --git a/testsuite/tests/annotations/should_compile/Makefile b/testsuite/tests/dependent/should_run/Makefile similarity index 100% copy from testsuite/tests/annotations/should_compile/Makefile copy to testsuite/tests/dependent/should_run/Makefile diff --git a/testsuite/tests/dependent/should_run/T11311.hs b/testsuite/tests/dependent/should_run/T11311.hs new file mode 100644 index 0000000..88f0e45 --- /dev/null +++ b/testsuite/tests/dependent/should_run/T11311.hs @@ -0,0 +1,8 @@ +module T11311 where + +import Data.Kind + +foo :: () +foo = (id :: * -> *) undefined `seq` () + +main = print foo diff --git a/testsuite/tests/dependent/should_run/all.T b/testsuite/tests/dependent/should_run/all.T new file mode 100755 index 0000000..e6c5a60 --- /dev/null +++ b/testsuite/tests/dependent/should_run/all.T @@ -0,0 +1,2 @@ + +test('T11311', normal, compile_and_run, ['']) From git at git.haskell.org Mon Jan 11 19:57:01 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 11 Jan 2016 19:57:01 +0000 (UTC) Subject: [commit: ghc] wip/rae: Fix #11254. (c9bb061) Message-ID: <20160111195701.CBF2B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/rae Link : http://ghc.haskell.org/trac/ghc/changeset/c9bb061dd2d173e3d5565d5ec352c8559f52820e/ghc >--------------------------------------------------------------- commit c9bb061dd2d173e3d5565d5ec352c8559f52820e Author: Richard Eisenberg Date: Mon Jan 11 14:47:49 2016 -0500 Fix #11254. This moves the call to tcSubType into the context of the checkInstConstraints call, allowing the deferred type error somewhere to hang its hat. >--------------------------------------------------------------- c9bb061dd2d173e3d5565d5ec352c8559f52820e compiler/typecheck/TcInstDcls.hs | 113 +++++++++++---------- .../tests/typecheck/should_compile/T11254.stderr | 25 +++++ testsuite/tests/typecheck/should_compile/all.T | 2 +- 3 files changed, 88 insertions(+), 52 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc c9bb061dd2d173e3d5565d5ec352c8559f52820e From git at git.haskell.org Mon Jan 11 19:57:04 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 11 Jan 2016 19:57:04 +0000 (UTC) Subject: [commit: ghc] wip/rae's head updated: Fix #11254. (c9bb061) Message-ID: <20160111195704.9DE183A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Branch 'wip/rae' now includes: 0fda908 Bump Haddock submodule again 8bf2d8f Linker: Fix cut-and-paste error in debug output 422107e T10518: Ensure literal has 64-bit type e39d10f testsuite/T8274: Remove 32-bit test output fb5d26d testsuite/codegen: Add missing dummy Makefiles 0b0652f testsuite/T9430: Fix word-size dependence b62215d Linker: Reenable Thumb support e8672e5 libraries/ghci: Implement mkJumpToAddr for ppc64 909bbdb Linker(ELF): Fix addProddableBlocks usage da5e693 testsuite/joao-circular: Clean up test results a3b34b6 Clean up a botched merge. d1ebbb0 testsuite/CmmSwitchTest: Mark as broken on 32-bit platforms 11778f7 Add testcase for getSizeofMutableByteArray# 07b3be7 integer-gmp: Fix #11296 bec5350 Adding flags: -ffull-guard-reasoning and too-many-guards c8d0af3 RTS: Detect powerpc64le as ELF 64-bit system 1b00016 The -package flag should select match from right-most package db. 0054bcd rts/Linker(ARM): Ensure all code sections are flushed from cache 01299ca Synchronise ghci-package version with ghc-package 4a10ecb Patch-level increment integer-gmp to 1.0.0.1 e01aa22 Patch-level increment integer-simple version 0.1.1.1 c7830bd Update hpc submodule to 0.6.0.3 version 3aa4a45 Update filepath submodule to v1.4.1.0 rls tag 295085c Update time submodule to latest snapshot bab5109 Make git-committer inferred version-date TZ-invariant 7fef7fe drop obsolete/redundant OPTIONS pragma [skip ci] af92ef3 ghc/Main: Update list of --print modes 4f69203 Fix panic when using pattern synonyms with DisambiguateRecordFields 5bb7fec Export some useful GHC API functions. 8e735fd Fix GEq1 when optimizations are enabled 2e49c8c users_guide: Move 7.12.1-notes to 8.0.1-notes 9cb79c5 Update a few references to GHC 7.12 b093e63 Modify getFullArgs to include program name df6cb57 Accept submodule libraries/primitive commit 1af89788d fcc7649 Introduce negative patterns for literals (addresses #11303) a1e01b6 testlib: Make TyCon normalization Python 2.6-compatible adcbc98 Add regression test for #11303 e4cc19d Update Cabal submodule to latest snapshot c6cab9d Remove `cabal07`-test broken by e4cc19de4bdbcc 34af60c testsuite: normalise away `ld`-warning on AIX c06b46d Fix #11305. 8fcf1e7 Make iserv-bin compatible with GHC version bump to 8.0 07779c2 T11303: Set maximum heap size 630303a users_guide/ghci: Fix heading 3bbc01a Testsuite: mark T7653 with high_memory_usage b0fa286 Fix some typos e9ab6d5 rts/PrimOps.cmm: fix UNREG profiled build d3a79bc rts/Linker.c: mark ia64 as 64-bit ELF, drop unused branches 0380a95 glasgow_exts.rst: fix code block 947c8a5 Bump GHC HEAD's Version from 7.11 to 8.1 bb7f2e3 Address #11245: Ensure the non-matched list is always non-empty 25e4556 Various API Annotations fixes 75851bf fix ghci build on ArchUnknown targets 0579fe9 Improve exprIsBottom 5ba3caa Comments only 70eefbc Test Trac #11245 351dea4 Drop redundant `-D__GLASGOW_HASKELL__=...` flag eae40e1 Use 0/1 instead of YES/NO as `__GLASGOW_HASKELL_TH__` macro value 0d20737 Drop redundant/explicit `=1` in `-DFOO=1` flags 2f923ce Drop pre-AMP compatibility CPP conditionals 3c8cb7f Remove some redundant definitions/constraints 12ee511 Remove ghc-7.8 `-package-name`-compat handling 37945c1 Simplify -fcmm-sink handling for Parser.hs 6a010b9 Update haskeline submodule to latest snapshot 8afeaad travis: use GHC 7.10.3 dafeb51 Canonicalise `MonadPlus` instances b469b30 Minor fix of MonadFail instance for `ReadPrec` ab0d733 Update Cabal submodule, Fixes #11326 f3cc345 Add strictness for runRW# 0b8dc7d API Annotations: AnnTilde missing 78daabc mk/config.mk.in: drop unused CONF_CC_OPTS for ia64 f5ad1f0 AnnDotDot missing for Pattern Synonym export 256c2cf Test Trac #11336 0490fed Linker: ARM: Ensure that cache flush covers all symbol extras d159a51 Linker: ARM: Refactor relocation handling 48e0f9c Linker: Make debugging output a bit more readable 07d127a Linker: Use contiguous mmapping on ARM d935d20 Omit TEST=T10697_decided_3 WAY=ghci 1dbc8d9 Add test for #10379 04f3524 Linker: ARM: Don't change to BLX if jump needed veneer c7d84d2 Update .mailmap [skip ci] 7e599f5 Linker: Move helpers to #ifdef da0f043 Rewrite Haddocks for GHC.Base.const 5c10f5c users_guide: Add ghci-cmd directive 4c56ad3 Build system: delete ghc-pwd 0acdcf2 Avoid generating guards for CoPats if possible (Addresses #11276) 1a8b752 Add (failing) test case for #11347 1f526d2 Release notes: Mention remote GHCi cdeefa4 ghc.mk: Add reference to Trac #5987 77494fa Remove -Wtoo-many-guards from default flags (fixes #11316) e32a6e1 Add Cabal synopses and descriptions bbee3e1 StgCmmForeign: Push local register creation into code generation bd702f4 StgCmmForeign: Break up long line aa699b9 Extend ghc environment file features 4dc4b84 relnotes: Note dropped support for Windows XP and earlier 852b603 Restore old GHC generics behavior vis-?-vis Fixity cac0795 Change Template Haskell representation of GADTs. 89ba83d Bump Cabal and Haddock to fix #11308 7861a22 Add a note describing the protocol for adding a language extension f01eb54 Fall back on ghc-stage2 when using Windows' GHCi driver 568736d users guide: Add documentation for custom compile-time errors 5040686 users guide: Add links to release notes 47367e0 Rewrite announce file 0a04837 users guide: Tweak wording of RTS -Nmax description 0839a66 Remove unused export 3f98045 Tiny refactor 97c49e9 Spelling in a comment 290a553 Tidy up tidySkolemInfo 4dda4ed Comment wibble 29b4632 Inline solveTopConstraints dc97096 Refactor simpl_top 02c1c57 Use an Implication in 'deriving' error a5cea73 Turn AThing into ATcTyCon, in TcTyThing 9915b65 Make demand analysis understand catch 1ee9229 Test Trac #10625 c78fedd Typos in docs and comments 6be09e8 Enable stack traces with ghci -fexternal-interpreter -prof 09425cb Support for qRecover in TH with -fexternal-interpreter 6f2e722 User's Guide: injective type families section 0163427 Fix Template Haskell's handling of infix GADT constructors 1abb700 Improve GHC.Event.IntTable performance c33e7c2 Fix +RTS -h when compiling without -prof 10769a1 Rename the test-way prof_h to normal_h 47ccf4d Add a pointer to the relevant paper for InScopeSet 2bd05b8 Docs for stack traces in GHCi f7b45c3 Build system: fix `pwd` issues on Windows 1cdf12c Fix test for T9367 (Windows) a6c3289 users_guide: Use semantic directive/role for command line options 86d0657 users-guide: A few fixes 8f60fd4 docs: Fix DeriveAnyClass reference in release notes and ANNOUNCE 67b5cec user-guide: More semantic markup 0dc2308 user-guide/safe_haskell: Fix typos a84c21e Reject import declaration with semicolon in GHCi 831102f Parser: delete rule numbers + validate shift/reduce conlicts 4405f9d Add failing testcase for #10603 5cb236d fix -ddump-splices to parenthesize ((\x -> x) a) correctly fbd6de2 Add InjectiveTypeFamilies language extension 4c9620f TrieMap: Minor documentation fix b1c063b ghc.mk: Use Windows_Target instead of Windows_Host 8e0c658 Linker: Define ELF_64BIT for aarch64_HOST_ARCH 39532be Fix #11355. 60b8d29 Test #11252 in ghci/scripts/T11252 c51cd2f Fix #10872. 2b9c696 Test #11311 in dependent/should_run/T11311 9e59c7a Clarify topological sorting of spec vars in manual c9bb061 Fix #11254. From git at git.haskell.org Mon Jan 11 20:28:29 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 11 Jan 2016 20:28:29 +0000 (UTC) Subject: [commit: ghc] wip/rae: Constrained types have kind * in validity check. (1040abc) Message-ID: <20160111202829.91A943A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/rae Link : http://ghc.haskell.org/trac/ghc/changeset/1040abc55541c0b7bd4c4da150ec240adffa301a/ghc >--------------------------------------------------------------- commit 1040abc55541c0b7bd4c4da150ec240adffa301a Author: Richard Eisenberg Date: Mon Jan 11 15:28:48 2016 -0500 Constrained types have kind * in validity check. This addresses #11405, but a deeper problem lurks. Try test dependent/should_compile/T11405 and see comment:3 on the ticket. >--------------------------------------------------------------- 1040abc55541c0b7bd4c4da150ec240adffa301a compiler/typecheck/TcValidity.hs | 7 ++++++- testsuite/tests/dependent/should_compile/T11405.hs | 9 +++++++++ testsuite/tests/dependent/should_compile/all.T | 1 + 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/compiler/typecheck/TcValidity.hs b/compiler/typecheck/TcValidity.hs index 63118d0..a89b783 100644 --- a/compiler/typecheck/TcValidity.hs +++ b/compiler/typecheck/TcValidity.hs @@ -452,12 +452,17 @@ check_type env ctxt rank ty -- but not type T = ?x::Int ; check_type env' ctxt rank tau -- Allow foralls to right of arrow - ; checkTcM (not (any (`elemVarSet` tyCoVarsOfType tau_kind) tvs)) + ; checkTcM (not (any (`elemVarSet` tyCoVarsOfType phi_kind) tvs)) (forAllEscapeErr env' ty tau_kind) } where (tvs, theta, tau) = tcSplitSigmaTy ty tau_kind = typeKind tau + + phi_kind | null theta = tau_kind + | otherwise = liftedTypeKind + -- If there are any constraints, the kind is *. (#11405) + (env', _) = tidyTyCoVarBndrs env tvs check_type _ _ _ (TyVarTy _) = return () diff --git a/testsuite/tests/dependent/should_compile/T11405.hs b/testsuite/tests/dependent/should_compile/T11405.hs new file mode 100644 index 0000000..f80d994 --- /dev/null +++ b/testsuite/tests/dependent/should_compile/T11405.hs @@ -0,0 +1,9 @@ +{-# LANGUAGE ImplicitParams, TypeInType, ExplicitForAll #-} + +module T11405 where + +import GHC.Exts +import GHC.Stack + +x :: forall (v :: Levity) (a :: TYPE v). (?callStack :: CallStack) => a +x = undefined diff --git a/testsuite/tests/dependent/should_compile/all.T b/testsuite/tests/dependent/should_compile/all.T index 1063b6e..ea671d0 100644 --- a/testsuite/tests/dependent/should_compile/all.T +++ b/testsuite/tests/dependent/should_compile/all.T @@ -11,3 +11,4 @@ test('mkGADTVars', normal, compile, ['']) test('TypeLevelVec',normal,compile, ['']) test('T9632', normal, compile, ['']) test('dynamic-paper', normal, compile, ['']) +test('T11405', normal, compile, ['']) From git at git.haskell.org Mon Jan 11 21:04:52 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 11 Jan 2016 21:04:52 +0000 (UTC) Subject: [commit: ghc] wip/aarch64-regd: configure.ac: AArch64 is now registerised (68eafd5) Message-ID: <20160111210452.D23473A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/aarch64-regd Link : http://ghc.haskell.org/trac/ghc/changeset/68eafd511a5849a23a8981668fc12db2615d0686/ghc >--------------------------------------------------------------- commit 68eafd511a5849a23a8981668fc12db2615d0686 Author: Erik de Castro Lopo Date: Sun Jul 5 11:22:24 2015 +0000 configure.ac: AArch64 is now registerised >--------------------------------------------------------------- 68eafd511a5849a23a8981668fc12db2615d0686 configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index e9bdeec..d581858 100644 --- a/configure.ac +++ b/configure.ac @@ -229,7 +229,7 @@ AC_SUBST(SOLARIS_BROKEN_SHLD) dnl ** Do an unregisterised build? dnl -------------------------------------------------------------- case "$HostArch" in - i386|x86_64|powerpc|powerpc64|powerpc64le|arm) + i386|x86_64|powerpc|powerpc64|powerpc64le|arm|aarch64) UnregisterisedDefault=NO ;; *) From git at git.haskell.org Mon Jan 11 21:04:55 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 11 Jan 2016 21:04:55 +0000 (UTC) Subject: [commit: ghc] wip/aarch64-regd: rts: Fix clobbered regs list for aarch64 StgRun (5d0dbab) Message-ID: <20160111210455.8159F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/aarch64-regd Link : http://ghc.haskell.org/trac/ghc/changeset/5d0dbab2b35c61817461e1997d5b08398e834667/ghc >--------------------------------------------------------------- commit 5d0dbab2b35c61817461e1997d5b08398e834667 Author: Erik de Castro Lopo Date: Wed Jun 3 05:54:23 2015 +0000 rts: Fix clobbered regs list for aarch64 StgRun >--------------------------------------------------------------- 5d0dbab2b35c61817461e1997d5b08398e834667 rts/StgCRun.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/rts/StgCRun.c b/rts/StgCRun.c index 0a010d4..9e80d02 100644 --- a/rts/StgCRun.c +++ b/rts/StgCRun.c @@ -829,8 +829,17 @@ StgRun(StgFunPtr f, StgRegTable *basereg) { : "=r" (r) : "r" (f), "r" (basereg), "i" (RESERVED_C_STACK_BYTES) - : "%x19", "%x20", "%x21", "%x22", "%x23", "%x24", "%x25", "%x26", "%x27", "%x28", - "%x16", "%x17", "%x30" + + : "%x16", "%x17", /* Exclude %r18 (platform/temporary register) */ + "%x19", "%x20", "%x21", "%x22", "%x23", "%x24", "%x25", + "%x26", "%x27", "%x28", /* Exclude %x29 (frame pointer) */ + "%x30", + "%d8", "%d9", "%d10", "%d11", "%d12", "%d13", "%d14", "%d15" + /* Since all these registers listed as clobbered are being explicitly + * saved and restored, they should probably not be listed as + * clobbered. Leaving them as is for now while I debug other + * issues. + */ ); return r; } From git at git.haskell.org Mon Jan 11 21:04:58 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 11 Jan 2016 21:04:58 +0000 (UTC) Subject: [commit: ghc] wip/aarch64-regd: Linker: WIP on supporting Arm64/AArch64 (31682d4) Message-ID: <20160111210458.335603A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/aarch64-regd Link : http://ghc.haskell.org/trac/ghc/changeset/31682d41f579e49968b924853e69fb0207c50488/ghc >--------------------------------------------------------------- commit 31682d41f579e49968b924853e69fb0207c50488 Author: Erik de Castro Lopo Date: Fri Oct 23 14:35:20 2015 +1100 Linker: WIP on supporting Arm64/AArch64 >--------------------------------------------------------------- 31682d41f579e49968b924853e69fb0207c50488 rts/Linker.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/rts/Linker.c b/rts/Linker.c index 6e20984..83b9c1e 100644 --- a/rts/Linker.c +++ b/rts/Linker.c @@ -4513,6 +4513,10 @@ ocVerifyImage_ELF ( ObjectCode* oc ) #elif defined(EM_AMD64) case EM_AMD64: IF_DEBUG(linker,debugBelch( "amd64" )); break; #endif +#ifdef EM_AARCH64 + case EM_AARCH64: IF_DEBUG(linker,debugBelch( "aarch64" )); break; +#endif + default: IF_DEBUG(linker,debugBelch( "unknown" )); errorBelch("%s: unknown architecture (e_machine == %d)" , oc->fileName, ehdr->e_machine); @@ -5332,7 +5336,7 @@ do_Elf_Rela_relocations ( ObjectCode* oc, char* ehdrC, #if defined(SHN_XINDEX) Elf_Word* shndx_table = get_shndx_table((Elf_Ehdr*)ehdrC); #endif -#if defined(DEBUG) || defined(sparc_HOST_ARCH) || defined(powerpc_HOST_ARCH) || defined(x86_64_HOST_ARCH) +#if defined(DEBUG) || defined(sparc_HOST_ARCH) || defined(powerpc_HOST_ARCH) || defined(x86_64_HOST_ARCH) || defined(aarch64_HOST_ARCH) /* This #ifdef only serves to avoid unused-var warnings. */ Elf_Addr targ = (Elf_Addr) oc->sections[target_shndx].start; #endif @@ -5350,7 +5354,7 @@ do_Elf_Rela_relocations ( ObjectCode* oc, char* ehdrC, } for (j = 0; j < nent; j++) { -#if defined(DEBUG) || defined(sparc_HOST_ARCH) || defined(powerpc_HOST_ARCH) || defined(x86_64_HOST_ARCH) +#if defined(DEBUG) || defined(sparc_HOST_ARCH) || defined(powerpc_HOST_ARCH) || defined(x86_64_HOST_ARCH) || defined(aarch64_HOST_ARCH) /* This #ifdef only serves to avoid unused-var warnings. */ Elf_Addr offset = rtab[j].r_offset; Elf_Addr P = targ + offset; @@ -5655,6 +5659,50 @@ do_Elf_Rela_relocations ( ObjectCode* oc, char* ehdrC, } #endif + case R_AARCH64_ABS64: + puts ("\n\nAArch64: ELF relocation(RelA) R_AARCH64_ABS64"); + *(Elf64_Xword *)P = S + A; + break; + + case R_AARCH64_ADR_PREL_PG_HI21: + puts ("\n\nAArch64: ELF relocation(RelA) R_AARCH64_ADR_PREL_PG_HI21"); + { + uint64_t final_address = (uint64_t) rtab + rtab[j].r_offset ; + // Operation: Page(S+A) - Page(P) + uint64_t result = ((S + A) & ~0xfffULL) - (final_address & ~0xfffULL); + +printf ("ehdrC: %p\nrtab : %p\n\n", ehdrC, rtab) ; + +printf ("rtab 0x%lx + 0x%lx -> 0x%lx\n", (uint64_t) rtab, (uint64_t) rtab[j].r_offset, final_address) ; +printf ("S 0x%lx + A 0x%lx : 0x%lx\n", S, A, S + A) ; +printf ("result 0x%lx\n", result) ; + + // Check that -2^32 <= X < 2^32 + if (result >> 32) + barf ("%s: overflow check failed for relocation", oc->fileName); + + *(Elf64_Xword *)P &= 0x9f00001fU; + // Immediate goes in bits 30:29 + 5:23 of ADRP instruction, taken + // from bits 32:12 of X. + *(Elf64_Xword *)P |= ((result & 0x3000U) << (29 - 12)); + *(Elf64_Xword *)P |= ((result & 0x1ffffc000ULL) >> (14 - 5)); + } + break; + + case R_AARCH64_CALL26: + case R_AARCH64_JUMP26: + puts ("\n\nAArch64: ELF relocation(RelA) R_AARCH64_CALL26/JUMP64"); + { + // These two are handled in the same way. + } + break; + + case R_AARCH64_ADD_ABS_LO12_NC: + puts ("\n\nAArch64: ELF relocation(RelA) R_AARCH64_ADD_ABS_LO12_NC"); + { + } + break; + default: errorBelch("%s: unhandled ELF relocation(RelA) type %" FMT_Word "\n", oc->fileName, (W_)ELF_R_TYPE(info)); From git at git.haskell.org Mon Jan 11 21:05:01 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 11 Jan 2016 21:05:01 +0000 (UTC) Subject: [commit: ghc] wip/aarch64-regd's head updated: Linker: WIP on supporting Arm64/AArch64 (31682d4) Message-ID: <20160111210501.64DEF3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Branch 'wip/aarch64-regd' now includes: ff3f918 Fix #11256 by not immediately erroring if we can't find a module. 2dff6c1 Added missing instances for Identity and Const (#11210) 1fcdcae testsuite/ClassOperator: Mark as compile_fail instead of should_fail fb3302c base: Add sections to changelog 083b700 users_guide: Synchronize relnotes with base changelog c12fc2e Update hoopl submodule to final 3.10.2.1 release aa7fb9a Fix GHCi segfault in Windows 32bit ff92395 Make HsAppsType contents Located 44de66b Update Cabal submodule to latest snapshot ea3f733 Comments only, about coercion holes b407bd7 Retain AnnTilde in splitTildeApps f975b0b Rework Template Haskell's handling of strictness 6eabd93 Update stm submodule to v2.4.4.1 release 29928f2 Fix grouping for pattern synonyms f40e122 Fix typechecking for pattern synonym signatures 51d8330 Remove duplicate T11224 test definition 7966eea Localize API Annotation in LInjectivtyAnn 01b0461 Remove another duplicate test 575a98e Refactor named wildcards (again) 721d56d APIAnnotations:AnnComma in wrong place in qcnames1 d3ce417 Tweak comments around UnivCos. 21b25df CoercionN is not in scope in TyCoRep 998739d Refactor package flags into several distinct types. 1faf1fc Implement -hide-all-plugin-packages and -plugin-package(-id), fixing #11244 3e99980 Update filepath submodule to latest snapshot 5f08681 - fix tests on OpenBSD which requires _DYNAMIC symbol 48e0634 Revert "Allow as-patterns in pattern synonym declarations." b55ad1b Wibble to error message in Trac #10426 1963250 Comments and white space c069be8 Add a pattern-syn form of PromotionErr 99eb002 Comments only 6eb9dc9 Tidy up and comment wildcards in family instances ed213ea Test Trac #11274 7ed0da6 Modify Nmax to maxN Trac #10728 dab8e34 Delete incorrect *-ws-32 expected test output 84f6739 - fix gc_thread related compilation failure on Solaris/i386 platform f13de71 Fix super-class cycle check b37f216 Comments only 7824870 Fix ASSERT in buildPatSyn, and T10897 test 380b25e Allow CallStacks to be frozen cb989e2 API Annotaions:add name in PatBind Match d1e9f82 Update tests for Trac #11039 f141f41 Test #10432 7cddcde Docs: -interactive-print should reside in registered package 3221599 Make testsuite work again with Py3 353e97a config.mk.in: Disable stripping by default on ARM 3017cbc ghc-cabal: Bring back TRANSITIVE_DEP_NAMES 6ec236b Improve SimplUtils.interestingArg d990354 Improve the runRW magic in CorePrep fcc7498 Improve tracing a bit in CoreSubst 1af0d36 Refactoring only e338376 Fix normalisation of TyCon representations 48db13d Don't drop last char of file if -osuf contains dot 2db18b8 Visible type application 2032635 Testsuite: fix qq005 and qq006 (#11279) bc8cac1 Testsuite: mark T7681 expect_broken (#11287) 5e4e9e0 Fix #11255. bd7ab66 Test #11254 in typecheck/should_compile/T11254 1411eaf Note [TyBinder] in TyCoRep 52da6bd Have mkCastTy look more closely for reflexivity. da69358 Fix #11287. b218241 Test #10589 in typecheck/should_compile/T10589 05e3541 Test #10619 in typecheck/should_fail/T10619 0fda908 Bump Haddock submodule again 8bf2d8f Linker: Fix cut-and-paste error in debug output 422107e T10518: Ensure literal has 64-bit type e39d10f testsuite/T8274: Remove 32-bit test output fb5d26d testsuite/codegen: Add missing dummy Makefiles 0b0652f testsuite/T9430: Fix word-size dependence b62215d Linker: Reenable Thumb support e8672e5 libraries/ghci: Implement mkJumpToAddr for ppc64 909bbdb Linker(ELF): Fix addProddableBlocks usage da5e693 testsuite/joao-circular: Clean up test results a3b34b6 Clean up a botched merge. d1ebbb0 testsuite/CmmSwitchTest: Mark as broken on 32-bit platforms 11778f7 Add testcase for getSizeofMutableByteArray# 07b3be7 integer-gmp: Fix #11296 bec5350 Adding flags: -ffull-guard-reasoning and too-many-guards c8d0af3 RTS: Detect powerpc64le as ELF 64-bit system 1b00016 The -package flag should select match from right-most package db. 0054bcd rts/Linker(ARM): Ensure all code sections are flushed from cache 01299ca Synchronise ghci-package version with ghc-package 4a10ecb Patch-level increment integer-gmp to 1.0.0.1 e01aa22 Patch-level increment integer-simple version 0.1.1.1 c7830bd Update hpc submodule to 0.6.0.3 version 3aa4a45 Update filepath submodule to v1.4.1.0 rls tag 295085c Update time submodule to latest snapshot bab5109 Make git-committer inferred version-date TZ-invariant 7fef7fe drop obsolete/redundant OPTIONS pragma [skip ci] af92ef3 ghc/Main: Update list of --print modes 4f69203 Fix panic when using pattern synonyms with DisambiguateRecordFields 5bb7fec Export some useful GHC API functions. 8e735fd Fix GEq1 when optimizations are enabled 2e49c8c users_guide: Move 7.12.1-notes to 8.0.1-notes 9cb79c5 Update a few references to GHC 7.12 b093e63 Modify getFullArgs to include program name df6cb57 Accept submodule libraries/primitive commit 1af89788d fcc7649 Introduce negative patterns for literals (addresses #11303) a1e01b6 testlib: Make TyCon normalization Python 2.6-compatible adcbc98 Add regression test for #11303 e4cc19d Update Cabal submodule to latest snapshot c6cab9d Remove `cabal07`-test broken by e4cc19de4bdbcc 34af60c testsuite: normalise away `ld`-warning on AIX c06b46d Fix #11305. 8fcf1e7 Make iserv-bin compatible with GHC version bump to 8.0 07779c2 T11303: Set maximum heap size 630303a users_guide/ghci: Fix heading 3bbc01a Testsuite: mark T7653 with high_memory_usage b0fa286 Fix some typos e9ab6d5 rts/PrimOps.cmm: fix UNREG profiled build d3a79bc rts/Linker.c: mark ia64 as 64-bit ELF, drop unused branches 0380a95 glasgow_exts.rst: fix code block 947c8a5 Bump GHC HEAD's Version from 7.11 to 8.1 bb7f2e3 Address #11245: Ensure the non-matched list is always non-empty 25e4556 Various API Annotations fixes 75851bf fix ghci build on ArchUnknown targets 0579fe9 Improve exprIsBottom 5ba3caa Comments only 70eefbc Test Trac #11245 351dea4 Drop redundant `-D__GLASGOW_HASKELL__=...` flag eae40e1 Use 0/1 instead of YES/NO as `__GLASGOW_HASKELL_TH__` macro value 0d20737 Drop redundant/explicit `=1` in `-DFOO=1` flags 2f923ce Drop pre-AMP compatibility CPP conditionals 3c8cb7f Remove some redundant definitions/constraints 12ee511 Remove ghc-7.8 `-package-name`-compat handling 37945c1 Simplify -fcmm-sink handling for Parser.hs 6a010b9 Update haskeline submodule to latest snapshot 8afeaad travis: use GHC 7.10.3 dafeb51 Canonicalise `MonadPlus` instances b469b30 Minor fix of MonadFail instance for `ReadPrec` ab0d733 Update Cabal submodule, Fixes #11326 f3cc345 Add strictness for runRW# 0b8dc7d API Annotations: AnnTilde missing 78daabc mk/config.mk.in: drop unused CONF_CC_OPTS for ia64 f5ad1f0 AnnDotDot missing for Pattern Synonym export 256c2cf Test Trac #11336 0490fed Linker: ARM: Ensure that cache flush covers all symbol extras d159a51 Linker: ARM: Refactor relocation handling 48e0f9c Linker: Make debugging output a bit more readable 07d127a Linker: Use contiguous mmapping on ARM d935d20 Omit TEST=T10697_decided_3 WAY=ghci 1dbc8d9 Add test for #10379 04f3524 Linker: ARM: Don't change to BLX if jump needed veneer c7d84d2 Update .mailmap [skip ci] 7e599f5 Linker: Move helpers to #ifdef da0f043 Rewrite Haddocks for GHC.Base.const 5c10f5c users_guide: Add ghci-cmd directive 4c56ad3 Build system: delete ghc-pwd 0acdcf2 Avoid generating guards for CoPats if possible (Addresses #11276) 1a8b752 Add (failing) test case for #11347 1f526d2 Release notes: Mention remote GHCi cdeefa4 ghc.mk: Add reference to Trac #5987 77494fa Remove -Wtoo-many-guards from default flags (fixes #11316) e32a6e1 Add Cabal synopses and descriptions bbee3e1 StgCmmForeign: Push local register creation into code generation bd702f4 StgCmmForeign: Break up long line aa699b9 Extend ghc environment file features 4dc4b84 relnotes: Note dropped support for Windows XP and earlier 852b603 Restore old GHC generics behavior vis-?-vis Fixity cac0795 Change Template Haskell representation of GADTs. 89ba83d Bump Cabal and Haddock to fix #11308 7861a22 Add a note describing the protocol for adding a language extension f01eb54 Fall back on ghc-stage2 when using Windows' GHCi driver 568736d users guide: Add documentation for custom compile-time errors 5040686 users guide: Add links to release notes 47367e0 Rewrite announce file 0a04837 users guide: Tweak wording of RTS -Nmax description 0839a66 Remove unused export 3f98045 Tiny refactor 97c49e9 Spelling in a comment 290a553 Tidy up tidySkolemInfo 4dda4ed Comment wibble 29b4632 Inline solveTopConstraints dc97096 Refactor simpl_top 02c1c57 Use an Implication in 'deriving' error a5cea73 Turn AThing into ATcTyCon, in TcTyThing 9915b65 Make demand analysis understand catch 1ee9229 Test Trac #10625 c78fedd Typos in docs and comments 6be09e8 Enable stack traces with ghci -fexternal-interpreter -prof 09425cb Support for qRecover in TH with -fexternal-interpreter 6f2e722 User's Guide: injective type families section 0163427 Fix Template Haskell's handling of infix GADT constructors 1abb700 Improve GHC.Event.IntTable performance c33e7c2 Fix +RTS -h when compiling without -prof 10769a1 Rename the test-way prof_h to normal_h 47ccf4d Add a pointer to the relevant paper for InScopeSet 2bd05b8 Docs for stack traces in GHCi f7b45c3 Build system: fix `pwd` issues on Windows 1cdf12c Fix test for T9367 (Windows) a6c3289 users_guide: Use semantic directive/role for command line options 86d0657 users-guide: A few fixes 8f60fd4 docs: Fix DeriveAnyClass reference in release notes and ANNOUNCE 67b5cec user-guide: More semantic markup 0dc2308 user-guide/safe_haskell: Fix typos a84c21e Reject import declaration with semicolon in GHCi 831102f Parser: delete rule numbers + validate shift/reduce conlicts 4405f9d Add failing testcase for #10603 5cb236d fix -ddump-splices to parenthesize ((\x -> x) a) correctly fbd6de2 Add InjectiveTypeFamilies language extension 4c9620f TrieMap: Minor documentation fix b1c063b ghc.mk: Use Windows_Target instead of Windows_Host 8e0c658 Linker: Define ELF_64BIT for aarch64_HOST_ARCH 5d0dbab rts: Fix clobbered regs list for aarch64 StgRun 68eafd5 configure.ac: AArch64 is now registerised 31682d4 Linker: WIP on supporting Arm64/AArch64 From git at git.haskell.org Mon Jan 11 22:43:10 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 11 Jan 2016 22:43:10 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: configure.ac: Bump down version number (497454f) Message-ID: <20160111224310.1C26F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/497454fc6610d67a2b2cd7902390c6497bddb483/ghc >--------------------------------------------------------------- commit 497454fc6610d67a2b2cd7902390c6497bddb483 Author: Ben Gamari Date: Mon Jan 11 10:48:03 2016 +0100 configure.ac: Bump down version number To ensure that the release candidate version has the correct lexicographic relation to the release. >--------------------------------------------------------------- 497454fc6610d67a2b2cd7902390c6497bddb483 configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index ea08cdc..637d3cb 100644 --- a/configure.ac +++ b/configure.ac @@ -13,7 +13,7 @@ dnl # see what flags are available. (Better yet, read the documentation!) # -AC_INIT([The Glorious Glasgow Haskell Compilation System], [8.0.1], [glasgow-haskell-bugs at haskell.org], [ghc]) +AC_INIT([The Glorious Glasgow Haskell Compilation System], [8.0.0], [glasgow-haskell-bugs at haskell.org], [ghc]) # Set this to YES for a released version, otherwise NO : ${RELEASE=NO} From git at git.haskell.org Tue Jan 12 20:58:40 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 12 Jan 2016 20:58:40 +0000 (UTC) Subject: [commit: ghc] master: fix typo causing compilation failure on SPARC (ArchSparc -> ArchSPARC) (00c8076) Message-ID: <20160112205840.34D6B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/00c8076ecf441e6be5cacafc78a98f7ab38ddad4/ghc >--------------------------------------------------------------- commit 00c8076ecf441e6be5cacafc78a98f7ab38ddad4 Author: Karel Gardas Date: Tue Jan 12 21:58:50 2016 +0100 fix typo causing compilation failure on SPARC (ArchSparc -> ArchSPARC) >--------------------------------------------------------------- 00c8076ecf441e6be5cacafc78a98f7ab38ddad4 libraries/ghci/GHCi/InfoTable.hsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/ghci/GHCi/InfoTable.hsc b/libraries/ghci/GHCi/InfoTable.hsc index cc57aff..7e1f8bc 100644 --- a/libraries/ghci/GHCi/InfoTable.hsc +++ b/libraries/ghci/GHCi/InfoTable.hsc @@ -71,7 +71,7 @@ data Arch = ArchSPARC platform :: Arch platform = #if defined(sparc_HOST_ARCH) - ArchSparc + ArchSPARC #elif defined(powerpc_HOST_ARCH) ArchPPC #elif defined(i386_HOST_ARCH) From git at git.haskell.org Wed Jan 13 13:06:26 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 13 Jan 2016 13:06:26 +0000 (UTC) Subject: [commit: ghc] master: Add -prof stack trace to assert (6cb860a) Message-ID: <20160113130626.C9E543A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/6cb860a9a154847906868ac0be93d750f99dac86/ghc >--------------------------------------------------------------- commit 6cb860a9a154847906868ac0be93d750f99dac86 Author: Simon Marlow Date: Mon Jan 11 18:30:29 2016 +0000 Add -prof stack trace to assert Summary: So that assertion failures have full call stack information attached when using `ghc -fexternal-interpreter -prof`. Here's one I just collected by inserting a dummy assert in Happy: ``` *** Exception: Assertion failed CallStack (from ImplicitParams): assert, called at ./First.lhs:37:11 in main:First CallStack (from -prof): First.mkFirst (First.lhs:37:11-27) First.mkFirst (First.lhs:37:11-93) Main.main2.runParserGen.first (Main.lhs:107:48-56) Main.main2.runParserGen.first (Main.lhs:107:27-57) Main.main2.runParserGen (Main.lhs:(96,9)-(276,9)) Main.main2.runParserGen (Main.lhs:(90,9)-(276,10)) Main.main2.runParserGen (Main.lhs:(86,9)-(276,10)) Main.main2.runParserGen (Main.lhs:(85,9)-(276,10)) Main.main2 (Main.lhs:74:20-43) Main.main2 (Main.lhs:(64,9)-(78,61)) Main.main (Main.lhs:57:9-18) ``` Test Plan: validate Reviewers: erikd, hvr, austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1765 GHC Trac Issues: #11047 >--------------------------------------------------------------- 6cb860a9a154847906868ac0be93d750f99dac86 libraries/base/GHC/Exception.hs | 3 ++- libraries/base/GHC/IO/Exception.hs | 12 +++++++++--- libraries/base/GHC/Stack/CCS.hsc | 3 ++- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/libraries/base/GHC/Exception.hs b/libraries/base/GHC/Exception.hs index 80761ad..6c579f0 100644 --- a/libraries/base/GHC/Exception.hs +++ b/libraries/base/GHC/Exception.hs @@ -28,7 +28,8 @@ module GHC.Exception , divZeroException, overflowException, ratioZeroDenomException , errorCallException, errorCallWithCallStackException -- re-export CallStack and SrcLoc from GHC.Types - , CallStack, getCallStack, prettyCallStack + , CallStack, getCallStack, prettyCallStack, prettyCallStackLines + , showCCSStack , SrcLoc(..), prettySrcLoc ) where diff --git a/libraries/base/GHC/IO/Exception.hs b/libraries/base/GHC/IO/Exception.hs index 933ce94..c7bccb0 100644 --- a/libraries/base/GHC/IO/Exception.hs +++ b/libraries/base/GHC/IO/Exception.hs @@ -51,6 +51,8 @@ import GHC.Show import GHC.Read import GHC.Exception import GHC.IO.Handle.Types +import GHC.OldList ( intercalate ) +import {-# SOURCE #-} GHC.Stack.CCS import Foreign.C.Types import Data.Typeable ( cast ) @@ -355,9 +357,13 @@ instance Show IOException where assertError :: (?callStack :: CallStack) => Bool -> a -> a assertError predicate v | predicate = lazy v - | otherwise = throw (AssertionFailed - ("Assertion failed\n" - ++ prettyCallStack ?callStack)) + | otherwise = unsafeDupablePerformIO $ do + ccsStack <- currentCallStack + let + implicitParamCallStack = prettyCallStackLines ?callStack + ccsCallStack = showCCSStack ccsStack + stack = intercalate "\n" $ implicitParamCallStack ++ ccsCallStack + throwIO (AssertionFailed ("Assertion failed\n" ++ stack)) unsupportedOperation :: IOError unsupportedOperation = diff --git a/libraries/base/GHC/Stack/CCS.hsc b/libraries/base/GHC/Stack/CCS.hsc index d40d92d..bab9f75 100644 --- a/libraries/base/GHC/Stack/CCS.hsc +++ b/libraries/base/GHC/Stack/CCS.hsc @@ -116,4 +116,5 @@ whoCreated obj = do ccsToStrings ccs renderStack :: [String] -> String -renderStack strs = "Stack trace:" ++ concatMap ("\n "++) (reverse strs) +renderStack strs = + "CallStack (from -prof):" ++ concatMap ("\n "++) (reverse strs) From git at git.haskell.org Wed Jan 13 13:06:29 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 13 Jan 2016 13:06:29 +0000 (UTC) Subject: [commit: ghc] master: A little closer to supporting breakpoints with -fexternal-interpreter (3e796e1) Message-ID: <20160113130629.7B64C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/3e796e1ae8b13ec1c607a1864894171a58cef592/ghc >--------------------------------------------------------------- commit 3e796e1ae8b13ec1c607a1864894171a58cef592 Author: Simon Marlow Date: Wed Jan 13 09:13:14 2016 +0000 A little closer to supporting breakpoints with -fexternal-interpreter Summary: Moves getIdValFromApStack to the server, and removes one use of wormhole. Test Plan: validate Reviewers: bgamari, niteria, austin, hvr, erikd Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1768 GHC Trac Issues: #11100 >--------------------------------------------------------------- 3e796e1ae8b13ec1c607a1864894171a58cef592 compiler/ghci/GHCi.hs | 44 +++++++++++-------- compiler/main/InteractiveEval.hs | 17 ++------ libraries/ghci/GHCi/Message.hs | 94 ++++++++++++++++++++++------------------ libraries/ghci/GHCi/Run.hs | 16 ++++++- 4 files changed, 94 insertions(+), 77 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 3e796e1ae8b13ec1c607a1864894171a58cef592 From git at git.haskell.org Wed Jan 13 14:22:22 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 13 Jan 2016 14:22:22 +0000 (UTC) Subject: [commit: ghc] master: Use implicit CallStacks for ASSERT when available (88d6d5a) Message-ID: <20160113142222.3AF5B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/88d6d5aae2ae86646084f3a060ae911eff589b7a/ghc >--------------------------------------------------------------- commit 88d6d5aae2ae86646084f3a060ae911eff589b7a Author: Bartosz Nitka Date: Wed Jan 13 14:44:58 2016 +0100 Use implicit CallStacks for ASSERT when available This aids with debugging, since all you have to do to get more stack frames is add a constraint `(?callStack :: CallStack) =>`. Old output: ``` ghc-stage2: panic! (the 'impossible' happened) (GHC version 8.1.20160107 for x86_64-unknown-linux): ASSERT failed! file compiler/types/TyCoRep.hs line 1800 InScope [] [Xuv :-> n_av5[sk]] [] ``` New output: ``` ghc-stage2: panic! (the 'impossible' happened) (GHC version 8.1.20160107 for x86_64-unknown-linux): ASSERT failed! CallStack (from ImplicitParams): assertPprPanic, called at compiler/types/TyCoRep.hs:1800:95 in ghc:TyCoRep InScope [] [Xuv :-> n_av5[sk]] [] ``` Test Plan: harbormaster manual testing Reviewers: austin, gridaphobe, bgamari Reviewed By: gridaphobe, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1751 >--------------------------------------------------------------- 88d6d5aae2ae86646084f3a060ae911eff589b7a compiler/utils/Outputable.hs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/compiler/utils/Outputable.hs b/compiler/utils/Outputable.hs index c3bdf5e..35a59c6 100644 --- a/compiler/utils/Outputable.hs +++ b/compiler/utils/Outputable.hs @@ -1096,15 +1096,24 @@ warnPprTrace True file line msg x where heading = hsep [text "WARNING: file", text file <> comma, text "line", int line] +-- | Panic with an assertation failure, recording the given file and +-- line number. Should typically be accessed with the ASSERT family of macros +#if __GLASGOW_HASKELL__ > 710 +assertPprPanic :: (?callStack :: CallStack) => String -> Int -> SDoc -> a +assertPprPanic _file _line msg + = pprPanic "ASSERT failed!" doc + where + doc = sep [ text (prettyCallStack ?callStack) + , msg ] +#else assertPprPanic :: String -> Int -> SDoc -> a --- ^ Panic with an assertation failure, recording the given file and line number. --- Should typically be accessed with the ASSERT family of macros assertPprPanic file line msg = pprPanic "ASSERT failed!" doc where doc = sep [ hsep [ text "file", text file , text "line", int line ] , msg ] +#endif pprDebugAndThen :: DynFlags -> (String -> a) -> SDoc -> SDoc -> a pprDebugAndThen dflags cont heading pretty_msg From git at git.haskell.org Wed Jan 13 14:22:24 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 13 Jan 2016 14:22:24 +0000 (UTC) Subject: [commit: ghc] master: TemplateHaskell: revive isStrict, notStrict and unpacked (d44bc5c) Message-ID: <20160113142224.D21033A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d44bc5c061e3f0ba459f835aba683c0366187b74/ghc >--------------------------------------------------------------- commit d44bc5c061e3f0ba459f835aba683c0366187b74 Author: Thomas Miedema Date: Wed Jan 13 14:45:21 2016 +0100 TemplateHaskell: revive isStrict, notStrict and unpacked These 3 functions are useful to keep around a bit longer, to prevent breaking existing code that uses them. Related to #10697. Reviewers: austin, goldfire, RyanGlScott, bgamari Reviewed By: RyanGlScott, bgamari Differential Revision: https://phabricator.haskell.org/D1761 >--------------------------------------------------------------- d44bc5c061e3f0ba459f835aba683c0366187b74 libraries/template-haskell/Language/Haskell/TH.hs | 1 + libraries/template-haskell/Language/Haskell/TH/Lib.hs | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/libraries/template-haskell/Language/Haskell/TH.hs b/libraries/template-haskell/Language/Haskell/TH.hs index 1988286..2f750e3 100644 --- a/libraries/template-haskell/Language/Haskell/TH.hs +++ b/libraries/template-haskell/Language/Haskell/TH.hs @@ -125,6 +125,7 @@ module Language.Haskell.TH( -- **** Strictness noSourceUnpackedness, sourceNoUnpack, sourceUnpack, noSourceStrictness, sourceLazy, sourceStrict, + isStrict, notStrict, unpacked, bang, bangType, varBangType, strictType, varStrictType, -- **** Class Contexts cxt, classP, equalP, diff --git a/libraries/template-haskell/Language/Haskell/TH/Lib.hs b/libraries/template-haskell/Language/Haskell/TH/Lib.hs index a024864..81ef1fc 100644 --- a/libraries/template-haskell/Language/Haskell/TH/Lib.hs +++ b/libraries/template-haskell/Language/Haskell/TH/Lib.hs @@ -656,6 +656,20 @@ noSourceStrictness = return NoSourceStrictness sourceLazy = return SourceLazy sourceStrict = return SourceStrict +{-# DEPRECATED isStrict + ["Use 'bang'. See https://ghc.haskell.org/trac/ghc/wiki/Migration/8.0. ", + "Example usage: 'bang noSourceUnpackedness sourceStrict'"] #-} +{-# DEPRECATED notStrict + ["Use 'bang'. See https://ghc.haskell.org/trac/ghc/wiki/Migration/8.0. ", + "Example usage: 'bang noSourceUnpackedness noSourceStrictness'"] #-} +{-# DEPRECATED unpacked + ["Use 'bang'. See https://ghc.haskell.org/trac/ghc/wiki/Migration/8.0. ", + "Example usage: 'bang sourceUnpack sourceStrict'"] #-} +isStrict, notStrict, unpacked :: Q Strict +isStrict = bang noSourceUnpackedness sourceStrict +notStrict = bang noSourceUnpackedness noSourceStrictness +unpacked = bang sourceUnpack sourceStrict + bang :: SourceUnpackednessQ -> SourceStrictnessQ -> BangQ bang u s = do u' <- u s' <- s From git at git.haskell.org Wed Jan 13 14:22:27 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 13 Jan 2016 14:22:27 +0000 (UTC) Subject: [commit: ghc] master: Add missing type representations (ac3cf68) Message-ID: <20160113142227.969683A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/ac3cf68c378410724973e64be7198bb8720a6809/ghc >--------------------------------------------------------------- commit ac3cf68c378410724973e64be7198bb8720a6809 Author: Ben Gamari Date: Wed Jan 13 14:53:02 2016 +0100 Add missing type representations Previously we were missing `Typeable` representations for several wired-in types (and their promoted constructors). These include, * `Nat` * `Symbol` * `':` * `'[]` Moreover, some constructors were incorrectly identified as being defined in `GHC.Types` whereas they were in fact defined in `GHC.Prim`. Ultimately this is just a temporary band-aid as there is general agreement that we should eliminate the manual definition of these representations entirely. Test Plan: Validate Reviewers: austin, hvr Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1769 GHC Trac Issues: #11120 >--------------------------------------------------------------- ac3cf68c378410724973e64be7198bb8720a6809 compiler/iface/BuildTyCl.hs | 3 +- compiler/prelude/PrelNames.hs | 23 -------------- compiler/prelude/TysWiredIn.hs | 53 +++++++++++++++++++++++++++++++- libraries/base/Data/Typeable/Internal.hs | 28 ++++++++++++----- libraries/ghc-prim/GHC/Types.hs | 8 +++++ 5 files changed, 82 insertions(+), 33 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc ac3cf68c378410724973e64be7198bb8720a6809 From git at git.haskell.org Wed Jan 13 14:22:30 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 13 Jan 2016 14:22:30 +0000 (UTC) Subject: [commit: ghc] master: Add test for Data.Typeable.typeOf (e782e88) Message-ID: <20160113142230.DF99C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e782e882ba455c671cb35751053822a74a9f66b7/ghc >--------------------------------------------------------------- commit e782e882ba455c671cb35751053822a74a9f66b7 Author: Ben Gamari Date: Wed Jan 13 14:53:21 2016 +0100 Add test for Data.Typeable.typeOf Test Plan: Validate Reviewers: goldfire, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1770 GHC Trac Issues: #11120 >--------------------------------------------------------------- e782e882ba455c671cb35751053822a74a9f66b7 testsuite/tests/typecheck/should_run/TypeOf.hs | 34 ++++++++++++++++++++++ testsuite/tests/typecheck/should_run/TypeOf.stdout | 23 +++++++++++++++ testsuite/tests/typecheck/should_run/all.T | 1 + 3 files changed, 58 insertions(+) diff --git a/testsuite/tests/typecheck/should_run/TypeOf.hs b/testsuite/tests/typecheck/should_run/TypeOf.hs new file mode 100644 index 0000000..12184e7 --- /dev/null +++ b/testsuite/tests/typecheck/should_run/TypeOf.hs @@ -0,0 +1,34 @@ +{-# LANGUAGE DataKinds #-} + +import Data.Typeable +import GHC.Types + +-- Test that Typeable works for various wired-in types. +-- See, for instance, #11120. + +main :: IO () +main = do + print $ typeOf "hello world" + print $ typeOf '4' + print $ typeOf (42 :: Int) + print $ typeOf (42 :: Word) + print $ typeOf (3.1415 :: Double) + print $ typeOf (return () :: IO ()) + print $ typeOf ('a', 1::Int, "hello") + print $ typeOf (typeOf "hi") + print $ typeOf True + print $ typeOf EQ + print $ typeOf (id :: Int -> Int) + + print $ typeOf (Proxy :: Proxy (Eq Int)) + print $ typeOf (Proxy :: Proxy (Int, Int)) + print $ typeOf (Proxy :: Proxy "hello world") + print $ typeOf (Proxy :: Proxy 1) + print $ typeOf (Proxy :: Proxy [1,2,3]) + print $ typeOf (Proxy :: Proxy 'EQ) + print $ typeOf (Proxy :: Proxy TYPE) + print $ typeOf (Proxy :: Proxy (TYPE 'Lifted)) + print $ typeOf (Proxy :: Proxy *) + print $ typeOf (Proxy :: Proxy ?) + print $ typeOf (Proxy :: Proxy 'Lifted) + print $ typeOf (Proxy :: Proxy (~~)) diff --git a/testsuite/tests/typecheck/should_run/TypeOf.stdout b/testsuite/tests/typecheck/should_run/TypeOf.stdout new file mode 100644 index 0000000..ffc2133 --- /dev/null +++ b/testsuite/tests/typecheck/should_run/TypeOf.stdout @@ -0,0 +1,23 @@ +[Char] +Char +Int +Word +Double +IO () +(Char,Int,[Char]) +TypeRep +Bool +Ordering +Int -> Int +Proxy Constraint (Eq Int) +Proxy Constraint (Int,Int) +Proxy Symbol "hello world" +Proxy Nat 1 +Proxy [Nat] (': Nat 1 (': Nat 2 (': Nat 3 '[]))) +Proxy Ordering 'EQ +Proxy (Levity -> Constraint) TYPE +Proxy Constraint Constraint +Proxy Constraint Constraint +Proxy Constraint Constraint +Proxy Levity 'Lifted +Proxy (Constraint -> Constraint -> Constraint) ~~ diff --git a/testsuite/tests/typecheck/should_run/all.T b/testsuite/tests/typecheck/should_run/all.T index 031dad6..42ec9a9 100755 --- a/testsuite/tests/typecheck/should_run/all.T +++ b/testsuite/tests/typecheck/should_run/all.T @@ -113,3 +113,4 @@ test('T9858d', normal, compile_and_run, ['']) test('T10284', exit_code(1), compile_and_run, ['']) test('T11049', exit_code(1), compile_and_run, ['']) test('T11230', normal, compile_and_run, ['']) +test('TypeOf', normal, compile_and_run, ['']) From git at git.haskell.org Wed Jan 13 14:22:33 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 13 Jan 2016 14:22:33 +0000 (UTC) Subject: [commit: ghc] master: Print a message when loading a .ghci file. (c3f9246) Message-ID: <20160113142233.91CDF3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/c3f92464bf64dacae76dc9b3566df9a9f6b3a85b/ghc >--------------------------------------------------------------- commit c3f92464bf64dacae76dc9b3566df9a9f6b3a85b Author: Kwang Yul Seo Date: Wed Jan 13 14:54:33 2016 +0100 Print a message when loading a .ghci file. Test Plan: ./validate Reviewers: austin, thomie, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D1756 GHC Trac Issues: #11389 >--------------------------------------------------------------- c3f92464bf64dacae76dc9b3566df9a9f6b3a85b ghc/GHCi/UI.hs | 6 ++++-- testsuite/tests/ghci/scripts/T10408.stdout | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ghc/GHCi/UI.hs b/ghc/GHCi/UI.hs index 1303af5..29d3688 100644 --- a/ghc/GHCi/UI.hs +++ b/ghc/GHCi/UI.hs @@ -525,6 +525,7 @@ runGHCi paths maybe_exprs = do do runInputTWithPrefs defaultPrefs defaultSettings $ runCommands $ fileLoop hdl liftIO (hClose hdl `catchIO` \_ -> return ()) + liftIO $ putStrLn ("Loaded GHCi configuration from " ++ file) -- @@ -533,12 +534,13 @@ runGHCi paths maybe_exprs = do dot_cfgs <- if ignore_dot_ghci then return [] else do dot_files <- catMaybes <$> sequence [ current_dir, app_user_dir, home_dir ] liftIO $ filterM checkFileAndDirPerms dot_files + mdot_cfgs <- liftIO $ mapM canonicalizePath' dot_cfgs + let arg_cfgs = reverse $ ghciScripts dflags -- -ghci-script are collected in reverse order - mcfgs <- liftIO $ mapM canonicalizePath' $ dot_cfgs ++ arg_cfgs -- We don't require that a script explicitly added by -ghci-script -- is owned by the current user. (#6017) - mapM_ sourceConfigFile $ nub $ catMaybes mcfgs + mapM_ sourceConfigFile $ nub $ (catMaybes mdot_cfgs) ++ arg_cfgs -- nub, because we don't want to read .ghci twice if the CWD is $HOME. -- Perform a :load for files given on the GHCi command line diff --git a/testsuite/tests/ghci/scripts/T10408.stdout b/testsuite/tests/ghci/scripts/T10408.stdout index b13d0a4..cef83bc 100644 --- a/testsuite/tests/ghci/scripts/T10408.stdout +++ b/testsuite/tests/ghci/scripts/T10408.stdout @@ -1,2 +1,4 @@ "T10408A" +Loaded GHCi configuration from T10408A.script "T10408B" +Loaded GHCi configuration from T10408B.script From git at git.haskell.org Wed Jan 13 19:29:21 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 13 Jan 2016 19:29:21 +0000 (UTC) Subject: [commit: ghc] master: Handle over-applied custom type errors too. (6ea24af) Message-ID: <20160113192921.5B2C73A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/6ea24af9f22f6ea661d79623135f4cd31e28c6a2/ghc >--------------------------------------------------------------- commit 6ea24af9f22f6ea661d79623135f4cd31e28c6a2 Author: Iavor S. Diatchki Date: Wed Jan 13 11:30:40 2016 -0800 Handle over-applied custom type errors too. Consider type family F :: Type -> Type where F = TypeError (Text "Error") Now, if we see something like `F Int` we should still report the custom type error. >--------------------------------------------------------------- 6ea24af9f22f6ea661d79623135f4cd31e28c6a2 compiler/typecheck/TcRnTypes.hs | 6 +++--- compiler/types/Type.hs | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/compiler/typecheck/TcRnTypes.hs b/compiler/typecheck/TcRnTypes.hs index 6beff7f..430a97d 100644 --- a/compiler/typecheck/TcRnTypes.hs +++ b/compiler/typecheck/TcRnTypes.hs @@ -1733,9 +1733,9 @@ isTypeHoleCt (CHoleCan { cc_hole = TypeHole }) = True isTypeHoleCt _ = False -- | The following constraints are considered to be a custom type error: --- 1. TypeError msg --- 2. TypeError msg ~ Something (and the other way around) --- 3. C (TypeError msg) (for any parameter of class constraint) +-- 1. TypeError msg a b c +-- 2. TypeError msg a b c ~ Something (and the other way around) +-- 4. C (TypeError msg a b c) (for any parameter of class constraint) getUserTypeErrorMsg :: Ct -> Maybe Type getUserTypeErrorMsg ct | Just (_,t1,t2) <- getEqPredTys_maybe ctT = oneOf [t1,t2] diff --git a/compiler/types/Type.hs b/compiler/types/Type.hs index 6a86f70..c727da6 100644 --- a/compiler/types/Type.hs +++ b/compiler/types/Type.hs @@ -707,7 +707,10 @@ isStrLitTy _ = Nothing -- If so, give us the kind and the error message. userTypeError_maybe :: Type -> Maybe Type userTypeError_maybe t - = do { (tc, [_kind, msg]) <- splitTyConApp_maybe t + = do { (tc, _kind : msg : _) <- splitTyConApp_maybe t + -- There may be more than 2 arguments, if the type error is + -- used as a type constructor (e.g. at kind `Type -> Type`). + ; guard (tyConName tc == errorMessageTypeErrorFamName) ; return msg } From git at git.haskell.org Wed Jan 13 19:34:01 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 13 Jan 2016 19:34:01 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: ghc.mk: Use Windows_Target instead of Windows_Host (0f2cb66) Message-ID: <20160113193401.83EC03A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/0f2cb663e47e5912e1694efe50d94d16bce63902/ghc >--------------------------------------------------------------- commit 0f2cb663e47e5912e1694efe50d94d16bce63902 Author: Erik de Castro Lopo Date: Sun Jan 10 09:28:47 2016 +1000 ghc.mk: Use Windows_Target instead of Windows_Host This is a step towards building a Linux to Windows cross-compiler. Test Plan: Build on Linux and Windows Reviewers: bgamari, hvr, austin, Phyx Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1758 GHC Trac Issues: #10070 (cherry picked from commit b1c063b47a6a4d078626f9a2d4b07cbb244de340) >--------------------------------------------------------------- 0f2cb663e47e5912e1694efe50d94d16bce63902 ghc.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ghc.mk b/ghc.mk index 7bb7eee..f521ceb 100644 --- a/ghc.mk +++ b/ghc.mk @@ -428,11 +428,11 @@ PACKAGES_STAGE1 += deepseq PACKAGES_STAGE1 += bytestring PACKAGES_STAGE1 += containers -ifeq "$(Windows_Host)" "YES" +ifeq "$(Windows_Target)" "YES" PACKAGES_STAGE1 += Win32 endif PACKAGES_STAGE1 += time -ifeq "$(Windows_Host)" "NO" +ifeq "$(Windows_Target)" "NO" PACKAGES_STAGE1 += unix endif From git at git.haskell.org Wed Jan 13 19:34:04 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 13 Jan 2016 19:34:04 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Linker: Define ELF_64BIT for aarch64_HOST_ARCH (9705d54) Message-ID: <20160113193404.2B59C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/9705d54da4919f502054be8c7bd69a56d7f98a59/ghc >--------------------------------------------------------------- commit 9705d54da4919f502054be8c7bd69a56d7f98a59 Author: Erik de Castro Lopo Date: Mon Jan 11 08:55:56 2016 +1100 Linker: Define ELF_64BIT for aarch64_HOST_ARCH Test Plan: Build on x86_64 and AArch64 Reviewers: hvr, austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1759 (cherry picked from commit 8e0c658c7af47a9211e5bffdf36b09d7700427bb) >--------------------------------------------------------------- 9705d54da4919f502054be8c7bd69a56d7f98a59 rts/Linker.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rts/Linker.c b/rts/Linker.c index d298179..6e20984 100644 --- a/rts/Linker.c +++ b/rts/Linker.c @@ -4181,6 +4181,8 @@ ocRunInit_PEi386 ( ObjectCode *oc ) # define ELF_64BIT #elif defined(ia64_HOST_ARCH) # define ELF_64BIT +#elif defined(aarch64_HOST_ARCH) +# define ELF_64BIT #endif #if !defined(openbsd_HOST_OS) From git at git.haskell.org Wed Jan 13 19:34:06 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 13 Jan 2016 19:34:06 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: fix typo causing compilation failure on SPARC (ArchSparc -> ArchSPARC) (3cf940b) Message-ID: <20160113193406.C49693A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/3cf940b80499999f45499dde85e865930a6f1ae9/ghc >--------------------------------------------------------------- commit 3cf940b80499999f45499dde85e865930a6f1ae9 Author: Karel Gardas Date: Tue Jan 12 21:58:50 2016 +0100 fix typo causing compilation failure on SPARC (ArchSparc -> ArchSPARC) (cherry picked from commit 00c8076ecf441e6be5cacafc78a98f7ab38ddad4) >--------------------------------------------------------------- 3cf940b80499999f45499dde85e865930a6f1ae9 libraries/ghci/GHCi/InfoTable.hsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/ghci/GHCi/InfoTable.hsc b/libraries/ghci/GHCi/InfoTable.hsc index cc57aff..7e1f8bc 100644 --- a/libraries/ghci/GHCi/InfoTable.hsc +++ b/libraries/ghci/GHCi/InfoTable.hsc @@ -71,7 +71,7 @@ data Arch = ArchSPARC platform :: Arch platform = #if defined(sparc_HOST_ARCH) - ArchSparc + ArchSPARC #elif defined(powerpc_HOST_ARCH) ArchPPC #elif defined(i386_HOST_ARCH) From git at git.haskell.org Wed Jan 13 19:34:09 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 13 Jan 2016 19:34:09 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Use implicit CallStacks for ASSERT when available (ec85e1e) Message-ID: <20160113193409.709FD3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/ec85e1e58fdcea165c4bd9881b091f07f2989014/ghc >--------------------------------------------------------------- commit ec85e1e58fdcea165c4bd9881b091f07f2989014 Author: Bartosz Nitka Date: Wed Jan 13 14:44:58 2016 +0100 Use implicit CallStacks for ASSERT when available This aids with debugging, since all you have to do to get more stack frames is add a constraint `(?callStack :: CallStack) =>`. Old output: ``` ghc-stage2: panic! (the 'impossible' happened) (GHC version 8.1.20160107 for x86_64-unknown-linux): ASSERT failed! file compiler/types/TyCoRep.hs line 1800 InScope [] [Xuv :-> n_av5[sk]] [] ``` New output: ``` ghc-stage2: panic! (the 'impossible' happened) (GHC version 8.1.20160107 for x86_64-unknown-linux): ASSERT failed! CallStack (from ImplicitParams): assertPprPanic, called at compiler/types/TyCoRep.hs:1800:95 in ghc:TyCoRep InScope [] [Xuv :-> n_av5[sk]] [] ``` Test Plan: harbormaster manual testing Reviewers: austin, gridaphobe, bgamari Reviewed By: gridaphobe, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1751 (cherry picked from commit 88d6d5aae2ae86646084f3a060ae911eff589b7a) >--------------------------------------------------------------- ec85e1e58fdcea165c4bd9881b091f07f2989014 compiler/utils/Outputable.hs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/compiler/utils/Outputable.hs b/compiler/utils/Outputable.hs index c3bdf5e..35a59c6 100644 --- a/compiler/utils/Outputable.hs +++ b/compiler/utils/Outputable.hs @@ -1096,15 +1096,24 @@ warnPprTrace True file line msg x where heading = hsep [text "WARNING: file", text file <> comma, text "line", int line] +-- | Panic with an assertation failure, recording the given file and +-- line number. Should typically be accessed with the ASSERT family of macros +#if __GLASGOW_HASKELL__ > 710 +assertPprPanic :: (?callStack :: CallStack) => String -> Int -> SDoc -> a +assertPprPanic _file _line msg + = pprPanic "ASSERT failed!" doc + where + doc = sep [ text (prettyCallStack ?callStack) + , msg ] +#else assertPprPanic :: String -> Int -> SDoc -> a --- ^ Panic with an assertation failure, recording the given file and line number. --- Should typically be accessed with the ASSERT family of macros assertPprPanic file line msg = pprPanic "ASSERT failed!" doc where doc = sep [ hsep [ text "file", text file , text "line", int line ] , msg ] +#endif pprDebugAndThen :: DynFlags -> (String -> a) -> SDoc -> SDoc -> a pprDebugAndThen dflags cont heading pretty_msg From git at git.haskell.org Wed Jan 13 19:34:12 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 13 Jan 2016 19:34:12 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: A little closer to supporting breakpoints with -fexternal-interpreter (74b06cf) Message-ID: <20160113193412.1F5443A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/74b06cf667a510c8325968e0dba633f5edb9ae6e/ghc >--------------------------------------------------------------- commit 74b06cf667a510c8325968e0dba633f5edb9ae6e Author: Simon Marlow Date: Wed Jan 13 09:13:14 2016 +0000 A little closer to supporting breakpoints with -fexternal-interpreter Summary: Moves getIdValFromApStack to the server, and removes one use of wormhole. Test Plan: validate Reviewers: bgamari, niteria, austin, hvr, erikd Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1768 GHC Trac Issues: #11100 (cherry picked from commit 3e796e1ae8b13ec1c607a1864894171a58cef592) >--------------------------------------------------------------- 74b06cf667a510c8325968e0dba633f5edb9ae6e compiler/ghci/GHCi.hs | 44 +++++++++++-------- compiler/main/InteractiveEval.hs | 17 ++------ libraries/ghci/GHCi/Message.hs | 94 ++++++++++++++++++++++------------------ libraries/ghci/GHCi/Run.hs | 16 ++++++- 4 files changed, 94 insertions(+), 77 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 74b06cf667a510c8325968e0dba633f5edb9ae6e From git at git.haskell.org Wed Jan 13 19:34:14 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 13 Jan 2016 19:34:14 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Add -prof stack trace to assert (b54ea29) Message-ID: <20160113193414.BC1083A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/b54ea2949573c8684f32d3cb2b761fe32c557a3f/ghc >--------------------------------------------------------------- commit b54ea2949573c8684f32d3cb2b761fe32c557a3f Author: Simon Marlow Date: Mon Jan 11 18:30:29 2016 +0000 Add -prof stack trace to assert Summary: So that assertion failures have full call stack information attached when using `ghc -fexternal-interpreter -prof`. Here's one I just collected by inserting a dummy assert in Happy: ``` *** Exception: Assertion failed CallStack (from ImplicitParams): assert, called at ./First.lhs:37:11 in main:First CallStack (from -prof): First.mkFirst (First.lhs:37:11-27) First.mkFirst (First.lhs:37:11-93) Main.main2.runParserGen.first (Main.lhs:107:48-56) Main.main2.runParserGen.first (Main.lhs:107:27-57) Main.main2.runParserGen (Main.lhs:(96,9)-(276,9)) Main.main2.runParserGen (Main.lhs:(90,9)-(276,10)) Main.main2.runParserGen (Main.lhs:(86,9)-(276,10)) Main.main2.runParserGen (Main.lhs:(85,9)-(276,10)) Main.main2 (Main.lhs:74:20-43) Main.main2 (Main.lhs:(64,9)-(78,61)) Main.main (Main.lhs:57:9-18) ``` Test Plan: validate Reviewers: erikd, hvr, austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1765 GHC Trac Issues: #11047 (cherry picked from commit 6cb860a9a154847906868ac0be93d750f99dac86) >--------------------------------------------------------------- b54ea2949573c8684f32d3cb2b761fe32c557a3f libraries/base/GHC/Exception.hs | 3 ++- libraries/base/GHC/IO/Exception.hs | 12 +++++++++--- libraries/base/GHC/Stack/CCS.hsc | 3 ++- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/libraries/base/GHC/Exception.hs b/libraries/base/GHC/Exception.hs index 80761ad..6c579f0 100644 --- a/libraries/base/GHC/Exception.hs +++ b/libraries/base/GHC/Exception.hs @@ -28,7 +28,8 @@ module GHC.Exception , divZeroException, overflowException, ratioZeroDenomException , errorCallException, errorCallWithCallStackException -- re-export CallStack and SrcLoc from GHC.Types - , CallStack, getCallStack, prettyCallStack + , CallStack, getCallStack, prettyCallStack, prettyCallStackLines + , showCCSStack , SrcLoc(..), prettySrcLoc ) where diff --git a/libraries/base/GHC/IO/Exception.hs b/libraries/base/GHC/IO/Exception.hs index 933ce94..c7bccb0 100644 --- a/libraries/base/GHC/IO/Exception.hs +++ b/libraries/base/GHC/IO/Exception.hs @@ -51,6 +51,8 @@ import GHC.Show import GHC.Read import GHC.Exception import GHC.IO.Handle.Types +import GHC.OldList ( intercalate ) +import {-# SOURCE #-} GHC.Stack.CCS import Foreign.C.Types import Data.Typeable ( cast ) @@ -355,9 +357,13 @@ instance Show IOException where assertError :: (?callStack :: CallStack) => Bool -> a -> a assertError predicate v | predicate = lazy v - | otherwise = throw (AssertionFailed - ("Assertion failed\n" - ++ prettyCallStack ?callStack)) + | otherwise = unsafeDupablePerformIO $ do + ccsStack <- currentCallStack + let + implicitParamCallStack = prettyCallStackLines ?callStack + ccsCallStack = showCCSStack ccsStack + stack = intercalate "\n" $ implicitParamCallStack ++ ccsCallStack + throwIO (AssertionFailed ("Assertion failed\n" ++ stack)) unsupportedOperation :: IOError unsupportedOperation = diff --git a/libraries/base/GHC/Stack/CCS.hsc b/libraries/base/GHC/Stack/CCS.hsc index d40d92d..bab9f75 100644 --- a/libraries/base/GHC/Stack/CCS.hsc +++ b/libraries/base/GHC/Stack/CCS.hsc @@ -116,4 +116,5 @@ whoCreated obj = do ccsToStrings ccs renderStack :: [String] -> String -renderStack strs = "Stack trace:" ++ concatMap ("\n "++) (reverse strs) +renderStack strs = + "CallStack (from -prof):" ++ concatMap ("\n "++) (reverse strs) From git at git.haskell.org Wed Jan 13 19:34:17 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 13 Jan 2016 19:34:17 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: TemplateHaskell: revive isStrict, notStrict and unpacked (b8d32e2) Message-ID: <20160113193417.68F383A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/b8d32e2f620d4f70bc3fffb791676b3a56ca26bd/ghc >--------------------------------------------------------------- commit b8d32e2f620d4f70bc3fffb791676b3a56ca26bd Author: Thomas Miedema Date: Wed Jan 13 14:45:21 2016 +0100 TemplateHaskell: revive isStrict, notStrict and unpacked These 3 functions are useful to keep around a bit longer, to prevent breaking existing code that uses them. Related to #10697. Reviewers: austin, goldfire, RyanGlScott, bgamari Reviewed By: RyanGlScott, bgamari Differential Revision: https://phabricator.haskell.org/D1761 (cherry picked from commit d44bc5c061e3f0ba459f835aba683c0366187b74) >--------------------------------------------------------------- b8d32e2f620d4f70bc3fffb791676b3a56ca26bd libraries/template-haskell/Language/Haskell/TH.hs | 1 + libraries/template-haskell/Language/Haskell/TH/Lib.hs | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/libraries/template-haskell/Language/Haskell/TH.hs b/libraries/template-haskell/Language/Haskell/TH.hs index 1988286..2f750e3 100644 --- a/libraries/template-haskell/Language/Haskell/TH.hs +++ b/libraries/template-haskell/Language/Haskell/TH.hs @@ -125,6 +125,7 @@ module Language.Haskell.TH( -- **** Strictness noSourceUnpackedness, sourceNoUnpack, sourceUnpack, noSourceStrictness, sourceLazy, sourceStrict, + isStrict, notStrict, unpacked, bang, bangType, varBangType, strictType, varStrictType, -- **** Class Contexts cxt, classP, equalP, diff --git a/libraries/template-haskell/Language/Haskell/TH/Lib.hs b/libraries/template-haskell/Language/Haskell/TH/Lib.hs index 9f75b45..7499c8a 100644 --- a/libraries/template-haskell/Language/Haskell/TH/Lib.hs +++ b/libraries/template-haskell/Language/Haskell/TH/Lib.hs @@ -656,6 +656,20 @@ noSourceStrictness = return NoSourceStrictness sourceLazy = return SourceLazy sourceStrict = return SourceStrict +{-# DEPRECATED isStrict + ["Use 'bang'. See https://ghc.haskell.org/trac/ghc/wiki/Migration/8.0. ", + "Example usage: 'bang noSourceUnpackedness sourceStrict'"] #-} +{-# DEPRECATED notStrict + ["Use 'bang'. See https://ghc.haskell.org/trac/ghc/wiki/Migration/8.0. ", + "Example usage: 'bang noSourceUnpackedness noSourceStrictness'"] #-} +{-# DEPRECATED unpacked + ["Use 'bang'. See https://ghc.haskell.org/trac/ghc/wiki/Migration/8.0. ", + "Example usage: 'bang sourceUnpack sourceStrict'"] #-} +isStrict, notStrict, unpacked :: Q Strict +isStrict = bang noSourceUnpackedness sourceStrict +notStrict = bang noSourceUnpackedness noSourceStrictness +unpacked = bang sourceUnpack sourceStrict + bang :: SourceUnpackednessQ -> SourceStrictnessQ -> BangQ bang u s = do u' <- u s' <- s From git at git.haskell.org Wed Jan 13 19:34:20 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 13 Jan 2016 19:34:20 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Print a message when loading a .ghci file. (45c4cc1) Message-ID: <20160113193420.1B58F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/45c4cc1e408e1fee5217fae2bdb01f279122d7d5/ghc >--------------------------------------------------------------- commit 45c4cc1e408e1fee5217fae2bdb01f279122d7d5 Author: Kwang Yul Seo Date: Wed Jan 13 14:54:33 2016 +0100 Print a message when loading a .ghci file. Test Plan: ./validate Reviewers: austin, thomie, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D1756 GHC Trac Issues: #11389 (cherry picked from commit c3f92464bf64dacae76dc9b3566df9a9f6b3a85b) >--------------------------------------------------------------- 45c4cc1e408e1fee5217fae2bdb01f279122d7d5 ghc/GHCi/UI.hs | 6 ++++-- testsuite/tests/ghci/scripts/T10408.stdout | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ghc/GHCi/UI.hs b/ghc/GHCi/UI.hs index 1303af5..29d3688 100644 --- a/ghc/GHCi/UI.hs +++ b/ghc/GHCi/UI.hs @@ -525,6 +525,7 @@ runGHCi paths maybe_exprs = do do runInputTWithPrefs defaultPrefs defaultSettings $ runCommands $ fileLoop hdl liftIO (hClose hdl `catchIO` \_ -> return ()) + liftIO $ putStrLn ("Loaded GHCi configuration from " ++ file) -- @@ -533,12 +534,13 @@ runGHCi paths maybe_exprs = do dot_cfgs <- if ignore_dot_ghci then return [] else do dot_files <- catMaybes <$> sequence [ current_dir, app_user_dir, home_dir ] liftIO $ filterM checkFileAndDirPerms dot_files + mdot_cfgs <- liftIO $ mapM canonicalizePath' dot_cfgs + let arg_cfgs = reverse $ ghciScripts dflags -- -ghci-script are collected in reverse order - mcfgs <- liftIO $ mapM canonicalizePath' $ dot_cfgs ++ arg_cfgs -- We don't require that a script explicitly added by -ghci-script -- is owned by the current user. (#6017) - mapM_ sourceConfigFile $ nub $ catMaybes mcfgs + mapM_ sourceConfigFile $ nub $ (catMaybes mdot_cfgs) ++ arg_cfgs -- nub, because we don't want to read .ghci twice if the CWD is $HOME. -- Perform a :load for files given on the GHCi command line diff --git a/testsuite/tests/ghci/scripts/T10408.stdout b/testsuite/tests/ghci/scripts/T10408.stdout index b13d0a4..cef83bc 100644 --- a/testsuite/tests/ghci/scripts/T10408.stdout +++ b/testsuite/tests/ghci/scripts/T10408.stdout @@ -1,2 +1,4 @@ "T10408A" +Loaded GHCi configuration from T10408A.script "T10408B" +Loaded GHCi configuration from T10408B.script From git at git.haskell.org Wed Jan 13 22:44:31 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 13 Jan 2016 22:44:31 +0000 (UTC) Subject: [commit: ghc] master: Minor improvement in CoreDump outputs: (c313327) Message-ID: <20160113224431.D7AD53A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/c3133273070b865011d848ec17b550168072f73c/ghc >--------------------------------------------------------------- commit c3133273070b865011d848ec17b550168072f73c Author: ?mer Sinan A?acan Date: Wed Jan 13 09:16:38 2016 -0500 Minor improvement in CoreDump outputs: Don't add parens unnecessarily when arguments of the application are all hidden (because of parameters like -dsuppress-all, -dsuppress-type-applications etc.) Reviewers: bgamari, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1771 >--------------------------------------------------------------- c3133273070b865011d848ec17b550168072f73c compiler/coreSyn/PprCore.hs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/compiler/coreSyn/PprCore.hs b/compiler/coreSyn/PprCore.hs index da2b311..147ff31 100644 --- a/compiler/coreSyn/PprCore.hs +++ b/compiler/coreSyn/PprCore.hs @@ -147,11 +147,18 @@ ppr_expr add_par expr@(Lam _ _) 2 (pprCoreExpr body) ppr_expr add_par expr@(App {}) - = case collectArgs expr of { (fun, args) -> + = sdocWithDynFlags $ \dflags -> + case collectArgs expr of { (fun, args) -> let pp_args = sep (map pprArg args) val_args = dropWhile isTypeArg args -- Drop the type arguments for tuples pp_tup_args = pprWithCommas pprCoreExpr val_args + args' + | gopt Opt_SuppressTypeApplications dflags = val_args + | otherwise = args + parens + | null args' = id + | otherwise = add_par in case fun of Var f -> case isDataConWorkId_maybe f of @@ -164,9 +171,9 @@ ppr_expr add_par expr@(App {}) tc = dataConTyCon dc saturated = val_args `lengthIs` idArity f - _ -> add_par (hang (ppr f) 2 pp_args) + _ -> parens (hang (ppr f) 2 pp_args) - _ -> add_par (hang (pprParendExpr fun) 2 pp_args) + _ -> parens (hang (pprParendExpr fun) 2 pp_args) } ppr_expr add_par (Case expr var ty [(con,args,rhs)]) From git at git.haskell.org Thu Jan 14 04:29:27 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 14 Jan 2016 04:29:27 +0000 (UTC) Subject: [commit: ghc] branch 'wip/exp-types' created Message-ID: <20160114042927.BB5B83A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/exp-types Referencing: cde4b629365f70ad1afd625bb5d279630cce997e From git at git.haskell.org Thu Jan 14 04:29:30 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 14 Jan 2016 04:29:30 +0000 (UTC) Subject: [commit: ghc] wip/exp-types: Fix #11311 (7bb9203) Message-ID: <20160114042930.D00F73A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/exp-types Link : http://ghc.haskell.org/trac/ghc/changeset/7bb920387bc8dfb3859ece241ad60a5fbf39a561/ghc >--------------------------------------------------------------- commit 7bb920387bc8dfb3859ece241ad60a5fbf39a561 Author: Richard Eisenberg Date: Mon Jan 11 17:03:47 2016 -0500 Fix #11311 All things of kind *, including * itself, need to have a PtrRep. Test: dependent/should_compile/T11311 >--------------------------------------------------------------- 7bb920387bc8dfb3859ece241ad60a5fbf39a561 compiler/types/TyCon.hs | 5 +++-- testsuite/tests/dependent/should_compile/T11311.hs | 8 ++++++++ testsuite/tests/dependent/should_compile/all.T | 1 + .../{annotations/should_compile => dependent/should_run}/Makefile | 0 testsuite/tests/dependent/should_run/T11311.hs | 8 ++++++++ testsuite/tests/dependent/should_run/all.T | 4 ++++ 6 files changed, 24 insertions(+), 2 deletions(-) diff --git a/compiler/types/TyCon.hs b/compiler/types/TyCon.hs index 356e2ea..0f64cf9 100644 --- a/compiler/types/TyCon.hs +++ b/compiler/types/TyCon.hs @@ -568,7 +568,7 @@ data TyCon primTyConRep :: PrimRep,-- ^ Many primitive tycons are unboxed, but -- some are boxed (represented by -- pointers). This 'PrimRep' holds that - -- information. Only relevant if tyConKind = * + -- information. Only relevant if tyConKind = # isUnLifted :: Bool, -- ^ Most primitive tycons are unlifted (may -- not contain bottom) but other are lifted, @@ -1203,7 +1203,8 @@ mkKindTyCon :: Name -> Kind -> [Role] -> Name -> TyCon mkKindTyCon name kind roles rep_nm = tc where - tc = mkPrimTyCon' name kind roles VoidRep False (Just rep_nm) + tc = mkPrimTyCon' name kind roles PtrRep False (Just rep_nm) + -- PtrRep because kinds have kind *. -- | Create a lifted primitive 'TyCon' such as @RealWorld@ mkLiftedPrimTyCon :: Name -> Kind -> [Role] -> PrimRep -> TyCon diff --git a/testsuite/tests/dependent/should_compile/T11311.hs b/testsuite/tests/dependent/should_compile/T11311.hs new file mode 100644 index 0000000..88f0e45 --- /dev/null +++ b/testsuite/tests/dependent/should_compile/T11311.hs @@ -0,0 +1,8 @@ +module T11311 where + +import Data.Kind + +foo :: () +foo = (id :: * -> *) undefined `seq` () + +main = print foo diff --git a/testsuite/tests/dependent/should_compile/all.T b/testsuite/tests/dependent/should_compile/all.T index 1063b6e..ef6dde9 100644 --- a/testsuite/tests/dependent/should_compile/all.T +++ b/testsuite/tests/dependent/should_compile/all.T @@ -11,3 +11,4 @@ test('mkGADTVars', normal, compile, ['']) test('TypeLevelVec',normal,compile, ['']) test('T9632', normal, compile, ['']) test('dynamic-paper', normal, compile, ['']) +test('T11311', normal, compile, ['']) diff --git a/testsuite/tests/annotations/should_compile/Makefile b/testsuite/tests/dependent/should_run/Makefile similarity index 100% copy from testsuite/tests/annotations/should_compile/Makefile copy to testsuite/tests/dependent/should_run/Makefile diff --git a/testsuite/tests/dependent/should_run/T11311.hs b/testsuite/tests/dependent/should_run/T11311.hs new file mode 100644 index 0000000..88f0e45 --- /dev/null +++ b/testsuite/tests/dependent/should_run/T11311.hs @@ -0,0 +1,8 @@ +module T11311 where + +import Data.Kind + +foo :: () +foo = (id :: * -> *) undefined `seq` () + +main = print foo diff --git a/testsuite/tests/dependent/should_run/all.T b/testsuite/tests/dependent/should_run/all.T new file mode 100755 index 0000000..c3b18c1 --- /dev/null +++ b/testsuite/tests/dependent/should_run/all.T @@ -0,0 +1,4 @@ + + +# test('T11311', normal, compile_and_run, ['']) + From git at git.haskell.org Thu Jan 14 04:29:33 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 14 Jan 2016 04:29:33 +0000 (UTC) Subject: [commit: ghc] wip/exp-types: Fix #11254. (f961122) Message-ID: <20160114042933.EA9643A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/exp-types Link : http://ghc.haskell.org/trac/ghc/changeset/f96112213b3b5e1d980fdc627492e1f4d293ed54/ghc >--------------------------------------------------------------- commit f96112213b3b5e1d980fdc627492e1f4d293ed54 Author: Richard Eisenberg Date: Mon Jan 11 14:47:49 2016 -0500 Fix #11254. This moves the call to tcSubType into the context of the checkInstConstraints call, allowing the deferred type error somewhere to hang its hat. >--------------------------------------------------------------- f96112213b3b5e1d980fdc627492e1f4d293ed54 compiler/typecheck/TcInstDcls.hs | 113 +++++++++++---------- .../tests/typecheck/should_compile/T11254.stderr | 25 +++++ testsuite/tests/typecheck/should_compile/all.T | 2 +- 3 files changed, 88 insertions(+), 52 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc f96112213b3b5e1d980fdc627492e1f4d293ed54 From git at git.haskell.org Thu Jan 14 04:29:36 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 14 Jan 2016 04:29:36 +0000 (UTC) Subject: [commit: ghc] wip/exp-types: Clarify topological sorting of spec vars in manual (058508a) Message-ID: <20160114042936.958213A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/exp-types Link : http://ghc.haskell.org/trac/ghc/changeset/058508a1149d3edae93db26603edbcfc8f3f6c61/ghc >--------------------------------------------------------------- commit 058508a1149d3edae93db26603edbcfc8f3f6c61 Author: Richard Eisenberg Date: Sun Jan 10 19:10:03 2016 -0500 Clarify topological sorting of spec vars in manual This is mentioned in #11376. >--------------------------------------------------------------- 058508a1149d3edae93db26603edbcfc8f3f6c61 docs/users_guide/glasgow_exts.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index f53478d..4cbc36a 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -2215,6 +2215,15 @@ Here are the details: will have its type variables ordered as ``m, a, b, c``. +- If any of the variables depend on other variables (that is, if some + of the variables are *kind* variables), the variables are reordered + so that kind variables come before type variables, preserving the + left-to-right order as much as possible. That is, GHC performs a + stable topological sort on the variables. + + For example: if we have ``bar :: Proxy (a :: (j, k)) -> b``, then + the variables are ordered ``j``, ``k``, ``a``, ``b``. + - Class methods' type arguments include the class type variables, followed by any variables an individual method is polymorphic in. So, ``class Monad m where return :: a -> m a`` means From git at git.haskell.org Thu Jan 14 04:29:39 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 14 Jan 2016 04:29:39 +0000 (UTC) Subject: [commit: ghc] wip/exp-types: Constrained types have kind * in validity check. (1acc1ea) Message-ID: <20160114042939.B7C183A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/exp-types Link : http://ghc.haskell.org/trac/ghc/changeset/1acc1ea51b99eb55e5fa87ac8af15a9392b79705/ghc >--------------------------------------------------------------- commit 1acc1ea51b99eb55e5fa87ac8af15a9392b79705 Author: Richard Eisenberg Date: Mon Jan 11 15:28:48 2016 -0500 Constrained types have kind * in validity check. This addresses #11405, but a deeper problem lurks. Try test dependent/should_compile/T11405 and see comment:3 on the ticket. >--------------------------------------------------------------- 1acc1ea51b99eb55e5fa87ac8af15a9392b79705 compiler/typecheck/TcValidity.hs | 7 ++++++- testsuite/tests/dependent/should_compile/T11405.hs | 9 +++++++++ testsuite/tests/dependent/should_compile/all.T | 2 ++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/compiler/typecheck/TcValidity.hs b/compiler/typecheck/TcValidity.hs index 63118d0..a89b783 100644 --- a/compiler/typecheck/TcValidity.hs +++ b/compiler/typecheck/TcValidity.hs @@ -452,12 +452,17 @@ check_type env ctxt rank ty -- but not type T = ?x::Int ; check_type env' ctxt rank tau -- Allow foralls to right of arrow - ; checkTcM (not (any (`elemVarSet` tyCoVarsOfType tau_kind) tvs)) + ; checkTcM (not (any (`elemVarSet` tyCoVarsOfType phi_kind) tvs)) (forAllEscapeErr env' ty tau_kind) } where (tvs, theta, tau) = tcSplitSigmaTy ty tau_kind = typeKind tau + + phi_kind | null theta = tau_kind + | otherwise = liftedTypeKind + -- If there are any constraints, the kind is *. (#11405) + (env', _) = tidyTyCoVarBndrs env tvs check_type _ _ _ (TyVarTy _) = return () diff --git a/testsuite/tests/dependent/should_compile/T11405.hs b/testsuite/tests/dependent/should_compile/T11405.hs new file mode 100644 index 0000000..f80d994 --- /dev/null +++ b/testsuite/tests/dependent/should_compile/T11405.hs @@ -0,0 +1,9 @@ +{-# LANGUAGE ImplicitParams, TypeInType, ExplicitForAll #-} + +module T11405 where + +import GHC.Exts +import GHC.Stack + +x :: forall (v :: Levity) (a :: TYPE v). (?callStack :: CallStack) => a +x = undefined diff --git a/testsuite/tests/dependent/should_compile/all.T b/testsuite/tests/dependent/should_compile/all.T index ef6dde9..c11f9ca 100644 --- a/testsuite/tests/dependent/should_compile/all.T +++ b/testsuite/tests/dependent/should_compile/all.T @@ -12,3 +12,5 @@ test('TypeLevelVec',normal,compile, ['']) test('T9632', normal, compile, ['']) test('dynamic-paper', normal, compile, ['']) test('T11311', normal, compile, ['']) +test('T11405', expect_broken(11405), compile, ['']) + From git at git.haskell.org Thu Jan 14 04:29:42 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 14 Jan 2016 04:29:42 +0000 (UTC) Subject: [commit: ghc] wip/exp-types: Fix #11404 (a9648c3) Message-ID: <20160114042942.7050A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/exp-types Link : http://ghc.haskell.org/trac/ghc/changeset/a9648c365af89ed0b10f4374fb032f20fd1c8baa/ghc >--------------------------------------------------------------- commit a9648c365af89ed0b10f4374fb032f20fd1c8baa Author: Richard Eisenberg Date: Mon Jan 11 16:47:22 2016 -0500 Fix #11404 We now check for unused variables one at a time, instead of all at the top. Test: dependent/should_compile/T11405 >--------------------------------------------------------------- a9648c365af89ed0b10f4374fb032f20fd1c8baa compiler/rename/RnSource.hs | 16 +++++++------- compiler/rename/RnTypes.hs | 53 ++++++++++++++++++++++++++------------------- 2 files changed, 39 insertions(+), 30 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc a9648c365af89ed0b10f4374fb032f20fd1c8baa From git at git.haskell.org Thu Jan 14 04:29:45 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 14 Jan 2016 04:29:45 +0000 (UTC) Subject: [commit: ghc] wip/exp-types: Tiny refactoring in TcUnify (c89c990) Message-ID: <20160114042945.193E73A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/exp-types Link : http://ghc.haskell.org/trac/ghc/changeset/c89c9903a093e979b875dfdd2099d846fad21fc1/ghc >--------------------------------------------------------------- commit c89c9903a093e979b875dfdd2099d846fad21fc1 Author: Richard Eisenberg Date: Mon Jan 11 21:28:24 2016 -0500 Tiny refactoring in TcUnify >--------------------------------------------------------------- c89c9903a093e979b875dfdd2099d846fad21fc1 compiler/typecheck/TcUnify.hs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/compiler/typecheck/TcUnify.hs b/compiler/typecheck/TcUnify.hs index 908b692..20636bf 100644 --- a/compiler/typecheck/TcUnify.hs +++ b/compiler/typecheck/TcUnify.hs @@ -677,8 +677,10 @@ tc_sub_type_ds eq_orig inst_orig ctxt ty_actual ty_expected = inst_and_unify -- It's still possible that ty_actual has nested foralls. Instantiate -- these, as there's no way unification will succeed with them in. - -- See typecheck/should_compiler/T11350 for an example of when this - -- is important. + -- See typecheck/should_compile/T11305 for an example of when this + -- is important. The problem is that we're checking something like + -- a -> forall b. b -> b <= alpha beta gamma + -- where we end up with alpha := (->) inst_and_unify = do { (wrap, rho_a) <- deeplyInstantiate inst_orig ty_actual @@ -693,10 +695,7 @@ tc_sub_type_ds eq_orig inst_orig ctxt ty_actual ty_expected , uo_thing = thing } | orig_ty_actual `tcEqType` ty_actual , not (isIdHsWrapper wrap) - -> TypeEqOrigin - { uo_actual = rho_a - , uo_expected = orig_ty_expected - , uo_thing = thing } + -> eq_orig { uo_actual = rho_a } _ -> eq_orig ; cow <- uType eq_orig' TypeLevel rho_a ty_expected From git at git.haskell.org Thu Jan 14 04:29:47 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 14 Jan 2016 04:29:47 +0000 (UTC) Subject: [commit: ghc] wip/exp-types: Fix typo in error message (#11409) (b832748) Message-ID: <20160114042947.C4B3D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/exp-types Link : http://ghc.haskell.org/trac/ghc/changeset/b83274820db93cd24154f96f861106284a7f1dd2/ghc >--------------------------------------------------------------- commit b83274820db93cd24154f96f861106284a7f1dd2 Author: Richard Eisenberg Date: Mon Jan 11 21:29:23 2016 -0500 Fix typo in error message (#11409) >--------------------------------------------------------------- b83274820db93cd24154f96f861106284a7f1dd2 compiler/typecheck/TcExpr.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/typecheck/TcExpr.hs b/compiler/typecheck/TcExpr.hs index 93ba3db..d5a0016 100644 --- a/compiler/typecheck/TcExpr.hs +++ b/compiler/typecheck/TcExpr.hs @@ -1178,7 +1178,7 @@ tcArgs fun orig_fun_ty fun_orig orig_args herald ty_app_err ty arg = do { (_, ty) <- zonkTidyTcType emptyTidyEnv ty ; failWith $ - text "Cannot not apply expression of type" <+> quotes (ppr ty) $$ + text "Cannot apply expression of type" <+> quotes (ppr ty) $$ text "to a visible type argument" <+> quotes (ppr arg) } ---------------- From git at git.haskell.org Thu Jan 14 04:29:50 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 14 Jan 2016 04:29:50 +0000 (UTC) Subject: [commit: ghc] wip/exp-types: Some work toward having ExpTypes (cde4b62) Message-ID: <20160114042950.867233A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/exp-types Link : http://ghc.haskell.org/trac/ghc/changeset/cde4b629365f70ad1afd625bb5d279630cce997e/ghc >--------------------------------------------------------------- commit cde4b629365f70ad1afd625bb5d279630cce997e Author: Richard Eisenberg Date: Wed Jan 13 23:29:17 2016 -0500 Some work toward having ExpTypes >--------------------------------------------------------------- cde4b629365f70ad1afd625bb5d279630cce997e compiler/typecheck/Inst.hs | 57 ++++++-- compiler/typecheck/TcArrows.hs | 9 +- compiler/typecheck/TcBinds.hs | 14 +- compiler/typecheck/TcErrors.hs | 33 +++-- compiler/typecheck/TcEvidence.hs | 38 +++-- compiler/typecheck/TcExpr.hs | 296 ++++++++++++++++++++++++++------------- compiler/typecheck/TcHsType.hs | 4 +- compiler/typecheck/TcInstDcls.hs | 3 +- compiler/typecheck/TcMType.hs | 142 ++++++++++++++++--- compiler/typecheck/TcMatches.hs | 241 ++++++++++++++++--------------- compiler/typecheck/TcPat.hs | 29 ++-- compiler/typecheck/TcRnDriver.hs | 3 +- compiler/typecheck/TcRnTypes.hs | 14 +- compiler/typecheck/TcRules.hs | 3 +- compiler/typecheck/TcSplice.hs | 6 +- compiler/typecheck/TcUnify.hs | 258 ++++++++++++++++++++-------------- 16 files changed, 737 insertions(+), 413 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc cde4b629365f70ad1afd625bb5d279630cce997e From git at git.haskell.org Thu Jan 14 08:27:56 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 14 Jan 2016 08:27:56 +0000 (UTC) Subject: [commit: ghc] master: Minor code refactoring (c73333a) Message-ID: <20160114082756.964643A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/c73333a1a1b6697e5ffa54fa1f3c96fe54bf42b4/ghc >--------------------------------------------------------------- commit c73333a1a1b6697e5ffa54fa1f3c96fe54bf42b4 Author: Jan Stolarek Date: Thu Jan 14 09:26:44 2016 +0100 Minor code refactoring This moves let-bindings right next to their use site. >--------------------------------------------------------------- c73333a1a1b6697e5ffa54fa1f3c96fe54bf42b4 compiler/typecheck/TcSplice.hs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/compiler/typecheck/TcSplice.hs b/compiler/typecheck/TcSplice.hs index 86bdbde..16c0883 100644 --- a/compiler/typecheck/TcSplice.hs +++ b/compiler/typecheck/TcSplice.hs @@ -1400,9 +1400,6 @@ reifyDataCon isGadtDataCon tys dc ; r_arg_tys <- reifyTypes (if isGadtDataCon then g_arg_tys else arg_tys) - ; let [r_a1, r_a2] = r_arg_tys - [s1, s2] = dcdBangs - ; main_con <- if | not (null fields) && not isGadtDataCon -> return $ TH.RecC name (zip3 (map reifyFieldLabel fields) @@ -1416,8 +1413,10 @@ reifyDataCon isGadtDataCon tys dc -- constructors can be declared infix. -- See Note [Infix GADT constructors] in TcTyClsDecls. | dataConIsInfix dc && not isGadtDataCon -> - ASSERT( length arg_tys == 2 ) - return $ TH.InfixC (s1,r_a1) name (s2,r_a2) + ASSERT( length arg_tys == 2 ) do + { let [r_a1, r_a2] = r_arg_tys + [s1, s2] = dcdBangs + ; return $ TH.InfixC (s1,r_a1) name (s2,r_a2) } | isGadtDataCon -> do { res_ty <- reifyType g_res_ty ; return $ TH.GadtC [name] (dcdBangs `zip` r_arg_tys) res_ty } From git at git.haskell.org Thu Jan 14 11:43:55 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 14 Jan 2016 11:43:55 +0000 (UTC) Subject: [commit: ghc] master: users-guide: Wibbles (61011b4) Message-ID: <20160114114355.DB71B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/61011b4e76fcdaa6602faf3e735ed5afd2240d00/ghc >--------------------------------------------------------------- commit 61011b4e76fcdaa6602faf3e735ed5afd2240d00 Author: Ben Gamari Date: Wed Jan 13 19:53:01 2016 +0100 users-guide: Wibbles >--------------------------------------------------------------- 61011b4e76fcdaa6602faf3e735ed5afd2240d00 docs/users_guide/glasgow_exts.rst | 2 +- docs/users_guide/profiling.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index f53478d..1910fc9 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -12239,7 +12239,7 @@ package on Hackage. More information ---------------- -For more details please refer to the `HaskellWiki +For more details please refer to the `Haskell Wiki page `__ or the original paper [Generics2010]_. diff --git a/docs/users_guide/profiling.rst b/docs/users_guide/profiling.rst index a163173..4d0bb3a 100644 --- a/docs/users_guide/profiling.rst +++ b/docs/users_guide/profiling.rst @@ -335,7 +335,7 @@ for all modules in a program. Adds an automatic ``SCC`` annotation to all *call sites*. This is particularly useful when using profiling for the purposes of - generating stack traces; see the function ``traceStack`` in the + generating stack traces; see the function :base-ref:`traceStack ` in the module ``Debug.Trace``, or the :rts-flag:`-xc` RTS flag (:ref:`rts-options-debugging`) for more details. From git at git.haskell.org Thu Jan 14 11:43:58 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 14 Jan 2016 11:43:58 +0000 (UTC) Subject: [commit: ghc] master: GHC.Generics: Fix documentation (91dcc65) Message-ID: <20160114114358.83C863A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/91dcc655932b7977c9901d3504bc3d8f0ca8cb6e/ghc >--------------------------------------------------------------- commit 91dcc655932b7977c9901d3504bc3d8f0ca8cb6e Author: Ben Gamari Date: Wed Jan 13 21:36:51 2016 +0100 GHC.Generics: Fix documentation Fixes #11417. >--------------------------------------------------------------- 91dcc655932b7977c9901d3504bc3d8f0ca8cb6e libraries/base/GHC/Generics.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/base/GHC/Generics.hs b/libraries/base/GHC/Generics.hs index 16e61f9..3ac4d5c 100644 --- a/libraries/base/GHC/Generics.hs +++ b/libraries/base/GHC/Generics.hs @@ -386,7 +386,7 @@ module GHC.Generics ( -- @ -- class Encode a where -- encode :: a -> [Bool] --- default encode :: ('Generic' a) => a -> [Bool] +-- default encode :: (Generic a, Encode' (Rep a)) => a -> [Bool] -- encode x = encode' ('from' x) -- @ -- From git at git.haskell.org Thu Jan 14 11:44:01 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 14 Jan 2016 11:44:01 +0000 (UTC) Subject: [commit: ghc] master: INSTALL.md: Mention -j and other wibbles (b0641ad) Message-ID: <20160114114401.296C53A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/b0641ad9009df1e3f4eae4274668840ff6e46732/ghc >--------------------------------------------------------------- commit b0641ad9009df1e3f4eae4274668840ff6e46732 Author: Ben Gamari Date: Thu Jan 14 11:33:09 2016 +0100 INSTALL.md: Mention -j and other wibbles >--------------------------------------------------------------- b0641ad9009df1e3f4eae4274668840ff6e46732 INSTALL.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 34bb5b4..3ae9186 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -8,13 +8,13 @@ has all the answers. Before building GHC you may need to install some other tools and libraries. See "Setting up your system for building GHC" [2]. -NB. in particular you need GHC installed in order to build GHC, +N.B. in particular you need GHC installed in order to build GHC, because the compiler is itself written in Haskell. For instructions on how to port GHC to a new platform, see the Building Guide [1]. For building library documentation, you'll need Haddock [3]. To build the compiler documentation, you need [Sphinx](http://www.sphinx-doc.org/) and -Xelatex (only for PDF output). +XeLaTex (only for PDF output). Quick start: the following gives you a default build: @@ -28,7 +28,10 @@ Quick start: the following gives you a default build: $ ./configure --enable-tarballs-autodownload -The "perl boot" step is only necessary if this is a tree checked out +You can use Make's `-jN` option to parallelize the build. It's generally best +to set `N` somewhere around the core count of the build machine. + +The `perl boot` step is only necessary if this is a tree checked out from git. For source distributions downloaded from GHC's web site, this step has already been performed. From git at git.haskell.org Thu Jan 14 11:44:04 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 14 Jan 2016 11:44:04 +0000 (UTC) Subject: [commit: ghc] master: Add tests for #11391 (f0c4e46) Message-ID: <20160114114404.76F453A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/f0c4e460ee0dad372d5b896a03cdac9666026174/ghc >--------------------------------------------------------------- commit f0c4e460ee0dad372d5b896a03cdac9666026174 Author: Ben Gamari Date: Thu Jan 14 11:27:37 2016 +0100 Add tests for #11391 >--------------------------------------------------------------- f0c4e460ee0dad372d5b896a03cdac9666026174 .../tests/typecheck/should_fail/CustomTypeErrors04.hs | 14 ++++++++++++++ .../tests/typecheck/should_fail/CustomTypeErrors04.stderr | 5 +++++ .../tests/typecheck/should_fail/CustomTypeErrors05.hs | 14 ++++++++++++++ .../tests/typecheck/should_fail/CustomTypeErrors05.stderr | 5 +++++ testsuite/tests/typecheck/should_fail/all.T | 2 ++ 5 files changed, 40 insertions(+) diff --git a/testsuite/tests/typecheck/should_fail/CustomTypeErrors04.hs b/testsuite/tests/typecheck/should_fail/CustomTypeErrors04.hs new file mode 100644 index 0000000..d1957bf --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/CustomTypeErrors04.hs @@ -0,0 +1,14 @@ +{-# LANGUAGE TypeInType, TypeFamilies, UndecidableInstances #-} +{-# LANGUAGE UndecidableInstances #-} + +-- The "bad case" in #11391 +module CustomTypeErrors04 where + +import Data.Kind +import GHC.TypeLits (TypeError, ErrorMessage(..)) + +type family Resolve (t :: Type -> Type) :: Type -> Type where + Resolve _ = TypeError (Text "ERROR") + +testNOTOK1 :: Resolve [] Int +testNOTOK1 = () diff --git a/testsuite/tests/typecheck/should_fail/CustomTypeErrors04.stderr b/testsuite/tests/typecheck/should_fail/CustomTypeErrors04.stderr new file mode 100644 index 0000000..9bec37b --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/CustomTypeErrors04.stderr @@ -0,0 +1,5 @@ + +CustomTypeErrors04.hs:14:14: error: + ? ERROR + ? In the expression: () + In an equation for ?testNOTOK1?: testNOTOK1 = () diff --git a/testsuite/tests/typecheck/should_fail/CustomTypeErrors05.hs b/testsuite/tests/typecheck/should_fail/CustomTypeErrors05.hs new file mode 100644 index 0000000..5a15b6f --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/CustomTypeErrors05.hs @@ -0,0 +1,14 @@ +{-# LANGUAGE TypeInType, TypeFamilies, UndecidableInstances #-} +{-# LANGUAGE UndecidableInstances #-} + +-- The "tricky case" in #11391 +module CustomTypeErrors05 where + +import Data.Kind +import GHC.TypeLits (TypeError, ErrorMessage(..)) + +type family Resolve (t :: Type -> Type) :: Type -> Type where + Resolve _ = TypeError (Text "ERROR") + +testNOTOK2 :: Resolve [] Int +testNOTOK2 = 1 diff --git a/testsuite/tests/typecheck/should_fail/CustomTypeErrors05.stderr b/testsuite/tests/typecheck/should_fail/CustomTypeErrors05.stderr new file mode 100644 index 0000000..3164c86 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/CustomTypeErrors05.stderr @@ -0,0 +1,5 @@ + +CustomTypeErrors05.hs:14:14: error: + ? ERROR + ? In the expression: 1 + In an equation for ?testNOTOK2?: testNOTOK2 = 1 diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T index 753708d..9aef820 100644 --- a/testsuite/tests/typecheck/should_fail/all.T +++ b/testsuite/tests/typecheck/should_fail/all.T @@ -394,6 +394,8 @@ test('T10971d', extra_clean(['T10971c.hi', 'T10971c.o']), multimod_compile_fail, test('CustomTypeErrors01', normal, compile_fail, ['']) test('CustomTypeErrors02', normal, compile_fail, ['']) test('CustomTypeErrors03', normal, compile_fail, ['']) +test('CustomTypeErrors04', normal, compile_fail, ['']) +test('CustomTypeErrors05', normal, compile_fail, ['']) test('T11112', normal, compile_fail, ['']) test('ClassOperator', normal, compile_fail, ['']) test('T11274', normal, compile_fail, ['']) From git at git.haskell.org Thu Jan 14 11:44:07 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 14 Jan 2016 11:44:07 +0000 (UTC) Subject: [commit: ghc] master: Rename InjectiveTypeFamilies to TypeFamilyDependencies (78a4c72) Message-ID: <20160114114407.33B533A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/78a4c729ecb07c92822625fda15f14a778679452/ghc >--------------------------------------------------------------- commit 78a4c729ecb07c92822625fda15f14a778679452 Author: Ben Gamari Date: Thu Jan 14 11:52:10 2016 +0100 Rename InjectiveTypeFamilies to TypeFamilyDependencies >--------------------------------------------------------------- 78a4c729ecb07c92822625fda15f14a778679452 compiler/main/DynFlags.hs | 4 ++-- compiler/typecheck/TcTyClsDecls.hs | 4 ++-- docs/users_guide/glasgow_exts.rst | 7 ++++--- libraries/ghc-boot/GHC/LanguageExtensions.hs | 2 +- testsuite/tests/driver/T11381.hs | 2 +- testsuite/tests/driver/T11381.stderr | 2 +- testsuite/tests/driver/T4437.hs | 2 +- testsuite/tests/ghci/scripts/T6018ghci.script | 2 +- testsuite/tests/ghci/scripts/T6018ghcifail.script | 2 +- testsuite/tests/ghci/scripts/T6018ghcirnfail.script | 2 +- testsuite/tests/th/T6018th.hs | 2 +- testsuite/tests/th/T8884.hs | 2 +- testsuite/tests/typecheck/should_compile/T6018.hs | 2 +- testsuite/tests/typecheck/should_compile/T6018.hs-boot | 2 +- testsuite/tests/typecheck/should_compile/T6018a.hs | 2 +- testsuite/tests/typecheck/should_fail/T10836.hs | 2 +- testsuite/tests/typecheck/should_fail/T6018Afail.hs | 2 +- testsuite/tests/typecheck/should_fail/T6018Bfail.hs | 2 +- testsuite/tests/typecheck/should_fail/T6018fail.hs | 2 +- testsuite/tests/typecheck/should_fail/T6018failclosed.hs | 2 +- testsuite/tests/typecheck/should_fail/T6018failclosed2.hs | 2 +- utils/mkUserGuidePart/Options/Language.hs | 4 ++-- 22 files changed, 28 insertions(+), 27 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 78a4c729ecb07c92822625fda15f14a778679452 From git at git.haskell.org Thu Jan 14 11:44:09 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 14 Jan 2016 11:44:09 +0000 (UTC) Subject: [commit: ghc] master: users-guide: Update language extension implications (4dbc31b) Message-ID: <20160114114409.D63A73A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/4dbc31b8240d98bd7eb4fd0874c7da91797c4e2e/ghc >--------------------------------------------------------------- commit 4dbc31b8240d98bd7eb4fd0874c7da91797c4e2e Author: Ben Gamari Date: Thu Jan 14 12:08:14 2016 +0100 users-guide: Update language extension implications >--------------------------------------------------------------- 4dbc31b8240d98bd7eb4fd0874c7da91797c4e2e docs/users_guide/glasgow_exts.rst | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index 91e0e18..6abe331 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -2187,7 +2187,8 @@ Visible type application .. ghc-flag:: -XTypeApplications - :since: 8.0 + :implies: :ghc-flag:`-XAllowAmbiguousTypes` + :since: 8.0.1 Allow the use of type application syntax. @@ -2421,6 +2422,8 @@ Type operators .. ghc-flag:: -XTypeOperators + :implies: :ghc-flag:`-XExplicitNamespaces` + Allow the use and definition of types with operator names. In types, an operator symbol like ``(+)`` is normally treated as a type @@ -2470,6 +2473,8 @@ Liberalised type synonyms .. ghc-flag:: -XLiberalTypeSynonyms + :implies: :ghc-flag:`-XExplicitForAll` + Relax many of the Haskell 98 rules on type synonym definitions. Type synonyms are like macros at the type level, but Haskell 98 imposes @@ -2546,6 +2551,8 @@ Existentially quantified data constructors .. ghc-flag:: -XExistentialQuantification + :implies: :ghc-flag:`-XExplicitForAll` + Allow existentially quantified type variables in types. The idea of using existential quantification in data type declarations @@ -3050,7 +3057,7 @@ Generalised Algebraic Data Types (GADTs) .. ghc-flag:: -XGADTs - :implies: :ghc-flag:`-XMonoLocalBinds` + :implies: :ghc-flag:`-XMonoLocalBinds`, :ghc-flag:`-XGADTSyntax` Allow use of Generalised Algebraic Data Types (GADTs). @@ -3272,6 +3279,8 @@ Duplicate record fields .. ghc-flag:: -XDuplicateRecordFields + :implies: :ghc-flag:`-XDisambiguateRecordFields` + Allow definition of record types with identically-named fields. Going beyond :ghc-flag:`-XDisambiguateRecordFields` (see :ref:`disambiguate-fields`), @@ -3691,8 +3700,6 @@ Deriving instances of extra classes (``Data``, etc.) .. ghc-flag:: -XDeriveFoldable - :implies: :ghc-flag:`-XDeriveFunctor` - Allow automatic deriving of instances for the ``Foldable`` typeclass. .. ghc-flag:: -XDeriveTraversable @@ -4456,6 +4463,8 @@ Multi-parameter type classes .. ghc-flag:: -XMultiParamTypeClasses + :implies: :ghc-flag:`-XConstrainedClassMethods` + Allow the definition of typeclasses with more than one parameter. Multi-parameter type classes are permitted, with flag @@ -4619,6 +4628,8 @@ Functional dependencies .. ghc-flag:: -XFunctionalDependencies + :implies: :ghc-flag:`-XMultiParamTypeClasses` + Allow use of functional dependencies in class declarations. Functional dependencies are implemented as described by [Jones2000]_.Mark Jones in @@ -5882,7 +5893,8 @@ Type families .. ghc-flag:: -XTypeFamilies - :implies: :ghc-flag:`-XMonoLocalBinds` + :implies: :ghc-flag:`-XMonoLocalBinds`, :ghc-flag:`-XKindSignatures`, + :ghc-flag:`-XExplicitNamespaces` Allow use and definition of indexed type and data families. @@ -6743,6 +6755,8 @@ Injective type families .. ghc-flag:: -XTypeFamilyDependencies + :implies: :ghc-flag:`-XTypeFamilies` + Allow functional dependency annotations on type families. This allows one to define injective type families. @@ -8398,6 +8412,8 @@ Impredicative polymorphism .. ghc-flag:: -XImpredicativeTypes + :implies: :ghc-flag:`RankNTypes` + Allow impredicative polymorphic types. In general, GHC will only instantiate a polymorphic function at a @@ -8450,6 +8466,7 @@ Lexically scoped type variables .. ghc-flag:: -XScopedTypeVariables :implies: :ghc-flag:`-XRelaxedPolyRec` + :implies: :ghc-flag:`-XExplicitForAll` Enable lexical scoping of type variables explicitly introduced with ``forall``. @@ -9421,6 +9438,8 @@ Syntax .. ghc-flag:: -XTemplateHaskell + :implies: :ghc-flag:`-XTemplateHaskellQuotes` + Enable Template Haskell's splice and quotation syntax. .. ghc-flag:: -XTemplateHaskellQuotes From git at git.haskell.org Thu Jan 14 11:44:12 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 14 Jan 2016 11:44:12 +0000 (UTC) Subject: [commit: ghc] master: users-guide: Add since annotations for language extensions (b355b8f) Message-ID: <20160114114412.A75403A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/b355b8fc5287bb10da6ead223f91f7de647bb908/ghc >--------------------------------------------------------------- commit b355b8fc5287bb10da6ead223f91f7de647bb908 Author: Ben Gamari Date: Thu Jan 14 12:18:09 2016 +0100 users-guide: Add since annotations for language extensions Based off of https://ghc.haskell.org/trac/ghc/wiki/LanguagePragmaHistory. >--------------------------------------------------------------- b355b8fc5287bb10da6ead223f91f7de647bb908 docs/users_guide/glasgow_exts.rst | 60 +++++++++++++++++++++++++++++++++++++++ docs/users_guide/safe_haskell.rst | 6 ++++ 2 files changed, 66 insertions(+) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc b355b8fc5287bb10da6ead223f91f7de647bb908 From git at git.haskell.org Thu Jan 14 12:17:49 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 14 Jan 2016 12:17:49 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Handle over-applied custom type errors too. (e6a6d29) Message-ID: <20160114121749.CC0EC3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/e6a6d2963c0ae788178e1298e3c0729100f0f86b/ghc >--------------------------------------------------------------- commit e6a6d2963c0ae788178e1298e3c0729100f0f86b Author: Iavor S. Diatchki Date: Wed Jan 13 11:30:40 2016 -0800 Handle over-applied custom type errors too. Consider type family F :: Type -> Type where F = TypeError (Text "Error") Now, if we see something like `F Int` we should still report the custom type error. (cherry picked from commit 6ea24af9f22f6ea661d79623135f4cd31e28c6a2) >--------------------------------------------------------------- e6a6d2963c0ae788178e1298e3c0729100f0f86b compiler/typecheck/TcRnTypes.hs | 6 +++--- compiler/types/Type.hs | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/compiler/typecheck/TcRnTypes.hs b/compiler/typecheck/TcRnTypes.hs index 3822e83..fded11c 100644 --- a/compiler/typecheck/TcRnTypes.hs +++ b/compiler/typecheck/TcRnTypes.hs @@ -1733,9 +1733,9 @@ isTypeHoleCt (CHoleCan { cc_hole = TypeHole }) = True isTypeHoleCt _ = False -- | The following constraints are considered to be a custom type error: --- 1. TypeError msg --- 2. TypeError msg ~ Something (and the other way around) --- 3. C (TypeError msg) (for any parameter of class constraint) +-- 1. TypeError msg a b c +-- 2. TypeError msg a b c ~ Something (and the other way around) +-- 4. C (TypeError msg a b c) (for any parameter of class constraint) getUserTypeErrorMsg :: Ct -> Maybe Type getUserTypeErrorMsg ct | Just (_,t1,t2) <- getEqPredTys_maybe ctT = oneOf [t1,t2] diff --git a/compiler/types/Type.hs b/compiler/types/Type.hs index 42263d8..a149bbb 100644 --- a/compiler/types/Type.hs +++ b/compiler/types/Type.hs @@ -713,7 +713,10 @@ isStrLitTy _ = Nothing -- If so, give us the kind and the error message. userTypeError_maybe :: Type -> Maybe Type userTypeError_maybe t - = do { (tc, [_kind, msg]) <- splitTyConApp_maybe t + = do { (tc, _kind : msg : _) <- splitTyConApp_maybe t + -- There may be more than 2 arguments, if the type error is + -- used as a type constructor (e.g. at kind `Type -> Type`). + ; guard (tyConName tc == errorMessageTypeErrorFamName) ; return msg } From git at git.haskell.org Thu Jan 14 12:17:52 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 14 Jan 2016 12:17:52 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Minor improvement in CoreDump outputs: (5878aa0) Message-ID: <20160114121752.7B56E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/5878aa098a11ac685588b00969b7b567dfc43f20/ghc >--------------------------------------------------------------- commit 5878aa098a11ac685588b00969b7b567dfc43f20 Author: ?mer Sinan A?acan Date: Wed Jan 13 09:16:38 2016 -0500 Minor improvement in CoreDump outputs: Don't add parens unnecessarily when arguments of the application are all hidden (because of parameters like -dsuppress-all, -dsuppress-type-applications etc.) Reviewers: bgamari, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1771 (cherry picked from commit c3133273070b865011d848ec17b550168072f73c) >--------------------------------------------------------------- 5878aa098a11ac685588b00969b7b567dfc43f20 compiler/coreSyn/PprCore.hs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/compiler/coreSyn/PprCore.hs b/compiler/coreSyn/PprCore.hs index da2b311..147ff31 100644 --- a/compiler/coreSyn/PprCore.hs +++ b/compiler/coreSyn/PprCore.hs @@ -147,11 +147,18 @@ ppr_expr add_par expr@(Lam _ _) 2 (pprCoreExpr body) ppr_expr add_par expr@(App {}) - = case collectArgs expr of { (fun, args) -> + = sdocWithDynFlags $ \dflags -> + case collectArgs expr of { (fun, args) -> let pp_args = sep (map pprArg args) val_args = dropWhile isTypeArg args -- Drop the type arguments for tuples pp_tup_args = pprWithCommas pprCoreExpr val_args + args' + | gopt Opt_SuppressTypeApplications dflags = val_args + | otherwise = args + parens + | null args' = id + | otherwise = add_par in case fun of Var f -> case isDataConWorkId_maybe f of @@ -164,9 +171,9 @@ ppr_expr add_par expr@(App {}) tc = dataConTyCon dc saturated = val_args `lengthIs` idArity f - _ -> add_par (hang (ppr f) 2 pp_args) + _ -> parens (hang (ppr f) 2 pp_args) - _ -> add_par (hang (pprParendExpr fun) 2 pp_args) + _ -> parens (hang (pprParendExpr fun) 2 pp_args) } ppr_expr add_par (Case expr var ty [(con,args,rhs)]) From git at git.haskell.org Thu Jan 14 12:17:55 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 14 Jan 2016 12:17:55 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: GHC.Generics: Fix documentation (20b0416) Message-ID: <20160114121755.2813F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/20b0416164411d24e81e654c52cd82f63f5522f9/ghc >--------------------------------------------------------------- commit 20b0416164411d24e81e654c52cd82f63f5522f9 Author: Ben Gamari Date: Wed Jan 13 21:36:51 2016 +0100 GHC.Generics: Fix documentation Fixes #11417. (cherry picked from commit 91dcc655932b7977c9901d3504bc3d8f0ca8cb6e) >--------------------------------------------------------------- 20b0416164411d24e81e654c52cd82f63f5522f9 libraries/base/GHC/Generics.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/base/GHC/Generics.hs b/libraries/base/GHC/Generics.hs index 16e61f9..3ac4d5c 100644 --- a/libraries/base/GHC/Generics.hs +++ b/libraries/base/GHC/Generics.hs @@ -386,7 +386,7 @@ module GHC.Generics ( -- @ -- class Encode a where -- encode :: a -> [Bool] --- default encode :: ('Generic' a) => a -> [Bool] +-- default encode :: (Generic a, Encode' (Rep a)) => a -> [Bool] -- encode x = encode' ('from' x) -- @ -- From git at git.haskell.org Thu Jan 14 12:17:57 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 14 Jan 2016 12:17:57 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Minor code refactoring (2f78d98) Message-ID: <20160114121757.D44973A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/2f78d980bedf294932ff5fbe9f27d2aaf45f425f/ghc >--------------------------------------------------------------- commit 2f78d980bedf294932ff5fbe9f27d2aaf45f425f Author: Jan Stolarek Date: Thu Jan 14 09:26:44 2016 +0100 Minor code refactoring This moves let-bindings right next to their use site. (cherry picked from commit c73333a1a1b6697e5ffa54fa1f3c96fe54bf42b4) >--------------------------------------------------------------- 2f78d980bedf294932ff5fbe9f27d2aaf45f425f compiler/typecheck/TcSplice.hs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/compiler/typecheck/TcSplice.hs b/compiler/typecheck/TcSplice.hs index 9a4a171..9ee7335 100644 --- a/compiler/typecheck/TcSplice.hs +++ b/compiler/typecheck/TcSplice.hs @@ -1399,9 +1399,6 @@ reifyDataCon isGadtDataCon tys dc ; r_arg_tys <- reifyTypes (if isGadtDataCon then g_arg_tys else arg_tys) - ; let [r_a1, r_a2] = r_arg_tys - [s1, s2] = dcdBangs - ; main_con <- if | not (null fields) && not isGadtDataCon -> return $ TH.RecC name (zip3 (map reifyFieldLabel fields) @@ -1415,8 +1412,10 @@ reifyDataCon isGadtDataCon tys dc -- constructors can be declared infix. -- See Note [Infix GADT constructors] in TcTyClsDecls. | dataConIsInfix dc && not isGadtDataCon -> - ASSERT( length arg_tys == 2 ) - return $ TH.InfixC (s1,r_a1) name (s2,r_a2) + ASSERT( length arg_tys == 2 ) do + { let [r_a1, r_a2] = r_arg_tys + [s1, s2] = dcdBangs + ; return $ TH.InfixC (s1,r_a1) name (s2,r_a2) } | isGadtDataCon -> do { res_ty <- reifyType g_res_ty ; return $ TH.GadtC [name] (dcdBangs `zip` r_arg_tys) res_ty } From git at git.haskell.org Thu Jan 14 12:18:00 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 14 Jan 2016 12:18:00 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: users-guide: Wibbles (5daf176) Message-ID: <20160114121800.8968F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/5daf1768419c58c63c69b8f8a47abd1eba0839b9/ghc >--------------------------------------------------------------- commit 5daf1768419c58c63c69b8f8a47abd1eba0839b9 Author: Ben Gamari Date: Wed Jan 13 19:53:01 2016 +0100 users-guide: Wibbles (cherry picked from commit 61011b4e76fcdaa6602faf3e735ed5afd2240d00) >--------------------------------------------------------------- 5daf1768419c58c63c69b8f8a47abd1eba0839b9 docs/users_guide/glasgow_exts.rst | 2 +- docs/users_guide/profiling.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index 7d37c63..2769a1a 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -12239,7 +12239,7 @@ package on Hackage. More information ---------------- -For more details please refer to the `HaskellWiki +For more details please refer to the `Haskell Wiki page `__ or the original paper [Generics2010]_. diff --git a/docs/users_guide/profiling.rst b/docs/users_guide/profiling.rst index a163173..4d0bb3a 100644 --- a/docs/users_guide/profiling.rst +++ b/docs/users_guide/profiling.rst @@ -335,7 +335,7 @@ for all modules in a program. Adds an automatic ``SCC`` annotation to all *call sites*. This is particularly useful when using profiling for the purposes of - generating stack traces; see the function ``traceStack`` in the + generating stack traces; see the function :base-ref:`traceStack ` in the module ``Debug.Trace``, or the :rts-flag:`-xc` RTS flag (:ref:`rts-options-debugging`) for more details. From git at git.haskell.org Thu Jan 14 12:18:04 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 14 Jan 2016 12:18:04 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Add tests for #11391 (59f58ea) Message-ID: <20160114121804.286FE3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/59f58ea540654f4a8d64bc881845ca9860ae2bf2/ghc >--------------------------------------------------------------- commit 59f58ea540654f4a8d64bc881845ca9860ae2bf2 Author: Ben Gamari Date: Thu Jan 14 11:27:37 2016 +0100 Add tests for #11391 (cherry picked from commit f0c4e460ee0dad372d5b896a03cdac9666026174) >--------------------------------------------------------------- 59f58ea540654f4a8d64bc881845ca9860ae2bf2 .../tests/typecheck/should_fail/CustomTypeErrors04.hs | 14 ++++++++++++++ .../tests/typecheck/should_fail/CustomTypeErrors04.stderr | 5 +++++ .../tests/typecheck/should_fail/CustomTypeErrors05.hs | 14 ++++++++++++++ .../tests/typecheck/should_fail/CustomTypeErrors05.stderr | 5 +++++ testsuite/tests/typecheck/should_fail/all.T | 2 ++ 5 files changed, 40 insertions(+) diff --git a/testsuite/tests/typecheck/should_fail/CustomTypeErrors04.hs b/testsuite/tests/typecheck/should_fail/CustomTypeErrors04.hs new file mode 100644 index 0000000..d1957bf --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/CustomTypeErrors04.hs @@ -0,0 +1,14 @@ +{-# LANGUAGE TypeInType, TypeFamilies, UndecidableInstances #-} +{-# LANGUAGE UndecidableInstances #-} + +-- The "bad case" in #11391 +module CustomTypeErrors04 where + +import Data.Kind +import GHC.TypeLits (TypeError, ErrorMessage(..)) + +type family Resolve (t :: Type -> Type) :: Type -> Type where + Resolve _ = TypeError (Text "ERROR") + +testNOTOK1 :: Resolve [] Int +testNOTOK1 = () diff --git a/testsuite/tests/typecheck/should_fail/CustomTypeErrors04.stderr b/testsuite/tests/typecheck/should_fail/CustomTypeErrors04.stderr new file mode 100644 index 0000000..9bec37b --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/CustomTypeErrors04.stderr @@ -0,0 +1,5 @@ + +CustomTypeErrors04.hs:14:14: error: + ? ERROR + ? In the expression: () + In an equation for ?testNOTOK1?: testNOTOK1 = () diff --git a/testsuite/tests/typecheck/should_fail/CustomTypeErrors05.hs b/testsuite/tests/typecheck/should_fail/CustomTypeErrors05.hs new file mode 100644 index 0000000..5a15b6f --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/CustomTypeErrors05.hs @@ -0,0 +1,14 @@ +{-# LANGUAGE TypeInType, TypeFamilies, UndecidableInstances #-} +{-# LANGUAGE UndecidableInstances #-} + +-- The "tricky case" in #11391 +module CustomTypeErrors05 where + +import Data.Kind +import GHC.TypeLits (TypeError, ErrorMessage(..)) + +type family Resolve (t :: Type -> Type) :: Type -> Type where + Resolve _ = TypeError (Text "ERROR") + +testNOTOK2 :: Resolve [] Int +testNOTOK2 = 1 diff --git a/testsuite/tests/typecheck/should_fail/CustomTypeErrors05.stderr b/testsuite/tests/typecheck/should_fail/CustomTypeErrors05.stderr new file mode 100644 index 0000000..3164c86 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/CustomTypeErrors05.stderr @@ -0,0 +1,5 @@ + +CustomTypeErrors05.hs:14:14: error: + ? ERROR + ? In the expression: 1 + In an equation for ?testNOTOK2?: testNOTOK2 = 1 diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T index 753708d..9aef820 100644 --- a/testsuite/tests/typecheck/should_fail/all.T +++ b/testsuite/tests/typecheck/should_fail/all.T @@ -394,6 +394,8 @@ test('T10971d', extra_clean(['T10971c.hi', 'T10971c.o']), multimod_compile_fail, test('CustomTypeErrors01', normal, compile_fail, ['']) test('CustomTypeErrors02', normal, compile_fail, ['']) test('CustomTypeErrors03', normal, compile_fail, ['']) +test('CustomTypeErrors04', normal, compile_fail, ['']) +test('CustomTypeErrors05', normal, compile_fail, ['']) test('T11112', normal, compile_fail, ['']) test('ClassOperator', normal, compile_fail, ['']) test('T11274', normal, compile_fail, ['']) From git at git.haskell.org Thu Jan 14 12:18:06 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 14 Jan 2016 12:18:06 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: INSTALL.md: Mention -j and other wibbles (35751ec) Message-ID: <20160114121806.C94543A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/35751ec8c732002e09b8bc31c1b5aa0dfd43bb97/ghc >--------------------------------------------------------------- commit 35751ec8c732002e09b8bc31c1b5aa0dfd43bb97 Author: Ben Gamari Date: Thu Jan 14 11:33:09 2016 +0100 INSTALL.md: Mention -j and other wibbles (cherry picked from commit b0641ad9009df1e3f4eae4274668840ff6e46732) >--------------------------------------------------------------- 35751ec8c732002e09b8bc31c1b5aa0dfd43bb97 INSTALL.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 34bb5b4..3ae9186 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -8,13 +8,13 @@ has all the answers. Before building GHC you may need to install some other tools and libraries. See "Setting up your system for building GHC" [2]. -NB. in particular you need GHC installed in order to build GHC, +N.B. in particular you need GHC installed in order to build GHC, because the compiler is itself written in Haskell. For instructions on how to port GHC to a new platform, see the Building Guide [1]. For building library documentation, you'll need Haddock [3]. To build the compiler documentation, you need [Sphinx](http://www.sphinx-doc.org/) and -Xelatex (only for PDF output). +XeLaTex (only for PDF output). Quick start: the following gives you a default build: @@ -28,7 +28,10 @@ Quick start: the following gives you a default build: $ ./configure --enable-tarballs-autodownload -The "perl boot" step is only necessary if this is a tree checked out +You can use Make's `-jN` option to parallelize the build. It's generally best +to set `N` somewhere around the core count of the build machine. + +The `perl boot` step is only necessary if this is a tree checked out from git. For source distributions downloaded from GHC's web site, this step has already been performed. From git at git.haskell.org Thu Jan 14 12:18:09 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 14 Jan 2016 12:18:09 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: users-guide: Add since annotations for language extensions (eb13ce9) Message-ID: <20160114121809.817AC3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/eb13ce938b6f87550013351f4a6f533a25f20771/ghc >--------------------------------------------------------------- commit eb13ce938b6f87550013351f4a6f533a25f20771 Author: Ben Gamari Date: Thu Jan 14 12:18:09 2016 +0100 users-guide: Add since annotations for language extensions Based off of https://ghc.haskell.org/trac/ghc/wiki/LanguagePragmaHistory. (cherry picked from commit b355b8fc5287bb10da6ead223f91f7de647bb908) >--------------------------------------------------------------- eb13ce938b6f87550013351f4a6f533a25f20771 docs/users_guide/glasgow_exts.rst | 60 +++++++++++++++++++++++++++++++++++++++ docs/users_guide/safe_haskell.rst | 6 ++++ 2 files changed, 66 insertions(+) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc eb13ce938b6f87550013351f4a6f533a25f20771 From git at git.haskell.org Thu Jan 14 12:18:12 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 14 Jan 2016 12:18:12 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Rename InjectiveTypeFamilies to TypeFamilyDependencies (76cfbc0) Message-ID: <20160114121812.3F9153A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/76cfbc0ebaa9eb1b506d0a6b8a641140c721de53/ghc >--------------------------------------------------------------- commit 76cfbc0ebaa9eb1b506d0a6b8a641140c721de53 Author: Ben Gamari Date: Thu Jan 14 11:52:10 2016 +0100 Rename InjectiveTypeFamilies to TypeFamilyDependencies (cherry picked from commit 78a4c729ecb07c92822625fda15f14a778679452) >--------------------------------------------------------------- 76cfbc0ebaa9eb1b506d0a6b8a641140c721de53 compiler/main/DynFlags.hs | 4 ++-- compiler/typecheck/TcTyClsDecls.hs | 4 ++-- docs/users_guide/glasgow_exts.rst | 7 ++++--- libraries/ghc-boot/GHC/LanguageExtensions.hs | 2 +- testsuite/tests/driver/T11381.hs | 2 +- testsuite/tests/driver/T11381.stderr | 2 +- testsuite/tests/driver/T4437.hs | 2 +- testsuite/tests/ghci/scripts/T6018ghci.script | 2 +- testsuite/tests/ghci/scripts/T6018ghcifail.script | 2 +- testsuite/tests/ghci/scripts/T6018ghcirnfail.script | 2 +- testsuite/tests/th/T6018th.hs | 2 +- testsuite/tests/th/T8884.hs | 2 +- testsuite/tests/typecheck/should_compile/T6018.hs | 2 +- testsuite/tests/typecheck/should_compile/T6018.hs-boot | 2 +- testsuite/tests/typecheck/should_compile/T6018a.hs | 2 +- testsuite/tests/typecheck/should_fail/T10836.hs | 2 +- testsuite/tests/typecheck/should_fail/T6018Afail.hs | 2 +- testsuite/tests/typecheck/should_fail/T6018Bfail.hs | 2 +- testsuite/tests/typecheck/should_fail/T6018fail.hs | 2 +- testsuite/tests/typecheck/should_fail/T6018failclosed.hs | 2 +- testsuite/tests/typecheck/should_fail/T6018failclosed2.hs | 2 +- utils/mkUserGuidePart/Options/Language.hs | 4 ++-- 22 files changed, 28 insertions(+), 27 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 76cfbc0ebaa9eb1b506d0a6b8a641140c721de53 From git at git.haskell.org Thu Jan 14 12:18:14 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 14 Jan 2016 12:18:14 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: users-guide: Update language extension implications (62fa1cc) Message-ID: <20160114121814.E27D93A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/62fa1cc73a51dcb790e7191305f71cc82a92464c/ghc >--------------------------------------------------------------- commit 62fa1cc73a51dcb790e7191305f71cc82a92464c Author: Ben Gamari Date: Thu Jan 14 12:08:14 2016 +0100 users-guide: Update language extension implications (cherry picked from commit 4dbc31b8240d98bd7eb4fd0874c7da91797c4e2e) >--------------------------------------------------------------- 62fa1cc73a51dcb790e7191305f71cc82a92464c docs/users_guide/glasgow_exts.rst | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index 4a5b77e..410565b 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -2187,7 +2187,8 @@ Visible type application .. ghc-flag:: -XTypeApplications - :since: 8.0 + :implies: :ghc-flag:`-XAllowAmbiguousTypes` + :since: 8.0.1 Allow the use of type application syntax. @@ -2421,6 +2422,8 @@ Type operators .. ghc-flag:: -XTypeOperators + :implies: :ghc-flag:`-XExplicitNamespaces` + Allow the use and definition of types with operator names. In types, an operator symbol like ``(+)`` is normally treated as a type @@ -2470,6 +2473,8 @@ Liberalised type synonyms .. ghc-flag:: -XLiberalTypeSynonyms + :implies: :ghc-flag:`-XExplicitForAll` + Relax many of the Haskell 98 rules on type synonym definitions. Type synonyms are like macros at the type level, but Haskell 98 imposes @@ -2546,6 +2551,8 @@ Existentially quantified data constructors .. ghc-flag:: -XExistentialQuantification + :implies: :ghc-flag:`-XExplicitForAll` + Allow existentially quantified type variables in types. The idea of using existential quantification in data type declarations @@ -3050,7 +3057,7 @@ Generalised Algebraic Data Types (GADTs) .. ghc-flag:: -XGADTs - :implies: :ghc-flag:`-XMonoLocalBinds` + :implies: :ghc-flag:`-XMonoLocalBinds`, :ghc-flag:`-XGADTSyntax` Allow use of Generalised Algebraic Data Types (GADTs). @@ -3272,6 +3279,8 @@ Duplicate record fields .. ghc-flag:: -XDuplicateRecordFields + :implies: :ghc-flag:`-XDisambiguateRecordFields` + Allow definition of record types with identically-named fields. Going beyond :ghc-flag:`-XDisambiguateRecordFields` (see :ref:`disambiguate-fields`), @@ -3691,8 +3700,6 @@ Deriving instances of extra classes (``Data``, etc.) .. ghc-flag:: -XDeriveFoldable - :implies: :ghc-flag:`-XDeriveFunctor` - Allow automatic deriving of instances for the ``Foldable`` typeclass. .. ghc-flag:: -XDeriveTraversable @@ -4456,6 +4463,8 @@ Multi-parameter type classes .. ghc-flag:: -XMultiParamTypeClasses + :implies: :ghc-flag:`-XConstrainedClassMethods` + Allow the definition of typeclasses with more than one parameter. Multi-parameter type classes are permitted, with flag @@ -4619,6 +4628,8 @@ Functional dependencies .. ghc-flag:: -XFunctionalDependencies + :implies: :ghc-flag:`-XMultiParamTypeClasses` + Allow use of functional dependencies in class declarations. Functional dependencies are implemented as described by [Jones2000]_.Mark Jones in @@ -5882,7 +5893,8 @@ Type families .. ghc-flag:: -XTypeFamilies - :implies: :ghc-flag:`-XMonoLocalBinds` + :implies: :ghc-flag:`-XMonoLocalBinds`, :ghc-flag:`-XKindSignatures`, + :ghc-flag:`-XExplicitNamespaces` Allow use and definition of indexed type and data families. @@ -6743,6 +6755,8 @@ Injective type families .. ghc-flag:: -XTypeFamilyDependencies + :implies: :ghc-flag:`-XTypeFamilies` + Allow functional dependency annotations on type families. This allows one to define injective type families. @@ -8398,6 +8412,8 @@ Impredicative polymorphism .. ghc-flag:: -XImpredicativeTypes + :implies: :ghc-flag:`RankNTypes` + Allow impredicative polymorphic types. In general, GHC will only instantiate a polymorphic function at a @@ -8450,6 +8466,7 @@ Lexically scoped type variables .. ghc-flag:: -XScopedTypeVariables :implies: :ghc-flag:`-XRelaxedPolyRec` + :implies: :ghc-flag:`-XExplicitForAll` Enable lexical scoping of type variables explicitly introduced with ``forall``. @@ -9421,6 +9438,8 @@ Syntax .. ghc-flag:: -XTemplateHaskell + :implies: :ghc-flag:`-XTemplateHaskellQuotes` + Enable Template Haskell's splice and quotation syntax. .. ghc-flag:: -XTemplateHaskellQuotes From git at git.haskell.org Thu Jan 14 13:04:46 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 14 Jan 2016 13:04:46 +0000 (UTC) Subject: [commit: ghc] master: user-guide: Use ghc-flag for dump formatting flags (83c13c2) Message-ID: <20160114130446.D1E933A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/83c13c2a6b7d7424d0bbee31f4ef2e7ab44836b0/ghc >--------------------------------------------------------------- commit 83c13c2a6b7d7424d0bbee31f4ef2e7ab44836b0 Author: Ben Gamari Date: Thu Jan 14 13:49:17 2016 +0100 user-guide: Use ghc-flag for dump formatting flags And document -dth-dec-file. Not sure how these were missed. >--------------------------------------------------------------- 83c13c2a6b7d7424d0bbee31f4ef2e7ab44836b0 docs/users_guide/debugging.rst | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/docs/users_guide/debugging.rst b/docs/users_guide/debugging.rst index f366d95..80c9f8d 100644 --- a/docs/users_guide/debugging.rst +++ b/docs/users_guide/debugging.rst @@ -51,6 +51,10 @@ Dumping out compiler intermediate structures Dump Template Haskell expressions that we splice in, and what Haskell code the expression evaluates to. + .. ghc-flag:: -dth-dec-file= + + Dump expansions of all top-level Template Haskell splices into ?file?. + .. ghc-flag:: -ddump-types Dump a type signature for each value defined at the top level of @@ -226,32 +230,24 @@ Formatting dumps .. index:: single: formatting dumps -``-dppr-user-length`` - .. index:: - single: -dppr-user-length +.. ghc-flag:: -dppr-user-length In error messages, expressions are printed to a certain "depth", with subexpressions beyond the depth replaced by ellipses. This flag sets the depth. Its default value is 5. -``-dppr-colsNNN`` - .. index:: - single: -dppr-colsNNN +.. ghc-flag:: -dppr-cols=N Set the width of debugging output. Use this if your code is wrapping - too much. For example: ``-dppr-cols200``. + too much. For example: ``-dppr-cols=200``. -``-dppr-case-as-let`` - .. index:: - single: -dppr-case-as-let +.. ghc-flag:: -dppr-case-as-let Print single alternative case expressions as though they were strict let expressions. This is helpful when your code does a lot of unboxing. -``-dno-debug-output`` - .. index:: - single: -dno-debug-output +.. ghc-flag:: -dno-debug-output Suppress any unsolicited debugging output. When GHC has been built with the ``DEBUG`` option it occasionally emits debug output of From git at git.haskell.org Thu Jan 14 18:51:39 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 14 Jan 2016 18:51:39 +0000 (UTC) Subject: [commit: ghc] master: API Annotations: use AnnValue for (~) (fd686c4) Message-ID: <20160114185139.8C77F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/fd686c43c45b68fec97ae4c45709358798af6121/ghc >--------------------------------------------------------------- commit fd686c43c45b68fec97ae4c45709358798af6121 Author: Alan Zimmerman Date: Thu Jan 14 20:46:35 2016 +0200 API Annotations: use AnnValue for (~) Previously oqtycon used AnnTilde for the location of the RdrName when parsing (~). The recent increase in '~' characters in the AST confuses ghc-exactprint, so this patch treats all RdrNames the same way now, marking the location of the core name with AnnValue. >--------------------------------------------------------------- fd686c43c45b68fec97ae4c45709358798af6121 compiler/parser/Parser.y | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/parser/Parser.y b/compiler/parser/Parser.y index 7c9aea8..5f6f12c 100644 --- a/compiler/parser/Parser.y +++ b/compiler/parser/Parser.y @@ -2840,7 +2840,7 @@ oqtycon :: { Located RdrName } -- An "ordinary" qualified tycon; | '(' qtyconsym ')' {% ams (sLL $1 $> (unLoc $2)) [mop $1,mj AnnVal $2,mcp $3] } | '(' '~' ')' {% ams (sLL $1 $> $ eqTyCon_RDR) - [mop $1,mj AnnTilde $2,mcp $3] } + [mop $1,mj AnnVal $2,mcp $3] } oqtycon_no_varcon :: { Located RdrName } -- Type constructor which cannot be mistaken -- for variable constructor in export lists From git at git.haskell.org Thu Jan 14 20:24:13 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 14 Jan 2016 20:24:13 +0000 (UTC) Subject: [commit: ghc] master: T11300: Fix test on windows (db371c1) Message-ID: <20160114202413.65E1A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/db371c10a2da722a18b0d5bc042eb2d02ba60e1b/ghc >--------------------------------------------------------------- commit db371c10a2da722a18b0d5bc042eb2d02ba60e1b Author: Tamar Christina Date: Sun Jan 10 07:20:57 2016 +0100 T11300: Fix test on windows Summary: Fix exit code for Windows to match expected for out-of-memory test Test Plan: ./validate Reviewers: simonmar, austin, thomie, bgamari Reviewed By: thomie, bgamari Differential Revision: https://phabricator.haskell.org/D1753 GHC Trac Issues: #11422 >--------------------------------------------------------------- db371c10a2da722a18b0d5bc042eb2d02ba60e1b rts/win32/OSMem.c | 5 +++-- rts/win32/veh_excn.c | 3 +-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rts/win32/OSMem.c b/rts/win32/OSMem.c index 47e24f0..0009a4e 100644 --- a/rts/win32/OSMem.c +++ b/rts/win32/OSMem.c @@ -59,7 +59,8 @@ allocNew(nat n) { rec=0; if (GetLastError() == ERROR_NOT_ENOUGH_MEMORY) { - errorBelch("out of memory"); + errorBelch("Out of memory"); + stg_exit(EXIT_HEAPOVERFLOW); } else { sysErrorBelch( "getMBlocks: VirtualAlloc MEM_RESERVE %d blocks failed", n); @@ -177,7 +178,7 @@ commitBlocks(char* base, W_ size) { temp = VirtualAlloc(base, size_delta, MEM_COMMIT, PAGE_READWRITE); if(temp==0) { sysErrorBelch("getMBlocks: VirtualAlloc MEM_COMMIT failed"); - stg_exit(EXIT_FAILURE); + stg_exit(EXIT_HEAPOVERFLOW); } size-=size_delta; base+=size_delta; diff --git a/rts/win32/veh_excn.c b/rts/win32/veh_excn.c index a24354e..bf2151a 100644 --- a/rts/win32/veh_excn.c +++ b/rts/win32/veh_excn.c @@ -37,7 +37,6 @@ long WINAPI __hs_exception_handler(struct _EXCEPTION_POINTERS *exception_data) // return immediately. if ((exception_data->ExceptionRecord->ExceptionFlags & EH_UNWINDING) == 0) { - // Error handling cases covered by this implementation. switch (exception_data->ExceptionRecord->ExceptionCode) { case EXCEPTION_FLT_DIVIDE_BY_ZERO: @@ -62,7 +61,7 @@ long WINAPI __hs_exception_handler(struct _EXCEPTION_POINTERS *exception_data) if (EXCEPTION_CONTINUE_EXECUTION == action) { fflush(stdout); - stg_exit(1); + stg_exit(EXIT_FAILURE); } } From git at git.haskell.org Thu Jan 14 20:34:58 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 14 Jan 2016 20:34:58 +0000 (UTC) Subject: [commit: ghc] master: Remove lookup of sections by name instead use the index numbers as offsets (49e414a) Message-ID: <20160114203458.43F833A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/49e414a736efe6a5aa221907d9eab9019978e225/ghc >--------------------------------------------------------------- commit 49e414a736efe6a5aa221907d9eab9019978e225 Author: Tamar Christina Date: Tue Jan 12 20:34:25 2016 +0100 Remove lookup of sections by name instead use the index numbers as offsets Summary: This patch comes from @awson {{{ Playing with `-fsplit-sections` on Windows I've found a pile of ancient (it was borrowed from Hugs interpreter code and I don't even know when was it created), absolutely redundant and plain wrong code in RTS linker. Technically it is a bug, but it doesn't break things when used with current Windows binutils with no special linker scripts involved. OTOH, it slows down runtime linker on Windows noticeably and thus can be considered as a performance bug. The nice side-effect for existing users is that GHCi now loads compiled object code much faster on Windows. }}} More specifically, sections were being looked up by name by doing a loop over all sections until the section with the given name is found. The new approach uses the section index and finds the section in O(1) time based on information gathered when we originally processed the section Test Plan: ./validate (was run on GHC x86) Reviewers: austin, awson, erikd, thomie, bgamari Reviewed By: thomie, bgamari Subscribers: awson, #ghc_windows_task_force Differential Revision: https://phabricator.haskell.org/D1773 GHC Trac Issues: #11388 >--------------------------------------------------------------- 49e414a736efe6a5aa221907d9eab9019978e225 rts/Linker.c | 64 +----------------------------------------------------------- 1 file changed, 1 insertion(+), 63 deletions(-) diff --git a/rts/Linker.c b/rts/Linker.c index 6e20984..1c76a00 100644 --- a/rts/Linker.c +++ b/rts/Linker.c @@ -3232,62 +3232,6 @@ cstring_from_section_name (UChar* name, UChar* strtab) } } -/* Just compares the short names (first 8 chars) */ -static COFF_section * -findPEi386SectionCalled ( ObjectCode* oc, UChar* name, UChar* strtab ) -{ - int i; - rtsBool long_name = rtsFalse; - COFF_header* hdr - = (COFF_header*)(oc->image); - COFF_section* sectab - = (COFF_section*) ( - ((UChar*)(oc->image)) - + sizeof_COFF_header + hdr->SizeOfOptionalHeader - ); - // String is longer than 8 bytes, swap in the proper - // (NULL-terminated) version, and make a note that this - // is a long name. - if (name[0]==0 && name[1]==0 && name[2]==0 && name[3]==0) { - UInt32 strtab_offset = * (UInt32*)(name+4); - name = ((UChar*)strtab) + strtab_offset; - long_name = rtsTrue; - } - for (i = 0; i < hdr->NumberOfSections; i++) { - UChar* n1; - UChar* n2; - COFF_section* section_i - = (COFF_section*) - myindex ( sizeof_COFF_section, sectab, i ); - n1 = (UChar*) &(section_i->Name); - n2 = name; - // Long section names are prefixed with a slash, see - // also cstring_from_section_name - if (n1[0] == '/' && long_name) { - // Long name check - // We don't really want to make an assumption that the string - // table indexes are the same, so we'll do a proper check. - int n1_strtab_offset = strtol((char*)n1+1,NULL,10); - n1 = (UChar*) (((char*)strtab) + n1_strtab_offset); - if (0==strcmp((const char*)n1, (const char*)n2)) { - return section_i; - } - } else if (n1[0] != '/' && !long_name) { - // Short name check - if (n1[0]==n2[0] && n1[1]==n2[1] && n1[2]==n2[2] && - n1[3]==n2[3] && n1[4]==n2[4] && n1[5]==n2[5] && - n1[6]==n2[6] && n1[7]==n2[7]) { - return section_i; - } - } else { - // guaranteed to mismatch, because we never attempt to link - // in an executable where the section name may be truncated - } - } - - return NULL; -} - /* See Note [mingw-w64 name decoration scheme] */ #ifndef x86_64_HOST_ARCH static void @@ -3986,13 +3930,7 @@ ocResolve_PEi386 ( ObjectCode* oc ) if (sym->StorageClass == MYIMAGE_SYM_CLASS_STATIC) { COFF_section* section_sym - = findPEi386SectionCalled ( oc, sym->Name, strtab ); - if (!section_sym) { - errorBelch("%" PATH_FMT ": can't find section named: ", oc->fileName); - printName(sym->Name, strtab); - errorBelch(" in %s", secname); - return 0; - } + = (COFF_section*) myindex ( sizeof_COFF_section, sectab, sym->SectionNumber-1 ); S = ((size_t)(oc->image)) + ((size_t)(section_sym->PointerToRawData)) + ((size_t)(sym->Value)); From git at git.haskell.org Fri Jan 15 05:38:11 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 15 Jan 2016 05:38:11 +0000 (UTC) Subject: [commit: ghc] master: Fix #11015 with a nice note. (91f1c60) Message-ID: <20160115053811.BFC863A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/91f1c600614e8c456a62bd95611400b442113cdf/ghc >--------------------------------------------------------------- commit 91f1c600614e8c456a62bd95611400b442113cdf Author: Edward Z. Yang Date: Wed Jan 13 16:10:11 2016 -0800 Fix #11015 with a nice note. Signed-off-by: Edward Z. Yang Test Plan: doc only Reviewers: bgamari, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1776 GHC Trac Issues: #11015 >--------------------------------------------------------------- 91f1c600614e8c456a62bd95611400b442113cdf compiler/basicTypes/Module.hs | 70 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/compiler/basicTypes/Module.hs b/compiler/basicTypes/Module.hs index 8015a25..0051147 100644 --- a/compiler/basicTypes/Module.hs +++ b/compiler/basicTypes/Module.hs @@ -95,6 +95,76 @@ import qualified Data.Map as Map import qualified FiniteMap as Map import System.FilePath +-- Note [The identifier lexicon] +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-- Package keys, installed package IDs, ABI hashes, package names, +-- versions, there are a *lot* of different identifiers for closely +-- related things. What do they all mean? Here's what. (See also +-- https://ghc.haskell.org/trac/ghc/wiki/Commentary/Packages/Concepts ) +-- +-- THE IMPORTANT ONES +-- +-- ComponentId: An opaque identifier provided by Cabal, which should +-- uniquely identify such things as the package name, the package +-- version, the name of the component, the hash of the source code +-- tarball, the selected Cabal flags, GHC flags, direct dependencies of +-- the component. These are very similar to InstalledPackageId, but +-- an 'InstalledPackageId' implies that it identifies a package, while +-- a package may install multiple components with different +-- 'ComponentId's. +-- - Same as Distribution.Package.ComponentId +-- +-- UnitId: A ComponentId + a mapping from hole names (ModuleName) to +-- Modules. This is how the compiler identifies instantatiated +-- components, and also is the main identifier by which GHC identifies +-- things. +-- - When Backpack is not being used, UnitId = ComponentId. +-- this means a useful fiction for end-users is that there are +-- only ever ComponentIds, and some ComponentIds happen to have +-- more information (UnitIds). +-- - Same as Language.Haskell.TH.Syntax:PkgName, see +-- https://ghc.haskell.org/trac/ghc/ticket/10279 +-- - The same as PackageKey in GHC 7.10 (we renamed it because +-- they don't necessarily identify packages anymore.) +-- - Same as -this-package-key/-package-name flags +-- +-- Module: A UnitId + ModuleName. This is how the compiler identifies +-- modules (e.g. a Name is a Module + OccName) +-- - Same as Language.Haskell.TH.Syntax:Module +-- +-- THE LESS IMPORTANT ONES +-- +-- PackageName: The "name" field in a Cabal file, something like "lens". +-- - Same as Distribution.Package.PackageName +-- - DIFFERENT FROM Language.Haskell.TH.Syntax:PkgName, see +-- https://ghc.haskell.org/trac/ghc/ticket/10279 +-- - DIFFERENT FROM -package-name flag +-- - DIFFERENT FROM the 'name' field in an installed package +-- information. This field could more accurately be described +-- as a munged package name: when it's for the main library +-- it is the same as the package name, but if it's an internal +-- library it's a munged combination of the package name and +-- the component name. +-- +-- LEGACY ONES +-- +-- InstalledPackageId: This is what we used to call ComponentId. +-- It's a still pretty useful concept for packages that have only +-- one library; in that case the logical InstalledPackageId = +-- ComponentId. Also, the Cabal nix-local-build continues to +-- compute an InstalledPackageId which is then forcibly used +-- for all components in a package. This means that if a dependency +-- from one component in a package changes, the InstalledPackageId +-- changes: you don't get as fine-grained dependency tracking, +-- but it means your builds are hermetic. Eventually, Cabal will +-- deal completely in components and we can get rid of this. +-- +-- PackageKey: This is what we used to call UnitId. We ditched +-- "Package" from the name when we realized that you might want to +-- assign different "PackageKeys" to components from the same package. +-- (For a brief, non-released period of time, we also called these +-- UnitKeys). + {- ************************************************************************ * * From git at git.haskell.org Fri Jan 15 12:07:21 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 15 Jan 2016 12:07:21 +0000 (UTC) Subject: [commit: ghc] master: user-guide: Note Cabal version limitation (b90cac6) Message-ID: <20160115120721.6B49F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/b90cac69b2abec7df998d1d447b3fe075eb8f15c/ghc >--------------------------------------------------------------- commit b90cac69b2abec7df998d1d447b3fe075eb8f15c Author: Ben Gamari Date: Thu Jan 14 15:46:31 2016 +0100 user-guide: Note Cabal version limitation >--------------------------------------------------------------- b90cac69b2abec7df998d1d447b3fe075eb8f15c docs/users_guide/8.0.1-notes.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/users_guide/8.0.1-notes.rst b/docs/users_guide/8.0.1-notes.rst index a5cc2b7..77f038d 100644 --- a/docs/users_guide/8.0.1-notes.rst +++ b/docs/users_guide/8.0.1-notes.rst @@ -7,6 +7,18 @@ The significant changes to the various parts of the compiler are listed in the following sections. There have also been numerous bug fixes and performance improvements over the 7.10 branch. +.. warning:: + + Only Cabal versions 0.24 and newer will function properly with this release. + Consequently it will likely be necessary to recompile ``cabal-install`` + before installing new packages. + + The reason for this is a change in how packages are identified in GHC + 8.0. While previous versions of Cabal identified packages to GHC with a + package key (with GHC's :ghc-flag:`-this-package-key` argument), GHC 8.0 and + later uses installed package IDs in place of package keys. + + Highlights ---------- From git at git.haskell.org Fri Jan 15 12:07:24 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 15 Jan 2016 12:07:24 +0000 (UTC) Subject: [commit: ghc] master: ANNOUNCE: Mention powerpc code generator (8959b03) Message-ID: <20160115120724.1B3C53A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/8959b03e0365d8ff016e95cfe7d87d5488cf3a96/ghc >--------------------------------------------------------------- commit 8959b03e0365d8ff016e95cfe7d87d5488cf3a96 Author: Ben Gamari Date: Thu Jan 14 15:38:49 2016 +0100 ANNOUNCE: Mention powerpc code generator >--------------------------------------------------------------- 8959b03e0365d8ff016e95cfe7d87d5488cf3a96 ANNOUNCE | 6 ++++-- docs/users_guide/8.0.1-notes.rst | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index 2db475e..c00db3c 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -18,7 +18,7 @@ of major features and numerous bug fixes. These include, * More reliable DWARF debugging information - * Support for injective type classes + * Support for injective type families * Applicative do-notation @@ -38,7 +38,9 @@ of major features and numerous bug fixes. These include, * A rewritten (and greatly improved) pattern exhaustiveness checker * GHCi can run the interpreter in a separate process, and the interpreter can - now run profiled code. + now run profiled code + + * A native code generator for powerpc64 and powerpc64le architectures * and more! diff --git a/docs/users_guide/8.0.1-notes.rst b/docs/users_guide/8.0.1-notes.rst index eba0d15..a5cc2b7 100644 --- a/docs/users_guide/8.0.1-notes.rst +++ b/docs/users_guide/8.0.1-notes.rst @@ -23,7 +23,7 @@ The highlights, since the 7.10 branch, are: - More reliable DWARF debugging information -- Support for :ref:`injective type classes ` +- Support for :ref:`injective type families ` - Applicative ``do`` notation (see :ref:`applicative-do`) @@ -50,6 +50,8 @@ The highlights, since the 7.10 branch, are: :ghc-flag:`-fexternal-interpreter` and :ghc-flag:`-prof` (see :ref:`ghci-stack-traces`). +- A native code generator for powerpc64 and powerpc64le architectures + - The reworked users guide you are now reading - Support for Windows XP and earlier has been dropped. From git at git.haskell.org Fri Jan 15 15:31:22 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 15 Jan 2016 15:31:22 +0000 (UTC) Subject: [commit: ghc] master: users-guide: Fix cabal version number (faf3f96) Message-ID: <20160115153122.CAC843A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/faf3f96f6e08c7e5bebc974f7e71580df0c11241/ghc >--------------------------------------------------------------- commit faf3f96f6e08c7e5bebc974f7e71580df0c11241 Author: Ben Gamari Date: Fri Jan 15 13:16:51 2016 +0100 users-guide: Fix cabal version number >--------------------------------------------------------------- faf3f96f6e08c7e5bebc974f7e71580df0c11241 docs/users_guide/8.0.1-notes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/users_guide/8.0.1-notes.rst b/docs/users_guide/8.0.1-notes.rst index 77f038d..80580e2 100644 --- a/docs/users_guide/8.0.1-notes.rst +++ b/docs/users_guide/8.0.1-notes.rst @@ -9,7 +9,7 @@ performance improvements over the 7.10 branch. .. warning:: - Only Cabal versions 0.24 and newer will function properly with this release. + Only Cabal versions 1.24 and newer will function properly with this release. Consequently it will likely be necessary to recompile ``cabal-install`` before installing new packages. From git at git.haskell.org Fri Jan 15 15:31:26 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 15 Jan 2016 15:31:26 +0000 (UTC) Subject: [commit: ghc] master: Link command line libs to temp so (c6a3e22) Message-ID: <20160115153126.56A423A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/c6a3e2277aef2d3b8a472cc82542c9b22cea86bf/ghc >--------------------------------------------------------------- commit c6a3e2277aef2d3b8a472cc82542c9b22cea86bf Author: Peter Trommler Date: Fri Jan 15 13:25:38 2016 +0100 Link command line libs to temp so Symbols in libraries specified on the GHCis command line are not available to compiled modules because shared libraries are loaded with local scope. So we link all libraries specified on the command line into each temporary shared library. Test Plan: validate Reviewers: simonmar, hvr, austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1631 GHC Trac Issues: #10458 >--------------------------------------------------------------- c6a3e2277aef2d3b8a472cc82542c9b22cea86bf compiler/ghci/Linker.hs | 14 +++++++++++++- testsuite/tests/ghci/linking/dyn/Makefile | 7 +++++++ .../tests/ghci/linking/dyn/{T1407.script => T10458.hs} | 6 +++++- testsuite/tests/ghci/linking/dyn/T10458.script | 4 ++++ .../T3279.stdout => ghci/linking/dyn/T10458.stdout} | 0 testsuite/tests/ghci/linking/dyn/all.T | 7 +++++++ 6 files changed, 36 insertions(+), 2 deletions(-) diff --git a/compiler/ghci/Linker.hs b/compiler/ghci/Linker.hs index 8f1107f..44d272e 100644 --- a/compiler/ghci/Linker.hs +++ b/compiler/ghci/Linker.hs @@ -846,6 +846,8 @@ dynLoadObjs _ pls [] = return pls dynLoadObjs hsc_env pls objs = do let dflags = hsc_dflags hsc_env let platform = targetPlatform dflags + let minus_ls = [ lib | Option ('-':'l':lib) <- ldInputs dflags ] + let minus_big_ls = [ lib | Option ('-':'L':lib) <- ldInputs dflags ] (soFile, libPath , libName) <- newTempLibName dflags (soExt platform) let dflags2 = dflags { @@ -863,7 +865,17 @@ dynLoadObjs hsc_env pls objs = do , Option ("-Wl," ++ lp) , Option ("-l" ++ l) ]) - (temp_sos pls), + (temp_sos pls) + ++ concatMap + (\lp -> + [ Option ("-L" ++ lp) + , Option ("-Wl,-rpath") + , Option ("-Wl," ++ lp) + ]) + minus_big_ls + ++ map (\l -> Option ("-l" ++ l)) minus_ls, + -- Add -l options and -L options from dflags. + -- -- When running TH for a non-dynamic way, we still -- need to make -l flags to link against the dynamic -- libraries, so we need to add WayDyn to ways. diff --git a/testsuite/tests/ghci/linking/dyn/Makefile b/testsuite/tests/ghci/linking/dyn/Makefile index bc33048..0f2d6e1 100644 --- a/testsuite/tests/ghci/linking/dyn/Makefile +++ b/testsuite/tests/ghci/linking/dyn/Makefile @@ -39,6 +39,13 @@ compile_libAS: '$(TEST_HC)' $(MY_TEST_HC_OPTS) -shared A.c -o $(call DLL,AS) rm -f libAS*.a +.PHONY: compile_libT10458 +compile_libT10458: + rm -rf T10458dir + mkdir T10458dir + '$(TEST_HC)' $(MY_TEST_HC_OPTS) -odir "T10458dir" -shared A.c -o "T10458dir/$(call DLL,AS)" + rm -f T10458dir/libAS*.a + .PHONY: compile_libAB_dep compile_libAB_dep: rm -rf bin_dep diff --git a/testsuite/tests/ghci/linking/dyn/T1407.script b/testsuite/tests/ghci/linking/dyn/T10458.hs similarity index 56% copy from testsuite/tests/ghci/linking/dyn/T1407.script copy to testsuite/tests/ghci/linking/dyn/T10458.hs index 0274f82..98fc4e4 100644 --- a/testsuite/tests/ghci/linking/dyn/T1407.script +++ b/testsuite/tests/ghci/linking/dyn/T10458.hs @@ -1,4 +1,8 @@ -:set -lAS +module T10458 (callSO) where + import Foreign import Foreign.C.Types foreign import ccall "foo" dle :: IO CInt + +callSO :: IO CInt +callSO = dle diff --git a/testsuite/tests/ghci/linking/dyn/T10458.script b/testsuite/tests/ghci/linking/dyn/T10458.script new file mode 100644 index 0000000..15ecb22 --- /dev/null +++ b/testsuite/tests/ghci/linking/dyn/T10458.script @@ -0,0 +1,4 @@ +:set -fobject-code +:load T10458 + +callSO diff --git a/testsuite/tests/concurrent/should_run/T3279.stdout b/testsuite/tests/ghci/linking/dyn/T10458.stdout similarity index 100% copy from testsuite/tests/concurrent/should_run/T3279.stdout copy to testsuite/tests/ghci/linking/dyn/T10458.stdout diff --git a/testsuite/tests/ghci/linking/dyn/all.T b/testsuite/tests/ghci/linking/dyn/all.T index e5b40d4..eb044fc 100644 --- a/testsuite/tests/ghci/linking/dyn/all.T +++ b/testsuite/tests/ghci/linking/dyn/all.T @@ -27,3 +27,10 @@ test('T10955dyn', [extra_clean(['bin_dyn/*', 'bin_dyn'])], run_command, ['$MAKE -s --no-print-directory compile_libAB_dyn']) + +test('T10458', + [unless(doing_ghci, skip), + extra_clean(['libAS.*']), + pre_cmd('$MAKE -s --no-print-directory compile_libT10458'), + extra_hc_opts('-L$PWD/T10458dir -lAS')], + ghci_script, ['T10458.script']) From git at git.haskell.org Fri Jan 15 15:31:29 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 15 Jan 2016 15:31:29 +0000 (UTC) Subject: [commit: ghc] master: Use XZ compression by default (e7eec3a) Message-ID: <20160115153129.1E6FA3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e7eec3a1c6ec46dc5b0d9d84c8a894b6f7e27f63/ghc >--------------------------------------------------------------- commit e7eec3a1c6ec46dc5b0d9d84c8a894b6f7e27f63 Author: Ben Gamari Date: Fri Jan 15 15:19:10 2016 +0100 Use XZ compression by default Resolves #11434. >--------------------------------------------------------------- e7eec3a1c6ec46dc5b0d9d84c8a894b6f7e27f63 mk/config.mk.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mk/config.mk.in b/mk/config.mk.in index 9fff715..a7a61e5 100644 --- a/mk/config.mk.in +++ b/mk/config.mk.in @@ -767,8 +767,8 @@ BZIP2_CMD = bzip2 GZIP_CMD = gzip XZ_CMD = xz -9e -# bzip2 is default compression -TAR_COMP = bzip2 +# xz is default compression +TAR_COMP = xz # select compression command and .tar extension based on TAR_COMP value ifeq "$(TAR_COMP)" "bzip2" From git at git.haskell.org Fri Jan 15 17:15:33 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 15 Jan 2016 17:15:33 +0000 (UTC) Subject: [commit: ghc] master: Don't output manpage in same directory as source (7cf16aa) Message-ID: <20160115171533.7D9723A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/7cf16aaf6d08a6be7f4c4a20b8684d61e1ee3163/ghc >--------------------------------------------------------------- commit 7cf16aaf6d08a6be7f4c4a20b8684d61e1ee3163 Author: Ben Gamari Date: Fri Jan 15 16:35:38 2016 +0100 Don't output manpage in same directory as source Test Plan: Validate Reviewers: austin, thomie, nomeata Differential Revision: https://phabricator.haskell.org/D1782 GHC Trac Issues: #11433 >--------------------------------------------------------------- 7cf16aaf6d08a6be7f4c4a20b8684d61e1ee3163 .gitignore | 1 + docs/users_guide/ghc.mk | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 0455251..5c2af90 100644 --- a/.gitignore +++ b/.gitignore @@ -98,6 +98,7 @@ _darcs/ /docs/users_guide/users_guide.pdf /docs/users_guide/build-html /docs/users_guide/build-pdf +/docs/users_guide/build-man /docs/users_guide/.doctrees-* /docs/users_guide/.doctrees/ /driver/ghci/ghc-pkg-inplace diff --git a/docs/users_guide/ghc.mk b/docs/users_guide/ghc.mk index deb60a3..83cf60a 100644 --- a/docs/users_guide/ghc.mk +++ b/docs/users_guide/ghc.mk @@ -23,11 +23,11 @@ html_docs/users_guide : docs/users_guide/images/prof_scc.svg docs/users_guide_MAN_RST_SOURCES := docs/users_guide/ghc.rst MAN_SECTION := 1 -MAN_PAGES := docs/users_guide/ghc.1 +MAN_PAGES := docs/users_guide/build-man/ghc.1 ifneq "$(BINDIST)" "YES" $(MAN_PAGES): $(docs/users_guide_MAN_RST_SOURCES) $(utils/mkUserGuidePart_GENERATED_RST_SOURCES) - $(SPHINXBUILD) -b man -d docs/users_guide/.doctrees-man docs/users_guide docs/users_guide + $(SPHINXBUILD) -b man -d docs/users_guide/.doctrees-man docs/users_guide docs/users_guide/build-man endif man : $(MAN_PAGES) From git at git.haskell.org Fri Jan 15 17:15:36 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 15 Jan 2016 17:15:36 +0000 (UTC) Subject: [commit: ghc] master: Refactor lookupFixityRn-related code following D1744 (756b228) Message-ID: <20160115171536.3A4853A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/756b22832e2ba5713e5bb8201eedf1d04db729a8/ghc >--------------------------------------------------------------- commit 756b22832e2ba5713e5bb8201eedf1d04db729a8 Author: RyanGlScott Date: Fri Jan 15 16:37:18 2016 +0100 Refactor lookupFixityRn-related code following D1744 Test Plan: ./validate Reviewers: goldfire, austin, bgamari, simonpj Subscribers: simonpj, thomie Differential Revision: https://phabricator.haskell.org/D1766 GHC Trac Issues: #11345 >--------------------------------------------------------------- 756b22832e2ba5713e5bb8201eedf1d04db729a8 compiler/iface/MkIface.hs | 14 +++++++------- compiler/main/HscTypes.hs | 17 +++++++++++------ compiler/rename/RnEnv.hs | 39 +++++++++++++++++++++++++++++++-------- compiler/typecheck/TcDeriv.hs | 2 +- compiler/typecheck/TcSplice.hs | 22 ++-------------------- docs/users_guide/8.0.1-notes.rst | 8 ++++++++ 6 files changed, 60 insertions(+), 42 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 756b22832e2ba5713e5bb8201eedf1d04db729a8 From git at git.haskell.org Fri Jan 15 17:15:38 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 15 Jan 2016 17:15:38 +0000 (UTC) Subject: [commit: ghc] master: configure.ac: Export MAKECMD to build system (67fc3f3) Message-ID: <20160115171538.D78E93A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/67fc3f3a290476eb65626897e6f80090dbdc04f8/ghc >--------------------------------------------------------------- commit 67fc3f3a290476eb65626897e6f80090dbdc04f8 Author: Karel Gardas Date: Fri Jan 15 17:38:41 2016 +0100 configure.ac: Export MAKECMD to build system Reviewers: austin, bgamari, thomie Reviewed By: thomie Subscribers: angerman, thomie, erikd Differential Revision: https://phabricator.haskell.org/D1775 >--------------------------------------------------------------- 67fc3f3a290476eb65626897e6f80090dbdc04f8 configure.ac | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/configure.ac b/configure.ac index e9bdeec..771ec43 100644 --- a/configure.ac +++ b/configure.ac @@ -1091,28 +1091,39 @@ if test -e shake-build/cfg/system.config.in; then AC_CONFIG_FILES([shake-build/cfg/system.config]) fi -AC_CONFIG_FILES([mk/config.mk mk/install.mk mk/project.mk compiler/ghc.cabal ghc/ghc-bin.cabal utils/runghc/runghc.cabal libraries/ghc-boot/ghc-boot.cabal libraries/ghci/ghci.cabal settings docs/users_guide/ghc_config.py docs/index.html libraries/prologue.txt distrib/configure.ac]) -AC_OUTPUT - # We got caught by # http://savannah.gnu.org/bugs/index.php?1516 # $(eval ...) inside conditionals causes errors # with make 3.80, so warn the user if it looks like they're about to # try to use it. # We would use "grep -q" here, but Solaris's grep doesn't support it. +print_make_warning="" checkMake380() { - if $1 --version 2>&1 | head -1 | grep 'GNU Make 3\.80' > /dev/null + make_ver=`$1 --version 2>&1 | head -1` + if echo "$make_ver" | grep 'GNU Make 3\.80' > /dev/null then - echo - echo "WARNING: It looks like \"$1\" is GNU make 3.80." - echo "This version cannot be used to build GHC." - echo "Please use GNU make >= 3.81." + print_make_warning="true" + fi + if echo "$make_ver" | grep 'GNU Make' > /dev/null + then + MakeCmd=$1 + AC_SUBST(MakeCmd) fi } checkMake380 make checkMake380 gmake +AC_CONFIG_FILES([mk/config.mk mk/install.mk mk/project.mk compiler/ghc.cabal ghc/ghc-bin.cabal utils/runghc/runghc.cabal libraries/ghc-boot/ghc-boot.cabal libraries/ghci/ghci.cabal settings docs/users_guide/ghc_config.py docs/index.html libraries/prologue.txt distrib/configure.ac]) +AC_OUTPUT + +if test "$print_make_warning" = "true"; then + echo + echo "WARNING: It looks like \"$MakeCmd\" is GNU make 3.80." + echo "This version cannot be used to build GHC." + echo "Please use GNU make >= 3.81." +fi + echo [" ---------------------------------------------------------------------- Configure completed successfully. From git at git.haskell.org Fri Jan 15 17:15:42 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 15 Jan 2016 17:15:42 +0000 (UTC) Subject: [commit: ghc] master: Allow pattern synonyms which have several clauses. (443bf04) Message-ID: <20160115171542.1E4983A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/443bf04485f997be2e3a744102605645c54e9d61/ghc >--------------------------------------------------------------- commit 443bf04485f997be2e3a744102605645c54e9d61 Author: Matthew Pickering Date: Fri Jan 15 17:40:51 2016 +0100 Allow pattern synonyms which have several clauses. But still disallow empty pattern synonym builder declarations. Handling this incorrectly was the cause of #11367. Test Plan: ./validate Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1779 GHC Trac Issues: #11367 >--------------------------------------------------------------- 443bf04485f997be2e3a744102605645c54e9d61 compiler/parser/RdrHsSyn.hs | 2 +- testsuite/tests/patsyn/should_compile/T11367.hs | 7 +++++++ testsuite/tests/patsyn/should_compile/all.T | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/compiler/parser/RdrHsSyn.hs b/compiler/parser/RdrHsSyn.hs index 74a18f1..ada9bf2 100644 --- a/compiler/parser/RdrHsSyn.hs +++ b/compiler/parser/RdrHsSyn.hs @@ -464,7 +464,7 @@ mkPatSynMatchGroup :: Located RdrName -> P (MatchGroup RdrName (LHsExpr RdrName)) mkPatSynMatchGroup (L loc patsyn_name) (L _ decls) = do { matches <- mapM fromDecl (fromOL decls) - ; when (length matches /= 1) (wrongNumberErr loc) + ; when (null matches) (wrongNumberErr loc) ; return $ mkMatchGroup FromSource matches } where fromDecl (L loc decl@(ValD (PatBind pat@(L _ (ConPatIn ln@(L _ name) details)) rhs _ _ _))) = diff --git a/testsuite/tests/patsyn/should_compile/T11367.hs b/testsuite/tests/patsyn/should_compile/T11367.hs new file mode 100644 index 0000000..8e00a50 --- /dev/null +++ b/testsuite/tests/patsyn/should_compile/T11367.hs @@ -0,0 +1,7 @@ +{-# LANGUAGE PatternSynonyms, ViewPatterns #-} +module T11367 where + +pattern A :: Int -> String +pattern A n <- (read -> n) where + A 0 = "hi" + A 1 = "bye" diff --git a/testsuite/tests/patsyn/should_compile/all.T b/testsuite/tests/patsyn/should_compile/all.T index 5205a24..14940f2 100644 --- a/testsuite/tests/patsyn/should_compile/all.T +++ b/testsuite/tests/patsyn/should_compile/all.T @@ -48,3 +48,4 @@ test('T11224b', normal, compile, ['']) test('MoreEx', normal, compile, ['']) test('T11283', normal, compile, ['']) test('T11336', normal, compile, ['']) +test('T11367', normal, compile, ['']) From git at git.haskell.org Fri Jan 15 17:15:45 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 15 Jan 2016 17:15:45 +0000 (UTC) Subject: [commit: ghc] master: Expand type/kind synonyms in TyVars before deriving-related typechecking (165ae44) Message-ID: <20160115171545.3B0CD3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/165ae440b6bbf577eabf0b6d422ed6ea3bf949b4/ghc >--------------------------------------------------------------- commit 165ae440b6bbf577eabf0b6d422ed6ea3bf949b4 Author: RyanGlScott Date: Fri Jan 15 17:42:02 2016 +0100 Expand type/kind synonyms in TyVars before deriving-related typechecking Before, it was possible to have a datatypes such as ``` type ConstantT a b = a newtype T (f :: * -> *) (a :: ConstantT * f) = T (f a) deriving Functor data family TFam (f :: * -> *) (a :: *) newtype instance TFam f (ConstantT a f) = TFam (f a) deriving Functor ``` fail to eta-reduce because either (1) a TyVar had a kind synonym that mentioned another TyVar, or (2) an instantiated type was itself a type synonym that mentioned another TyVar. A little bit of tweaking to `expandTypeSynonyms` and applying it before the eta-reduction check in the `deriving` machinery is sufficient to fix this. Fixes #11416. Test Plan: ./validate Reviewers: goldfire, simonpj, austin, bgamari Reviewed By: simonpj Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1772 GHC Trac Issues: #11416 >--------------------------------------------------------------- 165ae440b6bbf577eabf0b6d422ed6ea3bf949b4 compiler/typecheck/TcDeriv.hs | 32 ++++++++++++++++++++++- compiler/types/Type.hs | 3 +++ testsuite/tests/deriving/should_compile/T11416.hs | 19 ++++++++++++++ testsuite/tests/deriving/should_compile/all.T | 1 + 4 files changed, 54 insertions(+), 1 deletion(-) diff --git a/compiler/typecheck/TcDeriv.hs b/compiler/typecheck/TcDeriv.hs index d40aca1..e351f28 100644 --- a/compiler/typecheck/TcDeriv.hs +++ b/compiler/typecheck/TcDeriv.hs @@ -597,7 +597,11 @@ deriveTyData tvs tc tc_args deriv_pred (tc_args_to_keep, args_to_drop) = splitAt n_args_to_keep tc_args inst_ty_kind = typeKind (mkTyConApp tc tc_args_to_keep) - dropped_tvs = tyCoVarsOfTypes args_to_drop + -- Use exactTyCoVarsOfTypes, not tyCoVarsOfTypes, so that we + -- don't mistakenly grab a type variable mentioned in a type + -- synonym that drops it. + -- See Note [Eta-reducing type synonyms]. + dropped_tvs = exactTyCoVarsOfTypes args_to_drop -- Match up the kinds, and apply the resulting kind substitution -- to the types. See Note [Unify kinds in deriving] @@ -701,6 +705,32 @@ When deriving Functor for P, we unify k to *, but we then want an instance $df :: forall (x:*->*). Functor x => Functor (P * (x:*->*)) and similarly for C. Notice the modified kind of x, both at binding and occurrence sites. + +Note [Eta-reducing type synonyms] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +One can instantiate a type in a data family instance with a type synonym that +mentions other type variables: + + type Const a b = a + data family Fam (f :: * -> *) (a :: *) + newtype instance Fam f (Const a f) = Fam (f a) deriving Functor + +With -XTypeInType, it is also possible to define kind synonyms, and they can +mention other types in a datatype declaration. For example, + + type Const a b = a + newtype T f (a :: Const * f) = T (f a) deriving Functor + +When deriving, we need to perform eta-reduction analysis to ensure that none of +the eta-reduced type variables are mentioned elsewhere in the declaration. But +we need to be careful, because if we don't expand through the Const type +synonym, we will mistakenly believe that f is an eta-reduced type variable and +fail to derive Functor, even though the code above is correct (see Trac #11416, +where this was first noticed). + +For this reason, we call exactTyCoVarsOfTypes on the eta-reduced types so that +we only consider the type variables that remain after expanding through type +synonyms. -} mkEqnHelp :: Maybe OverlapMode diff --git a/compiler/types/Type.hs b/compiler/types/Type.hs index c727da6..3572434 100644 --- a/compiler/types/Type.hs +++ b/compiler/types/Type.hs @@ -314,6 +314,9 @@ expandTypeSynonyms :: Type -> Type -- ^ Expand out all type synonyms. Actually, it'd suffice to expand out -- just the ones that discard type variables (e.g. type Funny a = Int) -- But we don't know which those are currently, so we just expand all. +-- +-- 'expandTypeSynonyms' only expands out type synonyms mentioned in the type, +-- not in the kinds of any TyCon or TyVar mentioned in the type. expandTypeSynonyms ty = go (mkEmptyTCvSubst (mkTyCoInScopeSet [ty] [])) ty where diff --git a/testsuite/tests/deriving/should_compile/T11416.hs b/testsuite/tests/deriving/should_compile/T11416.hs new file mode 100644 index 0000000..4696306 --- /dev/null +++ b/testsuite/tests/deriving/should_compile/T11416.hs @@ -0,0 +1,19 @@ +{-# LANGUAGE DeriveFunctor #-} +{-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeInType #-} +module T11416 where + +import Data.Kind + +type ConstantT a b = a + +newtype T f (a :: ConstantT * f) = T (f a) + deriving Functor + +data family TFam1 (f :: k1) (a :: k2) +newtype instance TFam1 f (ConstantT a f) = TFam1 (f a) + deriving Functor + +data family TFam2 (f :: k1) (a :: k2) +newtype instance TFam2 f (a :: ConstantT * f) = TFam2 (f a) + deriving Functor diff --git a/testsuite/tests/deriving/should_compile/all.T b/testsuite/tests/deriving/should_compile/all.T index ff26d37..a18a257 100644 --- a/testsuite/tests/deriving/should_compile/all.T +++ b/testsuite/tests/deriving/should_compile/all.T @@ -61,3 +61,4 @@ test('T10524', normal, compile, ['']) test('T11148', normal, run_command, ['$MAKE -s --no-print-directory T11148']) test('T9968', normal, compile, ['']) +test('T11416', normal, compile, ['']) From git at git.haskell.org Fri Jan 15 20:43:41 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 15 Jan 2016 20:43:41 +0000 (UTC) Subject: [commit: ghc] master: Fix #10872. (d459f55) Message-ID: <20160115204341.E25D23A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d459f55c36c50ae02c55a7fb1331ef81af6751f5/ghc >--------------------------------------------------------------- commit d459f55c36c50ae02c55a7fb1331ef81af6751f5 Author: Richard Eisenberg Date: Sat Jan 9 16:59:05 2016 -0500 Fix #10872. This moves the duplicate-unique check from knownKeyNames (which omits TH) to allKnownKeyNames (which includes TH). >--------------------------------------------------------------- d459f55c36c50ae02c55a7fb1331ef81af6751f5 compiler/main/HscMain.hs | 33 ++++++++++++++++++++++++++++++--- compiler/prelude/PrelInfo.hs | 32 ++------------------------------ 2 files changed, 32 insertions(+), 33 deletions(-) diff --git a/compiler/main/HscMain.hs b/compiler/main/HscMain.hs index 7807f65..f8945b2 100644 --- a/compiler/main/HscMain.hs +++ b/compiler/main/HscMain.hs @@ -148,6 +148,8 @@ import DynFlags import ErrUtils import Outputable +import UniqFM +import NameEnv import HscStats ( ppSourceStats ) import HscTypes import FastString @@ -199,12 +201,37 @@ newHscEnv dflags = do allKnownKeyNames :: [Name] -- Put here to avoid loops involving DsMeta, -allKnownKeyNames = -- where templateHaskellNames are defined - knownKeyNames +allKnownKeyNames -- where templateHaskellNames are defined + | debugIsOn + , not (isNullUFM badNamesEnv) + = panic ("badAllKnownKeyNames:\n" ++ badNamesStr) + -- NB: We can't use ppr here, because this is sometimes evaluated in a + -- context where there are no DynFlags available, leading to a cryptic + -- "<
>" error. (This seems to happen only in the + -- stage 2 compiler, for reasons I [Richard] have no clue of.) + + | otherwise + = all_names + where + all_names = knownKeyNames #ifdef GHCI - ++ templateHaskellNames + ++ templateHaskellNames #endif + namesEnv = foldl (\m n -> extendNameEnv_Acc (:) singleton m n n) + emptyUFM all_names + badNamesEnv = filterNameEnv (\ns -> length ns > 1) namesEnv + badNamesPairs = nameEnvUniqueElts badNamesEnv + badNamesStrs = map pairToStr badNamesPairs + badNamesStr = unlines badNamesStrs + + pairToStr (uniq, ns) = " " ++ + show uniq ++ + ": [" ++ + intercalate ", " (map (occNameString . nameOccName) ns) ++ + "]" + + -- ----------------------------------------------------------------------------- getWarnings :: Hsc WarningMessages diff --git a/compiler/prelude/PrelInfo.hs b/compiler/prelude/PrelInfo.hs index 0651a2c..74005ed 100644 --- a/compiler/prelude/PrelInfo.hs +++ b/compiler/prelude/PrelInfo.hs @@ -34,18 +34,14 @@ import DataCon import Id import Name import MkId -import NameEnv import TysPrim import TysWiredIn import HscTypes -import UniqFM import Class import TyCon import Util -import Panic ( panic ) import {-# SOURCE #-} TcTypeNats ( typeNatTyCons ) -import Data.List ( intercalate ) import Data.Array {- @@ -81,19 +77,7 @@ knownKeyNames :: [Name] -- you get a Name with the correct known key -- (See Note [Known-key names] in PrelNames) knownKeyNames - | debugIsOn - , not (isNullUFM badNamesEnv) - = panic ("badKnownKeyNames:\n" ++ badNamesStr) - -- NB: We can't use ppr here, because this is sometimes evaluated in a - -- context where there are no DynFlags available, leading to a cryptic - -- "<
>" error. (This seems to happen only in the - -- stage 2 compiler, for reasons I [Richard] have no clue of.) - - | otherwise - = names - where - names = - concat [ tycon_kk_names funTyCon + = concat [ tycon_kk_names funTyCon , concatMap tycon_kk_names primTyCons , concatMap tycon_kk_names wiredInTyCons @@ -112,6 +96,7 @@ knownKeyNames , map (idName . primOpId) allThePrimOps , basicKnownKeyNames ] + where -- "kk" short for "known-key" tycon_kk_names :: TyCon -> [Name] tycon_kk_names tc = tyConName tc : (rep_names tc ++ concatMap thing_kk_names (implicitTyConThings tc)) @@ -133,19 +118,6 @@ knownKeyNames Just n -> [n] Nothing -> [] - namesEnv = foldl (\m n -> extendNameEnv_Acc (:) singleton m n n) - emptyUFM names - badNamesEnv = filterNameEnv (\ns -> length ns > 1) namesEnv - badNamesPairs = nameEnvUniqueElts badNamesEnv - badNamesStrs = map pairToStr badNamesPairs - badNamesStr = unlines badNamesStrs - - pairToStr (uniq, ns) = " " ++ - show uniq ++ - ": [" ++ - intercalate ", " (map (occNameString . nameOccName) ns) ++ - "]" - {- We let a lot of "non-standard" values be visible, so that we can make sense of them in interface pragmas. It's cool, though they all have From git at git.haskell.org Fri Jan 15 20:43:45 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 15 Jan 2016 20:43:45 +0000 (UTC) Subject: [commit: ghc] master: Fix #11311 (6c07f14) Message-ID: <20160115204345.2AFA13A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/6c07f1426e58232092043e28d56717aa489d3670/ghc >--------------------------------------------------------------- commit 6c07f1426e58232092043e28d56717aa489d3670 Author: Richard Eisenberg Date: Mon Jan 11 17:03:47 2016 -0500 Fix #11311 All things of kind *, including * itself, need to have a PtrRep. Test: dependent/should_compile/T11311 >--------------------------------------------------------------- 6c07f1426e58232092043e28d56717aa489d3670 compiler/types/TyCon.hs | 5 +++-- testsuite/tests/dependent/should_compile/T11311.hs | 8 ++++++++ testsuite/tests/dependent/should_compile/all.T | 1 + .../{annotations/should_compile => dependent/should_run}/Makefile | 0 testsuite/tests/dependent/should_run/T11311.hs | 8 ++++++++ testsuite/tests/dependent/should_run/all.T | 4 ++++ 6 files changed, 24 insertions(+), 2 deletions(-) diff --git a/compiler/types/TyCon.hs b/compiler/types/TyCon.hs index 356e2ea..0f64cf9 100644 --- a/compiler/types/TyCon.hs +++ b/compiler/types/TyCon.hs @@ -568,7 +568,7 @@ data TyCon primTyConRep :: PrimRep,-- ^ Many primitive tycons are unboxed, but -- some are boxed (represented by -- pointers). This 'PrimRep' holds that - -- information. Only relevant if tyConKind = * + -- information. Only relevant if tyConKind = # isUnLifted :: Bool, -- ^ Most primitive tycons are unlifted (may -- not contain bottom) but other are lifted, @@ -1203,7 +1203,8 @@ mkKindTyCon :: Name -> Kind -> [Role] -> Name -> TyCon mkKindTyCon name kind roles rep_nm = tc where - tc = mkPrimTyCon' name kind roles VoidRep False (Just rep_nm) + tc = mkPrimTyCon' name kind roles PtrRep False (Just rep_nm) + -- PtrRep because kinds have kind *. -- | Create a lifted primitive 'TyCon' such as @RealWorld@ mkLiftedPrimTyCon :: Name -> Kind -> [Role] -> PrimRep -> TyCon diff --git a/testsuite/tests/dependent/should_compile/T11311.hs b/testsuite/tests/dependent/should_compile/T11311.hs new file mode 100644 index 0000000..88f0e45 --- /dev/null +++ b/testsuite/tests/dependent/should_compile/T11311.hs @@ -0,0 +1,8 @@ +module T11311 where + +import Data.Kind + +foo :: () +foo = (id :: * -> *) undefined `seq` () + +main = print foo diff --git a/testsuite/tests/dependent/should_compile/all.T b/testsuite/tests/dependent/should_compile/all.T index 1063b6e..ef6dde9 100644 --- a/testsuite/tests/dependent/should_compile/all.T +++ b/testsuite/tests/dependent/should_compile/all.T @@ -11,3 +11,4 @@ test('mkGADTVars', normal, compile, ['']) test('TypeLevelVec',normal,compile, ['']) test('T9632', normal, compile, ['']) test('dynamic-paper', normal, compile, ['']) +test('T11311', normal, compile, ['']) diff --git a/testsuite/tests/annotations/should_compile/Makefile b/testsuite/tests/dependent/should_run/Makefile similarity index 100% copy from testsuite/tests/annotations/should_compile/Makefile copy to testsuite/tests/dependent/should_run/Makefile diff --git a/testsuite/tests/dependent/should_run/T11311.hs b/testsuite/tests/dependent/should_run/T11311.hs new file mode 100644 index 0000000..88f0e45 --- /dev/null +++ b/testsuite/tests/dependent/should_run/T11311.hs @@ -0,0 +1,8 @@ +module T11311 where + +import Data.Kind + +foo :: () +foo = (id :: * -> *) undefined `seq` () + +main = print foo diff --git a/testsuite/tests/dependent/should_run/all.T b/testsuite/tests/dependent/should_run/all.T new file mode 100755 index 0000000..c3b18c1 --- /dev/null +++ b/testsuite/tests/dependent/should_run/all.T @@ -0,0 +1,4 @@ + + +# test('T11311', normal, compile_and_run, ['']) + From git at git.haskell.org Fri Jan 15 20:43:48 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 15 Jan 2016 20:43:48 +0000 (UTC) Subject: [commit: ghc] master: Fix #11355. (e6ca930) Message-ID: <20160115204348.C3E043A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e6ca93005bc3df62619f3f968fe51b380e33938a/ghc >--------------------------------------------------------------- commit e6ca93005bc3df62619f3f968fe51b380e33938a Author: Richard Eisenberg Date: Sat Jan 9 11:18:53 2016 -0500 Fix #11355. Previously, the check for impredicative type applications was in the wrong spot. Test case: typecheck/should_fail/T11355 >--------------------------------------------------------------- e6ca93005bc3df62619f3f968fe51b380e33938a compiler/typecheck/TcValidity.hs | 8 +++++++- testsuite/tests/typecheck/should_fail/T11355.hs | 5 +++++ testsuite/tests/typecheck/should_fail/T11355.stderr | 9 +++++++++ testsuite/tests/typecheck/should_fail/all.T | 1 + 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/compiler/typecheck/TcValidity.hs b/compiler/typecheck/TcValidity.hs index 79d3702..63118d0 100644 --- a/compiler/typecheck/TcValidity.hs +++ b/compiler/typecheck/TcValidity.hs @@ -291,6 +291,7 @@ checkValidType :: UserTypeCtxt -> Type -> TcM () checkValidType ctxt ty = do { traceTc "checkValidType" (ppr ty <+> text "::" <+> ppr (typeKind ty)) ; rankn_flag <- xoptM LangExt.RankNTypes + ; impred_flag <- xoptM LangExt.ImpredicativeTypes ; let gen_rank :: Rank -> Rank gen_rank r | rankn_flag = ArbitraryRank | otherwise = r @@ -310,7 +311,12 @@ checkValidType ctxt ty TySynCtxt _ -> rank0 ExprSigCtxt -> rank1 - TypeAppCtxt -> rank0 + TypeAppCtxt | impred_flag -> ArbitraryRank + | otherwise -> tyConArgMonoType + -- Normally, ImpredicativeTypes is handled in check_arg_type, + -- but visible type applications don't go through there. + -- So we do this check here. + FunSigCtxt {} -> rank1 InfSigCtxt _ -> ArbitraryRank -- Inferred type ConArgCtxt _ -> rank1 -- We are given the type of the entire diff --git a/testsuite/tests/typecheck/should_fail/T11355.hs b/testsuite/tests/typecheck/should_fail/T11355.hs new file mode 100644 index 0000000..4ec11d0 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T11355.hs @@ -0,0 +1,5 @@ +{-# LANGUAGE TypeApplications, RankNTypes #-} + +module T11355 where + +foo = const @_ @((forall a. a) -> forall a. a) () (id @(forall a. a)) diff --git a/testsuite/tests/typecheck/should_fail/T11355.stderr b/testsuite/tests/typecheck/should_fail/T11355.stderr new file mode 100644 index 0000000..cd3cc73 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T11355.stderr @@ -0,0 +1,9 @@ + +T11355.hs:5:7: error: + ? Illegal polymorphic or qualified type: forall (a1 :: TYPE t0). a1 + GHC doesn't yet support impredicative polymorphism + ? In the expression: + const @_ @((forall a. a) -> forall a. a) () (id @(forall a. a)) + In an equation for ?foo?: + foo + = const @_ @((forall a. a) -> forall a. a) () (id @(forall a. a)) diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T index 9aef820..88ab499 100644 --- a/testsuite/tests/typecheck/should_fail/all.T +++ b/testsuite/tests/typecheck/should_fail/all.T @@ -402,3 +402,4 @@ test('T11274', normal, compile_fail, ['']) test('T10619', normal, compile_fail, ['']) test('T11347', normal, compile_fail, ['']) test('T11356', normal, compile_fail, ['']) +test('T11355', normal, compile_fail, ['']) From git at git.haskell.org Fri Jan 15 20:43:51 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 15 Jan 2016 20:43:51 +0000 (UTC) Subject: [commit: ghc] master: Test #11252 in ghci/scripts/T11252 (d4af57f) Message-ID: <20160115204351.BF1033A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d4af57fa2a2af0b369087c13c0c7dae869e323bd/ghc >--------------------------------------------------------------- commit d4af57fa2a2af0b369087c13c0c7dae869e323bd Author: Richard Eisenberg Date: Sat Jan 9 11:26:14 2016 -0500 Test #11252 in ghci/scripts/T11252 This one worked for me out of the box. >--------------------------------------------------------------- d4af57fa2a2af0b369087c13c0c7dae869e323bd testsuite/tests/ghci/scripts/T11252.script | 3 +++ testsuite/tests/ghci/scripts/T11252.stdout | 1 + testsuite/tests/ghci/scripts/all.T | 1 + 3 files changed, 5 insertions(+) diff --git a/testsuite/tests/ghci/scripts/T11252.script b/testsuite/tests/ghci/scripts/T11252.script new file mode 100644 index 0000000..485cd8f --- /dev/null +++ b/testsuite/tests/ghci/scripts/T11252.script @@ -0,0 +1,3 @@ +:set -XTypeInType +data Proxy1 k (a :: k) = Proxy1 +:kind Proxy1 diff --git a/testsuite/tests/ghci/scripts/T11252.stdout b/testsuite/tests/ghci/scripts/T11252.stdout new file mode 100644 index 0000000..eddba45 --- /dev/null +++ b/testsuite/tests/ghci/scripts/T11252.stdout @@ -0,0 +1 @@ +Proxy1 :: forall k -> k -> * diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T index 06a9125..4618281 100755 --- a/testsuite/tests/ghci/scripts/all.T +++ b/testsuite/tests/ghci/scripts/all.T @@ -233,3 +233,4 @@ test('T10989', ghci_script, ['T10989.script']) test('T11098', normal, ghci_script, ['T11098.script']) test('T8316', expect_broken(8316), ghci_script, ['T8316.script']) +test('T11252', normal, ghci_script, ['T11252.script']) From git at git.haskell.org Fri Jan 15 20:43:54 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 15 Jan 2016 20:43:54 +0000 (UTC) Subject: [commit: ghc] master: Clarify topological sorting of spec vars in manual (3a7f204) Message-ID: <20160115204354.8FE753A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/3a7f204f5d713ed4ac034d371fc10d8bedb39efa/ghc >--------------------------------------------------------------- commit 3a7f204f5d713ed4ac034d371fc10d8bedb39efa Author: Richard Eisenberg Date: Sun Jan 10 19:10:03 2016 -0500 Clarify topological sorting of spec vars in manual This is mentioned in #11376. >--------------------------------------------------------------- 3a7f204f5d713ed4ac034d371fc10d8bedb39efa docs/users_guide/glasgow_exts.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index 0ec5bd4..e77a7c0 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -2237,6 +2237,15 @@ Here are the details: will have its type variables ordered as ``m, a, b, c``. +- If any of the variables depend on other variables (that is, if some + of the variables are *kind* variables), the variables are reordered + so that kind variables come before type variables, preserving the + left-to-right order as much as possible. That is, GHC performs a + stable topological sort on the variables. + + For example: if we have ``bar :: Proxy (a :: (j, k)) -> b``, then + the variables are ordered ``j``, ``k``, ``a``, ``b``. + - Class methods' type arguments include the class type variables, followed by any variables an individual method is polymorphic in. So, ``class Monad m where return :: a -> m a`` means From git at git.haskell.org Fri Jan 15 20:43:57 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 15 Jan 2016 20:43:57 +0000 (UTC) Subject: [commit: ghc] master: Constrained types have kind * in validity check. (bafbde7) Message-ID: <20160115204357.C1F3A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/bafbde7e239dd7353fb32cb2ff1b1c9139e4f45c/ghc >--------------------------------------------------------------- commit bafbde7e239dd7353fb32cb2ff1b1c9139e4f45c Author: Richard Eisenberg Date: Mon Jan 11 15:28:48 2016 -0500 Constrained types have kind * in validity check. This addresses #11405, but a deeper problem lurks. Try test dependent/should_compile/T11405 and see comment:3 on the ticket. >--------------------------------------------------------------- bafbde7e239dd7353fb32cb2ff1b1c9139e4f45c compiler/typecheck/TcValidity.hs | 7 ++++++- testsuite/tests/dependent/should_compile/T11405.hs | 9 +++++++++ testsuite/tests/dependent/should_compile/all.T | 2 ++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/compiler/typecheck/TcValidity.hs b/compiler/typecheck/TcValidity.hs index 63118d0..a89b783 100644 --- a/compiler/typecheck/TcValidity.hs +++ b/compiler/typecheck/TcValidity.hs @@ -452,12 +452,17 @@ check_type env ctxt rank ty -- but not type T = ?x::Int ; check_type env' ctxt rank tau -- Allow foralls to right of arrow - ; checkTcM (not (any (`elemVarSet` tyCoVarsOfType tau_kind) tvs)) + ; checkTcM (not (any (`elemVarSet` tyCoVarsOfType phi_kind) tvs)) (forAllEscapeErr env' ty tau_kind) } where (tvs, theta, tau) = tcSplitSigmaTy ty tau_kind = typeKind tau + + phi_kind | null theta = tau_kind + | otherwise = liftedTypeKind + -- If there are any constraints, the kind is *. (#11405) + (env', _) = tidyTyCoVarBndrs env tvs check_type _ _ _ (TyVarTy _) = return () diff --git a/testsuite/tests/dependent/should_compile/T11405.hs b/testsuite/tests/dependent/should_compile/T11405.hs new file mode 100644 index 0000000..f80d994 --- /dev/null +++ b/testsuite/tests/dependent/should_compile/T11405.hs @@ -0,0 +1,9 @@ +{-# LANGUAGE ImplicitParams, TypeInType, ExplicitForAll #-} + +module T11405 where + +import GHC.Exts +import GHC.Stack + +x :: forall (v :: Levity) (a :: TYPE v). (?callStack :: CallStack) => a +x = undefined diff --git a/testsuite/tests/dependent/should_compile/all.T b/testsuite/tests/dependent/should_compile/all.T index ef6dde9..c11f9ca 100644 --- a/testsuite/tests/dependent/should_compile/all.T +++ b/testsuite/tests/dependent/should_compile/all.T @@ -12,3 +12,5 @@ test('TypeLevelVec',normal,compile, ['']) test('T9632', normal, compile, ['']) test('dynamic-paper', normal, compile, ['']) test('T11311', normal, compile, ['']) +test('T11405', expect_broken(11405), compile, ['']) + From git at git.haskell.org Fri Jan 15 20:44:00 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 15 Jan 2016 20:44:00 +0000 (UTC) Subject: [commit: ghc] master: Tiny refactoring in TcUnify (33950aa) Message-ID: <20160115204400.722443A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/33950aa6cfa9ba6866c81254c960de4def062fd2/ghc >--------------------------------------------------------------- commit 33950aa6cfa9ba6866c81254c960de4def062fd2 Author: Richard Eisenberg Date: Mon Jan 11 21:28:24 2016 -0500 Tiny refactoring in TcUnify >--------------------------------------------------------------- 33950aa6cfa9ba6866c81254c960de4def062fd2 compiler/typecheck/TcUnify.hs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/compiler/typecheck/TcUnify.hs b/compiler/typecheck/TcUnify.hs index 908b692..33525be 100644 --- a/compiler/typecheck/TcUnify.hs +++ b/compiler/typecheck/TcUnify.hs @@ -677,8 +677,10 @@ tc_sub_type_ds eq_orig inst_orig ctxt ty_actual ty_expected = inst_and_unify -- It's still possible that ty_actual has nested foralls. Instantiate -- these, as there's no way unification will succeed with them in. - -- See typecheck/should_compiler/T11350 for an example of when this - -- is important. + -- See typecheck/should_compile/T11305 for an example of when this + -- is important. The problem is that we're checking something like + -- a -> forall b. b -> b <= alpha beta gamma + -- where we end up with alpha := (->) inst_and_unify = do { (wrap, rho_a) <- deeplyInstantiate inst_orig ty_actual @@ -688,15 +690,10 @@ tc_sub_type_ds eq_orig inst_orig ctxt ty_actual ty_expected -- instantiation. If we *have* recurred through -- an arrow, it's better not to update. ; let eq_orig' = case eq_orig of - TypeEqOrigin { uo_actual = orig_ty_actual - , uo_expected = orig_ty_expected - , uo_thing = thing } + TypeEqOrigin { uo_actual = orig_ty_actual } | orig_ty_actual `tcEqType` ty_actual , not (isIdHsWrapper wrap) - -> TypeEqOrigin - { uo_actual = rho_a - , uo_expected = orig_ty_expected - , uo_thing = thing } + -> eq_orig { uo_actual = rho_a } _ -> eq_orig ; cow <- uType eq_orig' TypeLevel rho_a ty_expected From git at git.haskell.org Fri Jan 15 20:44:03 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 15 Jan 2016 20:44:03 +0000 (UTC) Subject: [commit: ghc] master: Fix #11254. (39ea4b4) Message-ID: <20160115204403.BEB473A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/39ea4b4b19ea65d05f0d946084b316d5f5d2e675/ghc >--------------------------------------------------------------- commit 39ea4b4b19ea65d05f0d946084b316d5f5d2e675 Author: Richard Eisenberg Date: Mon Jan 11 14:47:49 2016 -0500 Fix #11254. This moves the call to tcSubType into the context of the checkInstConstraints call, allowing the deferred type error somewhere to hang its hat. >--------------------------------------------------------------- 39ea4b4b19ea65d05f0d946084b316d5f5d2e675 compiler/typecheck/TcInstDcls.hs | 113 +++++++++++---------- .../tests/typecheck/should_compile/T11254.stderr | 25 +++++ testsuite/tests/typecheck/should_compile/all.T | 2 +- 3 files changed, 88 insertions(+), 52 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 39ea4b4b19ea65d05f0d946084b316d5f5d2e675 From git at git.haskell.org Fri Jan 15 20:44:06 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 15 Jan 2016 20:44:06 +0000 (UTC) Subject: [commit: ghc] master: Fix #11404 (072191f) Message-ID: <20160115204406.82ABB3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/072191fe2db55eb3ede5d5a90b7f5eb6afde25bc/ghc >--------------------------------------------------------------- commit 072191fe2db55eb3ede5d5a90b7f5eb6afde25bc Author: Richard Eisenberg Date: Mon Jan 11 16:47:22 2016 -0500 Fix #11404 We now check for unused variables one at a time, instead of all at the top. Test: dependent/should_compile/T11405 >--------------------------------------------------------------- 072191fe2db55eb3ede5d5a90b7f5eb6afde25bc compiler/rename/RnSource.hs | 16 +++++++------- compiler/rename/RnTypes.hs | 53 ++++++++++++++++++++++++++------------------- 2 files changed, 39 insertions(+), 30 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 072191fe2db55eb3ede5d5a90b7f5eb6afde25bc From git at git.haskell.org Fri Jan 15 20:44:09 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 15 Jan 2016 20:44:09 +0000 (UTC) Subject: [commit: ghc] master: Fix typo in error message (#11409) (80b4c71) Message-ID: <20160115204409.44BA63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/80b4c71c5fc8ae005f6fb73d900b225366c4d3cc/ghc >--------------------------------------------------------------- commit 80b4c71c5fc8ae005f6fb73d900b225366c4d3cc Author: Richard Eisenberg Date: Mon Jan 11 21:29:23 2016 -0500 Fix typo in error message (#11409) >--------------------------------------------------------------- 80b4c71c5fc8ae005f6fb73d900b225366c4d3cc compiler/typecheck/TcExpr.hs | 2 +- testsuite/tests/typecheck/should_fail/VtaFail.stderr | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/compiler/typecheck/TcExpr.hs b/compiler/typecheck/TcExpr.hs index 93ba3db..d5a0016 100644 --- a/compiler/typecheck/TcExpr.hs +++ b/compiler/typecheck/TcExpr.hs @@ -1178,7 +1178,7 @@ tcArgs fun orig_fun_ty fun_orig orig_args herald ty_app_err ty arg = do { (_, ty) <- zonkTidyTcType emptyTidyEnv ty ; failWith $ - text "Cannot not apply expression of type" <+> quotes (ppr ty) $$ + text "Cannot apply expression of type" <+> quotes (ppr ty) $$ text "to a visible type argument" <+> quotes (ppr arg) } ---------------- diff --git a/testsuite/tests/typecheck/should_fail/VtaFail.stderr b/testsuite/tests/typecheck/should_fail/VtaFail.stderr index 313d174..ea435e4 100644 --- a/testsuite/tests/typecheck/should_fail/VtaFail.stderr +++ b/testsuite/tests/typecheck/should_fail/VtaFail.stderr @@ -1,6 +1,6 @@ VtaFail.hs:7:16: error: - ? Cannot not apply expression of type ?t1 -> t0 -> (t1, t0)? + ? Cannot apply expression of type ?t1 -> t0 -> (t1, t0)? to a visible type argument ?Int? ? In the expression: pairup_nosig @Int @Bool 5 True In an equation for ?answer_nosig?: @@ -13,14 +13,14 @@ VtaFail.hs:12:26: error: answer_constraint_fail = addOne @Bool 5 VtaFail.hs:14:17: error: - ? Cannot not apply expression of type ?r0 -> r0? + ? Cannot apply expression of type ?r0 -> r0? to a visible type argument ?Int? ? In the expression: (\ x -> x) @Int 12 In an equation for ?answer_lambda?: answer_lambda = (\ x -> x) @Int 12 VtaFail.hs:19:5: error: - ? Cannot not apply expression of type ?Int -> (a0, Int)? + ? Cannot apply expression of type ?Int -> (a0, Int)? to a visible type argument ?Bool? ? In the expression: pair 3 @Int @Bool True In an equation for ?a?: a = pair 3 @Int @Bool True @@ -55,31 +55,31 @@ VtaFail.hs:41:27: error: threeWorse = too @(->) (T :: Three Either) VtaFail.hs:46:5: error: - ? Cannot not apply expression of type ?Int -> Int -> Int? + ? Cannot apply expression of type ?Int -> Int -> Int? to a visible type argument ?Int? ? In the expression: plus @Int 5 7 In an equation for ?b?: b = plus @Int 5 7 VtaFail.hs:47:5: error: - ? Cannot not apply expression of type ?Int -> Int -> Int? + ? Cannot apply expression of type ?Int -> Int -> Int? to a visible type argument ?Rational? ? In the expression: plus @Rational 5 10 In an equation for ?c?: c = plus @Rational 5 10 VtaFail.hs:48:5: error: - ? Cannot not apply expression of type ?Int -> Int -> Int? + ? Cannot apply expression of type ?Int -> Int -> Int? to a visible type argument ?Int? ? In the expression: (+) @Int @Int @Int 12 14 In an equation for ?d?: d = (+) @Int @Int @Int 12 14 VtaFail.hs:51:5: error: - ? Cannot not apply expression of type ?Int -> String? + ? Cannot apply expression of type ?Int -> String? to a visible type argument ?Float? ? In the expression: show @Int @Float (read "5") In an equation for ?e?: e = show @Int @Float (read "5") VtaFail.hs:52:11: error: - ? Cannot not apply expression of type ?String -> Int? + ? Cannot apply expression of type ?String -> Int? to a visible type argument ?Bool? ? In the first argument of ?show?, namely ?(read @Int @Bool @Float "3")? From git at git.haskell.org Fri Jan 15 20:44:12 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 15 Jan 2016 20:44:12 +0000 (UTC) Subject: [commit: ghc] master: Fix #11405. (3c6635e) Message-ID: <20160115204412.0DF913A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/3c6635ef4561ab53e51d7187c966b628a972b261/ghc >--------------------------------------------------------------- commit 3c6635ef4561ab53e51d7187c966b628a972b261 Author: Richard Eisenberg Date: Thu Jan 14 17:48:42 2016 -0500 Fix #11405. This adds a new variant of AbsBinds that is used solely for bindings with a type signature. This allows for a simpler desugaring that does not produce the bogus output that tripped up Core Lint in ticket #11405. Should make other desugarings simpler, too. >--------------------------------------------------------------- 3c6635ef4561ab53e51d7187c966b628a972b261 compiler/deSugar/Coverage.hs | 23 ++++++++++++++ compiler/deSugar/DsBinds.hs | 42 ++++++++++++++++++++++++-- compiler/deSugar/DsExpr.hs | 11 +++++++ compiler/deSugar/DsMeta.hs | 1 + compiler/hsSyn/HsBinds.hs | 29 +++++++++++++++++- compiler/hsSyn/HsUtils.hs | 1 + compiler/main/DynFlags.hs | 4 +-- compiler/typecheck/TcBinds.hs | 25 +++++++++------ compiler/typecheck/TcHsSyn.hs | 20 ++++++++++++ testsuite/tests/dependent/should_compile/all.T | 2 +- testsuite/tests/ghc-api/T6145.hs | 2 ++ utils/ghctags/Main.hs | 3 +- 12 files changed, 146 insertions(+), 17 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 3c6635ef4561ab53e51d7187c966b628a972b261 From git at git.haskell.org Sat Jan 16 12:19:00 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 16 Jan 2016 12:19:00 +0000 (UTC) Subject: [commit: ghc] master: Fix some typos (148a50b) Message-ID: <20160116121900.D451B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/148a50b5f8a9db4c3e2724540c41a7a7a10b3194/ghc >--------------------------------------------------------------- commit 148a50b5f8a9db4c3e2724540c41a7a7a10b3194 Author: Rik Steenkamp Date: Sat Jan 16 13:18:53 2016 +0100 Fix some typos Differential Revision: https://phabricator.haskell.org/D1785 >--------------------------------------------------------------- 148a50b5f8a9db4c3e2724540c41a7a7a10b3194 compiler/coreSyn/CoreFVs.hs | 2 +- compiler/hsSyn/HsBinds.hs | 2 +- compiler/hsSyn/HsTypes.hs | 7 +++---- compiler/main/DynFlags.hs | 2 +- compiler/rename/RnTypes.hs | 2 +- compiler/typecheck/TcArrows.hs | 2 +- compiler/typecheck/TcRnTypes.hs | 4 ++-- docs/users_guide/glasgow_exts.rst | 4 ++-- 8 files changed, 12 insertions(+), 13 deletions(-) diff --git a/compiler/coreSyn/CoreFVs.hs b/compiler/coreSyn/CoreFVs.hs index 2e1c182..d3767e7 100644 --- a/compiler/coreSyn/CoreFVs.hs +++ b/compiler/coreSyn/CoreFVs.hs @@ -180,7 +180,7 @@ exprsSomeFreeVars fv_cand es = addBndr :: CoreBndr -> FV -> FV addBndr bndr fv fv_cand in_scope acc = (varTypeTyCoVarsAcc bndr `unionFV` - -- Include type varibles in the binder's type + -- Include type variables in the binder's type -- (not just Ids; coercion variables too!) FV.delFV bndr fv) fv_cand in_scope acc diff --git a/compiler/hsSyn/HsBinds.hs b/compiler/hsSyn/HsBinds.hs index b4a84d4..3f502c9 100644 --- a/compiler/hsSyn/HsBinds.hs +++ b/compiler/hsSyn/HsBinds.hs @@ -729,7 +729,7 @@ data Sig name -- P :: forall a b. Prov => Req => ty -- | A signature for a class method - -- False: ordinary class-method signauure + -- False: ordinary class-method signature -- True: default class method signature -- e.g. class C a where -- op :: a -> a -- Ordinary diff --git a/compiler/hsSyn/HsTypes.hs b/compiler/hsSyn/HsTypes.hs index e8b38c7..83161b3 100644 --- a/compiler/hsSyn/HsTypes.hs +++ b/compiler/hsSyn/HsTypes.hs @@ -123,7 +123,7 @@ This is the syntax for types as seen in type signatures. Note [HsBSig binder lists] ~~~~~~~~~~~~~~~~~~~~~~~~~~ -Consider a binder (or pattern) decoarated with a type or kind, +Consider a binder (or pattern) decorated with a type or kind, \ (x :: a -> a). blah forall (a :: k -> *) (b :: k). blah Then we use a LHsBndrSig on the binder, so that the @@ -140,7 +140,7 @@ is a bit complicated. Here's how it works. * In a HsType, HsForAllTy represents an /explicit, user-written/ 'forall' e.g. forall a b. ... - HsQualTy reprsents an /explicit, user-written/ context + HsQualTy represents an /explicit, user-written/ context e.g. (Eq a, Show a) => ... The context can be empty if that's what the user wrote These constructors represent what the user wrote, no more @@ -154,8 +154,7 @@ is a bit complicated. Here's how it works. * HsImplicitBndrs is a wrapper that gives the implicitly-quantified kind and type variables of the wrapped thing. It is filled in by - the renamer. For example, if the - user writes + the renamer. For example, if the user writes f :: a -> a the HsImplicitBinders binds the 'a' (not a HsForAllTy!). NB: this implicit quantification is purely lexical: we bind any diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 2a27bda..acaa722 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -2448,7 +2448,7 @@ dynamic_flags = [ , defFlag "dppr-cols" (intSuffix (\n d -> d{ pprCols = n })) , defGhcFlag "dtrace-level" (intSuffix (\n d -> d{ traceLevel = n })) -- Suppress all that is suppressable in core dumps. - -- Except for uniques, as some simplifier phases introduce new varibles that + -- Except for uniques, as some simplifier phases introduce new variables that -- have otherwise identical names. , defGhcFlag "dsuppress-all" (NoArg $ do setGeneralFlag Opt_SuppressCoercions diff --git a/compiler/rename/RnTypes.hs b/compiler/rename/RnTypes.hs index 1f58b87..137b918 100644 --- a/compiler/rename/RnTypes.hs +++ b/compiler/rename/RnTypes.hs @@ -87,7 +87,7 @@ rnHsSigWcTypeScoped :: HsDocContext -> LHsSigWcType RdrName rnHsSigWcTypeScoped ctx sig_ty thing_inside = rn_hs_sig_wc_type False ctx sig_ty thing_inside -- False: for pattern type sigs and rules we /do/ want - -- to bring those type varibles into scope + -- to bring those type variables into scope -- e.g \ (x :: forall a. a-> b) -> e -- Here we do bring 'b' into scope diff --git a/compiler/typecheck/TcArrows.hs b/compiler/typecheck/TcArrows.hs index dac6aed..7f00d43 100644 --- a/compiler/typecheck/TcArrows.hs +++ b/compiler/typecheck/TcArrows.hs @@ -37,7 +37,7 @@ import Util import Control.Monad {- -Note [Arrow overivew] +Note [Arrow overview] ~~~~~~~~~~~~~~~~~~~~~ Here's a summary of arrows and how they typecheck. First, here's a cut-down syntax: diff --git a/compiler/typecheck/TcRnTypes.hs b/compiler/typecheck/TcRnTypes.hs index 430a97d..9465456 100644 --- a/compiler/typecheck/TcRnTypes.hs +++ b/compiler/typecheck/TcRnTypes.hs @@ -223,7 +223,7 @@ data Env gbl lcl -- Includes all info about imported things env_us :: {-# UNPACK #-} !(IORef UniqSupply), - -- Unique supply for local varibles + -- Unique supply for local variables env_gbl :: gbl, -- Info about things defined at the top level -- of the module being compiled @@ -2005,7 +2005,7 @@ Note [Shadowing in a constraint] We assume NO SHADOWING in a constraint. Specifically * The unification variables are all implicitly quantified at top level, and are all unique - * The skolem varibles bound in ic_skols are all freah when the + * The skolem variables bound in ic_skols are all freah when the implication is created. So we can safely substitute. For example, if we have forall a. a~Int => ...(forall b. ...a...)... diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index e77a7c0..1457274 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -932,7 +932,7 @@ Given a pattern synonym definition of the form :: it is assigned a *pattern type* of the form :: - pattern P :: CReq => CProf => t1 -> t2 -> ... -> tN -> t + pattern P :: CReq => CProv => t1 -> t2 -> ... -> tN -> t where ?CProv? and ?CReq? are type contexts, and ?t1?, ?t2?, ..., ?tN? and ?t? are types. Notice the unusual form of the type, with two @@ -7976,7 +7976,7 @@ An implicit parameter is *bound* using the standard ``let`` or ``where`` binding forms. For example, we define the ``min`` function by binding ``cmp``. :: - min :: [a] -> a + min :: Ord a => [a] -> a min = let ?cmp = (<=) in least A group of implicit-parameter bindings may occur anywhere a normal group From git at git.haskell.org Sat Jan 16 12:48:39 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 16 Jan 2016 12:48:39 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: user-guide: Use ghc-flag for dump formatting flags (84f1841) Message-ID: <20160116124839.0C7323A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/84f1841bbd0946bf50f10fcbbe36e081bf0a817c/ghc >--------------------------------------------------------------- commit 84f1841bbd0946bf50f10fcbbe36e081bf0a817c Author: Ben Gamari Date: Thu Jan 14 13:49:17 2016 +0100 user-guide: Use ghc-flag for dump formatting flags And document -dth-dec-file. Not sure how these were missed. (cherry picked from commit 83c13c2a6b7d7424d0bbee31f4ef2e7ab44836b0) >--------------------------------------------------------------- 84f1841bbd0946bf50f10fcbbe36e081bf0a817c docs/users_guide/debugging.rst | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/docs/users_guide/debugging.rst b/docs/users_guide/debugging.rst index f366d95..80c9f8d 100644 --- a/docs/users_guide/debugging.rst +++ b/docs/users_guide/debugging.rst @@ -51,6 +51,10 @@ Dumping out compiler intermediate structures Dump Template Haskell expressions that we splice in, and what Haskell code the expression evaluates to. + .. ghc-flag:: -dth-dec-file= + + Dump expansions of all top-level Template Haskell splices into ?file?. + .. ghc-flag:: -ddump-types Dump a type signature for each value defined at the top level of @@ -226,32 +230,24 @@ Formatting dumps .. index:: single: formatting dumps -``-dppr-user-length`` - .. index:: - single: -dppr-user-length +.. ghc-flag:: -dppr-user-length In error messages, expressions are printed to a certain "depth", with subexpressions beyond the depth replaced by ellipses. This flag sets the depth. Its default value is 5. -``-dppr-colsNNN`` - .. index:: - single: -dppr-colsNNN +.. ghc-flag:: -dppr-cols=N Set the width of debugging output. Use this if your code is wrapping - too much. For example: ``-dppr-cols200``. + too much. For example: ``-dppr-cols=200``. -``-dppr-case-as-let`` - .. index:: - single: -dppr-case-as-let +.. ghc-flag:: -dppr-case-as-let Print single alternative case expressions as though they were strict let expressions. This is helpful when your code does a lot of unboxing. -``-dno-debug-output`` - .. index:: - single: -dno-debug-output +.. ghc-flag:: -dno-debug-output Suppress any unsolicited debugging output. When GHC has been built with the ``DEBUG`` option it occasionally emits debug output of From git at git.haskell.org Sat Jan 16 12:48:41 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 16 Jan 2016 12:48:41 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: API Annotations: use AnnValue for (~) (b018abe) Message-ID: <20160116124841.BA95B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/b018abe61c1fa0f8885296597b87fd40cddcc3f2/ghc >--------------------------------------------------------------- commit b018abe61c1fa0f8885296597b87fd40cddcc3f2 Author: Alan Zimmerman Date: Thu Jan 14 20:46:35 2016 +0200 API Annotations: use AnnValue for (~) Previously oqtycon used AnnTilde for the location of the RdrName when parsing (~). The recent increase in '~' characters in the AST confuses ghc-exactprint, so this patch treats all RdrNames the same way now, marking the location of the core name with AnnValue. (cherry picked from commit fd686c43c45b68fec97ae4c45709358798af6121) >--------------------------------------------------------------- b018abe61c1fa0f8885296597b87fd40cddcc3f2 compiler/parser/Parser.y | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/parser/Parser.y b/compiler/parser/Parser.y index 4732956..83b63ae 100644 --- a/compiler/parser/Parser.y +++ b/compiler/parser/Parser.y @@ -2841,7 +2841,7 @@ oqtycon :: { Located RdrName } -- An "ordinary" qualified tycon; | '(' qtyconsym ')' {% ams (sLL $1 $> (unLoc $2)) [mop $1,mj AnnVal $2,mcp $3] } | '(' '~' ')' {% ams (sLL $1 $> $ eqTyCon_RDR) - [mop $1,mj AnnTilde $2,mcp $3] } + [mop $1,mj AnnVal $2,mcp $3] } oqtycon_no_varcon :: { Located RdrName } -- Type constructor which cannot be mistaken -- for variable constructor in export lists From git at git.haskell.org Sat Jan 16 12:48:44 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 16 Jan 2016 12:48:44 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: ANNOUNCE: Mention powerpc code generator (465267d) Message-ID: <20160116124844.8B9573A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/465267d028812690ceeadcd1bdb1ab5a02c6cfdb/ghc >--------------------------------------------------------------- commit 465267d028812690ceeadcd1bdb1ab5a02c6cfdb Author: Ben Gamari Date: Thu Jan 14 15:38:49 2016 +0100 ANNOUNCE: Mention powerpc code generator (cherry picked from commit 8959b03e0365d8ff016e95cfe7d87d5488cf3a96) >--------------------------------------------------------------- 465267d028812690ceeadcd1bdb1ab5a02c6cfdb ANNOUNCE | 6 ++++-- docs/users_guide/8.0.1-notes.rst | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index 2db475e..c00db3c 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -18,7 +18,7 @@ of major features and numerous bug fixes. These include, * More reliable DWARF debugging information - * Support for injective type classes + * Support for injective type families * Applicative do-notation @@ -38,7 +38,9 @@ of major features and numerous bug fixes. These include, * A rewritten (and greatly improved) pattern exhaustiveness checker * GHCi can run the interpreter in a separate process, and the interpreter can - now run profiled code. + now run profiled code + + * A native code generator for powerpc64 and powerpc64le architectures * and more! diff --git a/docs/users_guide/8.0.1-notes.rst b/docs/users_guide/8.0.1-notes.rst index 848e699..6175b39 100644 --- a/docs/users_guide/8.0.1-notes.rst +++ b/docs/users_guide/8.0.1-notes.rst @@ -23,7 +23,7 @@ The highlights, since the 7.10 branch, are: - More reliable DWARF debugging information -- Support for :ref:`injective type classes ` +- Support for :ref:`injective type families ` - Applicative ``do`` notation (see :ref:`applicative-do`) @@ -50,6 +50,8 @@ The highlights, since the 7.10 branch, are: :ghc-flag:`-fexternal-interpreter` and :ghc-flag:`-prof` (see :ref:`ghci-stack-traces`). +- A native code generator for powerpc64 and powerpc64le architectures + - The reworked users guide you are now reading - Support for Windows XP and earlier has been dropped. From git at git.haskell.org Sat Jan 16 12:48:47 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 16 Jan 2016 12:48:47 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Fix #11015 with a nice note. (0812e32) Message-ID: <20160116124847.5BDC03A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/0812e323a099a902ea5d1ed357549bc655b860d9/ghc >--------------------------------------------------------------- commit 0812e323a099a902ea5d1ed357549bc655b860d9 Author: Edward Z. Yang Date: Wed Jan 13 16:10:11 2016 -0800 Fix #11015 with a nice note. Signed-off-by: Edward Z. Yang Test Plan: doc only Reviewers: bgamari, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1776 GHC Trac Issues: #11015 (cherry picked from commit 91f1c600614e8c456a62bd95611400b442113cdf) >--------------------------------------------------------------- 0812e323a099a902ea5d1ed357549bc655b860d9 compiler/basicTypes/Module.hs | 70 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/compiler/basicTypes/Module.hs b/compiler/basicTypes/Module.hs index 8015a25..0051147 100644 --- a/compiler/basicTypes/Module.hs +++ b/compiler/basicTypes/Module.hs @@ -95,6 +95,76 @@ import qualified Data.Map as Map import qualified FiniteMap as Map import System.FilePath +-- Note [The identifier lexicon] +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-- Package keys, installed package IDs, ABI hashes, package names, +-- versions, there are a *lot* of different identifiers for closely +-- related things. What do they all mean? Here's what. (See also +-- https://ghc.haskell.org/trac/ghc/wiki/Commentary/Packages/Concepts ) +-- +-- THE IMPORTANT ONES +-- +-- ComponentId: An opaque identifier provided by Cabal, which should +-- uniquely identify such things as the package name, the package +-- version, the name of the component, the hash of the source code +-- tarball, the selected Cabal flags, GHC flags, direct dependencies of +-- the component. These are very similar to InstalledPackageId, but +-- an 'InstalledPackageId' implies that it identifies a package, while +-- a package may install multiple components with different +-- 'ComponentId's. +-- - Same as Distribution.Package.ComponentId +-- +-- UnitId: A ComponentId + a mapping from hole names (ModuleName) to +-- Modules. This is how the compiler identifies instantatiated +-- components, and also is the main identifier by which GHC identifies +-- things. +-- - When Backpack is not being used, UnitId = ComponentId. +-- this means a useful fiction for end-users is that there are +-- only ever ComponentIds, and some ComponentIds happen to have +-- more information (UnitIds). +-- - Same as Language.Haskell.TH.Syntax:PkgName, see +-- https://ghc.haskell.org/trac/ghc/ticket/10279 +-- - The same as PackageKey in GHC 7.10 (we renamed it because +-- they don't necessarily identify packages anymore.) +-- - Same as -this-package-key/-package-name flags +-- +-- Module: A UnitId + ModuleName. This is how the compiler identifies +-- modules (e.g. a Name is a Module + OccName) +-- - Same as Language.Haskell.TH.Syntax:Module +-- +-- THE LESS IMPORTANT ONES +-- +-- PackageName: The "name" field in a Cabal file, something like "lens". +-- - Same as Distribution.Package.PackageName +-- - DIFFERENT FROM Language.Haskell.TH.Syntax:PkgName, see +-- https://ghc.haskell.org/trac/ghc/ticket/10279 +-- - DIFFERENT FROM -package-name flag +-- - DIFFERENT FROM the 'name' field in an installed package +-- information. This field could more accurately be described +-- as a munged package name: when it's for the main library +-- it is the same as the package name, but if it's an internal +-- library it's a munged combination of the package name and +-- the component name. +-- +-- LEGACY ONES +-- +-- InstalledPackageId: This is what we used to call ComponentId. +-- It's a still pretty useful concept for packages that have only +-- one library; in that case the logical InstalledPackageId = +-- ComponentId. Also, the Cabal nix-local-build continues to +-- compute an InstalledPackageId which is then forcibly used +-- for all components in a package. This means that if a dependency +-- from one component in a package changes, the InstalledPackageId +-- changes: you don't get as fine-grained dependency tracking, +-- but it means your builds are hermetic. Eventually, Cabal will +-- deal completely in components and we can get rid of this. +-- +-- PackageKey: This is what we used to call UnitId. We ditched +-- "Package" from the name when we realized that you might want to +-- assign different "PackageKeys" to components from the same package. +-- (For a brief, non-released period of time, we also called these +-- UnitKeys). + {- ************************************************************************ * * From git at git.haskell.org Sat Jan 16 12:48:50 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 16 Jan 2016 12:48:50 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Remove lookup of sections by name instead use the index numbers as offsets (ca473b7) Message-ID: <20160116124850.0B43D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/ca473b7e0a3761c0259e8c5c49bb2a9a963ff1ed/ghc >--------------------------------------------------------------- commit ca473b7e0a3761c0259e8c5c49bb2a9a963ff1ed Author: Tamar Christina Date: Tue Jan 12 20:34:25 2016 +0100 Remove lookup of sections by name instead use the index numbers as offsets Summary: This patch comes from @awson {{{ Playing with `-fsplit-sections` on Windows I've found a pile of ancient (it was borrowed from Hugs interpreter code and I don't even know when was it created), absolutely redundant and plain wrong code in RTS linker. Technically it is a bug, but it doesn't break things when used with current Windows binutils with no special linker scripts involved. OTOH, it slows down runtime linker on Windows noticeably and thus can be considered as a performance bug. The nice side-effect for existing users is that GHCi now loads compiled object code much faster on Windows. }}} More specifically, sections were being looked up by name by doing a loop over all sections until the section with the given name is found. The new approach uses the section index and finds the section in O(1) time based on information gathered when we originally processed the section Test Plan: ./validate (was run on GHC x86) Reviewers: austin, awson, erikd, thomie, bgamari Reviewed By: thomie, bgamari Subscribers: awson, #ghc_windows_task_force Differential Revision: https://phabricator.haskell.org/D1773 GHC Trac Issues: #11388 (cherry picked from commit 49e414a736efe6a5aa221907d9eab9019978e225) >--------------------------------------------------------------- ca473b7e0a3761c0259e8c5c49bb2a9a963ff1ed rts/Linker.c | 64 +----------------------------------------------------------- 1 file changed, 1 insertion(+), 63 deletions(-) diff --git a/rts/Linker.c b/rts/Linker.c index 6e20984..1c76a00 100644 --- a/rts/Linker.c +++ b/rts/Linker.c @@ -3232,62 +3232,6 @@ cstring_from_section_name (UChar* name, UChar* strtab) } } -/* Just compares the short names (first 8 chars) */ -static COFF_section * -findPEi386SectionCalled ( ObjectCode* oc, UChar* name, UChar* strtab ) -{ - int i; - rtsBool long_name = rtsFalse; - COFF_header* hdr - = (COFF_header*)(oc->image); - COFF_section* sectab - = (COFF_section*) ( - ((UChar*)(oc->image)) - + sizeof_COFF_header + hdr->SizeOfOptionalHeader - ); - // String is longer than 8 bytes, swap in the proper - // (NULL-terminated) version, and make a note that this - // is a long name. - if (name[0]==0 && name[1]==0 && name[2]==0 && name[3]==0) { - UInt32 strtab_offset = * (UInt32*)(name+4); - name = ((UChar*)strtab) + strtab_offset; - long_name = rtsTrue; - } - for (i = 0; i < hdr->NumberOfSections; i++) { - UChar* n1; - UChar* n2; - COFF_section* section_i - = (COFF_section*) - myindex ( sizeof_COFF_section, sectab, i ); - n1 = (UChar*) &(section_i->Name); - n2 = name; - // Long section names are prefixed with a slash, see - // also cstring_from_section_name - if (n1[0] == '/' && long_name) { - // Long name check - // We don't really want to make an assumption that the string - // table indexes are the same, so we'll do a proper check. - int n1_strtab_offset = strtol((char*)n1+1,NULL,10); - n1 = (UChar*) (((char*)strtab) + n1_strtab_offset); - if (0==strcmp((const char*)n1, (const char*)n2)) { - return section_i; - } - } else if (n1[0] != '/' && !long_name) { - // Short name check - if (n1[0]==n2[0] && n1[1]==n2[1] && n1[2]==n2[2] && - n1[3]==n2[3] && n1[4]==n2[4] && n1[5]==n2[5] && - n1[6]==n2[6] && n1[7]==n2[7]) { - return section_i; - } - } else { - // guaranteed to mismatch, because we never attempt to link - // in an executable where the section name may be truncated - } - } - - return NULL; -} - /* See Note [mingw-w64 name decoration scheme] */ #ifndef x86_64_HOST_ARCH static void @@ -3986,13 +3930,7 @@ ocResolve_PEi386 ( ObjectCode* oc ) if (sym->StorageClass == MYIMAGE_SYM_CLASS_STATIC) { COFF_section* section_sym - = findPEi386SectionCalled ( oc, sym->Name, strtab ); - if (!section_sym) { - errorBelch("%" PATH_FMT ": can't find section named: ", oc->fileName); - printName(sym->Name, strtab); - errorBelch(" in %s", secname); - return 0; - } + = (COFF_section*) myindex ( sizeof_COFF_section, sectab, sym->SectionNumber-1 ); S = ((size_t)(oc->image)) + ((size_t)(section_sym->PointerToRawData)) + ((size_t)(sym->Value)); From git at git.haskell.org Sat Jan 16 12:48:52 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 16 Jan 2016 12:48:52 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: user-guide: Note Cabal version limitation (d38daab) Message-ID: <20160116124852.A8B083A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/d38daab8e7bacfcd7c5f7fde07484e660ad965b2/ghc >--------------------------------------------------------------- commit d38daab8e7bacfcd7c5f7fde07484e660ad965b2 Author: Ben Gamari Date: Thu Jan 14 15:46:31 2016 +0100 user-guide: Note Cabal version limitation (cherry picked from commit b90cac69b2abec7df998d1d447b3fe075eb8f15c) >--------------------------------------------------------------- d38daab8e7bacfcd7c5f7fde07484e660ad965b2 docs/users_guide/8.0.1-notes.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/users_guide/8.0.1-notes.rst b/docs/users_guide/8.0.1-notes.rst index 6175b39..e90a534 100644 --- a/docs/users_guide/8.0.1-notes.rst +++ b/docs/users_guide/8.0.1-notes.rst @@ -7,6 +7,18 @@ The significant changes to the various parts of the compiler are listed in the following sections. There have also been numerous bug fixes and performance improvements over the 7.10 branch. +.. warning:: + + Only Cabal versions 0.24 and newer will function properly with this release. + Consequently it will likely be necessary to recompile ``cabal-install`` + before installing new packages. + + The reason for this is a change in how packages are identified in GHC + 8.0. While previous versions of Cabal identified packages to GHC with a + package key (with GHC's :ghc-flag:`-this-package-key` argument), GHC 8.0 and + later uses installed package IDs in place of package keys. + + Highlights ---------- From git at git.haskell.org Sat Jan 16 12:48:55 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 16 Jan 2016 12:48:55 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: T11300: Fix test on windows (c95bb5e) Message-ID: <20160116124855.59ADA3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/c95bb5e30ecf359bf12c3ce49c85fdfed6361dfb/ghc >--------------------------------------------------------------- commit c95bb5e30ecf359bf12c3ce49c85fdfed6361dfb Author: Tamar Christina Date: Sun Jan 10 07:20:57 2016 +0100 T11300: Fix test on windows Summary: Fix exit code for Windows to match expected for out-of-memory test Test Plan: ./validate Reviewers: simonmar, austin, thomie, bgamari Reviewed By: thomie, bgamari Differential Revision: https://phabricator.haskell.org/D1753 GHC Trac Issues: #11422 (cherry picked from commit db371c10a2da722a18b0d5bc042eb2d02ba60e1b) >--------------------------------------------------------------- c95bb5e30ecf359bf12c3ce49c85fdfed6361dfb rts/win32/OSMem.c | 5 +++-- rts/win32/veh_excn.c | 3 +-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rts/win32/OSMem.c b/rts/win32/OSMem.c index 47e24f0..0009a4e 100644 --- a/rts/win32/OSMem.c +++ b/rts/win32/OSMem.c @@ -59,7 +59,8 @@ allocNew(nat n) { rec=0; if (GetLastError() == ERROR_NOT_ENOUGH_MEMORY) { - errorBelch("out of memory"); + errorBelch("Out of memory"); + stg_exit(EXIT_HEAPOVERFLOW); } else { sysErrorBelch( "getMBlocks: VirtualAlloc MEM_RESERVE %d blocks failed", n); @@ -177,7 +178,7 @@ commitBlocks(char* base, W_ size) { temp = VirtualAlloc(base, size_delta, MEM_COMMIT, PAGE_READWRITE); if(temp==0) { sysErrorBelch("getMBlocks: VirtualAlloc MEM_COMMIT failed"); - stg_exit(EXIT_FAILURE); + stg_exit(EXIT_HEAPOVERFLOW); } size-=size_delta; base+=size_delta; diff --git a/rts/win32/veh_excn.c b/rts/win32/veh_excn.c index a24354e..bf2151a 100644 --- a/rts/win32/veh_excn.c +++ b/rts/win32/veh_excn.c @@ -37,7 +37,6 @@ long WINAPI __hs_exception_handler(struct _EXCEPTION_POINTERS *exception_data) // return immediately. if ((exception_data->ExceptionRecord->ExceptionFlags & EH_UNWINDING) == 0) { - // Error handling cases covered by this implementation. switch (exception_data->ExceptionRecord->ExceptionCode) { case EXCEPTION_FLT_DIVIDE_BY_ZERO: @@ -62,7 +61,7 @@ long WINAPI __hs_exception_handler(struct _EXCEPTION_POINTERS *exception_data) if (EXCEPTION_CONTINUE_EXECUTION == action) { fflush(stdout); - stg_exit(1); + stg_exit(EXIT_FAILURE); } } From git at git.haskell.org Sat Jan 16 12:48:58 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 16 Jan 2016 12:48:58 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: users-guide: Fix cabal version number (e81043d) Message-ID: <20160116124858.2C77C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/e81043ddadda84ad77c8edd86bdcb634479a1819/ghc >--------------------------------------------------------------- commit e81043ddadda84ad77c8edd86bdcb634479a1819 Author: Ben Gamari Date: Fri Jan 15 13:16:51 2016 +0100 users-guide: Fix cabal version number (cherry picked from commit faf3f96f6e08c7e5bebc974f7e71580df0c11241) >--------------------------------------------------------------- e81043ddadda84ad77c8edd86bdcb634479a1819 docs/users_guide/8.0.1-notes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/users_guide/8.0.1-notes.rst b/docs/users_guide/8.0.1-notes.rst index e90a534..bbcf527 100644 --- a/docs/users_guide/8.0.1-notes.rst +++ b/docs/users_guide/8.0.1-notes.rst @@ -9,7 +9,7 @@ performance improvements over the 7.10 branch. .. warning:: - Only Cabal versions 0.24 and newer will function properly with this release. + Only Cabal versions 1.24 and newer will function properly with this release. Consequently it will likely be necessary to recompile ``cabal-install`` before installing new packages. From git at git.haskell.org Sat Jan 16 12:49:00 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 16 Jan 2016 12:49:00 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Use XZ compression by default (68a0452) Message-ID: <20160116124900.D7A2A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/68a04521be123d4351031f051d728aff41e2c9a9/ghc >--------------------------------------------------------------- commit 68a04521be123d4351031f051d728aff41e2c9a9 Author: Ben Gamari Date: Fri Jan 15 15:19:10 2016 +0100 Use XZ compression by default Resolves #11434. (cherry picked from commit e7eec3a1c6ec46dc5b0d9d84c8a894b6f7e27f63) >--------------------------------------------------------------- 68a04521be123d4351031f051d728aff41e2c9a9 mk/config.mk.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mk/config.mk.in b/mk/config.mk.in index fd0bb51..5d13f0c 100644 --- a/mk/config.mk.in +++ b/mk/config.mk.in @@ -775,8 +775,8 @@ BZIP2_CMD = bzip2 GZIP_CMD = gzip XZ_CMD = xz -9e -# bzip2 is default compression -TAR_COMP = bzip2 +# xz is default compression +TAR_COMP = xz # select compression command and .tar extension based on TAR_COMP value ifeq "$(TAR_COMP)" "bzip2" From git at git.haskell.org Sat Jan 16 12:49:04 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 16 Jan 2016 12:49:04 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Link command line libs to temp so (e4c8659) Message-ID: <20160116124904.2A74E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/e4c8659bbb78c98a30dd5e19a4fe27044d33aa85/ghc >--------------------------------------------------------------- commit e4c8659bbb78c98a30dd5e19a4fe27044d33aa85 Author: Peter Trommler Date: Fri Jan 15 13:25:38 2016 +0100 Link command line libs to temp so Symbols in libraries specified on the GHCis command line are not available to compiled modules because shared libraries are loaded with local scope. So we link all libraries specified on the command line into each temporary shared library. Test Plan: validate Reviewers: simonmar, hvr, austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1631 GHC Trac Issues: #10458 (cherry picked from commit c6a3e2277aef2d3b8a472cc82542c9b22cea86bf) >--------------------------------------------------------------- e4c8659bbb78c98a30dd5e19a4fe27044d33aa85 compiler/ghci/Linker.hs | 14 +++++++++++++- testsuite/tests/ghci/linking/dyn/Makefile | 7 +++++++ .../tests/ghci/linking/dyn/{T1407.script => T10458.hs} | 6 +++++- testsuite/tests/ghci/linking/dyn/T10458.script | 4 ++++ .../T3279.stdout => ghci/linking/dyn/T10458.stdout} | 0 testsuite/tests/ghci/linking/dyn/all.T | 7 +++++++ 6 files changed, 36 insertions(+), 2 deletions(-) diff --git a/compiler/ghci/Linker.hs b/compiler/ghci/Linker.hs index 8f1107f..44d272e 100644 --- a/compiler/ghci/Linker.hs +++ b/compiler/ghci/Linker.hs @@ -846,6 +846,8 @@ dynLoadObjs _ pls [] = return pls dynLoadObjs hsc_env pls objs = do let dflags = hsc_dflags hsc_env let platform = targetPlatform dflags + let minus_ls = [ lib | Option ('-':'l':lib) <- ldInputs dflags ] + let minus_big_ls = [ lib | Option ('-':'L':lib) <- ldInputs dflags ] (soFile, libPath , libName) <- newTempLibName dflags (soExt platform) let dflags2 = dflags { @@ -863,7 +865,17 @@ dynLoadObjs hsc_env pls objs = do , Option ("-Wl," ++ lp) , Option ("-l" ++ l) ]) - (temp_sos pls), + (temp_sos pls) + ++ concatMap + (\lp -> + [ Option ("-L" ++ lp) + , Option ("-Wl,-rpath") + , Option ("-Wl," ++ lp) + ]) + minus_big_ls + ++ map (\l -> Option ("-l" ++ l)) minus_ls, + -- Add -l options and -L options from dflags. + -- -- When running TH for a non-dynamic way, we still -- need to make -l flags to link against the dynamic -- libraries, so we need to add WayDyn to ways. diff --git a/testsuite/tests/ghci/linking/dyn/Makefile b/testsuite/tests/ghci/linking/dyn/Makefile index bc33048..0f2d6e1 100644 --- a/testsuite/tests/ghci/linking/dyn/Makefile +++ b/testsuite/tests/ghci/linking/dyn/Makefile @@ -39,6 +39,13 @@ compile_libAS: '$(TEST_HC)' $(MY_TEST_HC_OPTS) -shared A.c -o $(call DLL,AS) rm -f libAS*.a +.PHONY: compile_libT10458 +compile_libT10458: + rm -rf T10458dir + mkdir T10458dir + '$(TEST_HC)' $(MY_TEST_HC_OPTS) -odir "T10458dir" -shared A.c -o "T10458dir/$(call DLL,AS)" + rm -f T10458dir/libAS*.a + .PHONY: compile_libAB_dep compile_libAB_dep: rm -rf bin_dep diff --git a/testsuite/tests/ghci/linking/dyn/T1407.script b/testsuite/tests/ghci/linking/dyn/T10458.hs similarity index 56% copy from testsuite/tests/ghci/linking/dyn/T1407.script copy to testsuite/tests/ghci/linking/dyn/T10458.hs index 0274f82..98fc4e4 100644 --- a/testsuite/tests/ghci/linking/dyn/T1407.script +++ b/testsuite/tests/ghci/linking/dyn/T10458.hs @@ -1,4 +1,8 @@ -:set -lAS +module T10458 (callSO) where + import Foreign import Foreign.C.Types foreign import ccall "foo" dle :: IO CInt + +callSO :: IO CInt +callSO = dle diff --git a/testsuite/tests/ghci/linking/dyn/T10458.script b/testsuite/tests/ghci/linking/dyn/T10458.script new file mode 100644 index 0000000..15ecb22 --- /dev/null +++ b/testsuite/tests/ghci/linking/dyn/T10458.script @@ -0,0 +1,4 @@ +:set -fobject-code +:load T10458 + +callSO diff --git a/testsuite/tests/concurrent/should_run/T3279.stdout b/testsuite/tests/ghci/linking/dyn/T10458.stdout similarity index 100% copy from testsuite/tests/concurrent/should_run/T3279.stdout copy to testsuite/tests/ghci/linking/dyn/T10458.stdout diff --git a/testsuite/tests/ghci/linking/dyn/all.T b/testsuite/tests/ghci/linking/dyn/all.T index e5b40d4..eb044fc 100644 --- a/testsuite/tests/ghci/linking/dyn/all.T +++ b/testsuite/tests/ghci/linking/dyn/all.T @@ -27,3 +27,10 @@ test('T10955dyn', [extra_clean(['bin_dyn/*', 'bin_dyn'])], run_command, ['$MAKE -s --no-print-directory compile_libAB_dyn']) + +test('T10458', + [unless(doing_ghci, skip), + extra_clean(['libAS.*']), + pre_cmd('$MAKE -s --no-print-directory compile_libT10458'), + extra_hc_opts('-L$PWD/T10458dir -lAS')], + ghci_script, ['T10458.script']) From git at git.haskell.org Sat Jan 16 12:49:07 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 16 Jan 2016 12:49:07 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Don't output manpage in same directory as source (50d3b7f) Message-ID: <20160116124907.0C1C23A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/50d3b7f564c4cb5247a453e18a96113f2362eda0/ghc >--------------------------------------------------------------- commit 50d3b7f564c4cb5247a453e18a96113f2362eda0 Author: Ben Gamari Date: Fri Jan 15 16:35:38 2016 +0100 Don't output manpage in same directory as source Test Plan: Validate Reviewers: austin, thomie, nomeata Differential Revision: https://phabricator.haskell.org/D1782 GHC Trac Issues: #11433 (cherry picked from commit 7cf16aaf6d08a6be7f4c4a20b8684d61e1ee3163) >--------------------------------------------------------------- 50d3b7f564c4cb5247a453e18a96113f2362eda0 .gitignore | 1 + docs/users_guide/ghc.mk | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 0455251..5c2af90 100644 --- a/.gitignore +++ b/.gitignore @@ -98,6 +98,7 @@ _darcs/ /docs/users_guide/users_guide.pdf /docs/users_guide/build-html /docs/users_guide/build-pdf +/docs/users_guide/build-man /docs/users_guide/.doctrees-* /docs/users_guide/.doctrees/ /driver/ghci/ghc-pkg-inplace diff --git a/docs/users_guide/ghc.mk b/docs/users_guide/ghc.mk index deb60a3..83cf60a 100644 --- a/docs/users_guide/ghc.mk +++ b/docs/users_guide/ghc.mk @@ -23,11 +23,11 @@ html_docs/users_guide : docs/users_guide/images/prof_scc.svg docs/users_guide_MAN_RST_SOURCES := docs/users_guide/ghc.rst MAN_SECTION := 1 -MAN_PAGES := docs/users_guide/ghc.1 +MAN_PAGES := docs/users_guide/build-man/ghc.1 ifneq "$(BINDIST)" "YES" $(MAN_PAGES): $(docs/users_guide_MAN_RST_SOURCES) $(utils/mkUserGuidePart_GENERATED_RST_SOURCES) - $(SPHINXBUILD) -b man -d docs/users_guide/.doctrees-man docs/users_guide docs/users_guide + $(SPHINXBUILD) -b man -d docs/users_guide/.doctrees-man docs/users_guide docs/users_guide/build-man endif man : $(MAN_PAGES) From git at git.haskell.org Sat Jan 16 12:49:09 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 16 Jan 2016 12:49:09 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: configure.ac: Export MAKECMD to build system (cdfceac) Message-ID: <20160116124909.D5DBA3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/cdfceac411530811c28e9b43b86268909b849266/ghc >--------------------------------------------------------------- commit cdfceac411530811c28e9b43b86268909b849266 Author: Karel Gardas Date: Fri Jan 15 17:38:41 2016 +0100 configure.ac: Export MAKECMD to build system Reviewers: austin, bgamari, thomie Reviewed By: thomie Subscribers: angerman, thomie, erikd Differential Revision: https://phabricator.haskell.org/D1775 (cherry picked from commit 67fc3f3a290476eb65626897e6f80090dbdc04f8) >--------------------------------------------------------------- cdfceac411530811c28e9b43b86268909b849266 configure.ac | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/configure.ac b/configure.ac index 637d3cb..97dcef7 100644 --- a/configure.ac +++ b/configure.ac @@ -1103,28 +1103,39 @@ if test -e shake-build/cfg/system.config.in; then AC_CONFIG_FILES([shake-build/cfg/system.config]) fi -AC_CONFIG_FILES([mk/config.mk mk/install.mk mk/project.mk compiler/ghc.cabal ghc/ghc-bin.cabal utils/runghc/runghc.cabal libraries/ghc-boot/ghc-boot.cabal libraries/ghci/ghci.cabal settings docs/users_guide/ghc_config.py docs/index.html libraries/prologue.txt distrib/configure.ac]) -AC_OUTPUT - # We got caught by # http://savannah.gnu.org/bugs/index.php?1516 # $(eval ...) inside conditionals causes errors # with make 3.80, so warn the user if it looks like they're about to # try to use it. # We would use "grep -q" here, but Solaris's grep doesn't support it. +print_make_warning="" checkMake380() { - if $1 --version 2>&1 | head -1 | grep 'GNU Make 3\.80' > /dev/null + make_ver=`$1 --version 2>&1 | head -1` + if echo "$make_ver" | grep 'GNU Make 3\.80' > /dev/null then - echo - echo "WARNING: It looks like \"$1\" is GNU make 3.80." - echo "This version cannot be used to build GHC." - echo "Please use GNU make >= 3.81." + print_make_warning="true" + fi + if echo "$make_ver" | grep 'GNU Make' > /dev/null + then + MakeCmd=$1 + AC_SUBST(MakeCmd) fi } checkMake380 make checkMake380 gmake +AC_CONFIG_FILES([mk/config.mk mk/install.mk mk/project.mk compiler/ghc.cabal ghc/ghc-bin.cabal utils/runghc/runghc.cabal libraries/ghc-boot/ghc-boot.cabal libraries/ghci/ghci.cabal settings docs/users_guide/ghc_config.py docs/index.html libraries/prologue.txt distrib/configure.ac]) +AC_OUTPUT + +if test "$print_make_warning" = "true"; then + echo + echo "WARNING: It looks like \"$MakeCmd\" is GNU make 3.80." + echo "This version cannot be used to build GHC." + echo "Please use GNU make >= 3.81." +fi + echo [" ---------------------------------------------------------------------- Configure completed successfully. From git at git.haskell.org Sat Jan 16 12:49:12 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 16 Jan 2016 12:49:12 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Refactor lookupFixityRn-related code following D1744 (3e1f49f) Message-ID: <20160116124912.B40133A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/3e1f49fed900813de867255ede338fc47de38215/ghc >--------------------------------------------------------------- commit 3e1f49fed900813de867255ede338fc47de38215 Author: RyanGlScott Date: Fri Jan 15 16:37:18 2016 +0100 Refactor lookupFixityRn-related code following D1744 Test Plan: ./validate Reviewers: goldfire, austin, bgamari, simonpj Subscribers: simonpj, thomie Differential Revision: https://phabricator.haskell.org/D1766 GHC Trac Issues: #11345 (cherry picked from commit 756b22832e2ba5713e5bb8201eedf1d04db729a8) >--------------------------------------------------------------- 3e1f49fed900813de867255ede338fc47de38215 compiler/iface/MkIface.hs | 14 +++++++------- compiler/main/HscTypes.hs | 17 +++++++++++------ compiler/rename/RnEnv.hs | 39 +++++++++++++++++++++++++++++++-------- compiler/typecheck/TcDeriv.hs | 2 +- compiler/typecheck/TcSplice.hs | 22 ++-------------------- docs/users_guide/8.0.1-notes.rst | 8 ++++++++ 6 files changed, 60 insertions(+), 42 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 3e1f49fed900813de867255ede338fc47de38215 From git at git.haskell.org Sat Jan 16 12:49:16 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 16 Jan 2016 12:49:16 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Allow pattern synonyms which have several clauses. (e2c7397) Message-ID: <20160116124916.309E73A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/e2c739772bfd12f1ad0bd900abbb34bc28de543e/ghc >--------------------------------------------------------------- commit e2c739772bfd12f1ad0bd900abbb34bc28de543e Author: Matthew Pickering Date: Fri Jan 15 17:40:51 2016 +0100 Allow pattern synonyms which have several clauses. But still disallow empty pattern synonym builder declarations. Handling this incorrectly was the cause of #11367. Test Plan: ./validate Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1779 GHC Trac Issues: #11367 (cherry picked from commit 443bf04485f997be2e3a744102605645c54e9d61) >--------------------------------------------------------------- e2c739772bfd12f1ad0bd900abbb34bc28de543e compiler/parser/RdrHsSyn.hs | 2 +- testsuite/tests/patsyn/should_compile/T11367.hs | 7 +++++++ testsuite/tests/patsyn/should_compile/all.T | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/compiler/parser/RdrHsSyn.hs b/compiler/parser/RdrHsSyn.hs index 1094f49..25e5de1 100644 --- a/compiler/parser/RdrHsSyn.hs +++ b/compiler/parser/RdrHsSyn.hs @@ -468,7 +468,7 @@ mkPatSynMatchGroup :: Located RdrName -> P (MatchGroup RdrName (LHsExpr RdrName)) mkPatSynMatchGroup (L loc patsyn_name) (L _ decls) = do { matches <- mapM fromDecl (fromOL decls) - ; when (length matches /= 1) (wrongNumberErr loc) + ; when (null matches) (wrongNumberErr loc) ; return $ mkMatchGroup FromSource matches } where fromDecl (L loc decl@(ValD (PatBind pat@(L _ (ConPatIn ln@(L _ name) details)) rhs _ _ _))) = diff --git a/testsuite/tests/patsyn/should_compile/T11367.hs b/testsuite/tests/patsyn/should_compile/T11367.hs new file mode 100644 index 0000000..8e00a50 --- /dev/null +++ b/testsuite/tests/patsyn/should_compile/T11367.hs @@ -0,0 +1,7 @@ +{-# LANGUAGE PatternSynonyms, ViewPatterns #-} +module T11367 where + +pattern A :: Int -> String +pattern A n <- (read -> n) where + A 0 = "hi" + A 1 = "bye" diff --git a/testsuite/tests/patsyn/should_compile/all.T b/testsuite/tests/patsyn/should_compile/all.T index 880d6b2..ebfca5f 100644 --- a/testsuite/tests/patsyn/should_compile/all.T +++ b/testsuite/tests/patsyn/should_compile/all.T @@ -47,3 +47,4 @@ test('T10897', normal, multi_compile, ['T10897', [ test('T11224b', normal, compile, ['']) test('MoreEx', normal, compile, ['']) test('T11283', normal, compile, ['']) +test('T11367', normal, compile, ['']) From git at git.haskell.org Sat Jan 16 12:49:19 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 16 Jan 2016 12:49:19 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Expand type/kind synonyms in TyVars before deriving-related typechecking (20f848b) Message-ID: <20160116124919.627513A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/20f848b0e9020355340f3f0f2311d2f3d9aceb7c/ghc >--------------------------------------------------------------- commit 20f848b0e9020355340f3f0f2311d2f3d9aceb7c Author: RyanGlScott Date: Fri Jan 15 17:42:02 2016 +0100 Expand type/kind synonyms in TyVars before deriving-related typechecking Before, it was possible to have a datatypes such as ``` type ConstantT a b = a newtype T (f :: * -> *) (a :: ConstantT * f) = T (f a) deriving Functor data family TFam (f :: * -> *) (a :: *) newtype instance TFam f (ConstantT a f) = TFam (f a) deriving Functor ``` fail to eta-reduce because either (1) a TyVar had a kind synonym that mentioned another TyVar, or (2) an instantiated type was itself a type synonym that mentioned another TyVar. A little bit of tweaking to `expandTypeSynonyms` and applying it before the eta-reduction check in the `deriving` machinery is sufficient to fix this. Fixes #11416. Test Plan: ./validate Reviewers: goldfire, simonpj, austin, bgamari Reviewed By: simonpj Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1772 GHC Trac Issues: #11416 (cherry picked from commit 165ae440b6bbf577eabf0b6d422ed6ea3bf949b4) >--------------------------------------------------------------- 20f848b0e9020355340f3f0f2311d2f3d9aceb7c compiler/typecheck/TcDeriv.hs | 32 ++++++++++++++++++++++- compiler/types/Type.hs | 3 +++ testsuite/tests/deriving/should_compile/T11416.hs | 19 ++++++++++++++ testsuite/tests/deriving/should_compile/all.T | 1 + 4 files changed, 54 insertions(+), 1 deletion(-) diff --git a/compiler/typecheck/TcDeriv.hs b/compiler/typecheck/TcDeriv.hs index d40aca1..e351f28 100644 --- a/compiler/typecheck/TcDeriv.hs +++ b/compiler/typecheck/TcDeriv.hs @@ -597,7 +597,11 @@ deriveTyData tvs tc tc_args deriv_pred (tc_args_to_keep, args_to_drop) = splitAt n_args_to_keep tc_args inst_ty_kind = typeKind (mkTyConApp tc tc_args_to_keep) - dropped_tvs = tyCoVarsOfTypes args_to_drop + -- Use exactTyCoVarsOfTypes, not tyCoVarsOfTypes, so that we + -- don't mistakenly grab a type variable mentioned in a type + -- synonym that drops it. + -- See Note [Eta-reducing type synonyms]. + dropped_tvs = exactTyCoVarsOfTypes args_to_drop -- Match up the kinds, and apply the resulting kind substitution -- to the types. See Note [Unify kinds in deriving] @@ -701,6 +705,32 @@ When deriving Functor for P, we unify k to *, but we then want an instance $df :: forall (x:*->*). Functor x => Functor (P * (x:*->*)) and similarly for C. Notice the modified kind of x, both at binding and occurrence sites. + +Note [Eta-reducing type synonyms] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +One can instantiate a type in a data family instance with a type synonym that +mentions other type variables: + + type Const a b = a + data family Fam (f :: * -> *) (a :: *) + newtype instance Fam f (Const a f) = Fam (f a) deriving Functor + +With -XTypeInType, it is also possible to define kind synonyms, and they can +mention other types in a datatype declaration. For example, + + type Const a b = a + newtype T f (a :: Const * f) = T (f a) deriving Functor + +When deriving, we need to perform eta-reduction analysis to ensure that none of +the eta-reduced type variables are mentioned elsewhere in the declaration. But +we need to be careful, because if we don't expand through the Const type +synonym, we will mistakenly believe that f is an eta-reduced type variable and +fail to derive Functor, even though the code above is correct (see Trac #11416, +where this was first noticed). + +For this reason, we call exactTyCoVarsOfTypes on the eta-reduced types so that +we only consider the type variables that remain after expanding through type +synonyms. -} mkEqnHelp :: Maybe OverlapMode diff --git a/compiler/types/Type.hs b/compiler/types/Type.hs index a149bbb..587f636 100644 --- a/compiler/types/Type.hs +++ b/compiler/types/Type.hs @@ -320,6 +320,9 @@ expandTypeSynonyms :: Type -> Type -- ^ Expand out all type synonyms. Actually, it'd suffice to expand out -- just the ones that discard type variables (e.g. type Funny a = Int) -- But we don't know which those are currently, so we just expand all. +-- +-- 'expandTypeSynonyms' only expands out type synonyms mentioned in the type, +-- not in the kinds of any TyCon or TyVar mentioned in the type. expandTypeSynonyms ty = go (mkEmptyTCvSubst (mkTyCoInScopeSet [ty] [])) ty where diff --git a/testsuite/tests/deriving/should_compile/T11416.hs b/testsuite/tests/deriving/should_compile/T11416.hs new file mode 100644 index 0000000..4696306 --- /dev/null +++ b/testsuite/tests/deriving/should_compile/T11416.hs @@ -0,0 +1,19 @@ +{-# LANGUAGE DeriveFunctor #-} +{-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeInType #-} +module T11416 where + +import Data.Kind + +type ConstantT a b = a + +newtype T f (a :: ConstantT * f) = T (f a) + deriving Functor + +data family TFam1 (f :: k1) (a :: k2) +newtype instance TFam1 f (ConstantT a f) = TFam1 (f a) + deriving Functor + +data family TFam2 (f :: k1) (a :: k2) +newtype instance TFam2 f (a :: ConstantT * f) = TFam2 (f a) + deriving Functor diff --git a/testsuite/tests/deriving/should_compile/all.T b/testsuite/tests/deriving/should_compile/all.T index ff26d37..a18a257 100644 --- a/testsuite/tests/deriving/should_compile/all.T +++ b/testsuite/tests/deriving/should_compile/all.T @@ -61,3 +61,4 @@ test('T10524', normal, compile, ['']) test('T11148', normal, run_command, ['$MAKE -s --no-print-directory T11148']) test('T9968', normal, compile, ['']) +test('T11416', normal, compile, ['']) From git at git.haskell.org Sat Jan 16 12:49:22 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 16 Jan 2016 12:49:22 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Fix #11311 (7e58aa0) Message-ID: <20160116124922.83AE23A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/7e58aa08be2e58d0748c89fe7fad2c0961a35083/ghc >--------------------------------------------------------------- commit 7e58aa08be2e58d0748c89fe7fad2c0961a35083 Author: Richard Eisenberg Date: Mon Jan 11 17:03:47 2016 -0500 Fix #11311 All things of kind *, including * itself, need to have a PtrRep. Test: dependent/should_compile/T11311 (cherry picked from commit 6c07f1426e58232092043e28d56717aa489d3670) >--------------------------------------------------------------- 7e58aa08be2e58d0748c89fe7fad2c0961a35083 compiler/types/TyCon.hs | 5 +++-- testsuite/tests/dependent/should_compile/T11311.hs | 8 ++++++++ testsuite/tests/dependent/should_compile/all.T | 1 + .../{annotations/should_compile => dependent/should_run}/Makefile | 0 testsuite/tests/dependent/should_run/T11311.hs | 8 ++++++++ testsuite/tests/dependent/should_run/all.T | 4 ++++ 6 files changed, 24 insertions(+), 2 deletions(-) diff --git a/compiler/types/TyCon.hs b/compiler/types/TyCon.hs index 356e2ea..0f64cf9 100644 --- a/compiler/types/TyCon.hs +++ b/compiler/types/TyCon.hs @@ -568,7 +568,7 @@ data TyCon primTyConRep :: PrimRep,-- ^ Many primitive tycons are unboxed, but -- some are boxed (represented by -- pointers). This 'PrimRep' holds that - -- information. Only relevant if tyConKind = * + -- information. Only relevant if tyConKind = # isUnLifted :: Bool, -- ^ Most primitive tycons are unlifted (may -- not contain bottom) but other are lifted, @@ -1203,7 +1203,8 @@ mkKindTyCon :: Name -> Kind -> [Role] -> Name -> TyCon mkKindTyCon name kind roles rep_nm = tc where - tc = mkPrimTyCon' name kind roles VoidRep False (Just rep_nm) + tc = mkPrimTyCon' name kind roles PtrRep False (Just rep_nm) + -- PtrRep because kinds have kind *. -- | Create a lifted primitive 'TyCon' such as @RealWorld@ mkLiftedPrimTyCon :: Name -> Kind -> [Role] -> PrimRep -> TyCon diff --git a/testsuite/tests/dependent/should_compile/T11311.hs b/testsuite/tests/dependent/should_compile/T11311.hs new file mode 100644 index 0000000..88f0e45 --- /dev/null +++ b/testsuite/tests/dependent/should_compile/T11311.hs @@ -0,0 +1,8 @@ +module T11311 where + +import Data.Kind + +foo :: () +foo = (id :: * -> *) undefined `seq` () + +main = print foo diff --git a/testsuite/tests/dependent/should_compile/all.T b/testsuite/tests/dependent/should_compile/all.T index 1063b6e..ef6dde9 100644 --- a/testsuite/tests/dependent/should_compile/all.T +++ b/testsuite/tests/dependent/should_compile/all.T @@ -11,3 +11,4 @@ test('mkGADTVars', normal, compile, ['']) test('TypeLevelVec',normal,compile, ['']) test('T9632', normal, compile, ['']) test('dynamic-paper', normal, compile, ['']) +test('T11311', normal, compile, ['']) diff --git a/testsuite/tests/annotations/should_compile/Makefile b/testsuite/tests/dependent/should_run/Makefile similarity index 100% copy from testsuite/tests/annotations/should_compile/Makefile copy to testsuite/tests/dependent/should_run/Makefile diff --git a/testsuite/tests/dependent/should_run/T11311.hs b/testsuite/tests/dependent/should_run/T11311.hs new file mode 100644 index 0000000..88f0e45 --- /dev/null +++ b/testsuite/tests/dependent/should_run/T11311.hs @@ -0,0 +1,8 @@ +module T11311 where + +import Data.Kind + +foo :: () +foo = (id :: * -> *) undefined `seq` () + +main = print foo diff --git a/testsuite/tests/dependent/should_run/all.T b/testsuite/tests/dependent/should_run/all.T new file mode 100755 index 0000000..c3b18c1 --- /dev/null +++ b/testsuite/tests/dependent/should_run/all.T @@ -0,0 +1,4 @@ + + +# test('T11311', normal, compile_and_run, ['']) + From git at git.haskell.org Sat Jan 16 12:49:25 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 16 Jan 2016 12:49:25 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Fix #10872. (a1a054b) Message-ID: <20160116124925.2E16C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/a1a054b1c91a4dc234d879064a0612eefdcd3fcf/ghc >--------------------------------------------------------------- commit a1a054b1c91a4dc234d879064a0612eefdcd3fcf Author: Richard Eisenberg Date: Sat Jan 9 16:59:05 2016 -0500 Fix #10872. This moves the duplicate-unique check from knownKeyNames (which omits TH) to allKnownKeyNames (which includes TH). (cherry picked from commit d459f55c36c50ae02c55a7fb1331ef81af6751f5) >--------------------------------------------------------------- a1a054b1c91a4dc234d879064a0612eefdcd3fcf compiler/main/HscMain.hs | 33 ++++++++++++++++++++++++++++++--- compiler/prelude/PrelInfo.hs | 32 ++------------------------------ 2 files changed, 32 insertions(+), 33 deletions(-) diff --git a/compiler/main/HscMain.hs b/compiler/main/HscMain.hs index 7807f65..f8945b2 100644 --- a/compiler/main/HscMain.hs +++ b/compiler/main/HscMain.hs @@ -148,6 +148,8 @@ import DynFlags import ErrUtils import Outputable +import UniqFM +import NameEnv import HscStats ( ppSourceStats ) import HscTypes import FastString @@ -199,12 +201,37 @@ newHscEnv dflags = do allKnownKeyNames :: [Name] -- Put here to avoid loops involving DsMeta, -allKnownKeyNames = -- where templateHaskellNames are defined - knownKeyNames +allKnownKeyNames -- where templateHaskellNames are defined + | debugIsOn + , not (isNullUFM badNamesEnv) + = panic ("badAllKnownKeyNames:\n" ++ badNamesStr) + -- NB: We can't use ppr here, because this is sometimes evaluated in a + -- context where there are no DynFlags available, leading to a cryptic + -- "<
>" error. (This seems to happen only in the + -- stage 2 compiler, for reasons I [Richard] have no clue of.) + + | otherwise + = all_names + where + all_names = knownKeyNames #ifdef GHCI - ++ templateHaskellNames + ++ templateHaskellNames #endif + namesEnv = foldl (\m n -> extendNameEnv_Acc (:) singleton m n n) + emptyUFM all_names + badNamesEnv = filterNameEnv (\ns -> length ns > 1) namesEnv + badNamesPairs = nameEnvUniqueElts badNamesEnv + badNamesStrs = map pairToStr badNamesPairs + badNamesStr = unlines badNamesStrs + + pairToStr (uniq, ns) = " " ++ + show uniq ++ + ": [" ++ + intercalate ", " (map (occNameString . nameOccName) ns) ++ + "]" + + -- ----------------------------------------------------------------------------- getWarnings :: Hsc WarningMessages diff --git a/compiler/prelude/PrelInfo.hs b/compiler/prelude/PrelInfo.hs index 0651a2c..74005ed 100644 --- a/compiler/prelude/PrelInfo.hs +++ b/compiler/prelude/PrelInfo.hs @@ -34,18 +34,14 @@ import DataCon import Id import Name import MkId -import NameEnv import TysPrim import TysWiredIn import HscTypes -import UniqFM import Class import TyCon import Util -import Panic ( panic ) import {-# SOURCE #-} TcTypeNats ( typeNatTyCons ) -import Data.List ( intercalate ) import Data.Array {- @@ -81,19 +77,7 @@ knownKeyNames :: [Name] -- you get a Name with the correct known key -- (See Note [Known-key names] in PrelNames) knownKeyNames - | debugIsOn - , not (isNullUFM badNamesEnv) - = panic ("badKnownKeyNames:\n" ++ badNamesStr) - -- NB: We can't use ppr here, because this is sometimes evaluated in a - -- context where there are no DynFlags available, leading to a cryptic - -- "<
>" error. (This seems to happen only in the - -- stage 2 compiler, for reasons I [Richard] have no clue of.) - - | otherwise - = names - where - names = - concat [ tycon_kk_names funTyCon + = concat [ tycon_kk_names funTyCon , concatMap tycon_kk_names primTyCons , concatMap tycon_kk_names wiredInTyCons @@ -112,6 +96,7 @@ knownKeyNames , map (idName . primOpId) allThePrimOps , basicKnownKeyNames ] + where -- "kk" short for "known-key" tycon_kk_names :: TyCon -> [Name] tycon_kk_names tc = tyConName tc : (rep_names tc ++ concatMap thing_kk_names (implicitTyConThings tc)) @@ -133,19 +118,6 @@ knownKeyNames Just n -> [n] Nothing -> [] - namesEnv = foldl (\m n -> extendNameEnv_Acc (:) singleton m n n) - emptyUFM names - badNamesEnv = filterNameEnv (\ns -> length ns > 1) namesEnv - badNamesPairs = nameEnvUniqueElts badNamesEnv - badNamesStrs = map pairToStr badNamesPairs - badNamesStr = unlines badNamesStrs - - pairToStr (uniq, ns) = " " ++ - show uniq ++ - ": [" ++ - intercalate ", " (map (occNameString . nameOccName) ns) ++ - "]" - {- We let a lot of "non-standard" values be visible, so that we can make sense of them in interface pragmas. It's cool, though they all have From git at git.haskell.org Sat Jan 16 12:49:28 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 16 Jan 2016 12:49:28 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Test #11252 in ghci/scripts/T11252 (b41586b) Message-ID: <20160116124928.25C113A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/b41586be7ba0659216c74ef8a58a0aa4d2cc2195/ghc >--------------------------------------------------------------- commit b41586be7ba0659216c74ef8a58a0aa4d2cc2195 Author: Richard Eisenberg Date: Sat Jan 9 11:26:14 2016 -0500 Test #11252 in ghci/scripts/T11252 This one worked for me out of the box. (cherry picked from commit d4af57fa2a2af0b369087c13c0c7dae869e323bd) >--------------------------------------------------------------- b41586be7ba0659216c74ef8a58a0aa4d2cc2195 testsuite/tests/ghci/scripts/T11252.script | 3 +++ testsuite/tests/ghci/scripts/T11252.stdout | 1 + testsuite/tests/ghci/scripts/all.T | 1 + 3 files changed, 5 insertions(+) diff --git a/testsuite/tests/ghci/scripts/T11252.script b/testsuite/tests/ghci/scripts/T11252.script new file mode 100644 index 0000000..485cd8f --- /dev/null +++ b/testsuite/tests/ghci/scripts/T11252.script @@ -0,0 +1,3 @@ +:set -XTypeInType +data Proxy1 k (a :: k) = Proxy1 +:kind Proxy1 diff --git a/testsuite/tests/ghci/scripts/T11252.stdout b/testsuite/tests/ghci/scripts/T11252.stdout new file mode 100644 index 0000000..eddba45 --- /dev/null +++ b/testsuite/tests/ghci/scripts/T11252.stdout @@ -0,0 +1 @@ +Proxy1 :: forall k -> k -> * diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T index 06a9125..4618281 100755 --- a/testsuite/tests/ghci/scripts/all.T +++ b/testsuite/tests/ghci/scripts/all.T @@ -233,3 +233,4 @@ test('T10989', ghci_script, ['T10989.script']) test('T11098', normal, ghci_script, ['T11098.script']) test('T8316', expect_broken(8316), ghci_script, ['T8316.script']) +test('T11252', normal, ghci_script, ['T11252.script']) From git at git.haskell.org Sat Jan 16 12:49:30 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 16 Jan 2016 12:49:30 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Clarify topological sorting of spec vars in manual (eb09b29) Message-ID: <20160116124930.D19103A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/eb09b293d8b0700620098ecf9de6ac54c5bb8f0c/ghc >--------------------------------------------------------------- commit eb09b293d8b0700620098ecf9de6ac54c5bb8f0c Author: Richard Eisenberg Date: Sun Jan 10 19:10:03 2016 -0500 Clarify topological sorting of spec vars in manual This is mentioned in #11376. (cherry picked from commit 3a7f204f5d713ed4ac034d371fc10d8bedb39efa) >--------------------------------------------------------------- eb09b293d8b0700620098ecf9de6ac54c5bb8f0c docs/users_guide/glasgow_exts.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index 0e52ffd..0b7696e 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -2237,6 +2237,15 @@ Here are the details: will have its type variables ordered as ``m, a, b, c``. +- If any of the variables depend on other variables (that is, if some + of the variables are *kind* variables), the variables are reordered + so that kind variables come before type variables, preserving the + left-to-right order as much as possible. That is, GHC performs a + stable topological sort on the variables. + + For example: if we have ``bar :: Proxy (a :: (j, k)) -> b``, then + the variables are ordered ``j``, ``k``, ``a``, ``b``. + - Class methods' type arguments include the class type variables, followed by any variables an individual method is polymorphic in. So, ``class Monad m where return :: a -> m a`` means From git at git.haskell.org Sat Jan 16 12:49:34 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 16 Jan 2016 12:49:34 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Fix #11355. (d4661c1) Message-ID: <20160116124934.3CCC33A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/d4661c1adc732b12d39a6aab4a3f5a8c61e27dde/ghc >--------------------------------------------------------------- commit d4661c1adc732b12d39a6aab4a3f5a8c61e27dde Author: Richard Eisenberg Date: Sat Jan 9 11:18:53 2016 -0500 Fix #11355. Previously, the check for impredicative type applications was in the wrong spot. Test case: typecheck/should_fail/T11355 (cherry picked from commit e6ca93005bc3df62619f3f968fe51b380e33938a) >--------------------------------------------------------------- d4661c1adc732b12d39a6aab4a3f5a8c61e27dde compiler/typecheck/TcValidity.hs | 8 +++++++- testsuite/tests/typecheck/should_fail/T11355.hs | 5 +++++ testsuite/tests/typecheck/should_fail/T11355.stderr | 9 +++++++++ testsuite/tests/typecheck/should_fail/all.T | 1 + 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/compiler/typecheck/TcValidity.hs b/compiler/typecheck/TcValidity.hs index 2df092b..aec4e6d 100644 --- a/compiler/typecheck/TcValidity.hs +++ b/compiler/typecheck/TcValidity.hs @@ -291,6 +291,7 @@ checkValidType :: UserTypeCtxt -> Type -> TcM () checkValidType ctxt ty = do { traceTc "checkValidType" (ppr ty <+> text "::" <+> ppr (typeKind ty)) ; rankn_flag <- xoptM LangExt.RankNTypes + ; impred_flag <- xoptM LangExt.ImpredicativeTypes ; let gen_rank :: Rank -> Rank gen_rank r | rankn_flag = ArbitraryRank | otherwise = r @@ -310,7 +311,12 @@ checkValidType ctxt ty TySynCtxt _ -> rank0 ExprSigCtxt -> rank1 - TypeAppCtxt -> rank0 + TypeAppCtxt | impred_flag -> ArbitraryRank + | otherwise -> tyConArgMonoType + -- Normally, ImpredicativeTypes is handled in check_arg_type, + -- but visible type applications don't go through there. + -- So we do this check here. + FunSigCtxt {} -> rank1 InfSigCtxt _ -> ArbitraryRank -- Inferred type ConArgCtxt _ -> rank1 -- We are given the type of the entire diff --git a/testsuite/tests/typecheck/should_fail/T11355.hs b/testsuite/tests/typecheck/should_fail/T11355.hs new file mode 100644 index 0000000..4ec11d0 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T11355.hs @@ -0,0 +1,5 @@ +{-# LANGUAGE TypeApplications, RankNTypes #-} + +module T11355 where + +foo = const @_ @((forall a. a) -> forall a. a) () (id @(forall a. a)) diff --git a/testsuite/tests/typecheck/should_fail/T11355.stderr b/testsuite/tests/typecheck/should_fail/T11355.stderr new file mode 100644 index 0000000..cd3cc73 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T11355.stderr @@ -0,0 +1,9 @@ + +T11355.hs:5:7: error: + ? Illegal polymorphic or qualified type: forall (a1 :: TYPE t0). a1 + GHC doesn't yet support impredicative polymorphism + ? In the expression: + const @_ @((forall a. a) -> forall a. a) () (id @(forall a. a)) + In an equation for ?foo?: + foo + = const @_ @((forall a. a) -> forall a. a) () (id @(forall a. a)) diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T index 9aef820..88ab499 100644 --- a/testsuite/tests/typecheck/should_fail/all.T +++ b/testsuite/tests/typecheck/should_fail/all.T @@ -402,3 +402,4 @@ test('T11274', normal, compile_fail, ['']) test('T10619', normal, compile_fail, ['']) test('T11347', normal, compile_fail, ['']) test('T11356', normal, compile_fail, ['']) +test('T11355', normal, compile_fail, ['']) From git at git.haskell.org Sat Jan 16 12:49:36 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 16 Jan 2016 12:49:36 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Tiny refactoring in TcUnify (c24f868) Message-ID: <20160116124936.DBFAD3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/c24f868ebb6193af6bfdeb84371c896837d8b654/ghc >--------------------------------------------------------------- commit c24f868ebb6193af6bfdeb84371c896837d8b654 Author: Richard Eisenberg Date: Mon Jan 11 21:28:24 2016 -0500 Tiny refactoring in TcUnify (cherry picked from commit 33950aa6cfa9ba6866c81254c960de4def062fd2) >--------------------------------------------------------------- c24f868ebb6193af6bfdeb84371c896837d8b654 compiler/typecheck/TcUnify.hs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/compiler/typecheck/TcUnify.hs b/compiler/typecheck/TcUnify.hs index 908b692..33525be 100644 --- a/compiler/typecheck/TcUnify.hs +++ b/compiler/typecheck/TcUnify.hs @@ -677,8 +677,10 @@ tc_sub_type_ds eq_orig inst_orig ctxt ty_actual ty_expected = inst_and_unify -- It's still possible that ty_actual has nested foralls. Instantiate -- these, as there's no way unification will succeed with them in. - -- See typecheck/should_compiler/T11350 for an example of when this - -- is important. + -- See typecheck/should_compile/T11305 for an example of when this + -- is important. The problem is that we're checking something like + -- a -> forall b. b -> b <= alpha beta gamma + -- where we end up with alpha := (->) inst_and_unify = do { (wrap, rho_a) <- deeplyInstantiate inst_orig ty_actual @@ -688,15 +690,10 @@ tc_sub_type_ds eq_orig inst_orig ctxt ty_actual ty_expected -- instantiation. If we *have* recurred through -- an arrow, it's better not to update. ; let eq_orig' = case eq_orig of - TypeEqOrigin { uo_actual = orig_ty_actual - , uo_expected = orig_ty_expected - , uo_thing = thing } + TypeEqOrigin { uo_actual = orig_ty_actual } | orig_ty_actual `tcEqType` ty_actual , not (isIdHsWrapper wrap) - -> TypeEqOrigin - { uo_actual = rho_a - , uo_expected = orig_ty_expected - , uo_thing = thing } + -> eq_orig { uo_actual = rho_a } _ -> eq_orig ; cow <- uType eq_orig' TypeLevel rho_a ty_expected From git at git.haskell.org Sat Jan 16 12:49:40 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 16 Jan 2016 12:49:40 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Constrained types have kind * in validity check. (e7ae7cc) Message-ID: <20160116124940.43A973A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/e7ae7cc027691000cac34a70c6efba804975c564/ghc >--------------------------------------------------------------- commit e7ae7cc027691000cac34a70c6efba804975c564 Author: Richard Eisenberg Date: Mon Jan 11 15:28:48 2016 -0500 Constrained types have kind * in validity check. This addresses #11405, but a deeper problem lurks. Try test dependent/should_compile/T11405 and see comment:3 on the ticket. (cherry picked from commit bafbde7e239dd7353fb32cb2ff1b1c9139e4f45c) >--------------------------------------------------------------- e7ae7cc027691000cac34a70c6efba804975c564 compiler/typecheck/TcValidity.hs | 7 ++++++- testsuite/tests/dependent/should_compile/T11405.hs | 9 +++++++++ testsuite/tests/dependent/should_compile/all.T | 2 ++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/compiler/typecheck/TcValidity.hs b/compiler/typecheck/TcValidity.hs index aec4e6d..94e749d 100644 --- a/compiler/typecheck/TcValidity.hs +++ b/compiler/typecheck/TcValidity.hs @@ -452,12 +452,17 @@ check_type env ctxt rank ty -- but not type T = ?x::Int ; check_type env' ctxt rank tau -- Allow foralls to right of arrow - ; checkTcM (not (any (`elemVarSet` tyCoVarsOfType tau_kind) tvs)) + ; checkTcM (not (any (`elemVarSet` tyCoVarsOfType phi_kind) tvs)) (forAllEscapeErr env' ty tau_kind) } where (tvs, theta, tau) = tcSplitSigmaTy ty tau_kind = typeKind tau + + phi_kind | null theta = tau_kind + | otherwise = liftedTypeKind + -- If there are any constraints, the kind is *. (#11405) + (env', _) = tidyTyCoVarBndrs env tvs check_type _ _ _ (TyVarTy _) = return () diff --git a/testsuite/tests/dependent/should_compile/T11405.hs b/testsuite/tests/dependent/should_compile/T11405.hs new file mode 100644 index 0000000..f80d994 --- /dev/null +++ b/testsuite/tests/dependent/should_compile/T11405.hs @@ -0,0 +1,9 @@ +{-# LANGUAGE ImplicitParams, TypeInType, ExplicitForAll #-} + +module T11405 where + +import GHC.Exts +import GHC.Stack + +x :: forall (v :: Levity) (a :: TYPE v). (?callStack :: CallStack) => a +x = undefined diff --git a/testsuite/tests/dependent/should_compile/all.T b/testsuite/tests/dependent/should_compile/all.T index ef6dde9..c11f9ca 100644 --- a/testsuite/tests/dependent/should_compile/all.T +++ b/testsuite/tests/dependent/should_compile/all.T @@ -12,3 +12,5 @@ test('TypeLevelVec',normal,compile, ['']) test('T9632', normal, compile, ['']) test('dynamic-paper', normal, compile, ['']) test('T11311', normal, compile, ['']) +test('T11405', expect_broken(11405), compile, ['']) + From git at git.haskell.org Sat Jan 16 12:49:42 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 16 Jan 2016 12:49:42 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Fix #11404 (a5bb480) Message-ID: <20160116124942.EE5E73A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/a5bb4809614b6f898384c02c6e00d92fd0f5d7c4/ghc >--------------------------------------------------------------- commit a5bb4809614b6f898384c02c6e00d92fd0f5d7c4 Author: Richard Eisenberg Date: Mon Jan 11 16:47:22 2016 -0500 Fix #11404 We now check for unused variables one at a time, instead of all at the top. Test: dependent/should_compile/T11405 (cherry picked from commit 072191fe2db55eb3ede5d5a90b7f5eb6afde25bc) >--------------------------------------------------------------- a5bb4809614b6f898384c02c6e00d92fd0f5d7c4 compiler/rename/RnSource.hs | 16 +++++++------- compiler/rename/RnTypes.hs | 53 ++++++++++++++++++++++++++------------------- 2 files changed, 39 insertions(+), 30 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc a5bb4809614b6f898384c02c6e00d92fd0f5d7c4 From git at git.haskell.org Sat Jan 16 12:49:46 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 16 Jan 2016 12:49:46 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Fix #11254. (4c53ab2) Message-ID: <20160116124946.193CF3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/4c53ab2a108a749ae45657c73cda233b528fb029/ghc >--------------------------------------------------------------- commit 4c53ab2a108a749ae45657c73cda233b528fb029 Author: Richard Eisenberg Date: Mon Jan 11 14:47:49 2016 -0500 Fix #11254. This moves the call to tcSubType into the context of the checkInstConstraints call, allowing the deferred type error somewhere to hang its hat. (cherry picked from commit 39ea4b4b19ea65d05f0d946084b316d5f5d2e675) >--------------------------------------------------------------- 4c53ab2a108a749ae45657c73cda233b528fb029 compiler/typecheck/TcInstDcls.hs | 113 +++++++++++---------- .../tests/typecheck/should_compile/T11254.stderr | 25 +++++ testsuite/tests/typecheck/should_compile/all.T | 2 +- 3 files changed, 88 insertions(+), 52 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 4c53ab2a108a749ae45657c73cda233b528fb029 From git at git.haskell.org Sat Jan 16 12:49:48 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 16 Jan 2016 12:49:48 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Fix typo in error message (#11409) (b7af30f) Message-ID: <20160116124948.F3DFF3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/b7af30f79f7e3be105cdd17ee3369a5e483f7f3f/ghc >--------------------------------------------------------------- commit b7af30f79f7e3be105cdd17ee3369a5e483f7f3f Author: Richard Eisenberg Date: Mon Jan 11 21:29:23 2016 -0500 Fix typo in error message (#11409) (cherry picked from commit 80b4c71c5fc8ae005f6fb73d900b225366c4d3cc) >--------------------------------------------------------------- b7af30f79f7e3be105cdd17ee3369a5e483f7f3f compiler/typecheck/TcExpr.hs | 2 +- testsuite/tests/typecheck/should_fail/VtaFail.stderr | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/compiler/typecheck/TcExpr.hs b/compiler/typecheck/TcExpr.hs index 93ba3db..d5a0016 100644 --- a/compiler/typecheck/TcExpr.hs +++ b/compiler/typecheck/TcExpr.hs @@ -1178,7 +1178,7 @@ tcArgs fun orig_fun_ty fun_orig orig_args herald ty_app_err ty arg = do { (_, ty) <- zonkTidyTcType emptyTidyEnv ty ; failWith $ - text "Cannot not apply expression of type" <+> quotes (ppr ty) $$ + text "Cannot apply expression of type" <+> quotes (ppr ty) $$ text "to a visible type argument" <+> quotes (ppr arg) } ---------------- diff --git a/testsuite/tests/typecheck/should_fail/VtaFail.stderr b/testsuite/tests/typecheck/should_fail/VtaFail.stderr index 313d174..ea435e4 100644 --- a/testsuite/tests/typecheck/should_fail/VtaFail.stderr +++ b/testsuite/tests/typecheck/should_fail/VtaFail.stderr @@ -1,6 +1,6 @@ VtaFail.hs:7:16: error: - ? Cannot not apply expression of type ?t1 -> t0 -> (t1, t0)? + ? Cannot apply expression of type ?t1 -> t0 -> (t1, t0)? to a visible type argument ?Int? ? In the expression: pairup_nosig @Int @Bool 5 True In an equation for ?answer_nosig?: @@ -13,14 +13,14 @@ VtaFail.hs:12:26: error: answer_constraint_fail = addOne @Bool 5 VtaFail.hs:14:17: error: - ? Cannot not apply expression of type ?r0 -> r0? + ? Cannot apply expression of type ?r0 -> r0? to a visible type argument ?Int? ? In the expression: (\ x -> x) @Int 12 In an equation for ?answer_lambda?: answer_lambda = (\ x -> x) @Int 12 VtaFail.hs:19:5: error: - ? Cannot not apply expression of type ?Int -> (a0, Int)? + ? Cannot apply expression of type ?Int -> (a0, Int)? to a visible type argument ?Bool? ? In the expression: pair 3 @Int @Bool True In an equation for ?a?: a = pair 3 @Int @Bool True @@ -55,31 +55,31 @@ VtaFail.hs:41:27: error: threeWorse = too @(->) (T :: Three Either) VtaFail.hs:46:5: error: - ? Cannot not apply expression of type ?Int -> Int -> Int? + ? Cannot apply expression of type ?Int -> Int -> Int? to a visible type argument ?Int? ? In the expression: plus @Int 5 7 In an equation for ?b?: b = plus @Int 5 7 VtaFail.hs:47:5: error: - ? Cannot not apply expression of type ?Int -> Int -> Int? + ? Cannot apply expression of type ?Int -> Int -> Int? to a visible type argument ?Rational? ? In the expression: plus @Rational 5 10 In an equation for ?c?: c = plus @Rational 5 10 VtaFail.hs:48:5: error: - ? Cannot not apply expression of type ?Int -> Int -> Int? + ? Cannot apply expression of type ?Int -> Int -> Int? to a visible type argument ?Int? ? In the expression: (+) @Int @Int @Int 12 14 In an equation for ?d?: d = (+) @Int @Int @Int 12 14 VtaFail.hs:51:5: error: - ? Cannot not apply expression of type ?Int -> String? + ? Cannot apply expression of type ?Int -> String? to a visible type argument ?Float? ? In the expression: show @Int @Float (read "5") In an equation for ?e?: e = show @Int @Float (read "5") VtaFail.hs:52:11: error: - ? Cannot not apply expression of type ?String -> Int? + ? Cannot apply expression of type ?String -> Int? to a visible type argument ?Bool? ? In the first argument of ?show?, namely ?(read @Int @Bool @Float "3")? From git at git.haskell.org Sat Jan 16 12:49:51 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 16 Jan 2016 12:49:51 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Fix #11405. (018f866) Message-ID: <20160116124951.C5F293A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/018f8660d4317c0d8c6dce1ee73a24641ce0129e/ghc >--------------------------------------------------------------- commit 018f8660d4317c0d8c6dce1ee73a24641ce0129e Author: Richard Eisenberg Date: Thu Jan 14 17:48:42 2016 -0500 Fix #11405. This adds a new variant of AbsBinds that is used solely for bindings with a type signature. This allows for a simpler desugaring that does not produce the bogus output that tripped up Core Lint in ticket #11405. Should make other desugarings simpler, too. (cherry picked from commit 3c6635ef4561ab53e51d7187c966b628a972b261) >--------------------------------------------------------------- 018f8660d4317c0d8c6dce1ee73a24641ce0129e compiler/deSugar/Coverage.hs | 23 ++++++++++++++ compiler/deSugar/DsBinds.hs | 42 ++++++++++++++++++++++++-- compiler/deSugar/DsExpr.hs | 11 +++++++ compiler/deSugar/DsMeta.hs | 1 + compiler/hsSyn/HsBinds.hs | 29 +++++++++++++++++- compiler/hsSyn/HsUtils.hs | 1 + compiler/main/DynFlags.hs | 4 +-- compiler/typecheck/TcBinds.hs | 25 +++++++++------ compiler/typecheck/TcHsSyn.hs | 20 ++++++++++++ testsuite/tests/dependent/should_compile/all.T | 2 +- testsuite/tests/ghc-api/T6145.hs | 2 ++ utils/ghctags/Main.hs | 3 +- 12 files changed, 146 insertions(+), 17 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 018f8660d4317c0d8c6dce1ee73a24641ce0129e From git at git.haskell.org Sat Jan 16 13:52:54 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 16 Jan 2016 13:52:54 +0000 (UTC) Subject: [commit: ghc] master: Work SourceText in for all integer literals (3a1babd) Message-ID: <20160116135254.EFBCD3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/3a1babd6243edd96073ed3e3a5fb6e0aaf11350e/ghc >--------------------------------------------------------------- commit 3a1babd6243edd96073ed3e3a5fb6e0aaf11350e Author: Alan Zimmerman Date: Fri Jan 15 00:03:58 2016 +0200 Work SourceText in for all integer literals Summary: Certain syntactic elements have integers in them, such as fixity specifications, SPECIALISE pragmas and so on. The lexer will accept mult-radix literals, with arbitrary leading zeros in these. Bring in a SourceText field to each affected AST element to capture the original literal text for use with API Annotations. Affected hsSyn elements are ``` -- See note [Pragma source text] data Activation = NeverActive | AlwaysActive | ActiveBefore SourceText PhaseNum -- Active only *strictly before* this phase | ActiveAfter SourceText PhaseNum -- Active in this phase and later deriving( Eq, Data, Typeable ) -- Eq used in comparing rules in HsDecls data Fixity = Fixity SourceText Int FixityDirection -- Note [Pragma source text] deriving (Data, Typeable) ``` and ``` | HsTickPragma -- A pragma introduced tick SourceText -- Note [Pragma source text] in BasicTypes (StringLiteral,(Int,Int),(Int,Int)) -- external span for this tick ((SourceText,SourceText),(SourceText,SourceText)) -- Source text for the four integers used in the span. -- See note [Pragma source text] in BasicTypes (LHsExpr id) ``` Updates haddock submodule Test Plan: ./validate Reviewers: goldfire, bgamari, austin Reviewed By: bgamari Subscribers: thomie, mpickering Differential Revision: https://phabricator.haskell.org/D1781 GHC Trac Issues: #11430 >--------------------------------------------------------------- 3a1babd6243edd96073ed3e3a5fb6e0aaf11350e compiler/basicTypes/BasicTypes.hs | 49 ++++++++++++---------- compiler/basicTypes/MkId.hs | 3 +- compiler/deSugar/Coverage.hs | 2 +- compiler/deSugar/DsExpr.hs | 2 +- compiler/deSugar/DsMeta.hs | 12 +++--- compiler/deSugar/PmExpr.hs | 2 +- compiler/hsSyn/Convert.hs | 6 +-- compiler/hsSyn/HsExpr.hs | 5 ++- compiler/iface/LoadIface.hs | 2 +- compiler/parser/Parser.y | 33 +++++++++------ compiler/parser/RdrHsSyn.hs | 6 +-- compiler/rename/RnEnv.hs | 4 +- compiler/rename/RnExpr.hs | 12 +++--- compiler/rename/RnTypes.hs | 8 ++-- compiler/simplCore/SimplUtils.hs | 4 +- compiler/stranal/WorkWrap.hs | 2 +- compiler/typecheck/TcExpr.hs | 4 +- compiler/typecheck/TcGenDeriv.hs | 2 +- compiler/typecheck/TcGenGenerics.hs | 6 +-- compiler/typecheck/TcHsSyn.hs | 4 +- compiler/typecheck/TcRnTypes.hs | 2 +- compiler/typecheck/TcSplice.hs | 2 +- compiler/utils/Binary.hs | 22 ++++++---- testsuite/tests/ghc-api/annotations/Makefile | 7 ++++ testsuite/tests/ghc-api/annotations/T11430.stdout | 6 +++ testsuite/tests/ghc-api/annotations/Test11430.hs | 25 +++++++++++ testsuite/tests/ghc-api/annotations/all.T | 1 + .../tests/ghc-api/annotations/stringSource.hs | 2 +- .../annotations/{stringSource.hs => t11430.hs} | 47 +++++++-------------- utils/genprimopcode/Main.hs | 5 ++- utils/genprimopcode/Parser.y | 6 +-- utils/genprimopcode/Syntax.hs | 4 +- utils/haddock | 2 +- 33 files changed, 175 insertions(+), 124 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 3a1babd6243edd96073ed3e3a5fb6e0aaf11350e From git at git.haskell.org Sat Jan 16 22:44:31 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 16 Jan 2016 22:44:31 +0000 (UTC) Subject: [commit: ghc] master: Fix a number of subtle solver bugs (9308c73) Message-ID: <20160116224431.1F2283A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/9308c736d43b92bf8634babf565048e66e071bd8/ghc >--------------------------------------------------------------- commit 9308c736d43b92bf8634babf565048e66e071bd8 Author: Simon Peyton Jones Date: Sat Jan 16 00:37:15 2016 +0000 Fix a number of subtle solver bugs As a result of some other unrelated changes I found that IndTypesPerf was failing, and opened Trac #11408. There's a test in indexed-types/should-compile/T11408. The bug was that a type like forall t. (MT (UL t) (UR t) ~ t) => UL t -> UR t -> Int is in fact unambiguous, but it's a bit subtle to prove that it is unambiguous. In investigating, Dimitrios and I found several subtle bugs in the constraint solver, fixed by this patch * canRewrite was missing a Derived/Derived case. This was lost by accident in Richard's big kind-equality patch. * Interact.interactTyVarEq would discard [D] a ~ ty if there was a [W] a ~ ty in the inert set. But that is wrong because the former can rewrite things that the latter cannot. Fix: a new function eqCanDischarge * In TcSMonad.addInertEq, the process was outright wrong for a Given/Wanted in the (GWModel) case. We were adding a new Derived without kicking out things that it could rewrite. Now the code is simpler (no special GWModel case), and works correctly. * The special case in kickOutRewritable for [W] fsk ~ ty, turns out not to be needed. (We emit a [D] fsk ~ ty which will do the job. I improved comments and documentation, esp in TcSMonad. >--------------------------------------------------------------- 9308c736d43b92bf8634babf565048e66e071bd8 compiler/typecheck/TcCanonical.hs | 4 +- compiler/typecheck/TcFlatten.hs | 4 +- compiler/typecheck/TcInteract.hs | 49 ++-- compiler/typecheck/TcRnTypes.hs | 99 ++++--- compiler/typecheck/TcSMonad.hs | 290 ++++++++++++--------- .../should_compile/IndTypesPerfMerge.hs | 44 ++++ testsuite/tests/indexed-types/should_compile/all.T | 1 + .../tests/typecheck/should_fail/tcfail201.stderr | 4 +- 8 files changed, 304 insertions(+), 191 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 9308c736d43b92bf8634babf565048e66e071bd8 From git at git.haskell.org Sat Jan 16 23:52:00 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 16 Jan 2016 23:52:00 +0000 (UTC) Subject: [commit: ghc] master: Add missing T11408.hs (3b6a490) Message-ID: <20160116235200.AEC8D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/3b6a4909ff579507a7f9527264e0cb8464fbe555/ghc >--------------------------------------------------------------- commit 3b6a4909ff579507a7f9527264e0cb8464fbe555 Author: Simon Peyton Jones Date: Sat Jan 16 23:51:42 2016 +0000 Add missing T11408.hs >--------------------------------------------------------------- 3b6a4909ff579507a7f9527264e0cb8464fbe555 .../tests/indexed-types/should_compile/T11408.hs | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/testsuite/tests/indexed-types/should_compile/T11408.hs b/testsuite/tests/indexed-types/should_compile/T11408.hs new file mode 100644 index 0000000..df63c67 --- /dev/null +++ b/testsuite/tests/indexed-types/should_compile/T11408.hs @@ -0,0 +1,23 @@ +{-# LANGUAGE TypeFamilies #-} +module T11408 where + +type family UL a +type family UR a +type family MT a b + +mkMerge :: a -> UL a -> UR a -> Int +mkMerge = undefined + +merger :: a -> b -> MT a b +merger = undefined + +{- +merge :: + forall a b. (UL (MT a b) ~ a, UR (MT a b) ~ b) => a -> b -> Int +or + forall t. (MT (UL t) (UR t) ~ t) => UL t -> UR t -> Int + +These types are equivalent, and in fact neither is ambiguous, +but the solver has to work quite hard to prove that. +-} +merge x y = mkMerge (merger x y) x y From git at git.haskell.org Sun Jan 17 14:57:06 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 17 Jan 2016 14:57:06 +0000 (UTC) Subject: [commit: ghc] branch 'wip/ptext-sLit-cleanup' created Message-ID: <20160117145706.8CB803A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/ptext-sLit-cleanup Referencing: 5b4e52b508fc5ef40b38b9d32a9cbce6bf419016 From git at git.haskell.org Sun Jan 17 14:57:09 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 17 Jan 2016 14:57:09 +0000 (UTC) Subject: [commit: ghc] wip/ptext-sLit-cleanup: Replace calls to `ptext . sLit` with `text` (5b4e52b) Message-ID: <20160117145709.E4BDF3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/ptext-sLit-cleanup Link : http://ghc.haskell.org/trac/ghc/changeset/5b4e52b508fc5ef40b38b9d32a9cbce6bf419016/ghc >--------------------------------------------------------------- commit 5b4e52b508fc5ef40b38b9d32a9cbce6bf419016 Author: Jan Stolarek Date: Fri Jan 15 18:24:14 2016 +0100 Replace calls to `ptext . sLit` with `text` Summary: In the past the canonical way for constructing an SDoc string literal was the composition `ptext . sLit`. But for some time now we have function `text` that does the same. Plus it has some rules that optimize its runtime behaviour. This patch takes all uses of `ptext . sLit` in the compiler and replaces them with calls to `text`. The main benefits of this patch are clener (shorter) code and less dependencies between module, because many modules now do not need to import `FastString`. I don't expect any performance benefits - we mostly use SDocs to report errors and it seems there is little to be gained here. Test Plan: ./validate Reviewers: bgamari, austin, goldfire, hvr, alanz Subscribers: goldfire, thomie, mpickering Differential Revision: https://phabricator.haskell.org/D1784 >--------------------------------------------------------------- 5b4e52b508fc5ef40b38b9d32a9cbce6bf419016 compiler/basicTypes/BasicTypes.hs | 72 +++--- compiler/basicTypes/DataCon.hs | 18 +- compiler/basicTypes/Demand.hs | 5 +- compiler/basicTypes/IdInfo.hs | 30 +-- compiler/basicTypes/Literal.hs | 4 +- compiler/basicTypes/Name.hs | 10 +- compiler/basicTypes/OccName.hs | 12 +- compiler/basicTypes/PatSyn.hs | 5 +- compiler/basicTypes/RdrName.hs | 30 +-- compiler/basicTypes/Var.hs | 9 +- compiler/basicTypes/VarEnv.hs | 3 +- compiler/cmm/CLabel.hs | 74 +++--- compiler/cmm/CmmLayoutStack.hs | 4 +- compiler/cmm/CmmLint.hs | 5 +- compiler/cmm/CmmType.hs | 6 +- compiler/cmm/PprC.hs | 288 ++++++++++----------- compiler/cmm/PprCmm.hs | 64 ++--- compiler/cmm/PprCmmDecl.hs | 18 +- compiler/cmm/PprCmmExpr.hs | 49 ++-- compiler/cmm/SMRep.hs | 36 +-- compiler/codeGen/StgCmmClosure.hs | 5 +- compiler/codeGen/StgCmmEnv.hs | 3 +- compiler/codeGen/StgCmmMonad.hs | 6 +- compiler/coreSyn/CoreArity.hs | 4 +- compiler/coreSyn/CoreLint.hs | 226 ++++++++-------- compiler/coreSyn/CorePrep.hs | 8 +- compiler/coreSyn/CoreStats.hs | 7 +- compiler/coreSyn/CoreSubst.hs | 14 +- compiler/coreSyn/CoreSyn.hs | 3 +- compiler/coreSyn/CoreUnfold.hs | 25 +- compiler/coreSyn/CoreUtils.hs | 18 +- compiler/coreSyn/MkCore.hs | 4 +- compiler/coreSyn/PprCore.hs | 160 ++++++------ compiler/deSugar/Check.hs | 34 +-- compiler/deSugar/Coverage.hs | 10 +- compiler/deSugar/Desugar.hs | 22 +- compiler/deSugar/DsArrows.hs | 3 +- compiler/deSugar/DsBinds.hs | 38 +-- compiler/deSugar/DsExpr.hs | 14 +- compiler/deSugar/DsForeign.hs | 24 +- compiler/deSugar/DsListComp.hs | 5 +- compiler/deSugar/DsMeta.hs | 2 +- compiler/deSugar/DsMonad.hs | 12 +- compiler/deSugar/MatchLit.hs | 16 +- compiler/deSugar/PmExpr.hs | 5 +- compiler/ghci/ByteCodeInstr.hs | 12 +- compiler/ghci/Linker.hs | 34 +-- compiler/hsSyn/Convert.hs | 36 +-- compiler/hsSyn/HsBinds.hs | 60 ++--- compiler/hsSyn/HsDecls.hs | 77 +++--- compiler/hsSyn/HsExpr.hs | 220 ++++++++-------- compiler/hsSyn/HsImpExp.hs | 18 +- compiler/hsSyn/HsPat.hs | 3 +- compiler/hsSyn/HsSyn.hs | 7 +- compiler/hsSyn/HsTypes.hs | 2 +- compiler/iface/IfaceSyn.hs | 114 ++++---- compiler/iface/IfaceType.hs | 16 +- compiler/iface/LoadIface.hs | 102 ++++---- compiler/iface/MkIface.hs | 24 +- compiler/iface/TcIface.hs | 48 ++-- compiler/main/DriverMkDepend.hs | 10 +- compiler/main/DriverPipeline.hs | 7 +- compiler/main/DynFlags.hs | 6 +- compiler/main/DynamicLoading.hs | 27 +- compiler/main/ErrUtils.hs | 7 +- compiler/main/Finder.hs | 56 ++-- compiler/main/GhcMake.hs | 18 +- compiler/main/Hooks.hs | 4 +- compiler/main/HscMain.hs | 6 +- compiler/main/HscTypes.hs | 36 +-- compiler/main/Packages.hs | 16 +- compiler/main/PprTyThing.hs | 5 +- compiler/main/SysTools.hs | 6 +- compiler/main/TidyPgm.hs | 5 +- compiler/nativeGen/AsmCodeGen.hs | 2 +- compiler/nativeGen/Dwarf.hs | 7 +- compiler/nativeGen/Dwarf/Types.hs | 24 +- compiler/nativeGen/PIC.hs | 174 ++++++------- compiler/nativeGen/PPC/Ppr.hs | 218 ++++++++-------- compiler/nativeGen/PprBase.hs | 2 +- compiler/nativeGen/RegAlloc/Liveness.hs | 15 +- compiler/nativeGen/SPARC/Ppr.hs | 72 +++--- compiler/nativeGen/X86/Ppr.hs | 98 +++---- compiler/parser/Lexer.x | 4 +- compiler/parser/Parser.y | 6 +- compiler/parser/RdrHsSyn.hs | 16 +- compiler/prelude/ForeignCall.hs | 16 +- compiler/prelude/PrelRules.hs | 2 +- compiler/profiling/CostCentre.hs | 10 +- compiler/profiling/ProfInit.hs | 8 +- compiler/rename/RnBinds.hs | 66 ++--- compiler/rename/RnEnv.hs | 142 +++++----- compiler/rename/RnExpr.hs | 54 ++-- compiler/rename/RnNames.hs | 100 +++---- compiler/rename/RnPat.hs | 43 ++- compiler/rename/RnSource.hs | 46 ++-- compiler/rename/RnSplice.hs | 16 +- compiler/rename/RnTypes.hs | 66 ++--- compiler/simplCore/CoreMonad.hs | 64 ++--- compiler/simplCore/FloatOut.hs | 13 +- compiler/simplCore/OccurAnal.hs | 17 +- compiler/simplCore/SAT.hs | 14 +- compiler/simplCore/SimplCore.hs | 15 +- compiler/simplCore/SimplEnv.hs | 21 +- compiler/simplCore/SimplMonad.hs | 8 +- compiler/simplCore/SimplUtils.hs | 31 ++- compiler/simplCore/Simplify.hs | 4 +- compiler/specialise/Rules.hs | 20 +- compiler/specialise/SpecConstr.hs | 30 +-- compiler/specialise/Specialise.hs | 22 +- compiler/stgSyn/CoreToStg.hs | 6 +- compiler/stgSyn/StgLint.hs | 43 ++- compiler/stgSyn/StgSyn.hs | 56 ++-- compiler/stranal/DmdAnal.hs | 7 +- compiler/stranal/WwLib.hs | 2 +- compiler/typecheck/FamInst.hs | 3 +- compiler/typecheck/FunDeps.hs | 27 +- compiler/typecheck/Inst.hs | 12 +- compiler/typecheck/TcAnnotations.hs | 12 +- compiler/typecheck/TcArrows.hs | 9 +- compiler/typecheck/TcBinds.hs | 59 +++-- compiler/typecheck/TcCanonical.hs | 5 +- compiler/typecheck/TcClassDcl.hs | 34 +-- compiler/typecheck/TcDefaults.hs | 12 +- compiler/typecheck/TcDeriv.hs | 112 ++++---- compiler/typecheck/TcEnv.hs | 26 +- compiler/typecheck/TcErrors.hs | 188 +++++++------- compiler/typecheck/TcEvidence.hs | 40 +-- compiler/typecheck/TcExpr.hs | 74 +++--- compiler/typecheck/TcFlatten.hs | 5 +- compiler/typecheck/TcForeign.hs | 20 +- compiler/typecheck/TcGenGenerics.hs | 6 +- compiler/typecheck/TcHsType.hs | 46 ++-- compiler/typecheck/TcInstDcls.hs | 54 ++-- compiler/typecheck/TcInteract.hs | 53 ++-- compiler/typecheck/TcMType.hs | 2 +- compiler/typecheck/TcMatches.hs | 13 +- compiler/typecheck/TcPat.hs | 21 +- compiler/typecheck/TcPatSyn.hs | 24 +- compiler/typecheck/TcRnDriver.hs | 72 +++--- compiler/typecheck/TcRnMonad.hs | 8 +- compiler/typecheck/TcRnTypes.hs | 192 +++++++------- compiler/typecheck/TcRules.hs | 4 +- compiler/typecheck/TcSMonad.hs | 31 ++- compiler/typecheck/TcSimplify.hs | 41 ++- compiler/typecheck/TcSplice.hs | 32 +-- compiler/typecheck/TcTyClsDecls.hs | 159 ++++++------ compiler/typecheck/TcTyDecls.hs | 14 +- compiler/typecheck/TcType.hs | 86 +++--- compiler/typecheck/TcUnify.hs | 18 +- compiler/typecheck/TcValidity.hs | 108 ++++---- compiler/types/Class.hs | 7 +- compiler/types/Coercion.hs | 15 +- compiler/types/FamInstEnv.hs | 24 +- compiler/types/InstEnv.hs | 10 +- compiler/types/OptCoercion.hs | 3 +- compiler/types/TyCoRep.hs | 34 +-- compiler/types/Type.hs | 4 +- compiler/utils/Outputable.hs | 92 +++---- compiler/utils/UniqDFM.hs | 3 +- compiler/utils/UniqFM.hs | 3 +- .../vectorise/Vectorise/Builtins/Initialise.hs | 4 +- compiler/vectorise/Vectorise/Exp.hs | 5 +- compiler/vectorise/Vectorise/Monad/Global.hs | 13 +- compiler/vectorise/Vectorise/Type/Env.hs | 5 +- 165 files changed, 2887 insertions(+), 2929 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 5b4e52b508fc5ef40b38b9d32a9cbce6bf419016 From git at git.haskell.org Sun Jan 17 22:42:04 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 17 Jan 2016 22:42:04 +0000 (UTC) Subject: [commit: ghc] master: rts/posix: Fail with HEAPOVERFLOW when out of memory during mmap (ae1c48c) Message-ID: <20160117224204.213133A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/ae1c48c60abdfb134de7e247df851da101f0dd96/ghc >--------------------------------------------------------------- commit ae1c48c60abdfb134de7e247df851da101f0dd96 Author: Ben Gamari Date: Sun Jan 17 19:24:50 2016 +0100 rts/posix: Fail with HEAPOVERFLOW when out of memory during mmap Test Plan: Validate Reviewers: simonmar, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1787 GHC Trac Issues: #11300 >--------------------------------------------------------------- ae1c48c60abdfb134de7e247df851da101f0dd96 rts/posix/OSMem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rts/posix/OSMem.c b/rts/posix/OSMem.c index 60e684f..2a3c294 100644 --- a/rts/posix/OSMem.c +++ b/rts/posix/OSMem.c @@ -222,7 +222,7 @@ my_mmap_or_barf (void *addr, W_ size, int operation) // If we request more than 3Gig, then we get EINVAL // instead of ENOMEM (at least on Linux). errorBelch("out of memory (requested %" FMT_Word " bytes)", size); - stg_exit(EXIT_FAILURE); + stg_exit(EXIT_HEAPOVERFLOW); } else { barf("getMBlock: mmap: %s", strerror(errno)); } From git at git.haskell.org Sun Jan 17 23:14:14 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 17 Jan 2016 23:14:14 +0000 (UTC) Subject: [commit: ghc] master: users-guide: Clean manpage build artifacts and fix usage of clean-target (d1ce1aa) Message-ID: <20160117231414.3EC2A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d1ce1aa9beed4d3ecd3a0324ae4c98625fbe8d33/ghc >--------------------------------------------------------------- commit d1ce1aa9beed4d3ecd3a0324ae4c98625fbe8d33 Author: Ben Gamari Date: Sun Jan 17 19:26:03 2016 +0100 users-guide: Clean manpage build artifacts and fix usage of clean-target Test Plan: Build then clean Reviewers: austin, thomie Reviewed By: thomie Differential Revision: https://phabricator.haskell.org/D1786 GHC Trac Issues: #11433 >--------------------------------------------------------------- d1ce1aa9beed4d3ecd3a0324ae4c98625fbe8d33 docs/users_guide/ghc.mk | 2 ++ rules/sphinx.mk | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/users_guide/ghc.mk b/docs/users_guide/ghc.mk index 83cf60a..9144a07 100644 --- a/docs/users_guide/ghc.mk +++ b/docs/users_guide/ghc.mk @@ -30,6 +30,8 @@ $(MAN_PAGES): $(docs/users_guide_MAN_RST_SOURCES) $(utils/mkUserGuidePart_GENERA $(SPHINXBUILD) -b man -d docs/users_guide/.doctrees-man docs/users_guide docs/users_guide/build-man endif +$(eval $(call clean-target,users-guide,manpage,docs/users_guide/.doctrees-man/ docs/users_guide/build-man/)) + man : $(MAN_PAGES) ifeq "$(BUILD_MAN)" "YES" diff --git a/rules/sphinx.mk b/rules/sphinx.mk index 5a3c7ce..7337242 100644 --- a/rules/sphinx.mk +++ b/rules/sphinx.mk @@ -22,7 +22,7 @@ $(call profStart, sphinx($1,$2)) # $1 = dir # $2 = docname -$(call clean-target,$1,sphinx,$1/.doctrees-html/ $1/.doctrees-pdf/ $1/build-html/ $1/build-pdf/ $1/$2.pdf) +$(eval $(call clean-target,$1,sphinx,$1/.doctrees-html/ $1/.doctrees-pdf/ $1/build-html/ $1/build-pdf/ $1/$2.pdf)) # empty "all_$1" target just in case we're not building docs at all $(call all-target,$1,) From git at git.haskell.org Sun Jan 17 23:14:17 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 17 Jan 2016 23:14:17 +0000 (UTC) Subject: [commit: ghc] master: Show TYPE 'Lifted/TYPE 'Unlifted as */# in Show TypeRep instance (65b810b) Message-ID: <20160117231417.91EEB3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/65b810bdda625f2e98069c2c56ec93e1c65667a6/ghc >--------------------------------------------------------------- commit 65b810bdda625f2e98069c2c56ec93e1c65667a6 Author: RyanGlScott Date: Sun Jan 17 19:28:10 2016 +0100 Show TYPE 'Lifted/TYPE 'Unlifted as */# in Show TypeRep instance Kind equalities changed how `*`/`#` are represented internally, which means that showing a `TypeRep` that contains either of those kinds produces a rather gross-looking result, e.g., ``` > typeOf (Proxy :: Proxy 'Just) Proxy (TYPE 'Lifted -> Maybe (TYPE 'Lifted)) 'Just ``` We can at least special-case the `Show` instance for `TypeRep` so that it prints `*` to represent `TYPE 'Lifted` and `#` to represent `TYPE 'Unlifted`. Addresses one of the issues uncovered in #11334. Test Plan: ./validate Reviewers: simonpj, hvr, austin, goldfire, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1757 GHC Trac Issues: #11334 >--------------------------------------------------------------- 65b810bdda625f2e98069c2c56ec93e1c65667a6 libraries/base/Data/Typeable/Internal.hs | 5 ++++- libraries/base/tests/T11334.hs | 11 +++++++++++ libraries/base/tests/T11334.stdout | 3 +++ libraries/base/tests/all.T | 3 ++- 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/libraries/base/Data/Typeable/Internal.hs b/libraries/base/Data/Typeable/Internal.hs index 548df30..46e6e82 100644 --- a/libraries/base/Data/Typeable/Internal.hs +++ b/libraries/base/Data/Typeable/Internal.hs @@ -357,7 +357,10 @@ instance Show TypeRep where showsPrec p (TypeRep _ tycon kinds tys) = case tys of [] -> showsPrec p tycon - [x] | tycon == tcList -> showChar '[' . shows x . showChar ']' + [x@(TypeRep _ argCon _ _)] + | tycon == tcList -> showChar '[' . shows x . showChar ']' + | tycon == tcTYPE && argCon == tc'Lifted -> showChar '*' + | tycon == tcTYPE && argCon == tc'Unlifted -> showChar '#' [a,r] | tycon == tcFun -> showParen (p > 8) $ showsPrec 9 a . showString " -> " . diff --git a/libraries/base/tests/T11334.hs b/libraries/base/tests/T11334.hs new file mode 100644 index 0000000..22864d9 --- /dev/null +++ b/libraries/base/tests/T11334.hs @@ -0,0 +1,11 @@ +{-# LANGUAGE DataKinds #-} +module Main (main) where + +import Data.Typeable +import GHC.Types + +main :: IO () +main = do + print (typeOf (Proxy :: Proxy 'Just)) + print (typeOf (Proxy :: Proxy (TYPE 'Lifted))) + print (typeOf (Proxy :: Proxy (TYPE 'Unlifted))) diff --git a/libraries/base/tests/T11334.stdout b/libraries/base/tests/T11334.stdout new file mode 100644 index 0000000..a00f275 --- /dev/null +++ b/libraries/base/tests/T11334.stdout @@ -0,0 +1,3 @@ +Proxy (* -> Maybe *) 'Just +Proxy * * +Proxy * # diff --git a/libraries/base/tests/all.T b/libraries/base/tests/all.T index 0cb48bb..06ef3bb 100644 --- a/libraries/base/tests/all.T +++ b/libraries/base/tests/all.T @@ -210,4 +210,5 @@ test('T9848', , only_ways(['normal'])], compile_and_run, ['-O']) -test('T10149',normal, compile_and_run,['']) +test('T10149', normal, compile_and_run, ['']) +test('T11334', normal, compile_and_run, ['']) From git at git.haskell.org Sun Jan 17 23:14:20 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 17 Jan 2016 23:14:20 +0000 (UTC) Subject: [commit: ghc] master: Complete operators properly (b3eb8fa) Message-ID: <20160117231420.5DC9E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/b3eb8fad4c9d5aa293e197bfff7039d6fa112a54/ghc >--------------------------------------------------------------- commit b3eb8fad4c9d5aa293e197bfff7039d6fa112a54 Author: Arthur Fayzrakhmanov (????? ????????????) Date: Sun Jan 17 19:27:12 2016 +0100 Complete operators properly Fix operator completions: list of suitable completions only rather than everything from imported modules. Signed-off-by: Arthur Fayzrakhmanov (????? ????????????) ghc: fix operator completions Reviewers: austin, hvr, thomie, bgamari Reviewed By: thomie, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1058 GHC Trac Issues: #10576 >--------------------------------------------------------------- b3eb8fad4c9d5aa293e197bfff7039d6fa112a54 ghc/GHCi/UI.hs | 36 +++- libraries/base/Text/Read/Lex.hs | 27 +-- testsuite/tests/ghci/prog015/Level1.hs | 3 + testsuite/tests/ghci/prog015/Level2/Level2.hs | 3 + .../should_compile => ghci/prog015}/Makefile | 0 testsuite/tests/ghci/prog015/TopLevel.hs | 4 + testsuite/tests/ghci/prog015/prog015.T | 2 + testsuite/tests/ghci/prog015/prog015.script | 25 +++ testsuite/tests/ghci/prog015/prog015.stdout | 15 ++ testsuite/tests/ghci/prog016/Level1.hs | 7 + testsuite/tests/ghci/prog016/Level2/Level2.hs | 10 ++ .../should_compile => ghci/prog016}/Makefile | 0 testsuite/tests/ghci/prog016/TopLevel.hs | 7 + testsuite/tests/ghci/prog016/prog016.T | 2 + testsuite/tests/ghci/prog016/prog016.script | 34 ++++ testsuite/tests/ghci/prog016/prog016.stdout | 37 +++++ testsuite/tests/ghci/prog017/Level1.hs | 5 + testsuite/tests/ghci/prog017/Level2/Level2.hs | 3 + .../should_compile => ghci/prog017}/Makefile | 0 testsuite/tests/ghci/prog017/TopLevel.hs | 182 +++++++++++++++++++++ testsuite/tests/ghci/prog017/prog017.T | 2 + testsuite/tests/ghci/prog017/prog017.script | 136 +++++++++++++++ testsuite/tests/ghci/prog017/prog017.stdout | 144 ++++++++++++++++ testsuite/tests/ghci/scripts/T10576.hs | 7 + testsuite/tests/ghci/scripts/T10576a.script | 4 + testsuite/tests/ghci/scripts/T10576a.stdout | 2 + testsuite/tests/ghci/scripts/T10576b.script | 4 + testsuite/tests/ghci/scripts/T10576b.stdout | 3 + testsuite/tests/ghci/scripts/all.T | 3 + testsuite/tests/ghci/should_fail/all.T | 0 30 files changed, 687 insertions(+), 20 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc b3eb8fad4c9d5aa293e197bfff7039d6fa112a54 From git at git.haskell.org Sun Jan 17 23:14:23 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 17 Jan 2016 23:14:23 +0000 (UTC) Subject: [commit: ghc] master: Add testcase for #11414 (f3a867e) Message-ID: <20160117231423.61C963A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/f3a867e8aa0f6364aa3a152ca660c3c581412484/ghc >--------------------------------------------------------------- commit f3a867e8aa0f6364aa3a152ca660c3c581412484 Author: Ben Gamari Date: Sun Jan 17 23:26:43 2016 +0100 Add testcase for #11414 Reviewers: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1790 GHC Trac Issues: #11414 >--------------------------------------------------------------- f3a867e8aa0f6364aa3a152ca660c3c581412484 testsuite/tests/deSugar/should_compile/T11414.hs | 4 ++++ testsuite/tests/deSugar/should_compile/all.T | 1 + 2 files changed, 5 insertions(+) diff --git a/testsuite/tests/deSugar/should_compile/T11414.hs b/testsuite/tests/deSugar/should_compile/T11414.hs new file mode 100644 index 0000000..198c704 --- /dev/null +++ b/testsuite/tests/deSugar/should_compile/T11414.hs @@ -0,0 +1,4 @@ +{-# LANGUAGE Strict #-} + +main :: IO () +main = print $ let x = undefined in True diff --git a/testsuite/tests/deSugar/should_compile/all.T b/testsuite/tests/deSugar/should_compile/all.T index aa4f2dd..c6068c0 100644 --- a/testsuite/tests/deSugar/should_compile/all.T +++ b/testsuite/tests/deSugar/should_compile/all.T @@ -104,3 +104,4 @@ test('T10251', normal, compile, ['']) test('T10767', normal, compile, ['']) test('DsStrictWarn', normal, compile, ['']) test('T10662', normal, compile, ['-Wall']) +test('T11414', expect_broken(11414), compile, ['']) From git at git.haskell.org Mon Jan 18 10:23:54 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 18 Jan 2016 10:23:54 +0000 (UTC) Subject: [commit: ghc] master: validate: Use gz compression during bindist check (2fd407c) Message-ID: <20160118102354.620AF3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/2fd407cd28ea1c8fccb7a93d411d1cee690fa959/ghc >--------------------------------------------------------------- commit 2fd407cd28ea1c8fccb7a93d411d1cee690fa959 Author: Ben Gamari Date: Mon Jan 18 00:16:35 2016 +0100 validate: Use gz compression during bindist check Test Plan: validate, check that gz is used Reviewers: hvr, austin, thomie Reviewed By: thomie Differential Revision: https://phabricator.haskell.org/D1788 GHC Trac Issues: #11434 >--------------------------------------------------------------- 2fd407cd28ea1c8fccb7a93d411d1cee690fa959 mk/config.mk.in | 2 +- validate | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/mk/config.mk.in b/mk/config.mk.in index a7a61e5..966f34a 100644 --- a/mk/config.mk.in +++ b/mk/config.mk.in @@ -768,7 +768,7 @@ GZIP_CMD = gzip XZ_CMD = xz -9e # xz is default compression -TAR_COMP = xz +TAR_COMP ?= xz # select compression command and .tar extension based on TAR_COMP value ifeq "$(TAR_COMP)" "bzip2" diff --git a/validate b/validate index d6bc1bf..1735065 100755 --- a/validate +++ b/validate @@ -47,6 +47,10 @@ hpc=NO speed=NORMAL use_dph=0 be_quiet=0 +# Validate uses gzip compression for the binary distribution to avoid the rather +# heavy cost of xz, which is the typical default. The options are defined in +# mk/config.mk.in +tar_comp=gzip while [ $# -gt 0 ] do @@ -211,8 +215,8 @@ check_packages post-build if [ $speed != "FAST" ]; then - $make binary-dist-prep - $make test_bindist TEST_PREP=YES + $make binary-dist-prep TAR_COMP=$tar_comp + $make test_bindist TEST_PREP=YES TAR_COMP=$tar_comp # # Install the xhtml package into the bindist. From git at git.haskell.org Mon Jan 18 10:23:57 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 18 Jan 2016 10:23:57 +0000 (UTC) Subject: [commit: ghc] master: un-wire-in error, undefined, CallStack, and IP (a7b751d) Message-ID: <20160118102357.271FA3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a7b751db766bd456ace4f76a861e5e8b927d8f17/ghc >--------------------------------------------------------------- commit a7b751db766bd456ace4f76a861e5e8b927d8f17 Author: Eric Seidel Date: Mon Jan 18 09:45:23 2016 +0100 un-wire-in error, undefined, CallStack, and IP I missed a crucial step in the wiring-in process of `CallStack` in D861, the bit where you actually wire-in the Name... This led to a nasty bug where GHC thought `CallStack` was not wired-in and tried to fingerprint it, which failed because the defining module was not loaded. But we don't need `CallStack` to be wired-in anymore since `error` and `undefined` no longer need to be wired-in. So we just remove them all. Updates haddock submodule. Test Plan: `./validate` and `make slowtest TEST=tc198` Reviewers: simonpj, goldfire, austin, hvr, bgamari Reviewed By: simonpj, bgamari Subscribers: goldfire, thomie Projects: #ghc Differential Revision: https://phabricator.haskell.org/D1739 GHC Trac Issues: #11331 >--------------------------------------------------------------- a7b751db766bd456ace4f76a861e5e8b927d8f17 compiler/coreSyn/MkCore.hs | 56 +++------------------------------- compiler/iface/IfaceType.hs | 4 +-- compiler/main/HscTypes.hs | 2 +- compiler/prelude/PrelNames.hs | 35 ++++++++++----------- compiler/prelude/TysWiredIn.hs | 66 ---------------------------------------- compiler/typecheck/TcBinds.hs | 6 ++-- compiler/typecheck/TcExpr.hs | 1 + compiler/typecheck/TcGenDeriv.hs | 6 ++-- compiler/typecheck/TcHsType.hs | 1 + compiler/typecheck/TcInteract.hs | 6 ++-- compiler/typecheck/TcRnTypes.hs | 7 +++-- compiler/types/TyCoRep.hs | 2 +- compiler/types/Type.hs | 6 ++-- libraries/base/GHC/Err.hs | 14 ++++++--- utils/haddock | 2 +- 15 files changed, 53 insertions(+), 161 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc a7b751db766bd456ace4f76a861e5e8b927d8f17 From git at git.haskell.org Mon Jan 18 10:43:20 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 18 Jan 2016 10:43:20 +0000 (UTC) Subject: [commit: ghc] master: Layout only (f02200f) Message-ID: <20160118104320.CC0A73A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/f02200f1516bd1dc850eff5aa642f300f21503fd/ghc >--------------------------------------------------------------- commit f02200f1516bd1dc850eff5aa642f300f21503fd Author: Simon Peyton Jones Date: Mon Jan 18 10:37:09 2016 +0000 Layout only >--------------------------------------------------------------- f02200f1516bd1dc850eff5aa642f300f21503fd compiler/typecheck/TcHsType.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/typecheck/TcHsType.hs b/compiler/typecheck/TcHsType.hs index 421df69..114bcec 100644 --- a/compiler/typecheck/TcHsType.hs +++ b/compiler/typecheck/TcHsType.hs @@ -741,7 +741,8 @@ tcInferArgs fun fun_kind mb_kind_info args ; let (invis_bndrs, really_res_kind) = splitPiTysInvisible res_kind ; (subst, invis_args) <- tcInstBindersX emptyTCvSubst mb_kind_info invis_bndrs - ; return ( substTy subst really_res_kind, args' `chkAppend` invis_args + ; return ( substTy subst really_res_kind + , args' `chkAppend` invis_args , leftovers, n ) } -- | See comments for 'tcInferArgs'. But this version does not instantiate From git at git.haskell.org Mon Jan 18 10:43:23 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 18 Jan 2016 10:43:23 +0000 (UTC) Subject: [commit: ghc] master: Simplify API to tcMatchTys (5a62b6a) Message-ID: <20160118104323.8CA233A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/5a62b6ac0c44319e1a0b56a4300359fd25d3d818/ghc >--------------------------------------------------------------- commit 5a62b6ac0c44319e1a0b56a4300359fd25d3d818 Author: Simon Peyton Jones Date: Mon Jan 18 10:34:48 2016 +0000 Simplify API to tcMatchTys Previously tcMatchTys took a set of "template type variables" to bind. But all the calls are top-level, and we always want to bind all variables in the template. So I simplified the API by omitting that argument. There should be no change in behaviour. Feel free to merge to 8.0 if it helps in merging other patches >--------------------------------------------------------------- 5a62b6ac0c44319e1a0b56a4300359fd25d3d818 compiler/typecheck/FunDeps.hs | 5 ++--- compiler/typecheck/TcErrors.hs | 2 +- compiler/typecheck/TcSimplify.hs | 3 +-- compiler/typecheck/TcTyClsDecls.hs | 23 +++++++++----------- compiler/typecheck/TcValidity.hs | 4 +--- compiler/types/FamInstEnv.hs | 14 ++++++------- compiler/types/InstEnv.hs | 13 ++++++------ compiler/types/Unify.hs | 43 +++++++++++++++++++------------------- 8 files changed, 49 insertions(+), 58 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 5a62b6ac0c44319e1a0b56a4300359fd25d3d818 From git at git.haskell.org Mon Jan 18 10:43:27 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 18 Jan 2016 10:43:27 +0000 (UTC) Subject: [commit: ghc] master: Fix typecheck of default associated type decls (cb24e68) Message-ID: <20160118104327.147EF3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/cb24e684759f3d181a104cde76f0f95da896a7ef/ghc >--------------------------------------------------------------- commit cb24e684759f3d181a104cde76f0f95da896a7ef Author: Simon Peyton Jones Date: Mon Jan 18 10:43:47 2016 +0000 Fix typecheck of default associated type decls This bug was thrown up by Trac #11361, but I found that the problem was deeper: GHC was allowing class C a where type F (a :: k) :: * type F (x :: *) = x -- Not right! (Which is now indexed-types/should_compile/T11361a.) Anyway the fix is relatively simple; use tcMatchTys in tcDefaultAssocDecl. Merge to 8.0 branch. >--------------------------------------------------------------- cb24e684759f3d181a104cde76f0f95da896a7ef compiler/typecheck/TcTyClsDecls.hs | 67 +++++++++++++++------- .../should_compile/T11361.hs} | 5 +- .../tests/indexed-types/should_compile/T11361a.hs | 7 +++ .../indexed-types/should_compile/T11361a.stderr | 5 ++ testsuite/tests/indexed-types/should_compile/all.T | 2 + 5 files changed, 65 insertions(+), 21 deletions(-) diff --git a/compiler/typecheck/TcTyClsDecls.hs b/compiler/typecheck/TcTyClsDecls.hs index e622c15..f6a5c9f 100644 --- a/compiler/typecheck/TcTyClsDecls.hs +++ b/compiler/typecheck/TcTyClsDecls.hs @@ -971,42 +971,64 @@ tcDefaultAssocDecl _ (d1:_:_) tcDefaultAssocDecl fam_tc [L loc (TyFamEqn { tfe_tycon = L _ tc_name , tfe_pats = hs_tvs , tfe_rhs = rhs })] - = setSrcSpan loc $ + | HsQTvs { hsq_implicit = imp_vars, hsq_explicit = exp_vars } <- hs_tvs + = -- See Note [Type-checking default assoc decls] + setSrcSpan loc $ tcAddFamInstCtxt (ptext (sLit "default type instance")) tc_name $ do { traceTc "tcDefaultAssocDecl" (ppr tc_name) - ; let shape@(fam_name, fam_pat_arity, _) = famTyConShape fam_tc - fam_tc_tvs = tyConTyVars fam_tc + ; let shape@(fam_tc_name, fam_arity, _) = famTyConShape fam_tc -- Kind of family check - ; checkTc (isTypeFamilyTyCon fam_tc) (wrongKindOfFamily fam_tc) + ; ASSERT( fam_tc_name == tc_name ) + checkTc (isTypeFamilyTyCon fam_tc) (wrongKindOfFamily fam_tc) -- Arity check - ; ASSERT( fam_name == tc_name ) - checkTc (length (hsQTvExplicit hs_tvs) == fam_pat_arity) - (wrongNumberOfParmsErr fam_pat_arity) + ; checkTc (length exp_vars == fam_arity) + (wrongNumberOfParmsErr fam_arity) -- Typecheck RHS - -- Oddly, we don't pass in any enclosing class info, and we treat - -- this as a top-level type instance. Type family defaults are renamed - -- outside the scope of their enclosing class and so the ClsInfo would - -- be of no use. - ; let HsQTvs { hsq_implicit = imp_vars, hsq_explicit = exp_vars } = hs_tvs - pats = HsIB { hsib_vars = imp_vars ++ map hsLTyVarName exp_vars + ; let pats = HsIB { hsib_vars = imp_vars ++ map hsLTyVarName exp_vars , hsib_body = map hsLTyVarBndrToType exp_vars } -- NB: Use tcFamTyPats, not tcTyClTyVars. The latter expects to get -- the LHsQTyVars used for declaring a tycon, but the names here -- are different. - ; (ktvs, rhs_ty) + ; (pats', rhs_ty) <- tcFamTyPats shape Nothing pats - (discardResult . tcCheckLHsType rhs) $ \ktvs _ rhs_kind -> + (discardResult . tcCheckLHsType rhs) $ \_ pats' rhs_kind -> do { rhs_ty <- solveEqualities $ tcCheckLHsType rhs rhs_kind - ; return (ktvs, rhs_ty) } - + ; return (pats', rhs_ty) } + -- pats' is fully zonked already ; rhs_ty <- zonkTcTypeToType emptyZonkEnv rhs_ty - ; let subst = zipTopTCvSubst ktvs (mkTyVarTys fam_tc_tvs) - ; return ( Just (substTy subst rhs_ty, loc) ) } - -- We check for well-formedness and validity later, in checkValidClass + + -- See Note [Type-checking default assoc decls] + ; case tcMatchTys pats' (mkTyVarTys (tyConTyVars fam_tc)) of + Just subst -> return ( Just (substTy subst rhs_ty, loc) ) + Nothing -> failWithTc (defaultAssocKindErr fam_tc) + -- We check for well-formedness and validity later, + -- in checkValidClass + } + +{- Note [Type-checking default assoc decls] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Consider this default declaration for an associated type + + class C a where + type F (a :: k) b :: * + type F x y = Proxy x -> y + +Note that the class variable 'a' doesn't scope over the default assoc +decl (rather oddly I think), and (less oddly) neither does the second +argument 'b' of the associated type 'F', or the kind variable 'k'. +Instead, the default decl is treated more like a top-level type +instance. + +However we store the default rhs (Proxy x -> y) in F's TyCon, using +F's own type variables, so we need to convert it to (Proxy a -> b). +We do this by calling tcMatchTys to match them up. This also ensures +that x's kind matches a's and similarly for y and b. The error +message isnt' great, mind you. (Trac #11361 was caused by not doing a +proper tcMatchTys here.) -} ------------------------- kcTyFamInstEqn :: FamTyConShape -> LTyFamInstEqn Name -> TcM () @@ -2544,6 +2566,11 @@ wrongNumberOfParmsErr max_args = ptext (sLit "Number of parameters must match family declaration; expected") <+> ppr max_args +defaultAssocKindErr :: TyCon -> SDoc +defaultAssocKindErr fam_tc + = ptext (sLit "Kind mis-match on LHS of default declaration for") + <+> quotes (ppr fam_tc) + wrongTyFamName :: Name -> Name -> SDoc wrongTyFamName fam_tc_name eqn_tc_name = hang (ptext (sLit "Mismatched type name in type family instance.")) diff --git a/testsuite/tests/typecheck/should_compile/tc253.hs b/testsuite/tests/indexed-types/should_compile/T11361.hs similarity index 83% copy from testsuite/tests/typecheck/should_compile/tc253.hs copy to testsuite/tests/indexed-types/should_compile/T11361.hs index 2fd528b..61b412a 100644 --- a/testsuite/tests/typecheck/should_compile/tc253.hs +++ b/testsuite/tests/indexed-types/should_compile/T11361.hs @@ -1,7 +1,10 @@ {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE UndecidableInstances #-} -- this is needed because |FamHelper a x| /< |Fam a x| -module ShouldCompile where +{-# OPTIONS_GHC -dinitial-unique=16777000 -dunique-increment=-1 #-} + -- This is what made GHC crash before + +module T11361 where class Cls a where type Fam a b :: * diff --git a/testsuite/tests/indexed-types/should_compile/T11361a.hs b/testsuite/tests/indexed-types/should_compile/T11361a.hs new file mode 100644 index 0000000..66ab056 --- /dev/null +++ b/testsuite/tests/indexed-types/should_compile/T11361a.hs @@ -0,0 +1,7 @@ +{-# LANGUAGE TypeFamilies, PolyKinds #-} + +module T11361a where + +class C a where + type F (a :: k) :: * + type F (x :: *) = x -- Not right! diff --git a/testsuite/tests/indexed-types/should_compile/T11361a.stderr b/testsuite/tests/indexed-types/should_compile/T11361a.stderr new file mode 100644 index 0000000..f7052ae --- /dev/null +++ b/testsuite/tests/indexed-types/should_compile/T11361a.stderr @@ -0,0 +1,5 @@ + +T11361a.hs:7:3: error: + ? Kind mis-match on LHS of default declaration for ?F? + ? In the default type instance declaration for ?F? + In the class declaration for ?C? diff --git a/testsuite/tests/indexed-types/should_compile/all.T b/testsuite/tests/indexed-types/should_compile/all.T index fe2688e..28ea8bd 100644 --- a/testsuite/tests/indexed-types/should_compile/all.T +++ b/testsuite/tests/indexed-types/should_compile/all.T @@ -271,3 +271,5 @@ test('T10318', normal, compile, ['']) test('UnusedTyVarWarnings', normal, compile, ['-W']) test('UnusedTyVarWarningsNamedWCs', normal, compile, ['-W']) test('T11408', normal, compile, ['']) +test('T11361', normal, compile, ['']) +test('T11361a', normal, compile_fail, ['']) From git at git.haskell.org Mon Jan 18 10:55:41 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 18 Jan 2016 10:55:41 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Fix some typos (b212af5) Message-ID: <20160118105541.0E85F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/b212af56b0b4ec8b0db13bcb84225093f6751d59/ghc >--------------------------------------------------------------- commit b212af56b0b4ec8b0db13bcb84225093f6751d59 Author: Rik Steenkamp Date: Sat Jan 16 13:18:53 2016 +0100 Fix some typos Differential Revision: https://phabricator.haskell.org/D1785 (cherry picked from commit 148a50b5f8a9db4c3e2724540c41a7a7a10b3194) >--------------------------------------------------------------- b212af56b0b4ec8b0db13bcb84225093f6751d59 compiler/coreSyn/CoreFVs.hs | 2 +- compiler/hsSyn/HsBinds.hs | 2 +- compiler/hsSyn/HsTypes.hs | 7 +++---- compiler/main/DynFlags.hs | 2 +- compiler/rename/RnTypes.hs | 2 +- compiler/typecheck/TcArrows.hs | 2 +- compiler/typecheck/TcRnTypes.hs | 4 ++-- docs/users_guide/glasgow_exts.rst | 4 ++-- 8 files changed, 12 insertions(+), 13 deletions(-) diff --git a/compiler/coreSyn/CoreFVs.hs b/compiler/coreSyn/CoreFVs.hs index 2e1c182..d3767e7 100644 --- a/compiler/coreSyn/CoreFVs.hs +++ b/compiler/coreSyn/CoreFVs.hs @@ -180,7 +180,7 @@ exprsSomeFreeVars fv_cand es = addBndr :: CoreBndr -> FV -> FV addBndr bndr fv fv_cand in_scope acc = (varTypeTyCoVarsAcc bndr `unionFV` - -- Include type varibles in the binder's type + -- Include type variables in the binder's type -- (not just Ids; coercion variables too!) FV.delFV bndr fv) fv_cand in_scope acc diff --git a/compiler/hsSyn/HsBinds.hs b/compiler/hsSyn/HsBinds.hs index e17f298..7901f10 100644 --- a/compiler/hsSyn/HsBinds.hs +++ b/compiler/hsSyn/HsBinds.hs @@ -735,7 +735,7 @@ data Sig name -- P :: forall a b. Prov => Req => ty -- | A signature for a class method - -- False: ordinary class-method signauure + -- False: ordinary class-method signature -- True: default class method signature -- e.g. class C a where -- op :: a -> a -- Ordinary diff --git a/compiler/hsSyn/HsTypes.hs b/compiler/hsSyn/HsTypes.hs index e8b38c7..83161b3 100644 --- a/compiler/hsSyn/HsTypes.hs +++ b/compiler/hsSyn/HsTypes.hs @@ -123,7 +123,7 @@ This is the syntax for types as seen in type signatures. Note [HsBSig binder lists] ~~~~~~~~~~~~~~~~~~~~~~~~~~ -Consider a binder (or pattern) decoarated with a type or kind, +Consider a binder (or pattern) decorated with a type or kind, \ (x :: a -> a). blah forall (a :: k -> *) (b :: k). blah Then we use a LHsBndrSig on the binder, so that the @@ -140,7 +140,7 @@ is a bit complicated. Here's how it works. * In a HsType, HsForAllTy represents an /explicit, user-written/ 'forall' e.g. forall a b. ... - HsQualTy reprsents an /explicit, user-written/ context + HsQualTy represents an /explicit, user-written/ context e.g. (Eq a, Show a) => ... The context can be empty if that's what the user wrote These constructors represent what the user wrote, no more @@ -154,8 +154,7 @@ is a bit complicated. Here's how it works. * HsImplicitBndrs is a wrapper that gives the implicitly-quantified kind and type variables of the wrapped thing. It is filled in by - the renamer. For example, if the - user writes + the renamer. For example, if the user writes f :: a -> a the HsImplicitBinders binds the 'a' (not a HsForAllTy!). NB: this implicit quantification is purely lexical: we bind any diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 491fd0d..8480332 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -2453,7 +2453,7 @@ dynamic_flags = [ , defFlag "dppr-cols" (intSuffix (\n d -> d{ pprCols = n })) , defGhcFlag "dtrace-level" (intSuffix (\n d -> d{ traceLevel = n })) -- Suppress all that is suppressable in core dumps. - -- Except for uniques, as some simplifier phases introduce new varibles that + -- Except for uniques, as some simplifier phases introduce new variables that -- have otherwise identical names. , defGhcFlag "dsuppress-all" (NoArg $ do setGeneralFlag Opt_SuppressCoercions diff --git a/compiler/rename/RnTypes.hs b/compiler/rename/RnTypes.hs index 7a13cdc..4541d05 100644 --- a/compiler/rename/RnTypes.hs +++ b/compiler/rename/RnTypes.hs @@ -91,7 +91,7 @@ rnHsSigWcTypeScoped :: HsDocContext -> LHsSigWcType RdrName rnHsSigWcTypeScoped ctx sig_ty thing_inside = rn_hs_sig_wc_type False ctx sig_ty thing_inside -- False: for pattern type sigs and rules we /do/ want - -- to bring those type varibles into scope + -- to bring those type variables into scope -- e.g \ (x :: forall a. a-> b) -> e -- Here we do bring 'b' into scope diff --git a/compiler/typecheck/TcArrows.hs b/compiler/typecheck/TcArrows.hs index dac6aed..7f00d43 100644 --- a/compiler/typecheck/TcArrows.hs +++ b/compiler/typecheck/TcArrows.hs @@ -37,7 +37,7 @@ import Util import Control.Monad {- -Note [Arrow overivew] +Note [Arrow overview] ~~~~~~~~~~~~~~~~~~~~~ Here's a summary of arrows and how they typecheck. First, here's a cut-down syntax: diff --git a/compiler/typecheck/TcRnTypes.hs b/compiler/typecheck/TcRnTypes.hs index fded11c..203396e 100644 --- a/compiler/typecheck/TcRnTypes.hs +++ b/compiler/typecheck/TcRnTypes.hs @@ -223,7 +223,7 @@ data Env gbl lcl -- Includes all info about imported things env_us :: {-# UNPACK #-} !(IORef UniqSupply), - -- Unique supply for local varibles + -- Unique supply for local variables env_gbl :: gbl, -- Info about things defined at the top level -- of the module being compiled @@ -2005,7 +2005,7 @@ Note [Shadowing in a constraint] We assume NO SHADOWING in a constraint. Specifically * The unification variables are all implicitly quantified at top level, and are all unique - * The skolem varibles bound in ic_skols are all freah when the + * The skolem variables bound in ic_skols are all freah when the implication is created. So we can safely substitute. For example, if we have forall a. a~Int => ...(forall b. ...a...)... diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index 0b7696e..c6cacab 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -932,7 +932,7 @@ Given a pattern synonym definition of the form :: it is assigned a *pattern type* of the form :: - pattern P :: CReq => CProf => t1 -> t2 -> ... -> tN -> t + pattern P :: CReq => CProv => t1 -> t2 -> ... -> tN -> t where ?CProv? and ?CReq? are type contexts, and ?t1?, ?t2?, ..., ?tN? and ?t? are types. Notice the unusual form of the type, with two @@ -7976,7 +7976,7 @@ An implicit parameter is *bound* using the standard ``let`` or ``where`` binding forms. For example, we define the ``min`` function by binding ``cmp``. :: - min :: [a] -> a + min :: Ord a => [a] -> a min = let ?cmp = (<=) in least A group of implicit-parameter bindings may occur anywhere a normal group From git at git.haskell.org Mon Jan 18 10:55:45 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 18 Jan 2016 10:55:45 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Work SourceText in for all integer literals (953bbd3) Message-ID: <20160118105545.2A4383A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/953bbd31abcc1f328d1e70d5e84fceb402c07b42/ghc >--------------------------------------------------------------- commit 953bbd31abcc1f328d1e70d5e84fceb402c07b42 Author: Alan Zimmerman Date: Fri Jan 15 00:03:58 2016 +0200 Work SourceText in for all integer literals Summary: Certain syntactic elements have integers in them, such as fixity specifications, SPECIALISE pragmas and so on. The lexer will accept mult-radix literals, with arbitrary leading zeros in these. Bring in a SourceText field to each affected AST element to capture the original literal text for use with API Annotations. Affected hsSyn elements are ``` -- See note [Pragma source text] data Activation = NeverActive | AlwaysActive | ActiveBefore SourceText PhaseNum -- Active only *strictly before* this phase | ActiveAfter SourceText PhaseNum -- Active in this phase and later deriving( Eq, Data, Typeable ) -- Eq used in comparing rules in HsDecls data Fixity = Fixity SourceText Int FixityDirection -- Note [Pragma source text] deriving (Data, Typeable) ``` and ``` | HsTickPragma -- A pragma introduced tick SourceText -- Note [Pragma source text] in BasicTypes (StringLiteral,(Int,Int),(Int,Int)) -- external span for this tick ((SourceText,SourceText),(SourceText,SourceText)) -- Source text for the four integers used in the span. -- See note [Pragma source text] in BasicTypes (LHsExpr id) ``` Updates haddock submodule Test Plan: ./validate Reviewers: goldfire, bgamari, austin Reviewed By: bgamari Subscribers: thomie, mpickering Differential Revision: https://phabricator.haskell.org/D1781 GHC Trac Issues: #11430 (cherry picked from commit 3a1babd6243edd96073ed3e3a5fb6e0aaf11350e) >--------------------------------------------------------------- 953bbd31abcc1f328d1e70d5e84fceb402c07b42 compiler/basicTypes/BasicTypes.hs | 49 ++++++++++++---------- compiler/basicTypes/MkId.hs | 3 +- compiler/deSugar/Coverage.hs | 2 +- compiler/deSugar/DsExpr.hs | 2 +- compiler/deSugar/DsMeta.hs | 12 +++--- compiler/deSugar/PmExpr.hs | 2 +- compiler/hsSyn/Convert.hs | 6 +-- compiler/hsSyn/HsExpr.hs | 5 ++- compiler/iface/LoadIface.hs | 2 +- compiler/parser/Parser.y | 33 +++++++++------ compiler/parser/RdrHsSyn.hs | 6 +-- compiler/rename/RnEnv.hs | 4 +- compiler/rename/RnExpr.hs | 12 +++--- compiler/rename/RnTypes.hs | 8 ++-- compiler/simplCore/SimplUtils.hs | 4 +- compiler/stranal/WorkWrap.hs | 2 +- compiler/typecheck/TcExpr.hs | 4 +- compiler/typecheck/TcGenDeriv.hs | 2 +- compiler/typecheck/TcGenGenerics.hs | 6 +-- compiler/typecheck/TcHsSyn.hs | 4 +- compiler/typecheck/TcRnTypes.hs | 2 +- compiler/typecheck/TcSplice.hs | 2 +- compiler/utils/Binary.hs | 22 ++++++---- testsuite/tests/ghc-api/annotations/Makefile | 7 ++++ testsuite/tests/ghc-api/annotations/T11430.stdout | 6 +++ testsuite/tests/ghc-api/annotations/Test11430.hs | 25 +++++++++++ testsuite/tests/ghc-api/annotations/all.T | 1 + .../tests/ghc-api/annotations/stringSource.hs | 2 +- .../annotations/{stringSource.hs => t11430.hs} | 47 +++++++-------------- utils/genprimopcode/Main.hs | 5 ++- utils/genprimopcode/Parser.y | 6 +-- utils/genprimopcode/Syntax.hs | 4 +- utils/haddock | 2 +- 33 files changed, 175 insertions(+), 124 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 953bbd31abcc1f328d1e70d5e84fceb402c07b42 From git at git.haskell.org Mon Jan 18 10:55:48 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 18 Jan 2016 10:55:48 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Add missing T11408.hs (0fb7d4a) Message-ID: <20160118105548.60FC13A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/0fb7d4a185868470edcd7d49dc9f3dd18b688dbf/ghc >--------------------------------------------------------------- commit 0fb7d4a185868470edcd7d49dc9f3dd18b688dbf Author: Simon Peyton Jones Date: Sat Jan 16 23:51:42 2016 +0000 Add missing T11408.hs (cherry picked from commit 3b6a4909ff579507a7f9527264e0cb8464fbe555) >--------------------------------------------------------------- 0fb7d4a185868470edcd7d49dc9f3dd18b688dbf .../tests/indexed-types/should_compile/T11408.hs | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/testsuite/tests/indexed-types/should_compile/T11408.hs b/testsuite/tests/indexed-types/should_compile/T11408.hs new file mode 100644 index 0000000..df63c67 --- /dev/null +++ b/testsuite/tests/indexed-types/should_compile/T11408.hs @@ -0,0 +1,23 @@ +{-# LANGUAGE TypeFamilies #-} +module T11408 where + +type family UL a +type family UR a +type family MT a b + +mkMerge :: a -> UL a -> UR a -> Int +mkMerge = undefined + +merger :: a -> b -> MT a b +merger = undefined + +{- +merge :: + forall a b. (UL (MT a b) ~ a, UR (MT a b) ~ b) => a -> b -> Int +or + forall t. (MT (UL t) (UR t) ~ t) => UL t -> UR t -> Int + +These types are equivalent, and in fact neither is ambiguous, +but the solver has to work quite hard to prove that. +-} +merge x y = mkMerge (merger x y) x y From git at git.haskell.org Mon Jan 18 10:55:51 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 18 Jan 2016 10:55:51 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Fix a number of subtle solver bugs (9f466c8) Message-ID: <20160118105551.1C2843A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/9f466c8841c7ddda84951c9e3470540d25d0bfdb/ghc >--------------------------------------------------------------- commit 9f466c8841c7ddda84951c9e3470540d25d0bfdb Author: Simon Peyton Jones Date: Sat Jan 16 00:37:15 2016 +0000 Fix a number of subtle solver bugs As a result of some other unrelated changes I found that IndTypesPerf was failing, and opened Trac #11408. There's a test in indexed-types/should-compile/T11408. The bug was that a type like forall t. (MT (UL t) (UR t) ~ t) => UL t -> UR t -> Int is in fact unambiguous, but it's a bit subtle to prove that it is unambiguous. In investigating, Dimitrios and I found several subtle bugs in the constraint solver, fixed by this patch * canRewrite was missing a Derived/Derived case. This was lost by accident in Richard's big kind-equality patch. * Interact.interactTyVarEq would discard [D] a ~ ty if there was a [W] a ~ ty in the inert set. But that is wrong because the former can rewrite things that the latter cannot. Fix: a new function eqCanDischarge * In TcSMonad.addInertEq, the process was outright wrong for a Given/Wanted in the (GWModel) case. We were adding a new Derived without kicking out things that it could rewrite. Now the code is simpler (no special GWModel case), and works correctly. * The special case in kickOutRewritable for [W] fsk ~ ty, turns out not to be needed. (We emit a [D] fsk ~ ty which will do the job. I improved comments and documentation, esp in TcSMonad. (cherry picked from commit 9308c736d43b92bf8634babf565048e66e071bd8) >--------------------------------------------------------------- 9f466c8841c7ddda84951c9e3470540d25d0bfdb compiler/typecheck/TcCanonical.hs | 4 +- compiler/typecheck/TcFlatten.hs | 4 +- compiler/typecheck/TcInteract.hs | 49 ++-- compiler/typecheck/TcRnTypes.hs | 99 ++++--- compiler/typecheck/TcSMonad.hs | 290 ++++++++++++--------- .../should_compile/IndTypesPerfMerge.hs | 44 ++++ testsuite/tests/indexed-types/should_compile/all.T | 1 + .../tests/typecheck/should_fail/tcfail201.stderr | 4 +- 8 files changed, 304 insertions(+), 191 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 9f466c8841c7ddda84951c9e3470540d25d0bfdb From git at git.haskell.org Mon Jan 18 10:55:53 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 18 Jan 2016 10:55:53 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: rts/posix: Fail with HEAPOVERFLOW when out of memory during mmap (30caafe) Message-ID: <20160118105553.D04A93A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/30caafe829ce93a2e303b506cea21395b0a725eb/ghc >--------------------------------------------------------------- commit 30caafe829ce93a2e303b506cea21395b0a725eb Author: Ben Gamari Date: Sun Jan 17 19:24:50 2016 +0100 rts/posix: Fail with HEAPOVERFLOW when out of memory during mmap Test Plan: Validate Reviewers: simonmar, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1787 GHC Trac Issues: #11300 (cherry picked from commit ae1c48c60abdfb134de7e247df851da101f0dd96) >--------------------------------------------------------------- 30caafe829ce93a2e303b506cea21395b0a725eb rts/posix/OSMem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rts/posix/OSMem.c b/rts/posix/OSMem.c index 60e684f..2a3c294 100644 --- a/rts/posix/OSMem.c +++ b/rts/posix/OSMem.c @@ -222,7 +222,7 @@ my_mmap_or_barf (void *addr, W_ size, int operation) // If we request more than 3Gig, then we get EINVAL // instead of ENOMEM (at least on Linux). errorBelch("out of memory (requested %" FMT_Word " bytes)", size); - stg_exit(EXIT_FAILURE); + stg_exit(EXIT_HEAPOVERFLOW); } else { barf("getMBlock: mmap: %s", strerror(errno)); } From git at git.haskell.org Mon Jan 18 11:54:45 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 18 Jan 2016 11:54:45 +0000 (UTC) Subject: [commit: ghc] master: Implement scoped type variables in pattern synonyms (e2c7b7e) Message-ID: <20160118115445.2103B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e2c7b7ee976dcabf12002265ddbe58017b794cb8/ghc >--------------------------------------------------------------- commit e2c7b7ee976dcabf12002265ddbe58017b794cb8 Author: Simon Peyton Jones Date: Fri Jan 15 17:45:02 2016 +0000 Implement scoped type variables in pattern synonyms This fixes Trac #11351. The implementation is pretty simple, happily. I took the opportunity to re-order the prov/req context in builder-ids, which was confusingly backwards. >--------------------------------------------------------------- e2c7b7ee976dcabf12002265ddbe58017b794cb8 compiler/basicTypes/PatSyn.hs | 4 +- compiler/deSugar/DsExpr.hs | 6 +- compiler/rename/RnBinds.hs | 29 +++++---- compiler/typecheck/TcBinds.hs | 9 ++- compiler/typecheck/TcHsType.hs | 2 +- compiler/typecheck/TcPat.hs | 3 +- compiler/typecheck/TcPatSyn.hs | 82 +++++++++++++++++-------- compiler/typecheck/TcPatSyn.hs-boot | 4 +- compiler/typecheck/TcRnTypes.hs | 8 ++- testsuite/tests/patsyn/should_compile/T11351.hs | 23 +++++++ testsuite/tests/patsyn/should_compile/all.T | 1 + 11 files changed, 120 insertions(+), 51 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc e2c7b7ee976dcabf12002265ddbe58017b794cb8 From git at git.haskell.org Mon Jan 18 11:54:47 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 18 Jan 2016 11:54:47 +0000 (UTC) Subject: [commit: ghc] master: White space only (b7e5c30) Message-ID: <20160118115447.E38593A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/b7e5c302173f420780a1fdc8b599549298d286c3/ghc >--------------------------------------------------------------- commit b7e5c302173f420780a1fdc8b599549298d286c3 Author: Simon Peyton Jones Date: Mon Jan 11 09:02:01 2016 +0000 White space only >--------------------------------------------------------------- b7e5c302173f420780a1fdc8b599549298d286c3 compiler/typecheck/TcDeriv.hs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/compiler/typecheck/TcDeriv.hs b/compiler/typecheck/TcDeriv.hs index e351f28..c790956 100644 --- a/compiler/typecheck/TcDeriv.hs +++ b/compiler/typecheck/TcDeriv.hs @@ -1567,18 +1567,15 @@ mkNewTypeEqn dflags overlap_mode tvs -- we are gong to get all the methods for the newtype -- dictionary - -- Next we figure out what superclass dictionaries to use -- See Note [Newtype deriving superclasses] above - cls_tyvars = classTyVars cls - dfun_tvs = tyCoVarsOfTypes inst_tys - inst_ty = mkTyConApp tycon tc_args - inst_tys = cls_tys ++ [inst_ty] - sc_theta = - mkThetaOrigin DerivOrigin TypeLevel $ - substTheta (zipOpenTCvSubst cls_tyvars inst_tys) (classSCTheta cls) - + dfun_tvs = tyCoVarsOfTypes inst_tys + inst_ty = mkTyConApp tycon tc_args + inst_tys = cls_tys ++ [inst_ty] + sc_theta = mkThetaOrigin DerivOrigin TypeLevel $ + substTheta (zipOpenTCvSubst cls_tyvars inst_tys) $ + classSCTheta cls -- Next we collect Coercible constraints between -- the Class method types, instantiated with the representation and the From git at git.haskell.org Mon Jan 18 11:54:50 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 18 Jan 2016 11:54:50 +0000 (UTC) Subject: [commit: ghc] master: Typo in comment (5412899) Message-ID: <20160118115450.9E7E93A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/54128992b2ae8b18816e74fd02bc49833dda031e/ghc >--------------------------------------------------------------- commit 54128992b2ae8b18816e74fd02bc49833dda031e Author: Simon Peyton Jones Date: Mon Jan 18 11:55:20 2016 +0000 Typo in comment >--------------------------------------------------------------- 54128992b2ae8b18816e74fd02bc49833dda031e compiler/typecheck/TcSMonad.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/typecheck/TcSMonad.hs b/compiler/typecheck/TcSMonad.hs index 0ad02e5..6d30958 100644 --- a/compiler/typecheck/TcSMonad.hs +++ b/compiler/typecheck/TcSMonad.hs @@ -1117,7 +1117,7 @@ Note [Adding an inert canonical constraint the InertCans] * [Given/Wanted] a ~N ty 1. Add it to inert_eqs 2. Emit [D] a~ty - As a result of (2), the current model will rewrite teh new [D] a~ty + As a result of (2), the current model will rewrite the new [D] a~ty during canonicalisation, and then it'll be added to the model using the steps of [Derived] above. From git at git.haskell.org Mon Jan 18 11:54:53 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 18 Jan 2016 11:54:53 +0000 (UTC) Subject: [commit: ghc] master: Add Trac #11427 to Note [Recursive superclasses] (8e6a68d) Message-ID: <20160118115453.5808F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/8e6a68d49a4f2ffd49990dc6b84135d93015d3f8/ghc >--------------------------------------------------------------- commit 8e6a68d49a4f2ffd49990dc6b84135d93015d3f8 Author: Simon Peyton Jones Date: Fri Jan 15 17:33:35 2016 +0000 Add Trac #11427 to Note [Recursive superclasses] >--------------------------------------------------------------- 8e6a68d49a4f2ffd49990dc6b84135d93015d3f8 compiler/typecheck/TcInstDcls.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/typecheck/TcInstDcls.hs b/compiler/typecheck/TcInstDcls.hs index 4f04568..5fc09ea 100644 --- a/compiler/typecheck/TcInstDcls.hs +++ b/compiler/typecheck/TcInstDcls.hs @@ -1028,7 +1028,7 @@ See Trac #3731, #4809, #5751, #5913, #6117, #6161, which all describe somewhat more complicated situations, but ones encountered in practice. -See also tests tcrun020, tcrun021, tcrun033 +See also tests tcrun020, tcrun021, tcrun033, and Trac #11427. ----- THE PROBLEM -------- The problem is that it is all too easy to create a class whose From git at git.haskell.org Mon Jan 18 11:54:56 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 18 Jan 2016 11:54:56 +0000 (UTC) Subject: [commit: ghc] master: Test Trac #11379 (8e50301) Message-ID: <20160118115456.76A9D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/8e50301f7514751fc5c1fcc0e2847a49041ca2e7/ghc >--------------------------------------------------------------- commit 8e50301f7514751fc5c1fcc0e2847a49041ca2e7 Author: Simon Peyton Jones Date: Mon Jan 18 11:53:05 2016 +0000 Test Trac #11379 >--------------------------------------------------------------- 8e50301f7514751fc5c1fcc0e2847a49041ca2e7 testsuite/tests/typecheck/should_compile/T11379.hs | 36 ++++++++++++++++++++++ testsuite/tests/typecheck/should_compile/all.T | 1 + 2 files changed, 37 insertions(+) diff --git a/testsuite/tests/typecheck/should_compile/T11379.hs b/testsuite/tests/typecheck/should_compile/T11379.hs new file mode 100644 index 0000000..35e27a5 --- /dev/null +++ b/testsuite/tests/typecheck/should_compile/T11379.hs @@ -0,0 +1,36 @@ +{-# LANGUAGE ExistentialQuantification, RankNTypes, MultiParamTypeClasses, + FunctionalDependencies, FlexibleInstances, FlexibleContexts + #-} + +module XMonad.Layout.MultiToggle where + +import Data.Typeable + +-- This appears to be the culprit +expand :: (HList ts a) => MultiToggleS ts l a -> MultiToggle ts l a +expand (MultiToggleS b ts) = + resolve ts id + (\x mt -> let g = transform' x in mt{ currLayout = g $ currLayout mt }) + (MultiToggle (EL b id) ts) + +class (Typeable t) => Transformer t a | t -> a where + transform :: t + -> l a + -> (forall l'. l' a -> (l' a -> l a) -> b) + -> b + +data EL l a = forall l'. EL (l' a) (l' a -> l a) + +transform' :: (Transformer t a) => t -> EL l a -> EL l a +transform' t (EL l det) = undefined + +data MultiToggleS ts l a = MultiToggleS (l a) ts + deriving (Read, Show) + +data MultiToggle ts l a = MultiToggle{ + currLayout :: EL l a, + transformers :: ts + } + +class HList c a where + resolve :: c -> b -> (forall t. (Transformer t a) => t -> b) -> b diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T index bf43716..46ab53b 100644 --- a/testsuite/tests/typecheck/should_compile/all.T +++ b/testsuite/tests/typecheck/should_compile/all.T @@ -488,3 +488,4 @@ test('T11237', normal, compile, ['']) test('T10592', normal, compile, ['']) test('T11305', normal, compile, ['']) test('T11254', normal, compile, ['']) +test('T11379', normal, compile, ['']) From git at git.haskell.org Mon Jan 18 11:54:59 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 18 Jan 2016 11:54:59 +0000 (UTC) Subject: [commit: ghc] master: Refactoring on IdInfo and system derived names (ec8a188) Message-ID: <20160118115459.34CFF3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/ec8a188a927a4db2e709541765e5ef545eae284c/ghc >--------------------------------------------------------------- commit ec8a188a927a4db2e709541765e5ef545eae284c Author: Simon Peyton Jones Date: Fri Jan 15 17:30:30 2016 +0000 Refactoring on IdInfo and system derived names Some modest refactoring, triggered in part by Trac #11051 * Kill off PatSynId, ReflectionId in IdDetails They were barely used, and only for pretty-printing * Add helper function Id.mkExportedVanillaId, and use it * Polish up OccName.isDerivedOccName, as a predicate for definitions generated internally by GHC, which we might not want to show to the user. * Kill off unused OccName.mkDerivedTyConOcc * Shorten the derived OccNames for newtype and data instance axioms * A bit of related refactoring around newFamInstAxiomName >--------------------------------------------------------------- ec8a188a927a4db2e709541765e5ef545eae284c compiler/basicTypes/Id.hs | 6 ++- compiler/basicTypes/IdInfo.hs | 13 ----- compiler/basicTypes/OccName.hs | 23 ++++---- compiler/deSugar/DsExpr.hs | 3 +- compiler/iface/MkIface.hs | 5 -- compiler/typecheck/TcEnv.hs | 9 ++-- compiler/typecheck/TcInstDcls.hs | 5 +- compiler/typecheck/TcRnDriver.hs | 13 +++-- compiler/typecheck/TcTyClsDecls.hs | 51 +++++++++--------- compiler/typecheck/TcTyDecls.hs | 2 +- compiler/typecheck/TcTypeable.hs | 7 ++- .../tests/deSugar/should_compile/T2431.stderr | 6 +-- testsuite/tests/ghci/scripts/T4175.stdout | 22 ++++---- testsuite/tests/ghci/scripts/T7939.stdout | 2 +- .../indexed-types/should_compile/T3017.stderr | 7 ++- .../tests/numeric/should_compile/T7116.stdout | 2 +- .../tests/partial-sigs/should_compile/ADT.stderr | 3 +- .../should_compile/DataFamilyInstanceLHS.stderr | 14 ++++- .../NamedWildcardInDataFamilyInstanceLHS.stderr | 14 ++++- .../NamedWildcardInTypeFamilyInstanceLHS.stderr | 6 +-- .../partial-sigs/should_compile/SkipMany.stderr | 4 +- .../should_compile/TypeFamilyInstanceLHS.stderr | 6 +-- testsuite/tests/roles/should_compile/Roles1.stderr | 9 +++- .../tests/roles/should_compile/Roles13.stderr | 28 ++++++---- .../tests/roles/should_compile/Roles14.stderr | 17 ++++-- testsuite/tests/roles/should_compile/Roles2.stderr | 24 +++++++-- testsuite/tests/roles/should_compile/Roles3.stderr | 62 ++++++++++++++++------ testsuite/tests/roles/should_compile/Roles4.stderr | 32 +++++++---- testsuite/tests/roles/should_compile/T8958.stderr | 45 +++++++++++----- .../tests/simplCore/should_compile/T3717.stderr | 2 +- .../tests/simplCore/should_compile/T3772.stdout | 2 +- .../tests/simplCore/should_compile/T4201.stdout | 2 +- .../tests/simplCore/should_compile/T4908.stderr | 2 +- .../tests/simplCore/should_compile/T4930.stderr | 2 +- .../tests/simplCore/should_compile/T7360.stderr | 10 ++-- .../tests/simplCore/should_compile/T9400.stderr | 2 +- .../simplCore/should_compile/spec-inline.stderr | 2 +- .../tests/typecheck/should_compile/tc231.stderr | 8 ++- 38 files changed, 288 insertions(+), 184 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc ec8a188a927a4db2e709541765e5ef545eae284c From git at git.haskell.org Mon Jan 18 11:55:01 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 18 Jan 2016 11:55:01 +0000 (UTC) Subject: [commit: ghc] master: Improve debug printing/warnings (6e0c0fd) Message-ID: <20160118115501.D71ED3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/6e0c0fd2e09c552bf38e22645347dbb2e7327e8e/ghc >--------------------------------------------------------------- commit 6e0c0fd2e09c552bf38e22645347dbb2e7327e8e Author: Simon Peyton Jones Date: Mon Jan 11 09:02:25 2016 +0000 Improve debug printing/warnings >--------------------------------------------------------------- 6e0c0fd2e09c552bf38e22645347dbb2e7327e8e compiler/typecheck/TcRnTypes.hs | 4 +++- compiler/typecheck/TcSMonad.hs | 5 ++++- compiler/typecheck/TcSimplify.hs | 3 ++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/compiler/typecheck/TcRnTypes.hs b/compiler/typecheck/TcRnTypes.hs index a2f4045..a7895e7 100644 --- a/compiler/typecheck/TcRnTypes.hs +++ b/compiler/typecheck/TcRnTypes.hs @@ -1773,7 +1773,9 @@ instance Outputable Ct where CTyEqCan {} -> text "CTyEqCan" CFunEqCan {} -> text "CFunEqCan" CNonCanonical {} -> text "CNonCanonical" - CDictCan {} -> text "CDictCan" + CDictCan { cc_pend_sc = pend_sc } + | pend_sc -> text "CDictCan(psc)" + | otherwise -> text "CDictCan" CIrredEvCan {} -> text "CIrredEvCan" CHoleCan { cc_occ = occ } -> text "CHoleCan:" <+> ppr occ diff --git a/compiler/typecheck/TcSMonad.hs b/compiler/typecheck/TcSMonad.hs index 099be19..0ad02e5 100644 --- a/compiler/typecheck/TcSMonad.hs +++ b/compiler/typecheck/TcSMonad.hs @@ -13,7 +13,8 @@ module TcSMonad ( updWorkListTcS, -- The TcS monad - TcS, runTcS, runTcSDeriveds, runTcSWithEvBinds, failTcS, + TcS, runTcS, runTcSDeriveds, runTcSWithEvBinds, + failTcS, warnTcS, runTcSEqualities, nestTcS, nestImplicTcS, @@ -2319,7 +2320,9 @@ wrapWarnTcS :: TcM a -> TcS a wrapWarnTcS = wrapTcS failTcS, panicTcS :: SDoc -> TcS a +warnTcS :: SDoc -> TcS () failTcS = wrapTcS . TcM.failWith +warnTcS = wrapTcS . TcM.addWarn panicTcS doc = pprPanic "TcCanonical" doc traceTcS :: String -> SDoc -> TcS () diff --git a/compiler/typecheck/TcSimplify.hs b/compiler/typecheck/TcSimplify.hs index c85444e..4d93912 100644 --- a/compiler/typecheck/TcSimplify.hs +++ b/compiler/typecheck/TcSimplify.hs @@ -1018,7 +1018,7 @@ simpl_loop n limit floated_eqs no_new_scs = return wc -- Done! | n `intGtLimit` limit - = failTcS (hang (ptext (sLit "solveWanteds: too many iterations") + = do { warnTcS (hang (ptext (sLit "solveWanteds: too many iterations") <+> parens (ptext (sLit "limit =") <+> ppr limit)) 2 (vcat [ ptext (sLit "Unsolved:") <+> ppr wc , ppUnless (isEmptyBag floated_eqs) $ @@ -1027,6 +1027,7 @@ simpl_loop n limit floated_eqs no_new_scs ptext (sLit "New superclasses found") , ptext (sLit "Set limit with -fconstraint-solver-iterations=n; n=0 for no limit") ])) + ; return wc } | otherwise = do { traceTcS "simpl_loop, iteration" (int n) From git at git.haskell.org Mon Jan 18 12:24:16 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 18 Jan 2016 12:24:16 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Add missing type representations (288afc9) Message-ID: <20160118122416.A2CA93A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/288afc9bb83b587e09ac578d99bb6b64786b1e99/ghc >--------------------------------------------------------------- commit 288afc9bb83b587e09ac578d99bb6b64786b1e99 Author: Ben Gamari Date: Wed Jan 13 14:53:02 2016 +0100 Add missing type representations Previously we were missing `Typeable` representations for several wired-in types (and their promoted constructors). These include, * `Nat` * `Symbol` * `':` * `'[]` Moreover, some constructors were incorrectly identified as being defined in `GHC.Types` whereas they were in fact defined in `GHC.Prim`. Ultimately this is just a temporary band-aid as there is general agreement that we should eliminate the manual definition of these representations entirely. Test Plan: Validate Reviewers: austin, hvr Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1769 GHC Trac Issues: #11120 (cherry picked from commit ac3cf68c378410724973e64be7198bb8720a6809) >--------------------------------------------------------------- 288afc9bb83b587e09ac578d99bb6b64786b1e99 compiler/iface/BuildTyCl.hs | 3 +- compiler/prelude/PrelNames.hs | 23 -------------- compiler/prelude/TysWiredIn.hs | 53 +++++++++++++++++++++++++++++++- libraries/base/Data/Typeable/Internal.hs | 28 ++++++++++++----- libraries/ghc-prim/GHC/Types.hs | 8 +++++ 5 files changed, 82 insertions(+), 33 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 288afc9bb83b587e09ac578d99bb6b64786b1e99 From git at git.haskell.org Mon Jan 18 12:24:20 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 18 Jan 2016 12:24:20 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Show TYPE 'Lifted/TYPE 'Unlifted as */# in Show TypeRep instance (4b01ce3) Message-ID: <20160118122420.087543A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/4b01ce344adda8acf710d277170049e0ebf12ce0/ghc >--------------------------------------------------------------- commit 4b01ce344adda8acf710d277170049e0ebf12ce0 Author: RyanGlScott Date: Sun Jan 17 19:28:10 2016 +0100 Show TYPE 'Lifted/TYPE 'Unlifted as */# in Show TypeRep instance Kind equalities changed how `*`/`#` are represented internally, which means that showing a `TypeRep` that contains either of those kinds produces a rather gross-looking result, e.g., ``` > typeOf (Proxy :: Proxy 'Just) Proxy (TYPE 'Lifted -> Maybe (TYPE 'Lifted)) 'Just ``` We can at least special-case the `Show` instance for `TypeRep` so that it prints `*` to represent `TYPE 'Lifted` and `#` to represent `TYPE 'Unlifted`. Addresses one of the issues uncovered in #11334. Test Plan: ./validate Reviewers: simonpj, hvr, austin, goldfire, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1757 GHC Trac Issues: #11334 (cherry picked from commit 65b810bdda625f2e98069c2c56ec93e1c65667a6) >--------------------------------------------------------------- 4b01ce344adda8acf710d277170049e0ebf12ce0 libraries/base/Data/Typeable/Internal.hs | 5 ++++- libraries/base/tests/T11334.hs | 11 +++++++++++ libraries/base/tests/T11334.stdout | 3 +++ libraries/base/tests/all.T | 3 ++- 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/libraries/base/Data/Typeable/Internal.hs b/libraries/base/Data/Typeable/Internal.hs index 548df30..46e6e82 100644 --- a/libraries/base/Data/Typeable/Internal.hs +++ b/libraries/base/Data/Typeable/Internal.hs @@ -357,7 +357,10 @@ instance Show TypeRep where showsPrec p (TypeRep _ tycon kinds tys) = case tys of [] -> showsPrec p tycon - [x] | tycon == tcList -> showChar '[' . shows x . showChar ']' + [x@(TypeRep _ argCon _ _)] + | tycon == tcList -> showChar '[' . shows x . showChar ']' + | tycon == tcTYPE && argCon == tc'Lifted -> showChar '*' + | tycon == tcTYPE && argCon == tc'Unlifted -> showChar '#' [a,r] | tycon == tcFun -> showParen (p > 8) $ showsPrec 9 a . showString " -> " . diff --git a/libraries/base/tests/T11334.hs b/libraries/base/tests/T11334.hs new file mode 100644 index 0000000..22864d9 --- /dev/null +++ b/libraries/base/tests/T11334.hs @@ -0,0 +1,11 @@ +{-# LANGUAGE DataKinds #-} +module Main (main) where + +import Data.Typeable +import GHC.Types + +main :: IO () +main = do + print (typeOf (Proxy :: Proxy 'Just)) + print (typeOf (Proxy :: Proxy (TYPE 'Lifted))) + print (typeOf (Proxy :: Proxy (TYPE 'Unlifted))) diff --git a/libraries/base/tests/T11334.stdout b/libraries/base/tests/T11334.stdout new file mode 100644 index 0000000..a00f275 --- /dev/null +++ b/libraries/base/tests/T11334.stdout @@ -0,0 +1,3 @@ +Proxy (* -> Maybe *) 'Just +Proxy * * +Proxy * # diff --git a/libraries/base/tests/all.T b/libraries/base/tests/all.T index 0cb48bb..06ef3bb 100644 --- a/libraries/base/tests/all.T +++ b/libraries/base/tests/all.T @@ -210,4 +210,5 @@ test('T9848', , only_ways(['normal'])], compile_and_run, ['-O']) -test('T10149',normal, compile_and_run,['']) +test('T10149', normal, compile_and_run, ['']) +test('T11334', normal, compile_and_run, ['']) From git at git.haskell.org Mon Jan 18 12:24:22 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 18 Jan 2016 12:24:22 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Complete operators properly (a501fa4) Message-ID: <20160118122422.CDA613A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/a501fa4a165624dbf8984f540780e03c9f5a14e7/ghc >--------------------------------------------------------------- commit a501fa4a165624dbf8984f540780e03c9f5a14e7 Author: Arthur Fayzrakhmanov (????? ????????????) Date: Sun Jan 17 19:27:12 2016 +0100 Complete operators properly Fix operator completions: list of suitable completions only rather than everything from imported modules. Signed-off-by: Arthur Fayzrakhmanov (????? ????????????) ghc: fix operator completions Reviewers: austin, hvr, thomie, bgamari Reviewed By: thomie, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1058 GHC Trac Issues: #10576 (cherry picked from commit b3eb8fad4c9d5aa293e197bfff7039d6fa112a54) >--------------------------------------------------------------- a501fa4a165624dbf8984f540780e03c9f5a14e7 ghc/GHCi/UI.hs | 36 +++- libraries/base/Text/Read/Lex.hs | 27 +-- testsuite/tests/ghci/prog015/Level1.hs | 3 + testsuite/tests/ghci/prog015/Level2/Level2.hs | 3 + .../should_compile => ghci/prog015}/Makefile | 0 testsuite/tests/ghci/prog015/TopLevel.hs | 4 + testsuite/tests/ghci/prog015/prog015.T | 2 + testsuite/tests/ghci/prog015/prog015.script | 25 +++ testsuite/tests/ghci/prog015/prog015.stdout | 15 ++ testsuite/tests/ghci/prog016/Level1.hs | 7 + testsuite/tests/ghci/prog016/Level2/Level2.hs | 10 ++ .../should_compile => ghci/prog016}/Makefile | 0 testsuite/tests/ghci/prog016/TopLevel.hs | 7 + testsuite/tests/ghci/prog016/prog016.T | 2 + testsuite/tests/ghci/prog016/prog016.script | 34 ++++ testsuite/tests/ghci/prog016/prog016.stdout | 37 +++++ testsuite/tests/ghci/prog017/Level1.hs | 5 + testsuite/tests/ghci/prog017/Level2/Level2.hs | 3 + .../should_compile => ghci/prog017}/Makefile | 0 testsuite/tests/ghci/prog017/TopLevel.hs | 182 +++++++++++++++++++++ testsuite/tests/ghci/prog017/prog017.T | 2 + testsuite/tests/ghci/prog017/prog017.script | 136 +++++++++++++++ testsuite/tests/ghci/prog017/prog017.stdout | 144 ++++++++++++++++ testsuite/tests/ghci/scripts/T10576.hs | 7 + testsuite/tests/ghci/scripts/T10576a.script | 4 + testsuite/tests/ghci/scripts/T10576a.stdout | 2 + testsuite/tests/ghci/scripts/T10576b.script | 4 + testsuite/tests/ghci/scripts/T10576b.stdout | 3 + testsuite/tests/ghci/scripts/all.T | 3 + testsuite/tests/ghci/should_fail/all.T | 0 30 files changed, 687 insertions(+), 20 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc a501fa4a165624dbf8984f540780e03c9f5a14e7 From git at git.haskell.org Mon Jan 18 12:24:25 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 18 Jan 2016 12:24:25 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: users-guide: Clean manpage build artifacts and fix usage of clean-target (e7bea17) Message-ID: <20160118122425.80D8C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/e7bea17d70e422dfdd16d50b531e469b4d5e3cc5/ghc >--------------------------------------------------------------- commit e7bea17d70e422dfdd16d50b531e469b4d5e3cc5 Author: Ben Gamari Date: Sun Jan 17 19:26:03 2016 +0100 users-guide: Clean manpage build artifacts and fix usage of clean-target Test Plan: Build then clean Reviewers: austin, thomie Reviewed By: thomie Differential Revision: https://phabricator.haskell.org/D1786 GHC Trac Issues: #11433 (cherry picked from commit d1ce1aa9beed4d3ecd3a0324ae4c98625fbe8d33) >--------------------------------------------------------------- e7bea17d70e422dfdd16d50b531e469b4d5e3cc5 docs/users_guide/ghc.mk | 2 ++ rules/sphinx.mk | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/users_guide/ghc.mk b/docs/users_guide/ghc.mk index 83cf60a..9144a07 100644 --- a/docs/users_guide/ghc.mk +++ b/docs/users_guide/ghc.mk @@ -30,6 +30,8 @@ $(MAN_PAGES): $(docs/users_guide_MAN_RST_SOURCES) $(utils/mkUserGuidePart_GENERA $(SPHINXBUILD) -b man -d docs/users_guide/.doctrees-man docs/users_guide docs/users_guide/build-man endif +$(eval $(call clean-target,users-guide,manpage,docs/users_guide/.doctrees-man/ docs/users_guide/build-man/)) + man : $(MAN_PAGES) ifeq "$(BUILD_MAN)" "YES" diff --git a/rules/sphinx.mk b/rules/sphinx.mk index 5a3c7ce..7337242 100644 --- a/rules/sphinx.mk +++ b/rules/sphinx.mk @@ -22,7 +22,7 @@ $(call profStart, sphinx($1,$2)) # $1 = dir # $2 = docname -$(call clean-target,$1,sphinx,$1/.doctrees-html/ $1/.doctrees-pdf/ $1/build-html/ $1/build-pdf/ $1/$2.pdf) +$(eval $(call clean-target,$1,sphinx,$1/.doctrees-html/ $1/.doctrees-pdf/ $1/build-html/ $1/build-pdf/ $1/$2.pdf)) # empty "all_$1" target just in case we're not building docs at all $(call all-target,$1,) From git at git.haskell.org Mon Jan 18 12:24:28 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 18 Jan 2016 12:24:28 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Add testcase for #11414 (1f1a6aa) Message-ID: <20160118122428.7D7C63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/1f1a6aa6c209de27091f0133233e97adb76dbcbf/ghc >--------------------------------------------------------------- commit 1f1a6aa6c209de27091f0133233e97adb76dbcbf Author: Ben Gamari Date: Sun Jan 17 23:26:43 2016 +0100 Add testcase for #11414 Reviewers: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1790 GHC Trac Issues: #11414 (cherry picked from commit f3a867e8aa0f6364aa3a152ca660c3c581412484) >--------------------------------------------------------------- 1f1a6aa6c209de27091f0133233e97adb76dbcbf testsuite/tests/deSugar/should_compile/T11414.hs | 4 ++++ testsuite/tests/deSugar/should_compile/all.T | 1 + 2 files changed, 5 insertions(+) diff --git a/testsuite/tests/deSugar/should_compile/T11414.hs b/testsuite/tests/deSugar/should_compile/T11414.hs new file mode 100644 index 0000000..198c704 --- /dev/null +++ b/testsuite/tests/deSugar/should_compile/T11414.hs @@ -0,0 +1,4 @@ +{-# LANGUAGE Strict #-} + +main :: IO () +main = print $ let x = undefined in True diff --git a/testsuite/tests/deSugar/should_compile/all.T b/testsuite/tests/deSugar/should_compile/all.T index aa4f2dd..c6068c0 100644 --- a/testsuite/tests/deSugar/should_compile/all.T +++ b/testsuite/tests/deSugar/should_compile/all.T @@ -104,3 +104,4 @@ test('T10251', normal, compile, ['']) test('T10767', normal, compile, ['']) test('DsStrictWarn', normal, compile, ['']) test('T10662', normal, compile, ['-Wall']) +test('T11414', expect_broken(11414), compile, ['']) From git at git.haskell.org Mon Jan 18 12:24:31 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 18 Jan 2016 12:24:31 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: validate: Use gz compression during bindist check (526df12) Message-ID: <20160118122431.3ECF03A301@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/526df12607544c47dead378a9f5baec8dc3ab7fa/ghc >--------------------------------------------------------------- commit 526df12607544c47dead378a9f5baec8dc3ab7fa Author: Ben Gamari Date: Mon Jan 18 00:16:35 2016 +0100 validate: Use gz compression during bindist check Test Plan: validate, check that gz is used Reviewers: hvr, austin, thomie Reviewed By: thomie Differential Revision: https://phabricator.haskell.org/D1788 GHC Trac Issues: #11434 (cherry picked from commit 2fd407cd28ea1c8fccb7a93d411d1cee690fa959) >--------------------------------------------------------------- 526df12607544c47dead378a9f5baec8dc3ab7fa mk/config.mk.in | 2 +- validate | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/mk/config.mk.in b/mk/config.mk.in index 5d13f0c..7e4b327 100644 --- a/mk/config.mk.in +++ b/mk/config.mk.in @@ -776,7 +776,7 @@ GZIP_CMD = gzip XZ_CMD = xz -9e # xz is default compression -TAR_COMP = xz +TAR_COMP ?= xz # select compression command and .tar extension based on TAR_COMP value ifeq "$(TAR_COMP)" "bzip2" diff --git a/validate b/validate index 3b21002..dadd556 100755 --- a/validate +++ b/validate @@ -47,6 +47,10 @@ hpc=NO speed=NORMAL use_dph=0 be_quiet=0 +# Validate uses gzip compression for the binary distribution to avoid the rather +# heavy cost of xz, which is the typical default. The options are defined in +# mk/config.mk.in +tar_comp=gzip while [ $# -gt 0 ] do @@ -211,8 +215,8 @@ check_packages post-build if [ $speed != "FAST" ]; then - $make binary-dist-prep - $make test_bindist TEST_PREP=YES + $make binary-dist-prep TAR_COMP=$tar_comp + $make test_bindist TEST_PREP=YES TAR_COMP=$tar_comp # # Install the xhtml package into the bindist. From git at git.haskell.org Mon Jan 18 12:24:34 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 18 Jan 2016 12:24:34 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Make demand analysis understand catch (6135de3) Message-ID: <20160118122434.03AC83A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/6135de3b59d388aabbd880bc71ae44532647b9f1/ghc >--------------------------------------------------------------- commit 6135de3b59d388aabbd880bc71ae44532647b9f1 Author: Simon Peyton Jones Date: Wed Jan 6 17:40:09 2016 +0000 Make demand analysis understand catch As Trac #11222, and #10712 note, the strictness analyser needs to be rather careful about exceptions. Previously it treated them as identical to divergence, but that won't quite do. See Note [Exceptions and strictness] in Demand, which explains the deal. Getting more strictness in 'catch' and friends is a very good thing. Here is the nofib summary, keeping only the big ones. -------------------------------------------------------------------------------- Program Size Allocs Runtime Elapsed TotalMem -------------------------------------------------------------------------------- fasta -0.1% -6.9% -3.0% -3.0% +0.0% hpg -0.1% -2.0% -6.2% -6.2% +0.0% maillist -0.1% -0.3% 0.08 0.09 +1.2% reverse-complem -0.1% -10.9% -6.0% -5.9% +0.0% sphere -0.1% -4.3% 0.08 0.08 +0.0% x2n1 -0.1% -0.0% 0.00 0.00 +0.0% -------------------------------------------------------------------------------- Min -0.2% -10.9% -17.4% -17.3% +0.0% Max -0.0% +0.0% +4.3% +4.4% +1.2% Geometric Mean -0.1% -0.3% -2.9% -3.0% +0.0% On the way I did quite a bit of refactoring in Demand.hs (cherry picked from commit 9915b6564403a6d17651e9969e9ea5d7d7e78e7f) >--------------------------------------------------------------- 6135de3b59d388aabbd880bc71ae44532647b9f1 compiler/basicTypes/Demand.hs | 870 ++++++++++++--------- compiler/coreSyn/CoreArity.hs | 3 +- compiler/coreSyn/MkCore.hs | 7 +- compiler/prelude/primops.txt.pp | 47 +- compiler/stgSyn/CoreToStg.hs | 6 +- compiler/stranal/DmdAnal.hs | 14 +- compiler/stranal/WorkWrap.hs | 5 +- .../tests/deSugar/should_compile/T2431.stderr | 2 +- .../tests/numeric/should_compile/T7116.stdout | 8 +- .../tests/simplCore/should_compile/T3772.stdout | 2 +- .../tests/simplCore/should_compile/T4930.stderr | 4 +- .../simplCore/should_compile/spec-inline.stderr | 2 +- testsuite/tests/stranal/sigs/HyperStrUse.stderr | 2 +- testsuite/tests/stranal/sigs/T8598.stderr | 2 +- testsuite/tests/stranal/sigs/UnsatFun.stderr | 4 +- 15 files changed, 550 insertions(+), 428 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 6135de3b59d388aabbd880bc71ae44532647b9f1 From git at git.haskell.org Mon Jan 18 12:24:37 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 18 Jan 2016 12:24:37 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Test Trac #11379 (500ddd3) Message-ID: <20160118122437.1B4BE3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/500ddd33af85b4d91c9cee5568c11b56a372d1a7/ghc >--------------------------------------------------------------- commit 500ddd33af85b4d91c9cee5568c11b56a372d1a7 Author: Simon Peyton Jones Date: Mon Jan 18 11:53:05 2016 +0000 Test Trac #11379 (cherry picked from commit 8e50301f7514751fc5c1fcc0e2847a49041ca2e7) >--------------------------------------------------------------- 500ddd33af85b4d91c9cee5568c11b56a372d1a7 testsuite/tests/typecheck/should_compile/T11379.hs | 36 ++++++++++++++++++++++ testsuite/tests/typecheck/should_compile/all.T | 1 + 2 files changed, 37 insertions(+) diff --git a/testsuite/tests/typecheck/should_compile/T11379.hs b/testsuite/tests/typecheck/should_compile/T11379.hs new file mode 100644 index 0000000..35e27a5 --- /dev/null +++ b/testsuite/tests/typecheck/should_compile/T11379.hs @@ -0,0 +1,36 @@ +{-# LANGUAGE ExistentialQuantification, RankNTypes, MultiParamTypeClasses, + FunctionalDependencies, FlexibleInstances, FlexibleContexts + #-} + +module XMonad.Layout.MultiToggle where + +import Data.Typeable + +-- This appears to be the culprit +expand :: (HList ts a) => MultiToggleS ts l a -> MultiToggle ts l a +expand (MultiToggleS b ts) = + resolve ts id + (\x mt -> let g = transform' x in mt{ currLayout = g $ currLayout mt }) + (MultiToggle (EL b id) ts) + +class (Typeable t) => Transformer t a | t -> a where + transform :: t + -> l a + -> (forall l'. l' a -> (l' a -> l a) -> b) + -> b + +data EL l a = forall l'. EL (l' a) (l' a -> l a) + +transform' :: (Transformer t a) => t -> EL l a -> EL l a +transform' t (EL l det) = undefined + +data MultiToggleS ts l a = MultiToggleS (l a) ts + deriving (Read, Show) + +data MultiToggle ts l a = MultiToggle{ + currLayout :: EL l a, + transformers :: ts + } + +class HList c a where + resolve :: c -> b -> (forall t. (Transformer t a) => t -> b) -> b diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T index bf43716..46ab53b 100644 --- a/testsuite/tests/typecheck/should_compile/all.T +++ b/testsuite/tests/typecheck/should_compile/all.T @@ -488,3 +488,4 @@ test('T11237', normal, compile, ['']) test('T10592', normal, compile, ['']) test('T11305', normal, compile, ['']) test('T11254', normal, compile, ['']) +test('T11379', normal, compile, ['']) From git at git.haskell.org Mon Jan 18 12:24:39 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 18 Jan 2016 12:24:39 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: un-wire-in error, undefined, CallStack, and IP (b31aafb) Message-ID: <20160118122439.DC35E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/b31aafb7064480055e067924e0ecfcf47e3082b0/ghc >--------------------------------------------------------------- commit b31aafb7064480055e067924e0ecfcf47e3082b0 Author: Eric Seidel Date: Mon Jan 18 09:45:23 2016 +0100 un-wire-in error, undefined, CallStack, and IP I missed a crucial step in the wiring-in process of `CallStack` in D861, the bit where you actually wire-in the Name... This led to a nasty bug where GHC thought `CallStack` was not wired-in and tried to fingerprint it, which failed because the defining module was not loaded. But we don't need `CallStack` to be wired-in anymore since `error` and `undefined` no longer need to be wired-in. So we just remove them all. Updates haddock submodule. Test Plan: `./validate` and `make slowtest TEST=tc198` Reviewers: simonpj, goldfire, austin, hvr, bgamari Reviewed By: simonpj, bgamari Subscribers: goldfire, thomie Projects: #ghc Differential Revision: https://phabricator.haskell.org/D1739 GHC Trac Issues: #11331 (cherry picked from commit a7b751db766bd456ace4f76a861e5e8b927d8f17) >--------------------------------------------------------------- b31aafb7064480055e067924e0ecfcf47e3082b0 compiler/coreSyn/MkCore.hs | 56 +++------------------------------- compiler/iface/IfaceType.hs | 4 +-- compiler/main/HscTypes.hs | 2 +- compiler/prelude/PrelNames.hs | 35 ++++++++++----------- compiler/prelude/TysWiredIn.hs | 66 ---------------------------------------- compiler/typecheck/TcBinds.hs | 6 ++-- compiler/typecheck/TcExpr.hs | 1 + compiler/typecheck/TcGenDeriv.hs | 6 ++-- compiler/typecheck/TcHsType.hs | 1 + compiler/typecheck/TcInteract.hs | 6 ++-- compiler/typecheck/TcRnTypes.hs | 7 +++-- compiler/types/TyCoRep.hs | 2 +- compiler/types/Type.hs | 6 ++-- libraries/base/GHC/Err.hs | 14 ++++++--- utils/haddock | 2 +- 15 files changed, 53 insertions(+), 161 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc b31aafb7064480055e067924e0ecfcf47e3082b0 From git at git.haskell.org Mon Jan 18 12:24:42 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 18 Jan 2016 12:24:42 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: users-guide: Begin documenting --frontend (c94ef29) Message-ID: <20160118122442.B52883A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/c94ef2928a99cede690be7357e39d3274255e1e4/ghc >--------------------------------------------------------------- commit c94ef2928a99cede690be7357e39d3274255e1e4 Author: Ben Gamari Date: Mon Jan 18 10:11:25 2016 +0100 users-guide: Begin documenting --frontend See #11448. (cherry picked from commit 1dcb7d51a4dbe459e00ef22272b0bdd57cfcde4a) >--------------------------------------------------------------- c94ef2928a99cede690be7357e39d3274255e1e4 docs/users_guide/extending_ghc.rst | 2 +- docs/users_guide/using.rst | 10 +++++++++- utils/mkUserGuidePart/Options/Modes.hs | 8 +++++++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/docs/users_guide/extending_ghc.rst b/docs/users_guide/extending_ghc.rst index 74bba91..17d061e 100644 --- a/docs/users_guide/extending_ghc.rst +++ b/docs/users_guide/extending_ghc.rst @@ -590,7 +590,7 @@ A frontend plugin allows you to add new major modes to GHC. You may prefer this over a traditional program which calls the GHC API, as GHC manages a lot of parsing flags and administrative nonsense which can be difficult to manage manually. To load a frontend plugin exported by ``Foo.FrontendPlugin``, -we just invoke GHC as follows: +we just invoke GHC with the :ghc-flag:`--frontend` flag as follows: .. code-block:: none diff --git a/docs/users_guide/using.rst b/docs/users_guide/using.rst index a600a13..91b6291 100644 --- a/docs/users_guide/using.rst +++ b/docs/users_guide/using.rst @@ -281,12 +281,20 @@ The available mode flags are: .. ghc-flag:: -M .. index:: - single: dependency-generation mode; of GHC + single: dependency-generation mode; of GHC Dependency-generation mode. In this mode, GHC can be used to generate dependency information suitable for use in a ``Makefile``. See :ref:`makefile-dependencies`. +.. ghc-flag:: --frontend + + .. index:: + single: frontend plugins; using + + Run GHC using the given frontend plugin. See :ref:`frontend_plugins` for + details. + .. ghc-flag:: --mk-dll .. index:: diff --git a/utils/mkUserGuidePart/Options/Modes.hs b/utils/mkUserGuidePart/Options/Modes.hs index 57aaef2..792ee9f 100644 --- a/utils/mkUserGuidePart/Options/Modes.hs +++ b/utils/mkUserGuidePart/Options/Modes.hs @@ -32,10 +32,16 @@ modeOptions = } , flag { flagName = "-M" , flagDescription = - "denerate dependency information suitable for use in a "++ + "generate dependency information suitable for use in a "++ "``Makefile``; see :ref:`makefile-dependencies` for details." , flagType = ModeFlag } + , flag { flagName = "--frontend ?module?" + , flagDescription = + "run GHC with the given frontend plugin; see "++ + ":ref:`frontend_plugins` for details." + , flagType = ModeFlag + } , flag { flagName = "--supported-extensions, --supported-languages" , flagDescription = "display the supported language extensions" , flagType = ModeFlag From git at git.haskell.org Mon Jan 18 12:24:46 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 18 Jan 2016 12:24:46 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Fix typecheck of default associated type decls (3b1dae2) Message-ID: <20160118122446.6A5913A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/3b1dae2267241fa6a959e5d9785e20f712c11af0/ghc >--------------------------------------------------------------- commit 3b1dae2267241fa6a959e5d9785e20f712c11af0 Author: Simon Peyton Jones Date: Mon Jan 18 10:43:47 2016 +0000 Fix typecheck of default associated type decls This bug was thrown up by Trac #11361, but I found that the problem was deeper: GHC was allowing class C a where type F (a :: k) :: * type F (x :: *) = x -- Not right! (Which is now indexed-types/should_compile/T11361a.) Anyway the fix is relatively simple; use tcMatchTys in tcDefaultAssocDecl. Merge to 8.0 branch. (cherry picked from commit cb24e684759f3d181a104cde76f0f95da896a7ef) >--------------------------------------------------------------- 3b1dae2267241fa6a959e5d9785e20f712c11af0 compiler/typecheck/TcTyClsDecls.hs | 67 +++++++++++++++------- .../should_compile/T11361.hs} | 5 +- .../tests/indexed-types/should_compile/T11361a.hs | 7 +++ .../indexed-types/should_compile/T11361a.stderr | 5 ++ testsuite/tests/indexed-types/should_compile/all.T | 2 + 5 files changed, 65 insertions(+), 21 deletions(-) diff --git a/compiler/typecheck/TcTyClsDecls.hs b/compiler/typecheck/TcTyClsDecls.hs index e60fdca..a9c7c81 100644 --- a/compiler/typecheck/TcTyClsDecls.hs +++ b/compiler/typecheck/TcTyClsDecls.hs @@ -974,42 +974,64 @@ tcDefaultAssocDecl _ (d1:_:_) tcDefaultAssocDecl fam_tc [L loc (TyFamEqn { tfe_tycon = L _ tc_name , tfe_pats = hs_tvs , tfe_rhs = rhs })] - = setSrcSpan loc $ + | HsQTvs { hsq_implicit = imp_vars, hsq_explicit = exp_vars } <- hs_tvs + = -- See Note [Type-checking default assoc decls] + setSrcSpan loc $ tcAddFamInstCtxt (ptext (sLit "default type instance")) tc_name $ do { traceTc "tcDefaultAssocDecl" (ppr tc_name) - ; let shape@(fam_name, fam_pat_arity, _) = famTyConShape fam_tc - fam_tc_tvs = tyConTyVars fam_tc + ; let shape@(fam_tc_name, fam_arity, _) = famTyConShape fam_tc -- Kind of family check - ; checkTc (isTypeFamilyTyCon fam_tc) (wrongKindOfFamily fam_tc) + ; ASSERT( fam_tc_name == tc_name ) + checkTc (isTypeFamilyTyCon fam_tc) (wrongKindOfFamily fam_tc) -- Arity check - ; ASSERT( fam_name == tc_name ) - checkTc (length (hsQTvExplicit hs_tvs) == fam_pat_arity) - (wrongNumberOfParmsErr fam_pat_arity) + ; checkTc (length exp_vars == fam_arity) + (wrongNumberOfParmsErr fam_arity) -- Typecheck RHS - -- Oddly, we don't pass in any enclosing class info, and we treat - -- this as a top-level type instance. Type family defaults are renamed - -- outside the scope of their enclosing class and so the ClsInfo would - -- be of no use. - ; let HsQTvs { hsq_implicit = imp_vars, hsq_explicit = exp_vars } = hs_tvs - pats = HsIB { hsib_vars = imp_vars ++ map hsLTyVarName exp_vars + ; let pats = HsIB { hsib_vars = imp_vars ++ map hsLTyVarName exp_vars , hsib_body = map hsLTyVarBndrToType exp_vars } -- NB: Use tcFamTyPats, not tcTyClTyVars. The latter expects to get -- the LHsQTyVars used for declaring a tycon, but the names here -- are different. - ; (ktvs, rhs_ty) + ; (pats', rhs_ty) <- tcFamTyPats shape Nothing pats - (discardResult . tcCheckLHsType rhs) $ \ktvs _ rhs_kind -> + (discardResult . tcCheckLHsType rhs) $ \_ pats' rhs_kind -> do { rhs_ty <- solveEqualities $ tcCheckLHsType rhs rhs_kind - ; return (ktvs, rhs_ty) } - + ; return (pats', rhs_ty) } + -- pats' is fully zonked already ; rhs_ty <- zonkTcTypeToType emptyZonkEnv rhs_ty - ; let subst = zipTopTCvSubst ktvs (mkTyVarTys fam_tc_tvs) - ; return ( Just (substTy subst rhs_ty, loc) ) } - -- We check for well-formedness and validity later, in checkValidClass + + -- See Note [Type-checking default assoc decls] + ; case tcMatchTys pats' (mkTyVarTys (tyConTyVars fam_tc)) of + Just subst -> return ( Just (substTy subst rhs_ty, loc) ) + Nothing -> failWithTc (defaultAssocKindErr fam_tc) + -- We check for well-formedness and validity later, + -- in checkValidClass + } + +{- Note [Type-checking default assoc decls] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Consider this default declaration for an associated type + + class C a where + type F (a :: k) b :: * + type F x y = Proxy x -> y + +Note that the class variable 'a' doesn't scope over the default assoc +decl (rather oddly I think), and (less oddly) neither does the second +argument 'b' of the associated type 'F', or the kind variable 'k'. +Instead, the default decl is treated more like a top-level type +instance. + +However we store the default rhs (Proxy x -> y) in F's TyCon, using +F's own type variables, so we need to convert it to (Proxy a -> b). +We do this by calling tcMatchTys to match them up. This also ensures +that x's kind matches a's and similarly for y and b. The error +message isnt' great, mind you. (Trac #11361 was caused by not doing a +proper tcMatchTys here.) -} ------------------------- kcTyFamInstEqn :: FamTyConShape -> LTyFamInstEqn Name -> TcM () @@ -2550,6 +2572,11 @@ wrongNumberOfParmsErr max_args = ptext (sLit "Number of parameters must match family declaration; expected") <+> ppr max_args +defaultAssocKindErr :: TyCon -> SDoc +defaultAssocKindErr fam_tc + = ptext (sLit "Kind mis-match on LHS of default declaration for") + <+> quotes (ppr fam_tc) + wrongTyFamName :: Name -> Name -> SDoc wrongTyFamName fam_tc_name eqn_tc_name = hang (ptext (sLit "Mismatched type name in type family instance.")) diff --git a/testsuite/tests/typecheck/should_compile/tc253.hs b/testsuite/tests/indexed-types/should_compile/T11361.hs similarity index 83% copy from testsuite/tests/typecheck/should_compile/tc253.hs copy to testsuite/tests/indexed-types/should_compile/T11361.hs index 2fd528b..61b412a 100644 --- a/testsuite/tests/typecheck/should_compile/tc253.hs +++ b/testsuite/tests/indexed-types/should_compile/T11361.hs @@ -1,7 +1,10 @@ {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE UndecidableInstances #-} -- this is needed because |FamHelper a x| /< |Fam a x| -module ShouldCompile where +{-# OPTIONS_GHC -dinitial-unique=16777000 -dunique-increment=-1 #-} + -- This is what made GHC crash before + +module T11361 where class Cls a where type Fam a b :: * diff --git a/testsuite/tests/indexed-types/should_compile/T11361a.hs b/testsuite/tests/indexed-types/should_compile/T11361a.hs new file mode 100644 index 0000000..66ab056 --- /dev/null +++ b/testsuite/tests/indexed-types/should_compile/T11361a.hs @@ -0,0 +1,7 @@ +{-# LANGUAGE TypeFamilies, PolyKinds #-} + +module T11361a where + +class C a where + type F (a :: k) :: * + type F (x :: *) = x -- Not right! diff --git a/testsuite/tests/indexed-types/should_compile/T11361a.stderr b/testsuite/tests/indexed-types/should_compile/T11361a.stderr new file mode 100644 index 0000000..f7052ae --- /dev/null +++ b/testsuite/tests/indexed-types/should_compile/T11361a.stderr @@ -0,0 +1,5 @@ + +T11361a.hs:7:3: error: + ? Kind mis-match on LHS of default declaration for ?F? + ? In the default type instance declaration for ?F? + In the class declaration for ?C? diff --git a/testsuite/tests/indexed-types/should_compile/all.T b/testsuite/tests/indexed-types/should_compile/all.T index fe2688e..28ea8bd 100644 --- a/testsuite/tests/indexed-types/should_compile/all.T +++ b/testsuite/tests/indexed-types/should_compile/all.T @@ -271,3 +271,5 @@ test('T10318', normal, compile, ['']) test('UnusedTyVarWarnings', normal, compile, ['-W']) test('UnusedTyVarWarningsNamedWCs', normal, compile, ['-W']) test('T11408', normal, compile, ['']) +test('T11361', normal, compile, ['']) +test('T11361a', normal, compile_fail, ['']) From git at git.haskell.org Mon Jan 18 13:05:34 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 18 Jan 2016 13:05:34 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: White space only (ff333a4) Message-ID: <20160118130534.AD8283A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/ff333a45c2bad9d61927204fecf1ab3396b20acd/ghc >--------------------------------------------------------------- commit ff333a45c2bad9d61927204fecf1ab3396b20acd Author: Simon Peyton Jones Date: Mon Jan 11 09:02:01 2016 +0000 White space only (cherry picked from commit b7e5c302173f420780a1fdc8b599549298d286c3) >--------------------------------------------------------------- ff333a45c2bad9d61927204fecf1ab3396b20acd compiler/typecheck/TcDeriv.hs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/compiler/typecheck/TcDeriv.hs b/compiler/typecheck/TcDeriv.hs index e351f28..c790956 100644 --- a/compiler/typecheck/TcDeriv.hs +++ b/compiler/typecheck/TcDeriv.hs @@ -1567,18 +1567,15 @@ mkNewTypeEqn dflags overlap_mode tvs -- we are gong to get all the methods for the newtype -- dictionary - -- Next we figure out what superclass dictionaries to use -- See Note [Newtype deriving superclasses] above - cls_tyvars = classTyVars cls - dfun_tvs = tyCoVarsOfTypes inst_tys - inst_ty = mkTyConApp tycon tc_args - inst_tys = cls_tys ++ [inst_ty] - sc_theta = - mkThetaOrigin DerivOrigin TypeLevel $ - substTheta (zipOpenTCvSubst cls_tyvars inst_tys) (classSCTheta cls) - + dfun_tvs = tyCoVarsOfTypes inst_tys + inst_ty = mkTyConApp tycon tc_args + inst_tys = cls_tys ++ [inst_ty] + sc_theta = mkThetaOrigin DerivOrigin TypeLevel $ + substTheta (zipOpenTCvSubst cls_tyvars inst_tys) $ + classSCTheta cls -- Next we collect Coercible constraints between -- the Class method types, instantiated with the representation and the From git at git.haskell.org Mon Jan 18 13:05:37 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 18 Jan 2016 13:05:37 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Refactoring on IdInfo and system derived names (b8fcf05) Message-ID: <20160118130537.962CA3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/b8fcf0556a458eeea720cc89ae5bf4fc25849de2/ghc >--------------------------------------------------------------- commit b8fcf0556a458eeea720cc89ae5bf4fc25849de2 Author: Simon Peyton Jones Date: Fri Jan 15 17:30:30 2016 +0000 Refactoring on IdInfo and system derived names Some modest refactoring, triggered in part by Trac #11051 * Kill off PatSynId, ReflectionId in IdDetails They were barely used, and only for pretty-printing * Add helper function Id.mkExportedVanillaId, and use it * Polish up OccName.isDerivedOccName, as a predicate for definitions generated internally by GHC, which we might not want to show to the user. * Kill off unused OccName.mkDerivedTyConOcc * Shorten the derived OccNames for newtype and data instance axioms * A bit of related refactoring around newFamInstAxiomName (cherry picked from commit ec8a188a927a4db2e709541765e5ef545eae284c) >--------------------------------------------------------------- b8fcf0556a458eeea720cc89ae5bf4fc25849de2 compiler/basicTypes/Id.hs | 6 ++- compiler/basicTypes/IdInfo.hs | 13 ----- compiler/basicTypes/OccName.hs | 23 ++++---- compiler/deSugar/DsExpr.hs | 3 +- compiler/iface/MkIface.hs | 5 -- compiler/typecheck/TcEnv.hs | 9 ++-- compiler/typecheck/TcInstDcls.hs | 5 +- compiler/typecheck/TcRnDriver.hs | 13 +++-- compiler/typecheck/TcTyClsDecls.hs | 51 +++++++++--------- compiler/typecheck/TcTyDecls.hs | 2 +- compiler/typecheck/TcTypeable.hs | 7 ++- .../tests/deSugar/should_compile/T2431.stderr | 6 +-- testsuite/tests/ghci/scripts/T4175.stdout | 22 ++++---- testsuite/tests/ghci/scripts/T7939.stdout | 2 +- .../indexed-types/should_compile/T3017.stderr | 7 ++- .../tests/numeric/should_compile/T7116.stdout | 2 +- .../tests/partial-sigs/should_compile/ADT.stderr | 3 +- .../should_compile/DataFamilyInstanceLHS.stderr | 14 ++++- .../NamedWildcardInDataFamilyInstanceLHS.stderr | 14 ++++- .../NamedWildcardInTypeFamilyInstanceLHS.stderr | 6 +-- .../partial-sigs/should_compile/SkipMany.stderr | 4 +- .../should_compile/TypeFamilyInstanceLHS.stderr | 6 +-- testsuite/tests/roles/should_compile/Roles1.stderr | 9 +++- .../tests/roles/should_compile/Roles13.stderr | 28 ++++++---- .../tests/roles/should_compile/Roles14.stderr | 17 ++++-- testsuite/tests/roles/should_compile/Roles2.stderr | 24 +++++++-- testsuite/tests/roles/should_compile/Roles3.stderr | 62 ++++++++++++++++------ testsuite/tests/roles/should_compile/Roles4.stderr | 32 +++++++---- testsuite/tests/roles/should_compile/T8958.stderr | 45 +++++++++++----- .../tests/simplCore/should_compile/T3717.stderr | 2 +- .../tests/simplCore/should_compile/T3772.stdout | 2 +- .../tests/simplCore/should_compile/T4201.stdout | 2 +- .../tests/simplCore/should_compile/T4908.stderr | 2 +- .../tests/simplCore/should_compile/T4930.stderr | 2 +- .../tests/simplCore/should_compile/T7360.stderr | 10 ++-- .../tests/simplCore/should_compile/T9400.stderr | 2 +- .../simplCore/should_compile/spec-inline.stderr | 2 +- .../tests/typecheck/should_compile/tc231.stderr | 8 ++- 38 files changed, 288 insertions(+), 184 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc b8fcf0556a458eeea720cc89ae5bf4fc25849de2 From git at git.haskell.org Mon Jan 18 13:05:40 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 18 Jan 2016 13:05:40 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Add Trac #11427 to Note [Recursive superclasses] (cfaeaf4) Message-ID: <20160118130540.5009D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/cfaeaf41388f80e0e0e343e849824fea5dac7763/ghc >--------------------------------------------------------------- commit cfaeaf41388f80e0e0e343e849824fea5dac7763 Author: Simon Peyton Jones Date: Fri Jan 15 17:33:35 2016 +0000 Add Trac #11427 to Note [Recursive superclasses] (cherry picked from commit 8e6a68d49a4f2ffd49990dc6b84135d93015d3f8) >--------------------------------------------------------------- cfaeaf41388f80e0e0e343e849824fea5dac7763 compiler/typecheck/TcInstDcls.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/typecheck/TcInstDcls.hs b/compiler/typecheck/TcInstDcls.hs index 4f04568..5fc09ea 100644 --- a/compiler/typecheck/TcInstDcls.hs +++ b/compiler/typecheck/TcInstDcls.hs @@ -1028,7 +1028,7 @@ See Trac #3731, #4809, #5751, #5913, #6117, #6161, which all describe somewhat more complicated situations, but ones encountered in practice. -See also tests tcrun020, tcrun021, tcrun033 +See also tests tcrun020, tcrun021, tcrun033, and Trac #11427. ----- THE PROBLEM -------- The problem is that it is all too easy to create a class whose From git at git.haskell.org Mon Jan 18 13:05:43 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 18 Jan 2016 13:05:43 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Layout only (4d85c62) Message-ID: <20160118130543.09F303A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/4d85c62558a9961b827fa03dd4e5a49848fe1880/ghc >--------------------------------------------------------------- commit 4d85c62558a9961b827fa03dd4e5a49848fe1880 Author: Simon Peyton Jones Date: Mon Jan 18 10:37:09 2016 +0000 Layout only (cherry picked from commit f02200f1516bd1dc850eff5aa642f300f21503fd) >--------------------------------------------------------------- 4d85c62558a9961b827fa03dd4e5a49848fe1880 compiler/typecheck/TcHsType.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/typecheck/TcHsType.hs b/compiler/typecheck/TcHsType.hs index 421df69..114bcec 100644 --- a/compiler/typecheck/TcHsType.hs +++ b/compiler/typecheck/TcHsType.hs @@ -741,7 +741,8 @@ tcInferArgs fun fun_kind mb_kind_info args ; let (invis_bndrs, really_res_kind) = splitPiTysInvisible res_kind ; (subst, invis_args) <- tcInstBindersX emptyTCvSubst mb_kind_info invis_bndrs - ; return ( substTy subst really_res_kind, args' `chkAppend` invis_args + ; return ( substTy subst really_res_kind + , args' `chkAppend` invis_args , leftovers, n ) } -- | See comments for 'tcInferArgs'. But this version does not instantiate From git at git.haskell.org Mon Jan 18 13:05:45 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 18 Jan 2016 13:05:45 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Improve debug printing/warnings (00b64a5) Message-ID: <20160118130545.B6EB63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/00b64a5dbbce2076df8900dae4e0bc9bd66f1506/ghc >--------------------------------------------------------------- commit 00b64a5dbbce2076df8900dae4e0bc9bd66f1506 Author: Simon Peyton Jones Date: Mon Jan 11 09:02:25 2016 +0000 Improve debug printing/warnings (cherry picked from commit 6e0c0fd2e09c552bf38e22645347dbb2e7327e8e) >--------------------------------------------------------------- 00b64a5dbbce2076df8900dae4e0bc9bd66f1506 compiler/typecheck/TcRnTypes.hs | 4 +++- compiler/typecheck/TcSMonad.hs | 5 ++++- compiler/typecheck/TcSimplify.hs | 3 ++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/compiler/typecheck/TcRnTypes.hs b/compiler/typecheck/TcRnTypes.hs index 401aa85..6bb3e16 100644 --- a/compiler/typecheck/TcRnTypes.hs +++ b/compiler/typecheck/TcRnTypes.hs @@ -1773,7 +1773,9 @@ instance Outputable Ct where CTyEqCan {} -> text "CTyEqCan" CFunEqCan {} -> text "CFunEqCan" CNonCanonical {} -> text "CNonCanonical" - CDictCan {} -> text "CDictCan" + CDictCan { cc_pend_sc = pend_sc } + | pend_sc -> text "CDictCan(psc)" + | otherwise -> text "CDictCan" CIrredEvCan {} -> text "CIrredEvCan" CHoleCan { cc_occ = occ } -> text "CHoleCan:" <+> ppr occ diff --git a/compiler/typecheck/TcSMonad.hs b/compiler/typecheck/TcSMonad.hs index 073def1..9777ce9 100644 --- a/compiler/typecheck/TcSMonad.hs +++ b/compiler/typecheck/TcSMonad.hs @@ -13,7 +13,8 @@ module TcSMonad ( updWorkListTcS, -- The TcS monad - TcS, runTcS, runTcSDeriveds, runTcSWithEvBinds, failTcS, + TcS, runTcS, runTcSDeriveds, runTcSWithEvBinds, + failTcS, warnTcS, runTcSEqualities, nestTcS, nestImplicTcS, @@ -2318,7 +2319,9 @@ wrapWarnTcS :: TcM a -> TcS a wrapWarnTcS = wrapTcS failTcS, panicTcS :: SDoc -> TcS a +warnTcS :: SDoc -> TcS () failTcS = wrapTcS . TcM.failWith +warnTcS = wrapTcS . TcM.addWarn panicTcS doc = pprPanic "TcCanonical" doc traceTcS :: String -> SDoc -> TcS () diff --git a/compiler/typecheck/TcSimplify.hs b/compiler/typecheck/TcSimplify.hs index 8d49410..33ee1da 100644 --- a/compiler/typecheck/TcSimplify.hs +++ b/compiler/typecheck/TcSimplify.hs @@ -1033,7 +1033,7 @@ simpl_loop n limit floated_eqs no_new_scs = return wc -- Done! | n `intGtLimit` limit - = failTcS (hang (ptext (sLit "solveWanteds: too many iterations") + = do { warnTcS (hang (ptext (sLit "solveWanteds: too many iterations") <+> parens (ptext (sLit "limit =") <+> ppr limit)) 2 (vcat [ ptext (sLit "Unsolved:") <+> ppr wc , ppUnless (isEmptyBag floated_eqs) $ @@ -1042,6 +1042,7 @@ simpl_loop n limit floated_eqs no_new_scs ptext (sLit "New superclasses found") , ptext (sLit "Set limit with -fconstraint-solver-iterations=n; n=0 for no limit") ])) + ; return wc } | otherwise = do { traceTcS "simpl_loop, iteration" (int n) From git at git.haskell.org Mon Jan 18 13:05:48 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 18 Jan 2016 13:05:48 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Simplify API to tcMatchTys (8e6ec66) Message-ID: <20160118130548.959103A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/8e6ec665df52a14436be6c55771aed1afc7d4685/ghc >--------------------------------------------------------------- commit 8e6ec665df52a14436be6c55771aed1afc7d4685 Author: Simon Peyton Jones Date: Mon Jan 18 10:34:48 2016 +0000 Simplify API to tcMatchTys Previously tcMatchTys took a set of "template type variables" to bind. But all the calls are top-level, and we always want to bind all variables in the template. So I simplified the API by omitting that argument. There should be no change in behaviour. Feel free to merge to 8.0 if it helps in merging other patches (cherry picked from commit 5a62b6ac0c44319e1a0b56a4300359fd25d3d818) >--------------------------------------------------------------- 8e6ec665df52a14436be6c55771aed1afc7d4685 compiler/typecheck/FunDeps.hs | 5 ++--- compiler/typecheck/TcErrors.hs | 2 +- compiler/typecheck/TcSimplify.hs | 3 +-- compiler/typecheck/TcTyClsDecls.hs | 23 +++++++++----------- compiler/typecheck/TcValidity.hs | 4 +--- compiler/types/FamInstEnv.hs | 14 ++++++------- compiler/types/InstEnv.hs | 13 ++++++------ compiler/types/Unify.hs | 43 +++++++++++++++++++------------------- 8 files changed, 49 insertions(+), 58 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 8e6ec665df52a14436be6c55771aed1afc7d4685 From git at git.haskell.org Mon Jan 18 13:05:51 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 18 Jan 2016 13:05:51 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Typo in comment (30d0313) Message-ID: <20160118130551.539583A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/30d0313dc177441bc68df4377cefeac5631cf008/ghc >--------------------------------------------------------------- commit 30d0313dc177441bc68df4377cefeac5631cf008 Author: Simon Peyton Jones Date: Mon Jan 18 11:55:20 2016 +0000 Typo in comment (cherry picked from commit 54128992b2ae8b18816e74fd02bc49833dda031e) >--------------------------------------------------------------- 30d0313dc177441bc68df4377cefeac5631cf008 compiler/typecheck/TcSMonad.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/typecheck/TcSMonad.hs b/compiler/typecheck/TcSMonad.hs index 9777ce9..7921603 100644 --- a/compiler/typecheck/TcSMonad.hs +++ b/compiler/typecheck/TcSMonad.hs @@ -1117,7 +1117,7 @@ Note [Adding an inert canonical constraint the InertCans] * [Given/Wanted] a ~N ty 1. Add it to inert_eqs 2. Emit [D] a~ty - As a result of (2), the current model will rewrite teh new [D] a~ty + As a result of (2), the current model will rewrite the new [D] a~ty during canonicalisation, and then it'll be added to the model using the steps of [Derived] above. From git at git.haskell.org Mon Jan 18 13:05:54 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 18 Jan 2016 13:05:54 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Implement scoped type variables in pattern synonyms (8c10ee3) Message-ID: <20160118130554.8290F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/8c10ee3cacdd4f88561751e96831435397aef4e9/ghc >--------------------------------------------------------------- commit 8c10ee3cacdd4f88561751e96831435397aef4e9 Author: Simon Peyton Jones Date: Fri Jan 15 17:45:02 2016 +0000 Implement scoped type variables in pattern synonyms This fixes Trac #11351. The implementation is pretty simple, happily. I took the opportunity to re-order the prov/req context in builder-ids, which was confusingly backwards. (cherry picked from commit e2c7b7ee976dcabf12002265ddbe58017b794cb8) >--------------------------------------------------------------- 8c10ee3cacdd4f88561751e96831435397aef4e9 compiler/basicTypes/PatSyn.hs | 4 +- compiler/deSugar/DsExpr.hs | 6 +- compiler/rename/RnBinds.hs | 29 +++++---- compiler/typecheck/TcBinds.hs | 9 ++- compiler/typecheck/TcHsType.hs | 2 +- compiler/typecheck/TcPat.hs | 3 +- compiler/typecheck/TcPatSyn.hs | 82 +++++++++++++++++-------- compiler/typecheck/TcPatSyn.hs-boot | 4 +- compiler/typecheck/TcRnTypes.hs | 8 ++- testsuite/tests/patsyn/should_compile/T11351.hs | 23 +++++++ testsuite/tests/patsyn/should_compile/all.T | 1 + 11 files changed, 120 insertions(+), 51 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 8c10ee3cacdd4f88561751e96831435397aef4e9 From git at git.haskell.org Mon Jan 18 13:13:59 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 18 Jan 2016 13:13:59 +0000 (UTC) Subject: [commit: ghc] wip/gadtpm: Overhaul the Overhauled Pattern Match Checker (cd12c8d) Message-ID: <20160118131359.145903A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/gadtpm Link : http://ghc.haskell.org/trac/ghc/changeset/cd12c8dc2cbd7d2c1916c1598a1ef4edeb50bebc/ghc >--------------------------------------------------------------- commit cd12c8dc2cbd7d2c1916c1598a1ef4edeb50bebc Author: George Karachalias Date: Mon Jan 18 14:07:57 2016 +0100 Overhaul the Overhauled Pattern Match Checker Summary: * Changed the representation of Value Set Abstractions. Instead of using a prefix tree, we now use a list of Value Vector Abstractions. The set of constraints `Delta` for every Value Vector Abstraction is the oracle state so that we solve everything only once. * Instead of doing everything lazily, we prune at once (and in general everything is much stricter). Hence, an example written with pattern guards is checked in almost the same time as the equivalent with pattern matching. * Do not store the covered and the divergent sets at all. Since what we only need is a yes/no (does this clause cover anything? Does it force any thunk?) We just keep a boolean for each. * Removed flags -Wtoo-many-guards and -ffull-guard-reasoning. The checker does not seem to explode anymore. Even if it does, we can instead set a number of iterations (possibly settable by the user) for the checker which is much cleaner (Still a TODO). * When a guard is for sure not going to contribute anything, we treat it as such: The oracle is not called and cases `CGuard`, `UGuard` and `DGuard` from the paper are not happening at all (the generation of a fresh variable, the unfolding of the pattern list etc.). This combined with the above seems to be enough to drop the memory increase for test T783 down to 18.7%. * Added testcases T11195, T11303b (data families) and T11374 >--------------------------------------------------------------- cd12c8dc2cbd7d2c1916c1598a1ef4edeb50bebc compiler/deSugar/Check.hs | 1037 +++++++------------- compiler/deSugar/Match.hs | 17 +- compiler/deSugar/TmOracle.hs | 19 +- compiler/ghci/RtClosureInspect.hs | 3 - compiler/main/DynFlags.hs | 8 +- compiler/nativeGen/Dwarf/Constants.hs | 4 - compiler/types/OptCoercion.hs | 4 +- docs/users_guide/8.0.1-notes.rst | 9 - docs/users_guide/bugs.rst | 10 - docs/users_guide/using-warnings.rst | 34 - libraries/base/Foreign/C/Error.hs | 1 - testsuite/tests/pmcheck/should_compile/T11195.hs | 183 ++++ testsuite/tests/pmcheck/should_compile/T11303b.hs | 25 + testsuite/tests/pmcheck/should_compile/T11374.hs | 59 ++ .../tests/pmcheck/should_compile/T2204.stderr | 7 +- .../tests/pmcheck/should_compile/T9951b.stderr | 7 +- testsuite/tests/pmcheck/should_compile/all.T | 3 + .../tests/pmcheck/should_compile/pmc001.stderr | 13 +- .../tests/pmcheck/should_compile/pmc007.stderr | 13 +- utils/mkUserGuidePart/Options/Warnings.hs | 13 - 20 files changed, 693 insertions(+), 776 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc cd12c8dc2cbd7d2c1916c1598a1ef4edeb50bebc From git at git.haskell.org Mon Jan 18 13:14:01 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 18 Jan 2016 13:14:01 +0000 (UTC) Subject: [commit: ghc] wip/gadtpm's head updated: Overhaul the Overhauled Pattern Match Checker (cd12c8d) Message-ID: <20160118131401.C31563A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Branch 'wip/gadtpm' now includes: d935d20 Omit TEST=T10697_decided_3 WAY=ghci 1dbc8d9 Add test for #10379 04f3524 Linker: ARM: Don't change to BLX if jump needed veneer c7d84d2 Update .mailmap [skip ci] 7e599f5 Linker: Move helpers to #ifdef da0f043 Rewrite Haddocks for GHC.Base.const 5c10f5c users_guide: Add ghci-cmd directive 4c56ad3 Build system: delete ghc-pwd 0acdcf2 Avoid generating guards for CoPats if possible (Addresses #11276) 1a8b752 Add (failing) test case for #11347 1f526d2 Release notes: Mention remote GHCi cdeefa4 ghc.mk: Add reference to Trac #5987 77494fa Remove -Wtoo-many-guards from default flags (fixes #11316) e32a6e1 Add Cabal synopses and descriptions bbee3e1 StgCmmForeign: Push local register creation into code generation bd702f4 StgCmmForeign: Break up long line aa699b9 Extend ghc environment file features 4dc4b84 relnotes: Note dropped support for Windows XP and earlier 852b603 Restore old GHC generics behavior vis-?-vis Fixity cac0795 Change Template Haskell representation of GADTs. 89ba83d Bump Cabal and Haddock to fix #11308 7861a22 Add a note describing the protocol for adding a language extension f01eb54 Fall back on ghc-stage2 when using Windows' GHCi driver 568736d users guide: Add documentation for custom compile-time errors 5040686 users guide: Add links to release notes 47367e0 Rewrite announce file 0a04837 users guide: Tweak wording of RTS -Nmax description 0839a66 Remove unused export 3f98045 Tiny refactor 97c49e9 Spelling in a comment 290a553 Tidy up tidySkolemInfo 4dda4ed Comment wibble 29b4632 Inline solveTopConstraints dc97096 Refactor simpl_top 02c1c57 Use an Implication in 'deriving' error a5cea73 Turn AThing into ATcTyCon, in TcTyThing 9915b65 Make demand analysis understand catch 1ee9229 Test Trac #10625 c78fedd Typos in docs and comments 6be09e8 Enable stack traces with ghci -fexternal-interpreter -prof 09425cb Support for qRecover in TH with -fexternal-interpreter 6f2e722 User's Guide: injective type families section 0163427 Fix Template Haskell's handling of infix GADT constructors 1abb700 Improve GHC.Event.IntTable performance c33e7c2 Fix +RTS -h when compiling without -prof 10769a1 Rename the test-way prof_h to normal_h 47ccf4d Add a pointer to the relevant paper for InScopeSet 2bd05b8 Docs for stack traces in GHCi f7b45c3 Build system: fix `pwd` issues on Windows 1cdf12c Fix test for T9367 (Windows) a6c3289 users_guide: Use semantic directive/role for command line options 86d0657 users-guide: A few fixes 8f60fd4 docs: Fix DeriveAnyClass reference in release notes and ANNOUNCE 67b5cec user-guide: More semantic markup 0dc2308 user-guide/safe_haskell: Fix typos a84c21e Reject import declaration with semicolon in GHCi 831102f Parser: delete rule numbers + validate shift/reduce conlicts 4405f9d Add failing testcase for #10603 5cb236d fix -ddump-splices to parenthesize ((\x -> x) a) correctly fbd6de2 Add InjectiveTypeFamilies language extension 4c9620f TrieMap: Minor documentation fix b1c063b ghc.mk: Use Windows_Target instead of Windows_Host 8e0c658 Linker: Define ELF_64BIT for aarch64_HOST_ARCH 00c8076 fix typo causing compilation failure on SPARC (ArchSparc -> ArchSPARC) 6cb860a Add -prof stack trace to assert 3e796e1 A little closer to supporting breakpoints with -fexternal-interpreter 88d6d5a Use implicit CallStacks for ASSERT when available d44bc5c TemplateHaskell: revive isStrict, notStrict and unpacked ac3cf68 Add missing type representations e782e88 Add test for Data.Typeable.typeOf c3f9246 Print a message when loading a .ghci file. 6ea24af Handle over-applied custom type errors too. c313327 Minor improvement in CoreDump outputs: c73333a Minor code refactoring 61011b4 users-guide: Wibbles 91dcc65 GHC.Generics: Fix documentation f0c4e46 Add tests for #11391 b0641ad INSTALL.md: Mention -j and other wibbles 78a4c72 Rename InjectiveTypeFamilies to TypeFamilyDependencies 4dbc31b users-guide: Update language extension implications b355b8f users-guide: Add since annotations for language extensions 83c13c2 user-guide: Use ghc-flag for dump formatting flags fd686c4 API Annotations: use AnnValue for (~) db371c1 T11300: Fix test on windows 49e414a Remove lookup of sections by name instead use the index numbers as offsets 91f1c60 Fix #11015 with a nice note. 8959b03 ANNOUNCE: Mention powerpc code generator b90cac6 user-guide: Note Cabal version limitation faf3f96 users-guide: Fix cabal version number c6a3e22 Link command line libs to temp so e7eec3a Use XZ compression by default 7cf16aa Don't output manpage in same directory as source 756b228 Refactor lookupFixityRn-related code following D1744 67fc3f3 configure.ac: Export MAKECMD to build system 443bf04 Allow pattern synonyms which have several clauses. 165ae44 Expand type/kind synonyms in TyVars before deriving-related typechecking e6ca930 Fix #11355. d4af57f Test #11252 in ghci/scripts/T11252 d459f55 Fix #10872. 6c07f14 Fix #11311 3a7f204 Clarify topological sorting of spec vars in manual 39ea4b4 Fix #11254. bafbde7 Constrained types have kind * in validity check. 072191f Fix #11404 33950aa Tiny refactoring in TcUnify 80b4c71 Fix typo in error message (#11409) 3c6635e Fix #11405. 148a50b Fix some typos 3a1babd Work SourceText in for all integer literals 9308c73 Fix a number of subtle solver bugs 3b6a490 Add missing T11408.hs ae1c48c rts/posix: Fail with HEAPOVERFLOW when out of memory during mmap cd12c8d Overhaul the Overhauled Pattern Match Checker From git at git.haskell.org Mon Jan 18 15:38:05 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 18 Jan 2016 15:38:05 +0000 (UTC) Subject: [commit: ghc] master: Fixes to "make clean" for the iserv dir (817dd92) Message-ID: <20160118153805.205093A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/817dd925569d981523bbf4fb471014d46c51c7db/ghc >--------------------------------------------------------------- commit 817dd925569d981523bbf4fb471014d46c51c7db Author: Simon Marlow Date: Mon Jan 18 06:41:19 2016 -0800 Fixes to "make clean" for the iserv dir >--------------------------------------------------------------- 817dd925569d981523bbf4fb471014d46c51c7db ghc.mk | 2 +- iserv/ghc.mk | 22 +++++++++++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/ghc.mk b/ghc.mk index 1d6f02b..0759961 100644 --- a/ghc.mk +++ b/ghc.mk @@ -670,7 +670,7 @@ BUILD_DIRS += utils/mkUserGuidePart BUILD_DIRS += docs/users_guide BUILD_DIRS += utils/count_lines BUILD_DIRS += utils/compare_sizes -ifeq "$(Windows_Host)" "NO" +ifneq "$(Windows_Host)" "YES" BUILD_DIRS += iserv endif diff --git a/iserv/ghc.mk b/iserv/ghc.mk index 4cae482..1a44352 100644 --- a/iserv/ghc.mk +++ b/iserv/ghc.mk @@ -54,11 +54,31 @@ iserv_stage2_dyn_INSTALL_INPLACE = YES $(eval $(call build-prog,iserv,stage2,1)) +ifeq "$(CLEANING)" "YES" + +NEED_iserv_p = YES +NEED_iserv_dyn = YES + +else + ifneq "$(findstring p, $(GhcLibWays))" "" -$(eval $(call build-prog,iserv,stage2_p,1)) +NEED_iserv_p = YES +else +NEED_iserv_p = NO endif ifneq "$(findstring dyn, $(GhcLibWays))" "" +NEED_iserv_dyn = YES +else +NEED_iserv_dyn = NO +endif +endif + +ifeq "$(NEED_iserv_p)" "YES" +$(eval $(call build-prog,iserv,stage2_p,1)) +endif + +ifeq "$(NEED_iserv_dyn)" "YES" $(eval $(call build-prog,iserv,stage2_dyn,1)) endif From git at git.haskell.org Mon Jan 18 18:28:28 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 18 Jan 2016 18:28:28 +0000 (UTC) Subject: [commit: ghc] master: Replace calls to `ptext . sLit` with `text` (b8abd85) Message-ID: <20160118182828.9FBC73A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/b8abd852d3674cb485490d2b2e94906c06ee6e8f/ghc >--------------------------------------------------------------- commit b8abd852d3674cb485490d2b2e94906c06ee6e8f Author: Jan Stolarek Date: Fri Jan 15 18:24:14 2016 +0100 Replace calls to `ptext . sLit` with `text` Summary: In the past the canonical way for constructing an SDoc string literal was the composition `ptext . sLit`. But for some time now we have function `text` that does the same. Plus it has some rules that optimize its runtime behaviour. This patch takes all uses of `ptext . sLit` in the compiler and replaces them with calls to `text`. The main benefits of this patch are clener (shorter) code and less dependencies between module, because many modules now do not need to import `FastString`. I don't expect any performance benefits - we mostly use SDocs to report errors and it seems there is little to be gained here. Test Plan: ./validate Reviewers: bgamari, austin, goldfire, hvr, alanz Subscribers: goldfire, thomie, mpickering Differential Revision: https://phabricator.haskell.org/D1784 >--------------------------------------------------------------- b8abd852d3674cb485490d2b2e94906c06ee6e8f compiler/basicTypes/BasicTypes.hs | 72 +++--- compiler/basicTypes/DataCon.hs | 18 +- compiler/basicTypes/Demand.hs | 5 +- compiler/basicTypes/IdInfo.hs | 27 +- compiler/basicTypes/Literal.hs | 4 +- compiler/basicTypes/Name.hs | 10 +- compiler/basicTypes/OccName.hs | 12 +- compiler/basicTypes/PatSyn.hs | 5 +- compiler/basicTypes/RdrName.hs | 30 +-- compiler/basicTypes/Var.hs | 9 +- compiler/basicTypes/VarEnv.hs | 3 +- compiler/cmm/CLabel.hs | 74 +++--- compiler/cmm/CmmLayoutStack.hs | 4 +- compiler/cmm/CmmLint.hs | 5 +- compiler/cmm/CmmType.hs | 6 +- compiler/cmm/PprC.hs | 288 ++++++++++----------- compiler/cmm/PprCmm.hs | 64 ++--- compiler/cmm/PprCmmDecl.hs | 18 +- compiler/cmm/PprCmmExpr.hs | 49 ++-- compiler/cmm/SMRep.hs | 36 +-- compiler/codeGen/StgCmmClosure.hs | 5 +- compiler/codeGen/StgCmmEnv.hs | 3 +- compiler/codeGen/StgCmmMonad.hs | 6 +- compiler/coreSyn/CoreArity.hs | 4 +- compiler/coreSyn/CoreLint.hs | 226 ++++++++-------- compiler/coreSyn/CorePrep.hs | 8 +- compiler/coreSyn/CoreStats.hs | 7 +- compiler/coreSyn/CoreSubst.hs | 14 +- compiler/coreSyn/CoreSyn.hs | 3 +- compiler/coreSyn/CoreUnfold.hs | 25 +- compiler/coreSyn/CoreUtils.hs | 18 +- compiler/coreSyn/MkCore.hs | 4 +- compiler/coreSyn/PprCore.hs | 160 ++++++------ compiler/deSugar/Check.hs | 34 +-- compiler/deSugar/Coverage.hs | 10 +- compiler/deSugar/Desugar.hs | 22 +- compiler/deSugar/DsArrows.hs | 3 +- compiler/deSugar/DsBinds.hs | 38 +-- compiler/deSugar/DsExpr.hs | 14 +- compiler/deSugar/DsForeign.hs | 24 +- compiler/deSugar/DsListComp.hs | 5 +- compiler/deSugar/DsMeta.hs | 2 +- compiler/deSugar/DsMonad.hs | 12 +- compiler/deSugar/MatchLit.hs | 16 +- compiler/deSugar/PmExpr.hs | 5 +- compiler/ghci/ByteCodeInstr.hs | 12 +- compiler/ghci/Linker.hs | 34 +-- compiler/hsSyn/Convert.hs | 36 +-- compiler/hsSyn/HsBinds.hs | 60 ++--- compiler/hsSyn/HsDecls.hs | 77 +++--- compiler/hsSyn/HsExpr.hs | 220 ++++++++-------- compiler/hsSyn/HsImpExp.hs | 18 +- compiler/hsSyn/HsPat.hs | 3 +- compiler/hsSyn/HsSyn.hs | 7 +- compiler/hsSyn/HsTypes.hs | 2 +- compiler/iface/IfaceSyn.hs | 114 ++++---- compiler/iface/IfaceType.hs | 16 +- compiler/iface/LoadIface.hs | 102 ++++---- compiler/iface/MkIface.hs | 24 +- compiler/iface/TcIface.hs | 48 ++-- compiler/main/DriverMkDepend.hs | 10 +- compiler/main/DriverPipeline.hs | 7 +- compiler/main/DynFlags.hs | 6 +- compiler/main/DynamicLoading.hs | 27 +- compiler/main/ErrUtils.hs | 7 +- compiler/main/Finder.hs | 56 ++-- compiler/main/GhcMake.hs | 18 +- compiler/main/Hooks.hs | 4 +- compiler/main/HscMain.hs | 6 +- compiler/main/HscTypes.hs | 36 +-- compiler/main/Packages.hs | 16 +- compiler/main/PprTyThing.hs | 5 +- compiler/main/SysTools.hs | 6 +- compiler/main/TidyPgm.hs | 5 +- compiler/nativeGen/AsmCodeGen.hs | 2 +- compiler/nativeGen/Dwarf.hs | 7 +- compiler/nativeGen/Dwarf/Types.hs | 24 +- compiler/nativeGen/PIC.hs | 174 ++++++------- compiler/nativeGen/PPC/Ppr.hs | 218 ++++++++-------- compiler/nativeGen/PprBase.hs | 2 +- compiler/nativeGen/RegAlloc/Liveness.hs | 15 +- compiler/nativeGen/SPARC/Ppr.hs | 72 +++--- compiler/nativeGen/X86/Ppr.hs | 98 +++---- compiler/parser/Lexer.x | 4 +- compiler/parser/Parser.y | 6 +- compiler/parser/RdrHsSyn.hs | 16 +- compiler/prelude/ForeignCall.hs | 16 +- compiler/prelude/PrelRules.hs | 2 +- compiler/profiling/CostCentre.hs | 10 +- compiler/profiling/ProfInit.hs | 8 +- compiler/rename/RnBinds.hs | 66 ++--- compiler/rename/RnEnv.hs | 142 +++++----- compiler/rename/RnExpr.hs | 54 ++-- compiler/rename/RnNames.hs | 100 +++---- compiler/rename/RnPat.hs | 43 ++- compiler/rename/RnSource.hs | 46 ++-- compiler/rename/RnSplice.hs | 16 +- compiler/rename/RnTypes.hs | 66 ++--- compiler/simplCore/CoreMonad.hs | 64 ++--- compiler/simplCore/FloatOut.hs | 13 +- compiler/simplCore/OccurAnal.hs | 17 +- compiler/simplCore/SAT.hs | 14 +- compiler/simplCore/SimplCore.hs | 15 +- compiler/simplCore/SimplEnv.hs | 21 +- compiler/simplCore/SimplMonad.hs | 8 +- compiler/simplCore/SimplUtils.hs | 31 ++- compiler/simplCore/Simplify.hs | 4 +- compiler/specialise/Rules.hs | 20 +- compiler/specialise/SpecConstr.hs | 30 +-- compiler/specialise/Specialise.hs | 22 +- compiler/stgSyn/CoreToStg.hs | 6 +- compiler/stgSyn/StgLint.hs | 43 ++- compiler/stgSyn/StgSyn.hs | 56 ++-- compiler/stranal/DmdAnal.hs | 7 +- compiler/stranal/WwLib.hs | 2 +- compiler/typecheck/FamInst.hs | 3 +- compiler/typecheck/FunDeps.hs | 27 +- compiler/typecheck/Inst.hs | 12 +- compiler/typecheck/TcAnnotations.hs | 12 +- compiler/typecheck/TcArrows.hs | 9 +- compiler/typecheck/TcBinds.hs | 59 +++-- compiler/typecheck/TcCanonical.hs | 5 +- compiler/typecheck/TcClassDcl.hs | 34 +-- compiler/typecheck/TcDefaults.hs | 12 +- compiler/typecheck/TcDeriv.hs | 112 ++++---- compiler/typecheck/TcEnv.hs | 26 +- compiler/typecheck/TcErrors.hs | 188 +++++++------- compiler/typecheck/TcEvidence.hs | 40 +-- compiler/typecheck/TcExpr.hs | 74 +++--- compiler/typecheck/TcFlatten.hs | 5 +- compiler/typecheck/TcForeign.hs | 20 +- compiler/typecheck/TcGenGenerics.hs | 6 +- compiler/typecheck/TcHsType.hs | 46 ++-- compiler/typecheck/TcInstDcls.hs | 54 ++-- compiler/typecheck/TcInteract.hs | 53 ++-- compiler/typecheck/TcMType.hs | 2 +- compiler/typecheck/TcMatches.hs | 13 +- compiler/typecheck/TcPat.hs | 21 +- compiler/typecheck/TcPatSyn.hs | 24 +- compiler/typecheck/TcRnDriver.hs | 72 +++--- compiler/typecheck/TcRnMonad.hs | 8 +- compiler/typecheck/TcRnTypes.hs | 192 +++++++------- compiler/typecheck/TcRules.hs | 4 +- compiler/typecheck/TcSMonad.hs | 35 ++- compiler/typecheck/TcSimplify.hs | 41 ++- compiler/typecheck/TcSplice.hs | 30 +-- compiler/typecheck/TcTyClsDecls.hs | 161 ++++++------ compiler/typecheck/TcTyDecls.hs | 14 +- compiler/typecheck/TcType.hs | 86 +++--- compiler/typecheck/TcUnify.hs | 18 +- compiler/typecheck/TcValidity.hs | 108 ++++---- compiler/types/Class.hs | 7 +- compiler/types/Coercion.hs | 15 +- compiler/types/FamInstEnv.hs | 24 +- compiler/types/InstEnv.hs | 10 +- compiler/types/OptCoercion.hs | 3 +- compiler/types/TyCoRep.hs | 34 +-- compiler/types/Type.hs | 4 +- compiler/utils/Outputable.hs | 92 +++---- compiler/utils/UniqDFM.hs | 3 +- compiler/utils/UniqFM.hs | 3 +- .../vectorise/Vectorise/Builtins/Initialise.hs | 4 +- compiler/vectorise/Vectorise/Exp.hs | 5 +- compiler/vectorise/Vectorise/Monad/Global.hs | 13 +- compiler/vectorise/Vectorise/Type/Env.hs | 5 +- 165 files changed, 2887 insertions(+), 2930 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc b8abd852d3674cb485490d2b2e94906c06ee6e8f From git at git.haskell.org Mon Jan 18 20:44:18 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 18 Jan 2016 20:44:18 +0000 (UTC) Subject: [commit: ghc] wip/exp-types: Finish tcSyntaxOp. Still more to go, though. (a8ec027) Message-ID: <20160118204418.33CE73A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/exp-types Link : http://ghc.haskell.org/trac/ghc/changeset/a8ec02788b77d46cbb7529abd7224dc03c3b08c5/ghc >--------------------------------------------------------------- commit a8ec02788b77d46cbb7529abd7224dc03c3b08c5 Author: Richard Eisenberg Date: Sat Jan 16 14:02:07 2016 -0500 Finish tcSyntaxOp. Still more to go, though. >--------------------------------------------------------------- a8ec02788b77d46cbb7529abd7224dc03c3b08c5 compiler/ghci/RtClosureInspect.hs | 4 - compiler/hsSyn/HsPat.hs | 3 +- compiler/typecheck/Inst.hs | 57 ++------- compiler/typecheck/TcExpr.hs | 259 +++++++++++++++++++++++--------------- compiler/typecheck/TcMType.hs | 11 +- compiler/typecheck/TcMatches.hs | 63 ++++++---- compiler/typecheck/TcPat.hs | 133 ++++++++++++++------ compiler/typecheck/TcUnify.hs | 18 ++- compiler/utils/MonadUtils.hs | 7 +- 9 files changed, 334 insertions(+), 221 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc a8ec02788b77d46cbb7529abd7224dc03c3b08c5 From git at git.haskell.org Mon Jan 18 20:44:20 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 18 Jan 2016 20:44:20 +0000 (UTC) Subject: [commit: ghc] wip/exp-types: Checkpoint before ripping out ReturnTv (ec52d08) Message-ID: <20160118204420.E64EE3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/exp-types Link : http://ghc.haskell.org/trac/ghc/changeset/ec52d08e5253387a96f196d5a1ee82d4f7dcc002/ghc >--------------------------------------------------------------- commit ec52d08e5253387a96f196d5a1ee82d4f7dcc002 Author: Richard Eisenberg Date: Mon Jan 18 10:27:29 2016 -0500 Checkpoint before ripping out ReturnTv >--------------------------------------------------------------- ec52d08e5253387a96f196d5a1ee82d4f7dcc002 compiler/typecheck/Inst.hs | 4 +- compiler/typecheck/TcArrows.hs | 16 +++--- compiler/typecheck/TcExpr.hs | 72 +++++++++++++------------ compiler/typecheck/TcMType.hs | 6 ++- compiler/typecheck/TcMatches.hs | 97 ++++++++++++++++----------------- compiler/typecheck/TcPat.hs | 69 ++++++++++++++---------- compiler/typecheck/TcSplice.hs | 37 +++++++------ compiler/typecheck/TcUnify.hs | 116 +++++++++++++++++++++------------------- 8 files changed, 225 insertions(+), 192 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc ec52d08e5253387a96f196d5a1ee82d4f7dcc002 From git at git.haskell.org Mon Jan 18 20:44:23 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 18 Jan 2016 20:44:23 +0000 (UTC) Subject: [commit: ghc] wip/exp-types: Checkpoint before compiling (a4d8268) Message-ID: <20160118204423.A1DE33A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/exp-types Link : http://ghc.haskell.org/trac/ghc/changeset/a4d826881188a7ae7a87b29dd68db9fd5790d187/ghc >--------------------------------------------------------------- commit a4d826881188a7ae7a87b29dd68db9fd5790d187 Author: Richard Eisenberg Date: Mon Jan 18 12:08:35 2016 -0500 Checkpoint before compiling >--------------------------------------------------------------- a4d826881188a7ae7a87b29dd68db9fd5790d187 compiler/typecheck/TcExpr.hs | 25 ++++++++---------- compiler/typecheck/TcMType.hs | 57 +---------------------------------------- compiler/typecheck/TcMatches.hs | 38 ++++++++++++++++----------- compiler/typecheck/TcType.hs | 47 +++------------------------------ compiler/typecheck/TcUnify.hs | 28 ++++++-------------- 5 files changed, 45 insertions(+), 150 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc a4d826881188a7ae7a87b29dd68db9fd5790d187 From git at git.haskell.org Mon Jan 18 20:44:26 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 18 Jan 2016 20:44:26 +0000 (UTC) Subject: [commit: ghc] wip/exp-types: Compiles now. (5454ad6) Message-ID: <20160118204426.851703A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/exp-types Link : http://ghc.haskell.org/trac/ghc/changeset/5454ad6b9ce9aade41aaf41d5d1bf42027196493/ghc >--------------------------------------------------------------- commit 5454ad6b9ce9aade41aaf41d5d1bf42027196493 Author: Richard Eisenberg Date: Mon Jan 18 15:45:04 2016 -0500 Compiles now. >--------------------------------------------------------------- 5454ad6b9ce9aade41aaf41d5d1bf42027196493 compiler/deSugar/Check.hs | 9 +- compiler/deSugar/DsArrows.hs | 2 +- compiler/deSugar/Match.hs | 2 +- compiler/deSugar/MatchLit.hs | 11 +-- compiler/hsSyn/HsPat.hs | 7 +- compiler/hsSyn/HsUtils.hs | 4 +- compiler/hsSyn/PlaceHolder.hs | 23 ++--- compiler/rename/RnPat.hs | 4 +- compiler/typecheck/Inst.hs | 10 +-- compiler/typecheck/TcArrows.hs | 20 ++--- compiler/typecheck/TcBinds.hs | 4 +- compiler/typecheck/TcErrors.hs | 71 ++++++++------- compiler/typecheck/TcEvidence.hs | 6 -- compiler/typecheck/TcExpr.hs | 163 +++++++++++++++++------------------ compiler/typecheck/TcExpr.hs-boot | 23 +++-- compiler/typecheck/TcHsSyn.hs | 9 +- compiler/typecheck/TcHsType.hs | 7 +- compiler/typecheck/TcMType.hs | 41 +++------ compiler/typecheck/TcMatches.hs | 116 +++++++++++++------------ compiler/typecheck/TcMatches.hs-boot | 4 +- compiler/typecheck/TcPat.hs | 43 +++++---- compiler/typecheck/TcPatSyn.hs | 18 ++-- compiler/typecheck/TcRnDriver.hs | 3 +- compiler/typecheck/TcRnTypes.hs | 12 ++- compiler/typecheck/TcSplice.hs | 20 +++-- compiler/typecheck/TcSplice.hs-boot | 8 +- compiler/typecheck/TcType.hs | 62 ++++++++++++- compiler/typecheck/TcUnify.hs | 138 +++++++++++++++++------------ compiler/typecheck/TcValidity.hs | 2 +- compiler/utils/MonadUtils.hs | 2 +- 30 files changed, 476 insertions(+), 368 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 5454ad6b9ce9aade41aaf41d5d1bf42027196493 From git at git.haskell.org Tue Jan 19 04:18:35 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 19 Jan 2016 04:18:35 +0000 (UTC) Subject: [commit: ghc] wip/exp-types: Workin' the testsuite. (aaedf8b) Message-ID: <20160119041835.B61553A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/exp-types Link : http://ghc.haskell.org/trac/ghc/changeset/aaedf8b50a2448cbee5151ac2c0593e5ff3878d3/ghc >--------------------------------------------------------------- commit aaedf8b50a2448cbee5151ac2c0593e5ff3878d3 Author: Richard Eisenberg Date: Mon Jan 18 23:19:21 2016 -0500 Workin' the testsuite. >--------------------------------------------------------------- aaedf8b50a2448cbee5151ac2c0593e5ff3878d3 compiler/typecheck/TcExpr.hs | 18 ++++-- compiler/typecheck/TcGenDeriv.hs | 32 +++++++--- compiler/typecheck/TcMType.hs | 70 +++++++++++++++++----- compiler/typecheck/TcType.hs | 6 +- compiler/typecheck/TcUnify.hs | 20 +++++-- testsuite/tests/ado/ado004.stderr | 30 +++++----- .../tests/annotations/should_fail/annfail10.stderr | 12 ++-- testsuite/tests/determinism/typecheck/A.hs | 2 +- testsuite/tests/gadt/gadt-escape1.stderr | 16 ++--- testsuite/tests/gadt/gadt13.stderr | 10 ++-- testsuite/tests/gadt/gadt7.stderr | 20 +++---- .../tests/ghci.debugger/scripts/break003.stderr | 2 +- .../tests/ghci.debugger/scripts/break003.stdout | 8 +-- .../tests/ghci.debugger/scripts/break005.stdout | 4 +- .../tests/ghci.debugger/scripts/break006.stderr | 12 ++-- .../tests/ghci.debugger/scripts/break006.stdout | 10 ++-- .../tests/ghci.debugger/scripts/break012.stdout | 8 +-- .../tests/ghci.debugger/scripts/hist001.stdout | 28 ++++----- .../tests/ghci.debugger/scripts/print022.stdout | 4 +- testsuite/tests/ghci/scripts/T2182ghci.stderr | 30 +++++----- testsuite/tests/ghci/scripts/T8959.script | 8 ++- testsuite/tests/ghci/scripts/T8959.stderr | 48 +++++++-------- testsuite/tests/ghci/scripts/T8959.stdout | 11 +--- testsuite/tests/typecheck/should_compile/T2683.hs | 2 +- testsuite/tests/typecheck/should_compile/T7888.hs | 4 ++ .../tests/typecheck/should_compile/T9834.stderr | 5 +- .../tests/typecheck/should_compile/tc141.stderr | 6 +- testsuite/tests/typecheck/should_compile/tc158.hs | 2 +- testsuite/tests/typecheck/should_compile/twins.hs | 2 +- 29 files changed, 256 insertions(+), 174 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc aaedf8b50a2448cbee5151ac2c0593e5ff3878d3 From git at git.haskell.org Tue Jan 19 08:00:30 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 19 Jan 2016 08:00:30 +0000 (UTC) Subject: [commit: ghc] master: Hide derived OccNames from user (d2ea7f9) Message-ID: <20160119080030.53FC73A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d2ea7f94cb21662857cd50c95ff41943e5911a9b/ghc >--------------------------------------------------------------- commit d2ea7f94cb21662857cd50c95ff41943e5911a9b Author: Ben Gamari Date: Mon Jan 18 23:12:51 2016 +0100 Hide derived OccNames from user This hides derived OccNames from the Names returned from runDeclsWithLocation and clarifies the documentation. This is done to ensure that these names (originating from, e.g., derived Generic instances and type representation bindings) don't show up in ghci output when run with `:set +t`. This fixes #11051. Test Plan: Validate with included tests Reviewers: austin Reviewed By: austin Subscribers: thomie, hvr Differential Revision: https://phabricator.haskell.org/D1794 GHC Trac Issues: #11051 >--------------------------------------------------------------- d2ea7f94cb21662857cd50c95ff41943e5911a9b compiler/main/InteractiveEval.hs | 8 +++++--- testsuite/tests/ghci/scripts/T11051a.script | 3 +++ testsuite/tests/ghci/scripts/T11051a.stdout | 1 + testsuite/tests/ghci/scripts/T11051b.script | 5 +++++ testsuite/tests/ghci/scripts/T11051b.stdout | 1 + testsuite/tests/ghci/scripts/all.T | 2 ++ 6 files changed, 17 insertions(+), 3 deletions(-) diff --git a/compiler/main/InteractiveEval.hs b/compiler/main/InteractiveEval.hs index 47d282e..6356928 100644 --- a/compiler/main/InteractiveEval.hs +++ b/compiler/main/InteractiveEval.hs @@ -235,8 +235,9 @@ runStmtWithLocation source linenumber expr step = do runDecls :: GhcMonad m => String -> m [Name] runDecls = runDeclsWithLocation "" 1 -runDeclsWithLocation - :: GhcMonad m => String -> Int -> String -> m [Name] +-- | Run some declarations and return any user-visible names that were brought +-- into scope. +runDeclsWithLocation :: GhcMonad m => String -> Int -> String -> m [Name] runDeclsWithLocation source linenumber expr = do hsc_env <- getSession @@ -246,7 +247,8 @@ runDeclsWithLocation source linenumber expr = hsc_env <- getSession hsc_env' <- liftIO $ rttiEnvironment hsc_env modifySession (\_ -> hsc_env') - return (map getName tyThings) + return $ filter (not . isDerivedOccName . nameOccName) + $ map getName tyThings withVirtualCWD :: GhcMonad m => m a -> m a diff --git a/testsuite/tests/ghci/scripts/T11051a.script b/testsuite/tests/ghci/scripts/T11051a.script new file mode 100644 index 0000000..96fadeb --- /dev/null +++ b/testsuite/tests/ghci/scripts/T11051a.script @@ -0,0 +1,3 @@ +-- Ensure that type representation bindings aren't visible to user +:set +t +data Hi diff --git a/testsuite/tests/ghci/scripts/T11051a.stdout b/testsuite/tests/ghci/scripts/T11051a.stdout new file mode 100644 index 0000000..44fb93ca --- /dev/null +++ b/testsuite/tests/ghci/scripts/T11051a.stdout @@ -0,0 +1 @@ +data Hi diff --git a/testsuite/tests/ghci/scripts/T11051b.script b/testsuite/tests/ghci/scripts/T11051b.script new file mode 100644 index 0000000..dd42074 --- /dev/null +++ b/testsuite/tests/ghci/scripts/T11051b.script @@ -0,0 +1,5 @@ +-- ensure that derived Generics types aren't visible to user +:set +t +:set -XDeriveGeneric +import GHC.Generics +data Hello = Hello Int deriving (Eq, Generic) diff --git a/testsuite/tests/ghci/scripts/T11051b.stdout b/testsuite/tests/ghci/scripts/T11051b.stdout new file mode 100644 index 0000000..7eb3f08 --- /dev/null +++ b/testsuite/tests/ghci/scripts/T11051b.stdout @@ -0,0 +1 @@ +data Hello = Hello Int diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T index c1bda85..7a6225c 100755 --- a/testsuite/tests/ghci/scripts/all.T +++ b/testsuite/tests/ghci/scripts/all.T @@ -237,3 +237,5 @@ test('T11252', normal, ghci_script, ['T11252.script']) test('T10576a', expect_broken(10576), ghci_script, ['T10576a.script']) test('T10576b', expect_broken(10576), ghci_script, ['T10576b.script']) +test('T11051a', normal, ghci_script, ['T11051a.script']) +test('T11051b', normal, ghci_script, ['T11051b.script']) From git at git.haskell.org Tue Jan 19 08:00:33 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 19 Jan 2016 08:00:33 +0000 (UTC) Subject: [commit: ghc] master: Switch from -this-package-key to -this-unit-id. (240ddd7) Message-ID: <20160119080033.218093A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/240ddd7c39536776e955e881d709bbb039b48513/ghc >--------------------------------------------------------------- commit 240ddd7c39536776e955e881d709bbb039b48513 Author: Edward Z. Yang Date: Mon Jan 18 17:32:27 2016 +0100 Switch from -this-package-key to -this-unit-id. A small cosmetic change, but we have to do a bit of work to actually support it: - Cabal submodule update, so that Cabal passes us -this-unit-id when we ask for it. This includes a Cabal renaming to be consistent with Unit ID, which makes ghc-pkg a bit more scrutable. - Build system is updated to use -this-unit-id rather than -this-package-key, to avoid deprecation warnings. Needs a version test so I resurrected the old test we had (sorry rwbarton!) - I've *undeprecated* -package-name, so that we are in the same state as GHC 7.10, since the "correct" flag will have only entered circulation in GHC 8.0. - I removed -package-key. Since we didn't deprecate -package-id I think this should not cause any problems for users; they can just change their code to use -package-id. - The package database is indexed by UNIT IDs, not component IDs. I updated the naming here. - I dropped the signatures field from ExposedModule; nothing was using it, and instantiatedWith from the package database field. - ghc-pkg was updated to use unit ID nomenclature, I removed the -package-key flags but I decided not to add any new flags for now. Signed-off-by: Edward Z. Yang Test Plan: validate Reviewers: austin, hvr, bgamari Reviewed By: bgamari Subscribers: 23Skidoo, thomie, erikd Differential Revision: https://phabricator.haskell.org/D1780 >--------------------------------------------------------------- 240ddd7c39536776e955e881d709bbb039b48513 compiler/ghc.cabal.in | 15 ++-- compiler/main/DynFlags.hs | 45 ++++++---- compiler/main/HscTypes.hs | 4 +- compiler/main/PackageConfig.hs | 18 +--- compiler/main/Packages.hs | 11 +-- configure.ac | 5 ++ docs/users_guide/8.0.1-notes.rst | 8 ++ docs/users_guide/packages.rst | 17 ++-- libraries/Cabal | 2 +- libraries/base/base.cabal | 2 +- libraries/ghc-boot/GHC/PackageDb.hs | 83 +++++++------------ libraries/ghc-prim/ghc-prim.cabal | 2 +- libraries/integer-gmp/integer-gmp.cabal | 2 +- libraries/integer-simple/integer-simple.cabal | 4 +- libraries/template-haskell/template-haskell.cabal | 9 +- mk/config.mk.in | 2 + rts/ghc.mk | 6 +- rules/distdir-way-opts.mk | 14 +++- testsuite/tests/module/base01/Makefile | 4 +- testsuite/tests/rename/prog006/Makefile | 2 +- testsuite/tests/rename/should_compile/T3103/test.T | 2 +- utils/ghc-cabal/Main.hs | 14 ++-- utils/ghc-pkg/Main.hs | 95 ++++++++++------------ utils/mkUserGuidePart/Options/Packages.hs | 4 +- 24 files changed, 190 insertions(+), 180 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 240ddd7c39536776e955e881d709bbb039b48513 From git at git.haskell.org Tue Jan 19 08:00:35 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 19 Jan 2016 08:00:35 +0000 (UTC) Subject: [commit: ghc] master: ghci: Kill global macros list (cbc03f1) Message-ID: <20160119080035.D8C173A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/cbc03f1ce3ae23d6b9515157db7c43a2456ad9c9/ghc >--------------------------------------------------------------- commit cbc03f1ce3ae23d6b9515157db7c43a2456ad9c9 Author: Ben Gamari Date: Mon Jan 18 23:12:34 2016 +0100 ghci: Kill global macros list Test Plan: Validate Reviewers: simonmar, thomie, austin Reviewed By: austin Subscribers: alanz Differential Revision: https://phabricator.haskell.org/D1789 >--------------------------------------------------------------- cbc03f1ce3ae23d6b9515157db7c43a2456ad9c9 ghc/GHCi/UI.hs | 26 ++++++++++++++------------ ghc/GHCi/UI/Monad.hs | 52 +++++++++++++++++++++++++++------------------------- 2 files changed, 41 insertions(+), 37 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc cbc03f1ce3ae23d6b9515157db7c43a2456ad9c9 From git at git.haskell.org Tue Jan 19 08:00:38 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 19 Jan 2016 08:00:38 +0000 (UTC) Subject: [commit: ghc] master: user-guide: Delete errant fragment (38666bd) Message-ID: <20160119080038.960513A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/38666bda4517856eae3228c2119a97c32aa3fc40/ghc >--------------------------------------------------------------- commit 38666bda4517856eae3228c2119a97c32aa3fc40 Author: Ben Gamari Date: Mon Jan 18 23:13:29 2016 +0100 user-guide: Delete errant fragment Reviewers: austin Reviewed By: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1796 >--------------------------------------------------------------- 38666bda4517856eae3228c2119a97c32aa3fc40 docs/users_guide/glasgow_exts.rst | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index 1457274..4323b3a 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -90,8 +90,6 @@ here. Unboxed types ------------- -Unboxed types (Glasgow extension) - Most types in GHC are boxed, which means that values of that type are represented by a pointer to a heap object. The representation of a Haskell ``Int``, for example, is a two-word heap object. An unboxed From git at git.haskell.org Tue Jan 19 08:00:41 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 19 Jan 2016 08:00:41 +0000 (UTC) Subject: [commit: ghc] master: users-guide: Begin documenting --frontend (aff51af) Message-ID: <20160119080041.458D63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/aff51af1d747f88a140f435882efcd46b47b50af/ghc >--------------------------------------------------------------- commit aff51af1d747f88a140f435882efcd46b47b50af Author: Ben Gamari Date: Tue Jan 19 00:07:47 2016 +0100 users-guide: Begin documenting --frontend Reviewers: austin Subscribers: thomie, ezyang Differential Revision: https://phabricator.haskell.org/D1793 GHC Trac Issues: #11448 >--------------------------------------------------------------- aff51af1d747f88a140f435882efcd46b47b50af docs/users_guide/extending_ghc.rst | 2 +- docs/users_guide/using.rst | 10 +++++++++- utils/mkUserGuidePart/Options/Modes.hs | 8 +++++++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/docs/users_guide/extending_ghc.rst b/docs/users_guide/extending_ghc.rst index 74bba91..17d061e 100644 --- a/docs/users_guide/extending_ghc.rst +++ b/docs/users_guide/extending_ghc.rst @@ -590,7 +590,7 @@ A frontend plugin allows you to add new major modes to GHC. You may prefer this over a traditional program which calls the GHC API, as GHC manages a lot of parsing flags and administrative nonsense which can be difficult to manage manually. To load a frontend plugin exported by ``Foo.FrontendPlugin``, -we just invoke GHC as follows: +we just invoke GHC with the :ghc-flag:`--frontend` flag as follows: .. code-block:: none diff --git a/docs/users_guide/using.rst b/docs/users_guide/using.rst index a600a13..91b6291 100644 --- a/docs/users_guide/using.rst +++ b/docs/users_guide/using.rst @@ -281,12 +281,20 @@ The available mode flags are: .. ghc-flag:: -M .. index:: - single: dependency-generation mode; of GHC + single: dependency-generation mode; of GHC Dependency-generation mode. In this mode, GHC can be used to generate dependency information suitable for use in a ``Makefile``. See :ref:`makefile-dependencies`. +.. ghc-flag:: --frontend + + .. index:: + single: frontend plugins; using + + Run GHC using the given frontend plugin. See :ref:`frontend_plugins` for + details. + .. ghc-flag:: --mk-dll .. index:: diff --git a/utils/mkUserGuidePart/Options/Modes.hs b/utils/mkUserGuidePart/Options/Modes.hs index 57aaef2..792ee9f 100644 --- a/utils/mkUserGuidePart/Options/Modes.hs +++ b/utils/mkUserGuidePart/Options/Modes.hs @@ -32,10 +32,16 @@ modeOptions = } , flag { flagName = "-M" , flagDescription = - "denerate dependency information suitable for use in a "++ + "generate dependency information suitable for use in a "++ "``Makefile``; see :ref:`makefile-dependencies` for details." , flagType = ModeFlag } + , flag { flagName = "--frontend ?module?" + , flagDescription = + "run GHC with the given frontend plugin; see "++ + ":ref:`frontend_plugins` for details." + , flagType = ModeFlag + } , flag { flagName = "--supported-extensions, --supported-languages" , flagDescription = "display the supported language extensions" , flagType = ModeFlag From git at git.haskell.org Tue Jan 19 10:05:42 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 19 Jan 2016 10:05:42 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Fixes to "make clean" for the iserv dir (467f94f) Message-ID: <20160119100542.EFE313A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/467f94f47fcc863ee78d5c9e76ecdb4acbc13e05/ghc >--------------------------------------------------------------- commit 467f94f47fcc863ee78d5c9e76ecdb4acbc13e05 Author: Simon Marlow Date: Mon Jan 18 06:41:19 2016 -0800 Fixes to "make clean" for the iserv dir (cherry picked from commit 817dd925569d981523bbf4fb471014d46c51c7db) >--------------------------------------------------------------- 467f94f47fcc863ee78d5c9e76ecdb4acbc13e05 ghc.mk | 2 +- iserv/ghc.mk | 22 +++++++++++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/ghc.mk b/ghc.mk index f521ceb..e095ffd 100644 --- a/ghc.mk +++ b/ghc.mk @@ -672,7 +672,7 @@ BUILD_DIRS += utils/mkUserGuidePart BUILD_DIRS += docs/users_guide BUILD_DIRS += utils/count_lines BUILD_DIRS += utils/compare_sizes -ifeq "$(Windows_Host)" "NO" +ifneq "$(Windows_Host)" "YES" BUILD_DIRS += iserv endif diff --git a/iserv/ghc.mk b/iserv/ghc.mk index 4cae482..1a44352 100644 --- a/iserv/ghc.mk +++ b/iserv/ghc.mk @@ -54,11 +54,31 @@ iserv_stage2_dyn_INSTALL_INPLACE = YES $(eval $(call build-prog,iserv,stage2,1)) +ifeq "$(CLEANING)" "YES" + +NEED_iserv_p = YES +NEED_iserv_dyn = YES + +else + ifneq "$(findstring p, $(GhcLibWays))" "" -$(eval $(call build-prog,iserv,stage2_p,1)) +NEED_iserv_p = YES +else +NEED_iserv_p = NO endif ifneq "$(findstring dyn, $(GhcLibWays))" "" +NEED_iserv_dyn = YES +else +NEED_iserv_dyn = NO +endif +endif + +ifeq "$(NEED_iserv_p)" "YES" +$(eval $(call build-prog,iserv,stage2_p,1)) +endif + +ifeq "$(NEED_iserv_dyn)" "YES" $(eval $(call build-prog,iserv,stage2_dyn,1)) endif From git at git.haskell.org Tue Jan 19 10:05:46 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 19 Jan 2016 10:05:46 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Replace calls to `ptext . sLit` with `text` (f02fefd) Message-ID: <20160119100546.5F33B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/f02fefd3187beed98444273e5fbc2c022af5efbc/ghc >--------------------------------------------------------------- commit f02fefd3187beed98444273e5fbc2c022af5efbc Author: Jan Stolarek Date: Fri Jan 15 18:24:14 2016 +0100 Replace calls to `ptext . sLit` with `text` In the past the canonical way for constructing an SDoc string literal was the composition `ptext . sLit`. But for some time now we have function `text` that does the same. Plus it has some rules that optimize its runtime behaviour. This patch takes all uses of `ptext . sLit` in the compiler and replaces them with calls to `text`. The main benefits of this patch are clener (shorter) code and less dependencies between module, because many modules now do not need to import `FastString`. I don't expect any performance benefits - we mostly use SDocs to report errors and it seems there is little to be gained here. Test Plan: ./validate Reviewers: bgamari, austin, goldfire, hvr, alanz Subscribers: goldfire, thomie, mpickering Differential Revision: https://phabricator.haskell.org/D1784 (cherry picked from commit b8abd852d3674cb485490d2b2e94906c06ee6e8f) >--------------------------------------------------------------- f02fefd3187beed98444273e5fbc2c022af5efbc compiler/basicTypes/BasicTypes.hs | 72 +++--- compiler/basicTypes/DataCon.hs | 18 +- compiler/basicTypes/Demand.hs | 5 +- compiler/basicTypes/IdInfo.hs | 27 +- compiler/basicTypes/Literal.hs | 4 +- compiler/basicTypes/Name.hs | 10 +- compiler/basicTypes/OccName.hs | 12 +- compiler/basicTypes/PatSyn.hs | 5 +- compiler/basicTypes/RdrName.hs | 30 +-- compiler/basicTypes/Var.hs | 9 +- compiler/basicTypes/VarEnv.hs | 3 +- compiler/cmm/CLabel.hs | 74 +++--- compiler/cmm/CmmLayoutStack.hs | 4 +- compiler/cmm/CmmLint.hs | 5 +- compiler/cmm/CmmType.hs | 6 +- compiler/cmm/PprC.hs | 288 ++++++++++----------- compiler/cmm/PprCmm.hs | 64 ++--- compiler/cmm/PprCmmDecl.hs | 18 +- compiler/cmm/PprCmmExpr.hs | 49 ++-- compiler/cmm/SMRep.hs | 36 +-- compiler/codeGen/StgCmmClosure.hs | 5 +- compiler/codeGen/StgCmmEnv.hs | 3 +- compiler/codeGen/StgCmmMonad.hs | 6 +- compiler/coreSyn/CoreArity.hs | 4 +- compiler/coreSyn/CoreLint.hs | 226 ++++++++-------- compiler/coreSyn/CorePrep.hs | 8 +- compiler/coreSyn/CoreStats.hs | 7 +- compiler/coreSyn/CoreSubst.hs | 14 +- compiler/coreSyn/CoreSyn.hs | 3 +- compiler/coreSyn/CoreUnfold.hs | 25 +- compiler/coreSyn/CoreUtils.hs | 18 +- compiler/coreSyn/MkCore.hs | 4 +- compiler/coreSyn/PprCore.hs | 160 ++++++------ compiler/deSugar/Check.hs | 34 +-- compiler/deSugar/Coverage.hs | 10 +- compiler/deSugar/Desugar.hs | 22 +- compiler/deSugar/DsArrows.hs | 3 +- compiler/deSugar/DsBinds.hs | 38 +-- compiler/deSugar/DsExpr.hs | 14 +- compiler/deSugar/DsForeign.hs | 24 +- compiler/deSugar/DsListComp.hs | 5 +- compiler/deSugar/DsMeta.hs | 2 +- compiler/deSugar/DsMonad.hs | 12 +- compiler/deSugar/MatchLit.hs | 16 +- compiler/deSugar/PmExpr.hs | 5 +- compiler/ghci/ByteCodeInstr.hs | 12 +- compiler/ghci/Linker.hs | 34 +-- compiler/hsSyn/Convert.hs | 36 +-- compiler/hsSyn/HsBinds.hs | 60 ++--- compiler/hsSyn/HsDecls.hs | 77 +++--- compiler/hsSyn/HsExpr.hs | 220 ++++++++-------- compiler/hsSyn/HsImpExp.hs | 18 +- compiler/hsSyn/HsPat.hs | 3 +- compiler/hsSyn/HsSyn.hs | 7 +- compiler/hsSyn/HsTypes.hs | 2 +- compiler/iface/IfaceSyn.hs | 114 ++++---- compiler/iface/IfaceType.hs | 16 +- compiler/iface/LoadIface.hs | 102 ++++---- compiler/iface/MkIface.hs | 24 +- compiler/iface/TcIface.hs | 48 ++-- compiler/main/DriverMkDepend.hs | 10 +- compiler/main/DriverPipeline.hs | 7 +- compiler/main/DynFlags.hs | 6 +- compiler/main/DynamicLoading.hs | 27 +- compiler/main/ErrUtils.hs | 7 +- compiler/main/Finder.hs | 56 ++-- compiler/main/GhcMake.hs | 18 +- compiler/main/Hooks.hs | 4 +- compiler/main/HscMain.hs | 6 +- compiler/main/HscTypes.hs | 36 +-- compiler/main/Packages.hs | 16 +- compiler/main/PprTyThing.hs | 5 +- compiler/main/SysTools.hs | 6 +- compiler/main/TidyPgm.hs | 5 +- compiler/nativeGen/AsmCodeGen.hs | 2 +- compiler/nativeGen/Dwarf.hs | 7 +- compiler/nativeGen/Dwarf/Types.hs | 24 +- compiler/nativeGen/PIC.hs | 174 ++++++------- compiler/nativeGen/PPC/Ppr.hs | 218 ++++++++-------- compiler/nativeGen/PprBase.hs | 2 +- compiler/nativeGen/RegAlloc/Liveness.hs | 15 +- compiler/nativeGen/SPARC/Ppr.hs | 72 +++--- compiler/nativeGen/X86/Ppr.hs | 98 +++---- compiler/parser/Lexer.x | 4 +- compiler/parser/Parser.y | 6 +- compiler/parser/RdrHsSyn.hs | 16 +- compiler/prelude/ForeignCall.hs | 16 +- compiler/prelude/PrelRules.hs | 2 +- compiler/profiling/CostCentre.hs | 10 +- compiler/profiling/ProfInit.hs | 8 +- compiler/rename/RnBinds.hs | 66 ++--- compiler/rename/RnEnv.hs | 142 +++++----- compiler/rename/RnExpr.hs | 54 ++-- compiler/rename/RnNames.hs | 100 +++---- compiler/rename/RnPat.hs | 43 ++- compiler/rename/RnSource.hs | 46 ++-- compiler/rename/RnSplice.hs | 16 +- compiler/rename/RnTypes.hs | 66 ++--- compiler/simplCore/CoreMonad.hs | 64 ++--- compiler/simplCore/FloatOut.hs | 13 +- compiler/simplCore/OccurAnal.hs | 17 +- compiler/simplCore/SAT.hs | 14 +- compiler/simplCore/SimplCore.hs | 15 +- compiler/simplCore/SimplEnv.hs | 21 +- compiler/simplCore/SimplMonad.hs | 8 +- compiler/simplCore/SimplUtils.hs | 31 ++- compiler/simplCore/Simplify.hs | 4 +- compiler/specialise/Rules.hs | 20 +- compiler/specialise/SpecConstr.hs | 30 +-- compiler/specialise/Specialise.hs | 22 +- compiler/stgSyn/CoreToStg.hs | 6 +- compiler/stgSyn/StgLint.hs | 43 ++- compiler/stgSyn/StgSyn.hs | 56 ++-- compiler/stranal/DmdAnal.hs | 7 +- compiler/stranal/WwLib.hs | 2 +- compiler/typecheck/FamInst.hs | 3 +- compiler/typecheck/FunDeps.hs | 27 +- compiler/typecheck/Inst.hs | 12 +- compiler/typecheck/TcAnnotations.hs | 12 +- compiler/typecheck/TcArrows.hs | 9 +- compiler/typecheck/TcBinds.hs | 59 +++-- compiler/typecheck/TcCanonical.hs | 5 +- compiler/typecheck/TcClassDcl.hs | 34 +-- compiler/typecheck/TcDefaults.hs | 12 +- compiler/typecheck/TcDeriv.hs | 112 ++++---- compiler/typecheck/TcEnv.hs | 26 +- compiler/typecheck/TcErrors.hs | 188 +++++++------- compiler/typecheck/TcEvidence.hs | 40 +-- compiler/typecheck/TcExpr.hs | 74 +++--- compiler/typecheck/TcFlatten.hs | 5 +- compiler/typecheck/TcForeign.hs | 20 +- compiler/typecheck/TcGenGenerics.hs | 6 +- compiler/typecheck/TcHsType.hs | 46 ++-- compiler/typecheck/TcInstDcls.hs | 54 ++-- compiler/typecheck/TcInteract.hs | 53 ++-- compiler/typecheck/TcMType.hs | 2 +- compiler/typecheck/TcMatches.hs | 13 +- compiler/typecheck/TcPat.hs | 21 +- compiler/typecheck/TcPatSyn.hs | 24 +- compiler/typecheck/TcRnDriver.hs | 72 +++--- compiler/typecheck/TcRnMonad.hs | 8 +- compiler/typecheck/TcRnTypes.hs | 190 +++++++------- compiler/typecheck/TcRules.hs | 4 +- compiler/typecheck/TcSMonad.hs | 35 ++- compiler/typecheck/TcSimplify.hs | 41 ++- compiler/typecheck/TcSplice.hs | 30 +-- compiler/typecheck/TcTyClsDecls.hs | 161 ++++++------ compiler/typecheck/TcTyDecls.hs | 14 +- compiler/typecheck/TcType.hs | 86 +++--- compiler/typecheck/TcUnify.hs | 18 +- compiler/typecheck/TcValidity.hs | 108 ++++---- compiler/types/Class.hs | 7 +- compiler/types/Coercion.hs | 15 +- compiler/types/FamInstEnv.hs | 24 +- compiler/types/InstEnv.hs | 10 +- compiler/types/OptCoercion.hs | 3 +- compiler/types/TyCoRep.hs | 34 +-- compiler/types/Type.hs | 4 +- compiler/utils/Outputable.hs | 92 +++---- compiler/utils/UniqDFM.hs | 3 +- compiler/utils/UniqFM.hs | 3 +- .../vectorise/Vectorise/Builtins/Initialise.hs | 4 +- compiler/vectorise/Vectorise/Exp.hs | 5 +- compiler/vectorise/Vectorise/Monad/Global.hs | 13 +- compiler/vectorise/Vectorise/Type/Env.hs | 5 +- 165 files changed, 2886 insertions(+), 2929 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc f02fefd3187beed98444273e5fbc2c022af5efbc From git at git.haskell.org Tue Jan 19 10:05:49 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 19 Jan 2016 10:05:49 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Switch from -this-package-key to -this-unit-id. (9cebc24) Message-ID: <20160119100549.3E9933A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/9cebc2457aff5b9ad59ccecacc8df7e1155add7a/ghc >--------------------------------------------------------------- commit 9cebc2457aff5b9ad59ccecacc8df7e1155add7a Author: Edward Z. Yang Date: Mon Jan 18 17:32:27 2016 +0100 Switch from -this-package-key to -this-unit-id. A small cosmetic change, but we have to do a bit of work to actually support it: - Cabal submodule update, so that Cabal passes us -this-unit-id when we ask for it. This includes a Cabal renaming to be consistent with Unit ID, which makes ghc-pkg a bit more scrutable. - Build system is updated to use -this-unit-id rather than -this-package-key, to avoid deprecation warnings. Needs a version test so I resurrected the old test we had (sorry rwbarton!) - I've *undeprecated* -package-name, so that we are in the same state as GHC 7.10, since the "correct" flag will have only entered circulation in GHC 8.0. - I removed -package-key. Since we didn't deprecate -package-id I think this should not cause any problems for users; they can just change their code to use -package-id. - The package database is indexed by UNIT IDs, not component IDs. I updated the naming here. - I dropped the signatures field from ExposedModule; nothing was using it, and instantiatedWith from the package database field. - ghc-pkg was updated to use unit ID nomenclature, I removed the -package-key flags but I decided not to add any new flags for now. Signed-off-by: Edward Z. Yang Test Plan: validate Reviewers: austin, hvr, bgamari Reviewed By: bgamari Subscribers: 23Skidoo, thomie, erikd Differential Revision: https://phabricator.haskell.org/D1780 (cherry picked from commit 240ddd7c39536776e955e881d709bbb039b48513) >--------------------------------------------------------------- 9cebc2457aff5b9ad59ccecacc8df7e1155add7a compiler/ghc.cabal.in | 15 ++-- compiler/main/DynFlags.hs | 45 ++++++---- compiler/main/HscTypes.hs | 4 +- compiler/main/PackageConfig.hs | 18 +--- compiler/main/Packages.hs | 11 +-- configure.ac | 5 ++ docs/users_guide/8.0.1-notes.rst | 8 ++ docs/users_guide/packages.rst | 17 ++-- libraries/Cabal | 2 +- libraries/base/base.cabal | 2 +- libraries/ghc-boot/GHC/PackageDb.hs | 83 +++++++------------ libraries/ghc-prim/ghc-prim.cabal | 2 +- libraries/integer-gmp/integer-gmp.cabal | 2 +- libraries/integer-simple/integer-simple.cabal | 4 +- libraries/template-haskell/template-haskell.cabal | 9 +- mk/config.mk.in | 4 +- rts/ghc.mk | 6 +- rules/distdir-way-opts.mk | 12 +-- testsuite/tests/module/base01/Makefile | 4 +- testsuite/tests/rename/prog006/Makefile | 2 +- testsuite/tests/rename/should_compile/T3103/test.T | 2 +- utils/ghc-cabal/Main.hs | 14 ++-- utils/ghc-pkg/Main.hs | 95 ++++++++++------------ utils/mkUserGuidePart/Options/Packages.hs | 4 +- 24 files changed, 183 insertions(+), 187 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 9cebc2457aff5b9ad59ccecacc8df7e1155add7a From git at git.haskell.org Tue Jan 19 10:05:52 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 19 Jan 2016 10:05:52 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Hide derived OccNames from user (4a8b2ca) Message-ID: <20160119100552.870623A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/4a8b2ca082ec1d0966b197be1f190889f31189cd/ghc >--------------------------------------------------------------- commit 4a8b2ca082ec1d0966b197be1f190889f31189cd Author: Ben Gamari Date: Mon Jan 18 23:12:51 2016 +0100 Hide derived OccNames from user This hides derived OccNames from the Names returned from runDeclsWithLocation and clarifies the documentation. This is done to ensure that these names (originating from, e.g., derived Generic instances and type representation bindings) don't show up in ghci output when run with `:set +t`. This fixes #11051. Test Plan: Validate with included tests Reviewers: austin Reviewed By: austin Subscribers: thomie, hvr Differential Revision: https://phabricator.haskell.org/D1794 GHC Trac Issues: #11051 (cherry picked from commit d2ea7f94cb21662857cd50c95ff41943e5911a9b) >--------------------------------------------------------------- 4a8b2ca082ec1d0966b197be1f190889f31189cd compiler/main/InteractiveEval.hs | 8 +++++--- testsuite/tests/ghci/scripts/T11051a.script | 3 +++ testsuite/tests/ghci/scripts/T11051a.stdout | 1 + testsuite/tests/ghci/scripts/T11051b.script | 5 +++++ testsuite/tests/ghci/scripts/T11051b.stdout | 1 + testsuite/tests/ghci/scripts/all.T | 2 ++ 6 files changed, 17 insertions(+), 3 deletions(-) diff --git a/compiler/main/InteractiveEval.hs b/compiler/main/InteractiveEval.hs index 47d282e..6356928 100644 --- a/compiler/main/InteractiveEval.hs +++ b/compiler/main/InteractiveEval.hs @@ -235,8 +235,9 @@ runStmtWithLocation source linenumber expr step = do runDecls :: GhcMonad m => String -> m [Name] runDecls = runDeclsWithLocation "" 1 -runDeclsWithLocation - :: GhcMonad m => String -> Int -> String -> m [Name] +-- | Run some declarations and return any user-visible names that were brought +-- into scope. +runDeclsWithLocation :: GhcMonad m => String -> Int -> String -> m [Name] runDeclsWithLocation source linenumber expr = do hsc_env <- getSession @@ -246,7 +247,8 @@ runDeclsWithLocation source linenumber expr = hsc_env <- getSession hsc_env' <- liftIO $ rttiEnvironment hsc_env modifySession (\_ -> hsc_env') - return (map getName tyThings) + return $ filter (not . isDerivedOccName . nameOccName) + $ map getName tyThings withVirtualCWD :: GhcMonad m => m a -> m a diff --git a/testsuite/tests/ghci/scripts/T11051a.script b/testsuite/tests/ghci/scripts/T11051a.script new file mode 100644 index 0000000..96fadeb --- /dev/null +++ b/testsuite/tests/ghci/scripts/T11051a.script @@ -0,0 +1,3 @@ +-- Ensure that type representation bindings aren't visible to user +:set +t +data Hi diff --git a/testsuite/tests/ghci/scripts/T11051a.stdout b/testsuite/tests/ghci/scripts/T11051a.stdout new file mode 100644 index 0000000..44fb93ca --- /dev/null +++ b/testsuite/tests/ghci/scripts/T11051a.stdout @@ -0,0 +1 @@ +data Hi diff --git a/testsuite/tests/ghci/scripts/T11051b.script b/testsuite/tests/ghci/scripts/T11051b.script new file mode 100644 index 0000000..dd42074 --- /dev/null +++ b/testsuite/tests/ghci/scripts/T11051b.script @@ -0,0 +1,5 @@ +-- ensure that derived Generics types aren't visible to user +:set +t +:set -XDeriveGeneric +import GHC.Generics +data Hello = Hello Int deriving (Eq, Generic) diff --git a/testsuite/tests/ghci/scripts/T11051b.stdout b/testsuite/tests/ghci/scripts/T11051b.stdout new file mode 100644 index 0000000..7eb3f08 --- /dev/null +++ b/testsuite/tests/ghci/scripts/T11051b.stdout @@ -0,0 +1 @@ +data Hello = Hello Int diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T index c1bda85..7a6225c 100755 --- a/testsuite/tests/ghci/scripts/all.T +++ b/testsuite/tests/ghci/scripts/all.T @@ -237,3 +237,5 @@ test('T11252', normal, ghci_script, ['T11252.script']) test('T10576a', expect_broken(10576), ghci_script, ['T10576a.script']) test('T10576b', expect_broken(10576), ghci_script, ['T10576b.script']) +test('T11051a', normal, ghci_script, ['T11051a.script']) +test('T11051b', normal, ghci_script, ['T11051b.script']) From git at git.haskell.org Tue Jan 19 10:05:55 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 19 Jan 2016 10:05:55 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: ghci: Kill global macros list (9053716) Message-ID: <20160119100555.4FC8C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/905371624b7ca25a6f08c456d2d5f0e5c6df4872/ghc >--------------------------------------------------------------- commit 905371624b7ca25a6f08c456d2d5f0e5c6df4872 Author: Ben Gamari Date: Mon Jan 18 23:12:34 2016 +0100 ghci: Kill global macros list Test Plan: Validate Reviewers: simonmar, thomie, austin Reviewed By: austin Subscribers: alanz Differential Revision: https://phabricator.haskell.org/D1789 (cherry picked from commit cbc03f1ce3ae23d6b9515157db7c43a2456ad9c9) >--------------------------------------------------------------- 905371624b7ca25a6f08c456d2d5f0e5c6df4872 ghc/GHCi/UI.hs | 26 ++++++++++++++------------ ghc/GHCi/UI/Monad.hs | 52 +++++++++++++++++++++++++++------------------------- 2 files changed, 41 insertions(+), 37 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 905371624b7ca25a6f08c456d2d5f0e5c6df4872 From git at git.haskell.org Tue Jan 19 10:05:58 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 19 Jan 2016 10:05:58 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: user-guide: Delete errant fragment (614adc3) Message-ID: <20160119100558.041CD3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/614adc390c73ac232a3c645efb04612063c7fdbf/ghc >--------------------------------------------------------------- commit 614adc390c73ac232a3c645efb04612063c7fdbf Author: Ben Gamari Date: Mon Jan 18 23:13:29 2016 +0100 user-guide: Delete errant fragment Reviewers: austin Reviewed By: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1796 (cherry picked from commit 38666bda4517856eae3228c2119a97c32aa3fc40) >--------------------------------------------------------------- 614adc390c73ac232a3c645efb04612063c7fdbf docs/users_guide/glasgow_exts.rst | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index c6cacab..656b9d8 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -90,8 +90,6 @@ here. Unboxed types ------------- -Unboxed types (Glasgow extension) - Most types in GHC are boxed, which means that values of that type are represented by a pointer to a heap object. The representation of a Haskell ``Int``, for example, is a two-word heap object. An unboxed From git at git.haskell.org Tue Jan 19 11:09:20 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 19 Jan 2016 11:09:20 +0000 (UTC) Subject: [commit: ghc] master: Typos in comments (80265c4) Message-ID: <20160119110920.13E063A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/80265c4c3c827695e92dd9620faf47e064b5da37/ghc >--------------------------------------------------------------- commit 80265c4c3c827695e92dd9620faf47e064b5da37 Author: Gabor Greif Date: Tue Jan 19 12:10:13 2016 +0100 Typos in comments >--------------------------------------------------------------- 80265c4c3c827695e92dd9620faf47e064b5da37 compiler/typecheck/TcRnDriver.hs | 2 +- compiler/typecheck/TcTyClsDecls.hs | 2 +- compiler/typecheck/TcValidity.hs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/typecheck/TcRnDriver.hs b/compiler/typecheck/TcRnDriver.hs index 3ded08a..90d07a3 100644 --- a/compiler/typecheck/TcRnDriver.hs +++ b/compiler/typecheck/TcRnDriver.hs @@ -657,7 +657,7 @@ tcRnHsBootDecls hsc_src decls ; mapM_ (badBootDecl hsc_src "rule") rule_decls ; mapM_ (badBootDecl hsc_src "vect") vect_decls - -- Typecheck type/class/isntance decls + -- Typecheck type/class/instance decls ; traceTc "Tc2 (boot)" empty ; (tcg_env, inst_infos, _deriv_binds) <- tcTyClsInstDecls tycl_decls inst_decls deriv_decls val_binds diff --git a/compiler/typecheck/TcTyClsDecls.hs b/compiler/typecheck/TcTyClsDecls.hs index 684853d..2d2c5bb 100644 --- a/compiler/typecheck/TcTyClsDecls.hs +++ b/compiler/typecheck/TcTyClsDecls.hs @@ -1023,7 +1023,7 @@ However we store the default rhs (Proxy x -> y) in F's TyCon, using F's own type variables, so we need to convert it to (Proxy a -> b). We do this by calling tcMatchTys to match them up. This also ensures that x's kind matches a's and similarly for y and b. The error -message isnt' great, mind you. (Trac #11361 was caused by not doing a +message isn't great, mind you. (Trac #11361 was caused by not doing a proper tcMatchTys here.) -} ------------------------- diff --git a/compiler/typecheck/TcValidity.hs b/compiler/typecheck/TcValidity.hs index 54e04b8..4833684 100644 --- a/compiler/typecheck/TcValidity.hs +++ b/compiler/typecheck/TcValidity.hs @@ -946,7 +946,7 @@ checkValidInstHead ctxt clas cls_args (instTypeErr clas cls_args abstract_class_msg) -- Check language restrictions; - -- but not for SPECIALISE isntance pragmas + -- but not for SPECIALISE instance pragmas ; let ty_args = filterOutInvisibleTypes (classTyCon clas) cls_args ; unless spec_inst_prag $ do { checkTc (xopt LangExt.TypeSynonymInstances dflags || From git at git.haskell.org Tue Jan 19 11:25:07 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 19 Jan 2016 11:25:07 +0000 (UTC) Subject: [commit: ghc] master: Check InScopeSet in substTy and provide substTyUnchecked (9d33adb) Message-ID: <20160119112507.919833A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/9d33adb6f352ad4e488067a8756928b3778920e0/ghc >--------------------------------------------------------------- commit 9d33adb6f352ad4e488067a8756928b3778920e0 Author: Bartosz Nitka Date: Tue Jan 19 03:25:39 2016 -0800 Check InScopeSet in substTy and provide substTyUnchecked This adds sanity checks to `substTy` that implement: > when calling substTy subst ty it should be the case that the in-scope > set in the substitution is a superset of > * The free vars of the range of the substitution > * The free vars of ty minus the domain of the substitution and replaces violators with unchecked version. The violators were found by running the GHC test suite. This ensures that I can work on this incrementally and that what I fix won't be undone by some other change. It also includes a couple of fixes that I've already done. Test Plan: ./validate Reviewers: simonmar, goldfire, simonpj, austin, bgamari Reviewed By: simonpj, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1792 GHC Trac Issues: #11371 >--------------------------------------------------------------- 9d33adb6f352ad4e488067a8756928b3778920e0 compiler/basicTypes/MkId.hs | 2 +- compiler/basicTypes/VarEnv.hs | 4 ++ compiler/coreSyn/CoreSubst.hs | 2 +- compiler/coreSyn/CoreUtils.hs | 4 +- compiler/iface/BuildTyCl.hs | 2 +- compiler/typecheck/Inst.hs | 9 ++-- compiler/typecheck/TcClassDcl.hs | 4 +- compiler/typecheck/TcExpr.hs | 2 +- compiler/typecheck/TcFlatten.hs | 2 +- compiler/typecheck/TcHsType.hs | 4 +- compiler/typecheck/TcInteract.hs | 4 +- compiler/typecheck/TcMType.hs | 25 ++++++---- compiler/typecheck/TcPatSyn.hs | 2 +- compiler/typecheck/TcSMonad.hs | 6 +-- compiler/typecheck/TcTyClsDecls.hs | 2 +- compiler/typecheck/TcType.hs | 1 + compiler/types/FamInstEnv.hs | 2 +- compiler/types/TyCoRep.hs | 96 ++++++++++++++++++++++++++++++-------- compiler/types/Type.hs | 3 +- compiler/utils/UniqFM.hs | 3 ++ 20 files changed, 128 insertions(+), 51 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 9d33adb6f352ad4e488067a8756928b3778920e0 From git at git.haskell.org Tue Jan 19 16:22:05 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 19 Jan 2016 16:22:05 +0000 (UTC) Subject: [commit: ghc] master: Re-export ghc-boot:GHC.Serialized as Serialized (713aa90) Message-ID: <20160119162205.AA4503A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/713aa90d3c4fde18d58c321520611892ed426d38/ghc >--------------------------------------------------------------- commit 713aa90d3c4fde18d58c321520611892ed426d38 Author: Simon Marlow Date: Tue Jan 19 08:20:06 2016 -0800 Re-export ghc-boot:GHC.Serialized as Serialized For backwards-compat with GHC 7.10. >--------------------------------------------------------------- 713aa90d3c4fde18d58c321520611892ed426d38 compiler/ghc.cabal.in | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/compiler/ghc.cabal.in b/compiler/ghc.cabal.in index 9557d34..ca250a8 100644 --- a/compiler/ghc.cabal.in +++ b/compiler/ghc.cabal.in @@ -578,6 +578,13 @@ Library Dwarf.Types Dwarf.Constants + if !flag(stage1) + -- ghc:Serialized moved to ghc-boot:GHC.Serialized. So for + -- compatibility with GHC 7.10 and earlier, we reexport it + -- under the old name. + reexported-modules: + ghc-boot:GHC.Serialized as Serialized + if flag(ghci) Exposed-Modules: Convert From git at git.haskell.org Tue Jan 19 17:03:58 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 19 Jan 2016 17:03:58 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Re-export ghc-boot:GHC.Serialized as Serialized (f7ca52a) Message-ID: <20160119170358.51EEE3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/f7ca52a717d39ef49c09e3d537f388c9056d1f0d/ghc >--------------------------------------------------------------- commit f7ca52a717d39ef49c09e3d537f388c9056d1f0d Author: Simon Marlow Date: Tue Jan 19 08:20:06 2016 -0800 Re-export ghc-boot:GHC.Serialized as Serialized For backwards-compat with GHC 7.10. (cherry picked from commit 713aa90d3c4fde18d58c321520611892ed426d38) >--------------------------------------------------------------- f7ca52a717d39ef49c09e3d537f388c9056d1f0d compiler/ghc.cabal.in | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/compiler/ghc.cabal.in b/compiler/ghc.cabal.in index 9557d34..ca250a8 100644 --- a/compiler/ghc.cabal.in +++ b/compiler/ghc.cabal.in @@ -578,6 +578,13 @@ Library Dwarf.Types Dwarf.Constants + if !flag(stage1) + -- ghc:Serialized moved to ghc-boot:GHC.Serialized. So for + -- compatibility with GHC 7.10 and earlier, we reexport it + -- under the old name. + reexported-modules: + ghc-boot:GHC.Serialized as Serialized + if flag(ghci) Exposed-Modules: Convert From git at git.haskell.org Tue Jan 19 19:56:51 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 19 Jan 2016 19:56:51 +0000 (UTC) Subject: [commit: ghc] master: Fix IfaceType generation for TyCons without TyVars (952eda2) Message-ID: <20160119195651.2D5303A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/952eda2ec98e6fde27d25a8c6f398674062e398e/ghc >--------------------------------------------------------------- commit 952eda2ec98e6fde27d25a8c6f398674062e398e Author: ?mer Sinan A?acan Date: Tue Jan 19 14:56:59 2016 -0500 Fix IfaceType generation for TyCons without TyVars - This is only used for printing purposes (in :browse etc.). - Fixes #11266. Reviewers: goldfire, bgamari, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1799 GHC Trac Issues: #11266 >--------------------------------------------------------------- 952eda2ec98e6fde27d25a8c6f398674062e398e compiler/iface/MkIface.hs | 8 +++++++- testsuite/tests/ghci/scripts/T11266.script | 2 ++ testsuite/tests/ghci/scripts/all.T | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/compiler/iface/MkIface.hs b/compiler/iface/MkIface.hs index 1db02bd..8548eb3 100644 --- a/compiler/iface/MkIface.hs +++ b/compiler/iface/MkIface.hs @@ -1410,16 +1410,22 @@ tyConToIfaceDecl env tycon -- For pretty printing purposes only. = ( env , IfaceData { ifName = getOccName tycon, + ifKind = + -- These don't have `tyConTyVars`, so we use an empty + -- environment here, instead of `tc_env1` defined below. + tidyToIfaceType emptyTidyEnv (tyConKind tycon), ifCType = Nothing, ifTyVars = funAndPrimTyVars, ifRoles = tyConRoles tycon, - ifKind = if_kind, ifCtxt = [], ifCons = IfDataTyCon [] False [], ifRec = boolToRecFlag False, ifGadtSyntax = False, ifParent = IfNoParent }) where + -- NOTE: Not all TyCons have `tyConTyVars` field. Forcing this when `tycon` + -- is one of these TyCons (FunTyCon, PrimTyCon, PromotedDataCon) will cause + -- an error. (tc_env1, tc_tyvars) = tidyTyClTyCoVarBndrs env (tyConTyVars tycon) if_tc_tyvars = toIfaceTvBndrs tc_tyvars if_kind = tidyToIfaceType tc_env1 (tyConKind tycon) diff --git a/testsuite/tests/ghci/scripts/T11266.script b/testsuite/tests/ghci/scripts/T11266.script new file mode 100644 index 0000000..9b3df76 --- /dev/null +++ b/testsuite/tests/ghci/scripts/T11266.script @@ -0,0 +1,2 @@ +:m + GHC.Prim +:browse GHC.Prim diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T index 7a6225c..17bee5f 100755 --- a/testsuite/tests/ghci/scripts/all.T +++ b/testsuite/tests/ghci/scripts/all.T @@ -239,3 +239,4 @@ test('T10576a', expect_broken(10576), ghci_script, ['T10576a.script']) test('T10576b', expect_broken(10576), ghci_script, ['T10576b.script']) test('T11051a', normal, ghci_script, ['T11051a.script']) test('T11051b', normal, ghci_script, ['T11051b.script']) +test('T11266', check_stdout(lambda *args: 1), ghci_script, ['T11266.script']) From git at git.haskell.org Tue Jan 19 20:23:23 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 19 Jan 2016 20:23:23 +0000 (UTC) Subject: [commit: ghc] master: T11266: Improve the test by adding more of the other problematic modules (975bdac) Message-ID: <20160119202323.95D483A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/975bdacb2c72b2ffd4eb8108896f9f984c5d4fcf/ghc >--------------------------------------------------------------- commit 975bdacb2c72b2ffd4eb8108896f9f984c5d4fcf Author: ?mer Sinan A?acan Date: Tue Jan 19 15:23:50 2016 -0500 T11266: Improve the test by adding more of the other problematic modules >--------------------------------------------------------------- 975bdacb2c72b2ffd4eb8108896f9f984c5d4fcf testsuite/tests/ghci/scripts/T11266.script | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/testsuite/tests/ghci/scripts/T11266.script b/testsuite/tests/ghci/scripts/T11266.script index 9b3df76..713dbab 100644 --- a/testsuite/tests/ghci/scripts/T11266.script +++ b/testsuite/tests/ghci/scripts/T11266.script @@ -1,2 +1,4 @@ -:m + GHC.Prim +:m + GHC.Prim GHC.Base GHC.Exts :browse GHC.Prim +:browse GHC.Base +:browse GHC.Exts From git at git.haskell.org Wed Jan 20 08:10:27 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 20 Jan 2016 08:10:27 +0000 (UTC) Subject: [commit: ghc] master: Fix combineIdenticalAlts (514bac2) Message-ID: <20160120081027.766E83A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/514bac264cb60db26ff9da10c6b79c3f5bd6e96d/ghc >--------------------------------------------------------------- commit 514bac264cb60db26ff9da10c6b79c3f5bd6e96d Author: Simon Peyton Jones Date: Wed Jan 20 08:07:43 2016 +0000 Fix combineIdenticalAlts This long-standing bug in CoreUtils.combineIdenticalAlts was shown up by Trac #11172. The effect was that it returned a correct set of alternatives, but a bogus set of "impossible default constructors". That meant that we subsequently removed all the alternatives from a case, and hence ended up with a bogusly empty case that should not have been empty. See Note [Care with impossible-constructors when combining alternatives] in CoreUtils. >--------------------------------------------------------------- 514bac264cb60db26ff9da10c6b79c3f5bd6e96d compiler/coreSyn/CoreUtils.hs | 65 ++++++++++++++++------ testsuite/tests/simplCore/should_run/T11172.hs | 41 ++++++++++++++ testsuite/tests/simplCore/should_run/T11172.stdout | 1 + testsuite/tests/simplCore/should_run/all.T | 1 + 4 files changed, 91 insertions(+), 17 deletions(-) diff --git a/compiler/coreSyn/CoreUtils.hs b/compiler/coreSyn/CoreUtils.hs index 59f1d4f..b3931c8 100644 --- a/compiler/coreSyn/CoreUtils.hs +++ b/compiler/coreSyn/CoreUtils.hs @@ -585,7 +585,10 @@ filterAlts _tycon inst_tys imposs_cons alts impossible_alt inst_tys (DataAlt con, _, _) = dataConCannotMatch inst_tys con impossible_alt _ _ = False -refineDefaultAlt :: [Unique] -> TyCon -> [Type] -> [AltCon] -> [CoreAlt] -> (Bool, [CoreAlt]) +refineDefaultAlt :: [Unique] -> TyCon -> [Type] + -> [AltCon] -- Constructors tha cannot match the DEFAULT (if any) + -> [CoreAlt] + -> (Bool, [CoreAlt]) -- Refine the default alterantive to a DataAlt, -- if there is a unique way to do so refineDefaultAlt us tycon tys imposs_deflt_cons all_alts @@ -667,42 +670,70 @@ defeats combineIdenticalAlts (see Trac #7360). Note [Care with impossible-constructors when combining alternatives] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Suppose we have (Trac #10538) - data T = A | B | C + data T = A | B | C | D - ... case x::T of + case x::T of (Imposs-default-cons {A,B}) DEFAULT -> e1 A -> e2 B -> e1 -When calling combineIdentialAlts, we'll have computed that the "impossible -constructors" for the DEFAULT alt is {A,B}, since if x is A or B we'll -take the other alternatives. But suppose we combine B into the DEFAULT, -to get - ... case x::T of +When calling combineIdentialAlts, we'll have computed that the +"impossible constructors" for the DEFAULT alt is {A,B}, since if x is +A or B we'll take the other alternatives. But suppose we combine B +into the DEFAULT, to get + + case x::T of (Imposs-default-cons {A}) DEFAULT -> e1 A -> e2 + Then we must be careful to trim the impossible constructors to just {A}, else we risk compiling 'e1' wrong! --} +Not only that, but we take care when there is no DEFAULT beforehand, +because we are introducing one. Consider + + case x of (Imposs-default-cons {A,B,C}) + A -> e1 + B -> e2 + C -> e1 -combineIdenticalAlts :: [AltCon] -> [CoreAlt] -> (Bool, [AltCon], [CoreAlt]) +Then when combining the A and C alternatives we get + + case x of (Imposs-default-cons {B}) + DEFAULT -> e1 + B -> e2 + +Note that we have a new DEFAULT branch that we didn't have before. So +we need delete from the "impossible-default-constructors" all the +known-con alternatives that we have eliminated. (In Trac #11172 we +missed the first one.) + +combineIdenticalAlts :: [AltCon] -- Constructors that cannot match DEFAULT + -> [CoreAlt] + -> (Bool, -- True <=> something happened + [AltCon], -- New contructors that cannot match DEFAULT + [CoreAlt]) -- New alternatives -- See Note [Combine identical alternatives] --- See Note [Care with impossible-constructors when combining alternatives] -- True <=> we did some combining, result is a single DEFAULT alternative -combineIdenticalAlts imposs_cons ((_con1,bndrs1,rhs1) : con_alts) +combineIdenticalAlts imposs_deflt_cons ((con1,bndrs1,rhs1) : rest_alts) | all isDeadBinder bndrs1 -- Remember the default - , not (null eliminated_alts) -- alternative comes first - = (True, imposs_cons', deflt_alt : filtered_alts) + , not (null elim_rest) -- alternative comes first + = (True, imposs_deflt_cons', deflt_alt : filtered_rest) where - (eliminated_alts, filtered_alts) = partition identical_to_alt1 con_alts + (elim_rest, filtered_rest) = partition identical_to_alt1 rest_alts deflt_alt = (DEFAULT, [], mkTicks (concat tickss) rhs1) - imposs_cons' = imposs_cons `minusList` map fstOf3 eliminated_alts + + -- See Note [Care with impossible-constructors when combining alternatives] + imposs_deflt_cons' = imposs_deflt_cons `minusList` elim_cons + elim_cons = elim_con1 ++ map fstOf3 elim_rest + elim_con1 = case con1 of -- Don't forget con1! + DEFAULT -> [] -- See Note [ + _ -> [con1] cheapEqTicked e1 e2 = cheapEqExpr' tickishFloatable e1 e2 identical_to_alt1 (_con,bndrs,rhs) = all isDeadBinder bndrs && rhs `cheapEqTicked` rhs1 - tickss = map (stripTicksT tickishFloatable . thdOf3) eliminated_alts + tickss = map (stripTicksT tickishFloatable . thdOf3) elim_rest combineIdenticalAlts imposs_cons alts = (False, imposs_cons, alts) diff --git a/testsuite/tests/simplCore/should_run/T11172.hs b/testsuite/tests/simplCore/should_run/T11172.hs new file mode 100644 index 0000000..6cf5216 --- /dev/null +++ b/testsuite/tests/simplCore/should_run/T11172.hs @@ -0,0 +1,41 @@ +{-# LANGUAGE UnboxedTuples #-} +{-# OPTIONS_GHC -fno-warn-incomplete-patterns #-} +module Main where + +data JSONState = JSONState [()] () () deriving Show + +weta_s6yD :: Either a (b, c) -> (# (Either a b, JSONState) #) +weta_s6yD ww_s6ys = case ww_s6ys of + Left l -> (# (Left l, JSONState [] () ()) #) + Right (x, _) -> (# (Right x, JSONState [] () ()) #) + +eta_B1 :: (Either a (b, c), t) -> Either a1 (Either a b, JSONState) +eta_B1 (ww_s6ys, _) = case weta_s6yD ww_s6ys of + (# ww_s6zb #) -> Right ww_s6zb + +wks_s6yS :: Either a b -> (# (Either a b, JSONState) #) +wks_s6yS ww_s6yH = + case case ww_s6yH of + Left l_a4ay -> eta_B1 (Left l_a4ay, ()) + Right r_a4aB -> eta_B1 (Right (r_a4aB, ()), ()) + of + Right ww_s6ze -> (# ww_s6ze #) + +ks_a49u :: (Either a b, t) -> Either a1 (Either a b, JSONState) +ks_a49u (ww_s6yH, _) = case wks_s6yS ww_s6yH of + (# ww_s6ze #) -> Right ww_s6ze + +wks_s6z7 :: Either a b -> (# (Either a b, JSONState) #) +wks_s6z7 ww_s6yW = case ( + case ww_s6yW of + Left _ -> ks_a49u (ww_s6yW, JSONState [()] () ()) + Right _ -> ks_a49u (ww_s6yW, JSONState [] () ()) + ) of + Right ww_s6zh -> (# ww_s6zh #) + +ks_X3Sb :: Either () Int -> Either String (Either () Int, JSONState) +ks_X3Sb ww_s6yW = case wks_s6z7 ww_s6yW of + (# ww_s6zh #) -> Right ww_s6zh + +main :: IO () +main = print $ ks_X3Sb (Left ()) diff --git a/testsuite/tests/simplCore/should_run/T11172.stdout b/testsuite/tests/simplCore/should_run/T11172.stdout new file mode 100644 index 0000000..9173c65 --- /dev/null +++ b/testsuite/tests/simplCore/should_run/T11172.stdout @@ -0,0 +1 @@ +Right (Left (),JSONState [] () ()) diff --git a/testsuite/tests/simplCore/should_run/all.T b/testsuite/tests/simplCore/should_run/all.T index ba775b7..9c15b0f 100644 --- a/testsuite/tests/simplCore/should_run/all.T +++ b/testsuite/tests/simplCore/should_run/all.T @@ -70,3 +70,4 @@ test('T457', [ only_ways(['normal','optasm']), exit_code(1) ], compile_and_run, test('T9128', normal, compile_and_run, ['']) test('T9390', normal, compile_and_run, ['']) test('T10830', extra_run_opts('+RTS -K100k -RTS'), compile_and_run, ['']) +test('T11172', normal, compile_and_run, ['']) From git at git.haskell.org Wed Jan 20 09:29:35 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 20 Jan 2016 09:29:35 +0000 (UTC) Subject: [commit: ghc] master: Oops. Add missing close-comment (0373a84) Message-ID: <20160120092935.924AA3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/0373a8458a9d5ed0732d06ffd082b939c11b6adc/ghc >--------------------------------------------------------------- commit 0373a8458a9d5ed0732d06ffd082b939c11b6adc Author: Simon Peyton Jones Date: Wed Jan 20 09:27:31 2016 +0000 Oops. Add missing close-comment This fixes 514bac2 for Trac #11172. Sorry! >--------------------------------------------------------------- 0373a8458a9d5ed0732d06ffd082b939c11b6adc compiler/coreSyn/CoreUtils.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/coreSyn/CoreUtils.hs b/compiler/coreSyn/CoreUtils.hs index b3931c8..3664d8e 100644 --- a/compiler/coreSyn/CoreUtils.hs +++ b/compiler/coreSyn/CoreUtils.hs @@ -708,6 +708,8 @@ we need delete from the "impossible-default-constructors" all the known-con alternatives that we have eliminated. (In Trac #11172 we missed the first one.) +-} + combineIdenticalAlts :: [AltCon] -- Constructors that cannot match DEFAULT -> [CoreAlt] -> (Bool, -- True <=> something happened From git at git.haskell.org Wed Jan 20 11:20:27 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 20 Jan 2016 11:20:27 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Fix bootstrapping with GHC 7.8. (36e1fea) Message-ID: <20160120112027.35D923A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/36e1fead2fa63ad3d73d2e0fafbb305ff35cd08a/ghc >--------------------------------------------------------------- commit 36e1fead2fa63ad3d73d2e0fafbb305ff35cd08a Author: Edward Z. Yang Date: Wed Jan 20 11:22:43 2016 +0100 Fix bootstrapping with GHC 7.8. Test Plan: bootstrap with GHC 7.8 Reviewers: hvr, austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1803 >--------------------------------------------------------------- 36e1fead2fa63ad3d73d2e0fafbb305ff35cd08a mk/config.mk.in | 1 + rules/distdir-way-opts.mk | 18 +++++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/mk/config.mk.in b/mk/config.mk.in index fcc4b8a..a8581e3 100644 --- a/mk/config.mk.in +++ b/mk/config.mk.in @@ -500,6 +500,7 @@ GHC_PACKAGE_DB_FLAG = @GHC_PACKAGE_DB_FLAG@ CMM_SINK_BOOTSTRAP_IS_NEEDED = @CMM_SINK_BOOTSTRAP_IS_NEEDED@ +SUPPORTS_COMPONENT_ID = @SUPPORTS_COMPONENT_ID@ SUPPORTS_THIS_UNIT_ID = @SUPPORTS_THIS_UNIT_ID@ #----------------------------------------------------------------------------- diff --git a/rules/distdir-way-opts.mk b/rules/distdir-way-opts.mk index 66c00af..f099d4e 100644 --- a/rules/distdir-way-opts.mk +++ b/rules/distdir-way-opts.mk @@ -96,18 +96,22 @@ define distdir-way-opts # args: $1 = dir, $2 = distdir, $3 = way, $4 = stage # $1_$2_$3_MOST_HC_OPTS is also passed to C compilations when we use # GHC as the C compiler. -ifeq "$(SUPPORTS_THIS_UNIT_ID)" "NO" -ifeq "$4" "0" -$4_USE_THIS_UNIT_ID=NO -endif -endif - $1_$2_$4_DEP_OPTS = \ $$(foreach pkg,$$($1_$2_DEP_IPIDS),-package-id $$(pkg)) -ifeq "$($4_USE_THIS_UNIT_ID)" "NO" +# These are really all misnomers; SUPPORTS_COMPONENT_ID just tests for >=7.9 +# and SUPPORTS_THIS_UNIT_ID >=7.11 +ifeq "$4" "0" +ifeq "$(SUPPORTS_THIS_UNIT_ID)" "YES" +$4_THIS_UNIT_ID = -this-unit-id +else +ifeq "$(SUPPORTS_COMPONENT_ID)" "YES" $4_THIS_UNIT_ID = -this-package-key else +$4_THIS_UNIT_ID = -package-name +endif +endif +else $4_THIS_UNIT_ID = -this-unit-id endif From git at git.haskell.org Wed Jan 20 15:26:03 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 20 Jan 2016 15:26:03 +0000 (UTC) Subject: [commit: packages/stm] master: Do not run tests when stm is not installed (302aabc) Message-ID: <20160120152603.93A893A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/stm On branch : master Link : http://git.haskell.org/packages/stm.git/commitdiff/302aabc3799550b487a45f4c037b9ffbc0cfbc9a >--------------------------------------------------------------- commit 302aabc3799550b487a45f4c037b9ffbc0cfbc9a Author: Thomas Miedema Date: Wed Jan 20 16:25:35 2016 +0100 Do not run tests when stm is not installed >--------------------------------------------------------------- 302aabc3799550b487a45f4c037b9ffbc0cfbc9a tests/all.T | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/all.T b/tests/all.T index 6843c74..0efd7e8 100644 --- a/tests/all.T +++ b/tests/all.T @@ -1,3 +1,5 @@ +setTestOpts(reqlib('stm')) + test('stm046', only_compiler_types(['ghc']), compile_and_run, ['']) # Omit GHCi for these two, since they appear to deadlock (23/11/2004 --SDM) From git at git.haskell.org Wed Jan 20 16:07:13 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 20 Jan 2016 16:07:13 +0000 (UTC) Subject: [commit: ghc] master: Rework derivation of type representations for wired-in things (84b0ebe) Message-ID: <20160120160713.94A073A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/84b0ebedd09fcfbda8efd7576dce9f52a2b6e6ca/ghc >--------------------------------------------------------------- commit 84b0ebedd09fcfbda8efd7576dce9f52a2b6e6ca Author: Ben Gamari Date: Wed Jan 20 16:06:31 2016 +0100 Rework derivation of type representations for wired-in things Previously types defined by `GHC.Types` and `GHC.Prim` had their `Typeable` representations manually defined in `GHC.Typeable.Internals`. This was terrible, resulting in a great deal of boilerplate and a number of bugs due to missing or inconsistent representations (see #11120). Here we take a different tack, initially proposed by Richard Eisenberg: We wire-in the `Module`, `TrName`, and `TyCon` types, allowing them to be used in `GHC.Types`. We then allow the usual type representation generation logic to handle this module. `GHC.Prim`, on the other hand, is a bit tricky as it has no object code of its own. To handle this we instead place the type representations for the types defined here in `GHC.Types`. On the whole this eliminates several special-cases as well as a fair amount of boilerplate from hand-written representations. Moreover, we get full coverage of primitive types for free. Test Plan: Validate Reviewers: goldfire, simonpj, austin, hvr Subscribers: goldfire, simonpj, thomie Differential Revision: https://phabricator.haskell.org/D1774 GHC Trac Issues: #11120 >--------------------------------------------------------------- 84b0ebedd09fcfbda8efd7576dce9f52a2b6e6ca compiler/basicTypes/OccName.hs | 13 +- compiler/basicTypes/Unique.hs | 16 +-- compiler/iface/BuildTyCl.hs | 4 +- compiler/prelude/PrelNames.hs | 40 +++--- compiler/prelude/TysPrim.hs | 4 +- compiler/prelude/TysWiredIn.hs | 113 ++++++++------- compiler/typecheck/TcRnDriver.hs | 5 +- compiler/typecheck/TcTypeable.hs | 155 ++++++++++++--------- compiler/types/TyCon.hs | 31 ++++- compiler/vectorise/Vectorise/Type/TyConDecl.hs | 2 +- libraries/base/Data/Typeable/Internal.hs | 94 +++---------- libraries/ghc-prim/GHC/Types.hs | 12 -- .../tests/ghci.debugger/scripts/print019.stderr | 2 +- testsuite/tests/typecheck/should_run/T11120.hs | 10 ++ testsuite/tests/typecheck/should_run/T11120.stdout | 1 + testsuite/tests/typecheck/should_run/all.T | 1 + 16 files changed, 255 insertions(+), 248 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 84b0ebedd09fcfbda8efd7576dce9f52a2b6e6ca From git at git.haskell.org Wed Jan 20 16:07:16 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 20 Jan 2016 16:07:16 +0000 (UTC) Subject: [commit: ghc] master: Use (&&) instead of `if` in Ix derivation (5cce095) Message-ID: <20160120160716.C2F2C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/5cce09543db827e662539523ffff4513deb92777/ghc >--------------------------------------------------------------- commit 5cce09543db827e662539523ffff4513deb92777 Author: Ben Gamari Date: Tue Jan 19 16:30:26 2016 +0100 Use (&&) instead of `if` in Ix derivation We were previously using `if` in the derivation of `Ix` instances. This interacts badly with RebindableSyntax as the typechecker doesn't infer the type of the argument we give to `tagToEnum#`. Previously we produced, `if (ch >= ah) then (ch <= bh) else False`. We now produce `(ch >= ah) && (ch <= bh)` Fixes #11396. Test Plan: Validate Reviewers: austin, simonpj Reviewed By: simonpj Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1797 GHC Trac Issues: #11396 >--------------------------------------------------------------- 5cce09543db827e662539523ffff4513deb92777 compiler/typecheck/TcGenDeriv.hs | 13 ++++++++----- testsuite/tests/deriving/should_compile/T11396.hs | 11 +++++++++++ testsuite/tests/deriving/should_compile/all.T | 1 + 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/compiler/typecheck/TcGenDeriv.hs b/compiler/typecheck/TcGenDeriv.hs index c4279a7..218c0a4 100644 --- a/compiler/typecheck/TcGenDeriv.hs +++ b/compiler/typecheck/TcGenDeriv.hs @@ -783,16 +783,19 @@ gen_Ix_binds loc tycon )) ) + -- This produces something like `(ch >= ah) && (ch <= bh)` enum_inRange = mk_easy_FunBind loc inRange_RDR [nlTuplePat [a_Pat, b_Pat] Boxed, c_Pat] $ untag_Expr tycon [(a_RDR, ah_RDR)] ( untag_Expr tycon [(b_RDR, bh_RDR)] ( untag_Expr tycon [(c_RDR, ch_RDR)] ( - nlHsIf (genPrimOpApp (nlHsVar ch_RDR) geInt_RDR (nlHsVar ah_RDR)) ( - (genPrimOpApp (nlHsVar ch_RDR) leInt_RDR (nlHsVar bh_RDR)) - ) {-else-} ( - false_Expr - )))) + -- This used to use `if`, which interacts badly with RebindableSyntax. + -- See #11396. + nlHsApps and_RDR + [ genPrimOpApp (nlHsVar ch_RDR) geInt_RDR (nlHsVar ah_RDR) + , genPrimOpApp (nlHsVar ch_RDR) leInt_RDR (nlHsVar bh_RDR) + ] + ))) -------------------------------------------------------------- single_con_ixes diff --git a/testsuite/tests/deriving/should_compile/T11396.hs b/testsuite/tests/deriving/should_compile/T11396.hs new file mode 100644 index 0000000..ecb930c --- /dev/null +++ b/testsuite/tests/deriving/should_compile/T11396.hs @@ -0,0 +1,11 @@ +{-# LANGUAGE RebindableSyntax #-} +module IfThenElseIx where + +import Data.Ix (Ix, ) +import Prelude + +ifThenElse :: Bool -> a -> a -> a +ifThenElse True x _ = x +ifThenElse False _ x = x + +data T = A | B deriving (Eq, Ord, Ix) diff --git a/testsuite/tests/deriving/should_compile/all.T b/testsuite/tests/deriving/should_compile/all.T index a18a257..4589a86 100644 --- a/testsuite/tests/deriving/should_compile/all.T +++ b/testsuite/tests/deriving/should_compile/all.T @@ -62,3 +62,4 @@ test('T11148', normal, run_command, ['$MAKE -s --no-print-directory T11148']) test('T9968', normal, compile, ['']) test('T11416', normal, compile, ['']) +test('T11396', normal, compile, ['']) From git at git.haskell.org Wed Jan 20 16:44:47 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 20 Jan 2016 16:44:47 +0000 (UTC) Subject: [commit: ghc] master: Add test T9407 (Windows) (225afc4) Message-ID: <20160120164447.3FB4F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/225afc4ace4dff4ae52ac2147942cdeeb76fc723/ghc >--------------------------------------------------------------- commit 225afc4ace4dff4ae52ac2147942cdeeb76fc723 Author: Rik Steenkamp Date: Wed Jan 20 12:39:00 2016 +0100 Add test T9407 (Windows) Add test for #9407. The test is only run on Windows 64bit, as this is where the problem occurred. Reviewed by: thomie Differential Revision: https://phabricator.haskell.org/D1806 >--------------------------------------------------------------- 225afc4ace4dff4ae52ac2147942cdeeb76fc723 testsuite/tests/numeric/should_run/T9407.hs | 55 +++++++++++++++++++++++++ testsuite/tests/numeric/should_run/T9407.stdout | 1 + testsuite/tests/numeric/should_run/all.T | 5 +++ 3 files changed, 61 insertions(+) diff --git a/testsuite/tests/numeric/should_run/T9407.hs b/testsuite/tests/numeric/should_run/T9407.hs new file mode 100644 index 0000000..8e6b4fe --- /dev/null +++ b/testsuite/tests/numeric/should_run/T9407.hs @@ -0,0 +1,55 @@ +data Vec3 = Vec3 !Double !Double !Double + deriving (Show) + +infixl 6 ^+^, ^-^ +infixr 7 *^, <.> + +negateV :: Vec3 -> Vec3 +negateV (Vec3 x y z) = Vec3 (-x) (-y) (-z) + +(^+^), (^-^) :: Vec3 -> Vec3 -> Vec3 +Vec3 x1 y1 z1 ^+^ Vec3 x2 y2 z2 = Vec3 (x1 + x2) (y1 + y2) (z1 + z2) +v ^-^ v' = v ^+^ negateV v' + +(*^) :: Double -> Vec3 -> Vec3 +s *^ Vec3 x y z = Vec3 (s * x) (s * y) (s * z) + +(<.>) :: Vec3 -> Vec3 -> Double +Vec3 x1 y1 z1 <.> Vec3 x2 y2 z2 = x1 * x2 + y1 * y2 + z1 * z2 + +magnitudeSq :: Vec3 -> Double +magnitudeSq v = v <.> v + +normalized :: Vec3 -> Vec3 +normalized v = (1 / sqrt (magnitudeSq v)) *^ v + +class Surface s where + intersectSurfaceWithRay :: s -> Vec3 -> Vec3 -> Maybe Vec3 + +data Sphere = Sphere Vec3 Double + +instance Surface Sphere where + intersectSurfaceWithRay (Sphere c r) o d = + let c' = c ^-^ o + b = c' <.> d + det = b^2 - magnitudeSq c' + r^2 + det' = sqrt det + t1 = b - det' + t2 = b + det' + + returnIntersection t = + let x = o ^+^ t *^ d + in Just (normalized (x ^-^ c)) + in if det < 0 then Nothing + else if t1 > 1e-6 then returnIntersection t1 + else if t2 > 1e-6 then returnIntersection t2 + else Nothing + +iappend :: Maybe Vec3 -> Maybe Vec3 -> Maybe Vec3 +Nothing `iappend` i2 = i2 +i1 `iappend` _ = i1 + +main :: IO () +main = print $ foldl combine Nothing [Sphere (Vec3 0 0 0) 1] + where combine accum surf = accum `iappend` + intersectSurfaceWithRay surf (Vec3 0 0 5) (Vec3 0 0 (-1)) diff --git a/testsuite/tests/numeric/should_run/T9407.stdout b/testsuite/tests/numeric/should_run/T9407.stdout new file mode 100644 index 0000000..03535cc --- /dev/null +++ b/testsuite/tests/numeric/should_run/T9407.stdout @@ -0,0 +1 @@ +Just (Vec3 0.0 0.0 1.0) \ No newline at end of file diff --git a/testsuite/tests/numeric/should_run/all.T b/testsuite/tests/numeric/should_run/all.T index 7ebdd44..b097c7f 100644 --- a/testsuite/tests/numeric/should_run/all.T +++ b/testsuite/tests/numeric/should_run/all.T @@ -62,6 +62,11 @@ test('T7233', normal, compile_and_run, ['']) test('NumDecimals', normal, compile_and_run, ['']) test('T8726', normal, compile_and_run, ['']) test('CarryOverflow', omit_ways(['ghci']), compile_and_run, ['']) +test('T9407', [ + unless(opsys('mingw32') and wordsize(64), skip), + only_ways(['optasm']) + ], + compile_and_run, ['']) test('T9810', normal, compile_and_run, ['']) test('T10011', normal, compile_and_run, ['']) test('T10962', omit_ways(['ghci']), compile_and_run, ['']) From git at git.haskell.org Wed Jan 20 16:44:50 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 20 Jan 2016 16:44:50 +0000 (UTC) Subject: [commit: ghc] master: Update submodule stm + random (6ddc991) Message-ID: <20160120164450.038173A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/6ddc99116d0107d7781dff1b93d3e8b6f42a99ed/ghc >--------------------------------------------------------------- commit 6ddc99116d0107d7781dff1b93d3e8b6f42a99ed Author: Thomas Miedema Date: Wed Jan 20 17:41:53 2016 +0100 Update submodule stm + random Skip random tests when random is not built. Skip stm tests when stm is not built. >--------------------------------------------------------------- 6ddc99116d0107d7781dff1b93d3e8b6f42a99ed libraries/random | 2 +- libraries/stm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/random b/libraries/random index cfdfe6f..c72dd0a 160000 --- a/libraries/random +++ b/libraries/random @@ -1 +1 @@ -Subproject commit cfdfe6f09ad414fde5b855cc5f90207533413241 +Subproject commit c72dd0a01ae6255bead2d4fad33f002bb5684030 diff --git a/libraries/stm b/libraries/stm index 844f84c..302aabc 160000 --- a/libraries/stm +++ b/libraries/stm @@ -1 +1 @@ -Subproject commit 844f84c21f94282187f35a6684d3c3c9f32cf2df +Subproject commit 302aabc3799550b487a45f4c037b9ffbc0cfbc9a From git at git.haskell.org Wed Jan 20 20:30:05 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 20 Jan 2016 20:30:05 +0000 (UTC) Subject: [commit: ghc] master: substTy to substTyUnchecked to fix Travis build (48d4bc5) Message-ID: <20160120203005.56F163A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/48d4bc53c517d5e2ac3ff734a7d7a0e2d9454717/ghc >--------------------------------------------------------------- commit 48d4bc53c517d5e2ac3ff734a7d7a0e2d9454717 Author: Bartosz Nitka Date: Wed Jan 20 08:58:52 2016 -0800 substTy to substTyUnchecked to fix Travis build This fixes the immediate problem from https://s3.amazonaws.com/archive.travis-ci.org/jobs/103319396/log.txt Test Plan: ./validate Reviewers: bgamari, austin, thomie Differential Revision: https://phabricator.haskell.org/D1802 GHC Trac Issues: #11371 >--------------------------------------------------------------- 48d4bc53c517d5e2ac3ff734a7d7a0e2d9454717 compiler/main/HscTypes.hs | 2 +- compiler/main/InteractiveEval.hs | 5 +++-- compiler/typecheck/FunDeps.hs | 4 ++-- compiler/types/OptCoercion.hs | 8 ++++---- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/compiler/main/HscTypes.hs b/compiler/main/HscTypes.hs index 9b4cd65..16a1ebd 100644 --- a/compiler/main/HscTypes.hs +++ b/compiler/main/HscTypes.hs @@ -1529,7 +1529,7 @@ substInteractiveContext ictxt at InteractiveContext{ ic_tythings = tts } subst | isEmptyTCvSubst subst = ictxt | otherwise = ictxt { ic_tythings = map subst_ty tts } where - subst_ty (AnId id) = AnId $ id `setIdType` substTy subst (idType id) + subst_ty (AnId id) = AnId $ id `setIdType` substTyUnchecked subst (idType id) subst_ty tt = tt instance Outputable InteractiveImport where diff --git a/compiler/main/InteractiveEval.hs b/compiler/main/InteractiveEval.hs index 6356928..b7ed44f 100644 --- a/compiler/main/InteractiveEval.hs +++ b/compiler/main/InteractiveEval.hs @@ -533,12 +533,13 @@ bindLocalsAtBreakpoint hsc_env apStack_fhv (Just BreakInfo{..}) = do let tv_subst = newTyVars us free_tvs filtered_ids = [ id | (id, Just _hv) <- zip ids mb_hValues ] (_,tidy_tys) = tidyOpenTypes emptyTidyEnv $ - map (substTy tv_subst . idType) filtered_ids + map (substTyUnchecked tv_subst . idType) filtered_ids new_ids <- zipWith3M mkNewId occs tidy_tys filtered_ids result_name <- newInteractiveBinder hsc_env (mkVarOccFS result_fs) span - let result_id = Id.mkVanillaGlobal result_name (substTy tv_subst result_ty) + let result_id = Id.mkVanillaGlobal result_name + (substTyUnchecked tv_subst result_ty) result_ok = isPointer result_id final_ids | result_ok = result_id : new_ids diff --git a/compiler/typecheck/FunDeps.hs b/compiler/typecheck/FunDeps.hs index edf1781..1a0c310 100644 --- a/compiler/typecheck/FunDeps.hs +++ b/compiler/typecheck/FunDeps.hs @@ -286,7 +286,7 @@ improveClsFD clas_tvs fd -- executed. What we're doing instead is recording the partial -- work of the ls1/ls2 unification leaving a smaller unification problem where - rtys1' = map (substTy subst) rtys1 + rtys1' = map (substTyUnchecked subst) rtys1 fdeqs = zipAndComputeFDEqs (\_ _ -> False) rtys1' rtys2 -- Don't discard anything! @@ -294,7 +294,7 @@ improveClsFD clas_tvs fd -- eqType again, since we know for sure that /at least one/ -- equation in there is useful) - meta_tvs = [ setVarType tv (substTy subst (varType tv)) + meta_tvs = [ setVarType tv (substTyUnchecked subst (varType tv)) | tv <- qtvs, tv `notElemTCvSubst` subst ] -- meta_tvs are the quantified type variables -- that have not been substituted out diff --git a/compiler/types/OptCoercion.hs b/compiler/types/OptCoercion.hs index 8e7a08d..b867259 100644 --- a/compiler/types/OptCoercion.hs +++ b/compiler/types/OptCoercion.hs @@ -91,8 +91,8 @@ optCoercion env co (Pair in_ty1 in_ty2, in_role) = coercionKindRole co (Pair out_ty1 out_ty2, out_role) = coercionKindRole out_co in - ASSERT2( substTy env in_ty1 `eqType` out_ty1 && - substTy env in_ty2 `eqType` out_ty2 && + ASSERT2( substTyUnchecked env in_ty1 `eqType` out_ty1 && + substTyUnchecked env in_ty2 `eqType` out_ty2 && in_role == out_role , text "optCoercion changed types!" $$ hang (text "in_co:") 2 (ppr co) @@ -371,8 +371,8 @@ opt_univ env sym prov role oty1 oty2 mkForAllCo tv1' eta' (opt_univ env' sym prov role ty1 ty2') | otherwise - = let ty1 = substTy (lcSubstLeft env) oty1 - ty2 = substTy (lcSubstRight env) oty2 + = let ty1 = substTyUnchecked (lcSubstLeft env) oty1 + ty2 = substTyUnchecked (lcSubstRight env) oty2 (a, b) | sym = (ty2, ty1) | otherwise = (ty1, ty2) in From git at git.haskell.org Thu Jan 21 06:01:05 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Jan 2016 06:01:05 +0000 (UTC) Subject: [commit: ghc] wip/exp-types: Testsuite. (5d1fd50) Message-ID: <20160121060105.E15B83A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/exp-types Link : http://ghc.haskell.org/trac/ghc/changeset/5d1fd50a8be4b09f5e2524d123b8520d3a30d4fd/ghc >--------------------------------------------------------------- commit 5d1fd50a8be4b09f5e2524d123b8520d3a30d4fd Author: Richard Eisenberg Date: Thu Jan 21 01:02:06 2016 -0500 Testsuite. >--------------------------------------------------------------- 5d1fd50a8be4b09f5e2524d123b8520d3a30d4fd compiler/deSugar/Check.hs | 151 +++++++++++---------- compiler/deSugar/DsArrows.hs | 4 +- compiler/deSugar/DsMeta.hs | 4 +- compiler/deSugar/Match.hs | 8 +- compiler/deSugar/MatchCon.hs | 1 + compiler/deSugar/MatchLit.hs | 30 ++-- compiler/hsSyn/HsPat.hs | 10 +- compiler/hsSyn/HsUtils.hs | 12 +- compiler/rename/RnPat.hs | 8 +- compiler/typecheck/Inst.hs | 1 + compiler/typecheck/TcErrors.hs | 10 +- compiler/typecheck/TcHsSyn.hs | 14 +- compiler/typecheck/TcMType.hs | 7 +- compiler/typecheck/TcPat.hs | 15 +- compiler/typecheck/TcPatSyn.hs | 6 +- compiler/typecheck/TcUnify.hs | 15 +- .../tests/indexed-types/should_compile/T3484.hs | 4 +- .../tests/indexed-types/should_compile/T4120.hs | 4 +- .../tests/indexed-types/should_compile/T4494.hs | 3 +- .../tests/indexed-types/should_compile/T9090.hs | 2 +- .../tests/indexed-types/should_compile/T9316.hs | 2 +- .../tests/indexed-types/should_fail/T3330a.hs | 3 +- .../tests/indexed-types/should_fail/T5934.stderr | 11 +- .../tests/indexed-types/should_fail/T7788.stderr | 7 +- .../tests/indexed-types/should_fail/T8518.stderr | 33 +++-- testsuite/tests/module/mod71.stderr | 6 +- .../should_fail/overloadedlistsfail03.hs | 2 +- .../should_fail/overloadedlistsfail03.stderr | 13 +- .../should_fail/overloadedlistsfail05.hs | 2 +- .../should_fail/overloadedlistsfail05.stderr | 15 +- .../tests/parser/should_compile/read014.stderr | 8 +- testsuite/tests/parser/should_fail/T7848.stderr | 42 ++---- .../partial-sigs/should_compile/T10438.stderr | 16 +-- .../partial-sigs/should_compile/T11192.stderr | 12 +- testsuite/tests/polykinds/T7438.stderr | 16 +-- 35 files changed, 265 insertions(+), 232 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 5d1fd50a8be4b09f5e2524d123b8520d3a30d4fd From git at git.haskell.org Thu Jan 21 09:41:34 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Jan 2016 09:41:34 +0000 (UTC) Subject: [commit: ghc] master: MkId: Update OpenKind reference (1ce1371) Message-ID: <20160121094134.CE71B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/1ce137141b7cb3a3c2b111b6121740025bf85570/ghc >--------------------------------------------------------------- commit 1ce137141b7cb3a3c2b111b6121740025bf85570 Author: Ben Gamari Date: Thu Jan 21 10:35:19 2016 +0100 MkId: Update OpenKind reference >--------------------------------------------------------------- 1ce137141b7cb3a3c2b111b6121740025bf85570 compiler/basicTypes/MkId.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/basicTypes/MkId.hs b/compiler/basicTypes/MkId.hs index 6876956..f3063e9 100644 --- a/compiler/basicTypes/MkId.hs +++ b/compiler/basicTypes/MkId.hs @@ -1375,7 +1375,8 @@ no further floating will occur. This allows us to safely inline things like While the definition of @GHC.Magic.runRW#@, we override its type in @MkId@ to be open-kinded, - runRW# :: (o :: OpenKind) => (State# RealWorld -> (# State# RealWorld, o #)) + runRW# :: forall (lev :: Levity). (o :: TYPE lev) + => (State# RealWorld -> (# State# RealWorld, o #)) -> (# State# RealWorld, o #) From git at git.haskell.org Thu Jan 21 10:05:08 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Jan 2016 10:05:08 +0000 (UTC) Subject: [commit: ghc] master: Add comments about tyCoVarsOfType (2e65aae) Message-ID: <20160121100508.53EBB3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/2e65aae757e789d70249086b76b97ab975747525/ghc >--------------------------------------------------------------- commit 2e65aae757e789d70249086b76b97ab975747525 Author: Simon Peyton Jones Date: Wed Jan 20 22:13:39 2016 +0000 Add comments about tyCoVarsOfType See Note [Free variables of types]. Richard to check. >--------------------------------------------------------------- 2e65aae757e789d70249086b76b97ab975747525 compiler/types/TyCoRep.hs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/compiler/types/TyCoRep.hs b/compiler/types/TyCoRep.hs index bd5745a..85d91f5 100644 --- a/compiler/types/TyCoRep.hs +++ b/compiler/types/TyCoRep.hs @@ -1123,22 +1123,41 @@ Here, %************************************************************************ -} +{- Note [Free variables of types] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +The family of functions tyCoVarsOfType, tyCoVarsOfTypes etc, returns +a VarSet that is closed over the types of its variables. More precisely, + if S = tyCoVarsOfType( t ) + and (a:k) is in S + then tyCoVarsOftype( k ) is a subset of S + +Example: The tyCoVars of this ((a:* -> k) Int) is {a, k}. + +We could /not/ close over the kinds of the variable occurrences, and +instead do so at call sites, but it seems that we always want to do +so, so it's easiest to do it here. +-} + + -- | Returns free variables of a type, including kind variables as -- a non-deterministic set. For type synonyms it does /not/ expand the -- synonym. tyCoVarsOfType :: Type -> TyCoVarSet +-- See Note [Free variables of types] tyCoVarsOfType ty = runFVSet $ tyCoVarsOfTypeAcc ty -- | `tyVarsOfType` that returns free variables of a type in a deterministic -- set. For explanation of why using `VarSet` is not deterministic see -- Note [Deterministic FV] in FV. tyCoVarsOfTypeDSet :: Type -> DTyCoVarSet +-- See Note [Free variables of types] tyCoVarsOfTypeDSet ty = runFVDSet $ tyCoVarsOfTypeAcc ty -- | `tyVarsOfType` that returns free variables of a type in deterministic -- order. For explanation of why using `VarSet` is not deterministic see -- Note [Deterministic FV] in FV. tyCoVarsOfTypeList :: Type -> [TyCoVar] +-- See Note [Free variables of types] tyCoVarsOfTypeList ty = runFVList $ tyCoVarsOfTypeAcc ty -- | The worker for `tyVarsOfType` and `tyVarsOfTypeList`. @@ -1150,6 +1169,7 @@ tyCoVarsOfTypeList ty = runFVList $ tyCoVarsOfTypeAcc ty -- -- Eta-expanded because that makes it run faster (apparently) tyCoVarsOfTypeAcc :: Type -> FV +-- See Note [Free variables of types] tyCoVarsOfTypeAcc (TyVarTy v) a b c = (oneVar v `unionFV` tyCoVarsOfTypeAcc (tyVarKind v)) a b c tyCoVarsOfTypeAcc (TyConApp _ tys) a b c = tyCoVarsOfTypesAcc tys a b c tyCoVarsOfTypeAcc (LitTy {}) a b c = noVars a b c @@ -1167,36 +1187,44 @@ tyCoVarsBndrAcc bndr fvs = delBinderVarFV bndr fvs -- a non-deterministic set. For type synonyms it does /not/ expand the -- synonym. tyCoVarsOfTypes :: [Type] -> TyCoVarSet +-- See Note [Free variables of types] tyCoVarsOfTypes tys = runFVSet $ tyCoVarsOfTypesAcc tys -- | Returns free variables of types, including kind variables as -- a deterministic set. For type synonyms it does /not/ expand the -- synonym. tyCoVarsOfTypesDSet :: [Type] -> DTyCoVarSet +-- See Note [Free variables of types] tyCoVarsOfTypesDSet tys = runFVDSet $ tyCoVarsOfTypesAcc tys -- | Returns free variables of types, including kind variables as -- a deterministically ordered list. For type synonyms it does /not/ expand the -- synonym. tyCoVarsOfTypesList :: [Type] -> [TyCoVar] +-- See Note [Free variables of types] tyCoVarsOfTypesList tys = runFVList $ tyCoVarsOfTypesAcc tys tyCoVarsOfTypesAcc :: [Type] -> FV +-- See Note [Free variables of types] tyCoVarsOfTypesAcc (ty:tys) fv_cand in_scope acc = (tyCoVarsOfTypeAcc ty `unionFV` tyCoVarsOfTypesAcc tys) fv_cand in_scope acc tyCoVarsOfTypesAcc [] fv_cand in_scope acc = noVars fv_cand in_scope acc tyCoVarsOfCo :: Coercion -> TyCoVarSet +-- See Note [Free variables of types] tyCoVarsOfCo co = runFVSet $ tyCoVarsOfCoAcc co -- | Get a deterministic set of the vars free in a coercion tyCoVarsOfCoDSet :: Coercion -> DTyCoVarSet +-- See Note [Free variables of types] tyCoVarsOfCoDSet co = runFVDSet $ tyCoVarsOfCoAcc co tyCoVarsOfCoList :: Coercion -> [TyCoVar] +-- See Note [Free variables of types] tyCoVarsOfCoList co = runFVList $ tyCoVarsOfCoAcc co tyCoVarsOfCoAcc :: Coercion -> FV -- Extracts type and coercion variables from a coercion +-- See Note [Free variables of types] tyCoVarsOfCoAcc (Refl _ ty) fv_cand in_scope acc = tyCoVarsOfTypeAcc ty fv_cand in_scope acc tyCoVarsOfCoAcc (TyConAppCo _ _ cos) fv_cand in_scope acc = tyCoVarsOfCosAcc cos fv_cand in_scope acc tyCoVarsOfCoAcc (AppCo co arg) fv_cand in_scope acc From git at git.haskell.org Thu Jan 21 10:08:34 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Jan 2016 10:08:34 +0000 (UTC) Subject: [commit: ghc] master: Re-add missing kind generalisation (c572430) Message-ID: <20160121100834.1B0083A301@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/c572430cdade1d8c66fa9c4f1f251dfce09243f0/ghc >--------------------------------------------------------------- commit c572430cdade1d8c66fa9c4f1f251dfce09243f0 Author: Simon Peyton Jones Date: Tue Jan 19 13:18:39 2016 +0000 Re-add missing kind generalisation When splitting H98/GADT syntax in ConDecl we lost a key kind-generalisation step. I also renamed tcHsTyVarBndrs to tcExplicitTKBnders, by analogy with tcImplicitTkBndrs. This fixes Trac #11459. Merge to 8.0. >--------------------------------------------------------------- c572430cdade1d8c66fa9c4f1f251dfce09243f0 compiler/typecheck/TcBinds.hs | 2 +- compiler/typecheck/TcHsType.hs | 18 ++++++------- compiler/typecheck/TcPatSyn.hs | 6 ++--- compiler/typecheck/TcTyClsDecls.hs | 31 ++++++++++++---------- compiler/typecheck/TcValidity.hs | 2 +- testsuite/tests/ghci/scripts/T7873.stdout | 8 +++--- testsuite/tests/polykinds/T11459.hs | 14 ++++++++++ testsuite/tests/polykinds/T11459.stderr | 9 +++++++ testsuite/tests/polykinds/all.T | 1 + .../tests/rename/should_fail/rnfail055.stderr | 3 +-- 10 files changed, 60 insertions(+), 34 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc c572430cdade1d8c66fa9c4f1f251dfce09243f0 From git at git.haskell.org Thu Jan 21 10:08:30 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Jan 2016 10:08:30 +0000 (UTC) Subject: [commit: ghc] master: Comments only (6f95e23) Message-ID: <20160121100830.8D1513A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/6f95e23249c18d2e808b6586d2efecd3f3f0fb50/ghc >--------------------------------------------------------------- commit 6f95e23249c18d2e808b6586d2efecd3f3f0fb50 Author: Simon Peyton Jones Date: Wed Jan 20 14:09:35 2016 +0000 Comments only >--------------------------------------------------------------- 6f95e23249c18d2e808b6586d2efecd3f3f0fb50 compiler/typecheck/TcSimplify.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/typecheck/TcSimplify.hs b/compiler/typecheck/TcSimplify.hs index c428ce9..9ea3d91 100644 --- a/compiler/typecheck/TcSimplify.hs +++ b/compiler/typecheck/TcSimplify.hs @@ -146,7 +146,7 @@ simpl_top wanteds ; if something_happened then do { wc_residual <- nestTcS (solveWantedsAndDrop wc) ; try_class_defaulting wc_residual } - -- See Note [Overview of implicit CallStacks] + -- See Note [Overview of implicit CallStacks] in TcEvidence else try_callstack_defaulting wc } try_callstack_defaulting :: WantedConstraints -> TcS WantedConstraints @@ -158,7 +158,7 @@ simpl_top wanteds -- | Default any remaining @CallStack@ constraints to empty @CallStack at s. defaultCallStacks :: WantedConstraints -> TcS WantedConstraints --- See Note [Overview of implicit CallStacks] +-- See Note [Overview of implicit CallStacks] in TcEvidence defaultCallStacks wanteds = do simples <- handle_simples (wc_simple wanteds) implics <- mapBagM handle_implic (wc_impl wanteds) From git at git.haskell.org Thu Jan 21 10:08:36 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Jan 2016 10:08:36 +0000 (UTC) Subject: [commit: ghc] master: Improve pretty-printing of UnivCo (b3ee37c) Message-ID: <20160121100836.C546F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/b3ee37ce2b4ebde0f0e5574e2e50b2177bddf361/ghc >--------------------------------------------------------------- commit b3ee37ce2b4ebde0f0e5574e2e50b2177bddf361 Author: Simon Peyton Jones Date: Wed Jan 20 14:10:08 2016 +0000 Improve pretty-printing of UnivCo We really need to know the UnivCoProvenance to make sense of UnivCos in debug output >--------------------------------------------------------------- b3ee37ce2b4ebde0f0e5574e2e50b2177bddf361 compiler/types/Coercion.hs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/compiler/types/Coercion.hs b/compiler/types/Coercion.hs index 97fa211..c6a7845 100644 --- a/compiler/types/Coercion.hs +++ b/compiler/types/Coercion.hs @@ -227,12 +227,18 @@ ppr_co p (InstCo co arg) = maybeParen p TyConPrec $ ppr_co p (UnivCo UnsafeCoerceProv r ty1 ty2) = pprPrefixApp p (text "UnsafeCo" <+> ppr r) [pprParendType ty1, pprParendType ty2] -ppr_co _ (UnivCo p r t1 t2)= angleBrackets ( ppr t1 <> comma <+> ppr t2 ) <> ppr_role r <> ppr_prov +ppr_co _ (UnivCo p r t1 t2) + = char 'U' + <> parens (ppr_prov <> comma <+> ppr t1 <> comma <+> ppr t2) + <> ppr_role r where ppr_prov = case p of - HoleProv h -> ppr h - PhantomProv kind_co -> braces (ppr kind_co) - _ -> empty + HoleProv h -> text "hole:" <> ppr h + PhantomProv kind_co -> text "phant:" <> ppr kind_co + ProofIrrelProv co -> text "irrel:" <> ppr co + PluginProv s -> text "plugin:" <> text s + UnsafeCoerceProv -> text "unsafe" + ppr_co p (SymCo co) = pprPrefixApp p (text "Sym") [pprParendCo co] ppr_co p (NthCo n co) = pprPrefixApp p (text "Nth:" <> int n) [pprParendCo co] ppr_co p (LRCo sel co) = pprPrefixApp p (ppr sel) [pprParendCo co] From git at git.haskell.org Thu Jan 21 10:08:39 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Jan 2016 10:08:39 +0000 (UTC) Subject: [commit: ghc] master: Comments only (e604e91) Message-ID: <20160121100839.7A08D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e604e916a9727a22a392062096ea947df5fbe2c6/ghc >--------------------------------------------------------------- commit e604e916a9727a22a392062096ea947df5fbe2c6 Author: Simon Peyton Jones Date: Tue Jan 19 13:11:58 2016 +0000 Comments only Re Trac #11051 >--------------------------------------------------------------- e604e916a9727a22a392062096ea947df5fbe2c6 compiler/main/InteractiveEval.hs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/compiler/main/InteractiveEval.hs b/compiler/main/InteractiveEval.hs index b7ed44f..b7c2178 100644 --- a/compiler/main/InteractiveEval.hs +++ b/compiler/main/InteractiveEval.hs @@ -248,8 +248,18 @@ runDeclsWithLocation source linenumber expr = hsc_env' <- liftIO $ rttiEnvironment hsc_env modifySession (\_ -> hsc_env') return $ filter (not . isDerivedOccName . nameOccName) + -- For this filter, see Note [What to show to users] $ map getName tyThings +{- Note [What to show to users] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +We don't want to display internally-generated bindings to users. +Things like the coercion axiom for newtypes. These bindings all get +OccNames that users can't write, to avoid the possiblity of name +clashes (in linker symbols). That gives a convenient way to suppress +them. The relevant predicate is OccName.isDerivedOccName. +See Trac #11051 for more background and examples. +-} withVirtualCWD :: GhcMonad m => m a -> m a withVirtualCWD m = do From git at git.haskell.org Thu Jan 21 10:08:42 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Jan 2016 10:08:42 +0000 (UTC) Subject: [commit: ghc] master: Remove the check_lifted check in TcValidity (07afe44) Message-ID: <20160121100842.45B5D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/07afe448c3a83d7239054baf9d54681ca19766b0/ghc >--------------------------------------------------------------- commit 07afe448c3a83d7239054baf9d54681ca19766b0 Author: Simon Peyton Jones Date: Wed Jan 20 16:02:22 2016 +0000 Remove the check_lifted check in TcValidity This patch fixes Trac #11465. The check_unlifted check really isn't necessary, as discussed in Trac #11120 comment:19. Removing it made just one test-suite change, in indexed-types/should_fail/T9357, by allowing type family F (a :: k1) :: k2 type instance F Int# = Int to be accepted. And indeed that seems entirely reasonable. >--------------------------------------------------------------- 07afe448c3a83d7239054baf9d54681ca19766b0 compiler/typecheck/TcValidity.hs | 17 ++++++++++++++--- testsuite/tests/indexed-types/should_fail/T9357.hs | 5 +++++ testsuite/tests/indexed-types/should_fail/T9357.stderr | 10 +++------- 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/compiler/typecheck/TcValidity.hs b/compiler/typecheck/TcValidity.hs index 49cbb42..21accdb 100644 --- a/compiler/typecheck/TcValidity.hs +++ b/compiler/typecheck/TcValidity.hs @@ -430,9 +430,21 @@ forAllAllowed _ = False ---------------------------------------- -- | Fail with error message if the type is unlifted check_lifted :: TidyEnv -> Type -> TcM () +check_lifted _ _ = return () + +{- ------ Legacy comment --------- +The check_unlifted function seems entirely redundant. The +kind system should check for uses of unlifted types. So I've +removed the check. See Trac #11120 comment:19. + check_lifted env ty = checkTcM (not (isUnLiftedType ty)) (unliftedArgErr env ty) +unliftedArgErr :: TidyEnv -> Type -> (TidyEnv, SDoc) +unliftedArgErr env ty = (env, sep [text "Illegal unlifted type:", ppr_tidy env ty]) +------ End of legacy comment --------- -} + + check_type :: TidyEnv -> UserTypeCtxt -> Rank -> Type -> TcM () -- The args say what the *type context* requires, independent -- of *flag* settings. You test the flag settings at usage sites. @@ -598,9 +610,8 @@ forAllEscapeErr env ty tau_kind 2 (vcat [ text " type:" <+> ppr_tidy env ty , text "of kind:" <+> ppr_tidy env tau_kind ]) ) -unliftedArgErr, ubxArgTyErr :: TidyEnv -> Type -> (TidyEnv, SDoc) -unliftedArgErr env ty = (env, sep [text "Illegal unlifted type:", ppr_tidy env ty]) -ubxArgTyErr env ty = (env, sep [text "Illegal unboxed tuple type as function argument:", ppr_tidy env ty]) +ubxArgTyErr :: TidyEnv -> Type -> (TidyEnv, SDoc) +ubxArgTyErr env ty = (env, sep [text "Illegal unboxed tuple type as function argument:", ppr_tidy env ty]) kindErr :: TidyEnv -> Kind -> (TidyEnv, SDoc) kindErr env kind = (env, sep [text "Expecting an ordinary type, but found a type of kind", ppr_tidy env kind]) diff --git a/testsuite/tests/indexed-types/should_fail/T9357.hs b/testsuite/tests/indexed-types/should_fail/T9357.hs index 29c57f4..9365663 100644 --- a/testsuite/tests/indexed-types/should_fail/T9357.hs +++ b/testsuite/tests/indexed-types/should_fail/T9357.hs @@ -4,5 +4,10 @@ module T9357 where import GHC.Exts type family F (a :: k1) :: k2 + type instance F Int# = Int + -- This one is actually OK (F is poly-kinded; + -- c.f. Trac #11120 comment:19 + type instance F (forall a. a->a) = Int + -- But this one is not (impredicative) diff --git a/testsuite/tests/indexed-types/should_fail/T9357.stderr b/testsuite/tests/indexed-types/should_fail/T9357.stderr index cc483c5..32331e5 100644 --- a/testsuite/tests/indexed-types/should_fail/T9357.stderr +++ b/testsuite/tests/indexed-types/should_fail/T9357.stderr @@ -1,8 +1,4 @@ -T9357.hs:7:15: - Illegal unlifted type: Int# - In the type instance declaration for ?F? - -T9357.hs:8:15: - Illegal polymorphic or qualified type: forall a1. a1 -> a1 - In the type instance declaration for ?F? +T9357.hs:12:15: error: + ? Illegal polymorphic or qualified type: forall a1. a1 -> a1 + ? In the type instance declaration for ?F? From git at git.haskell.org Thu Jan 21 10:08:45 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Jan 2016 10:08:45 +0000 (UTC) Subject: [commit: ghc] master: Strip casts in checkValidInstHead (b2e6350) Message-ID: <20160121100845.ABC313A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/b2e6350fb23403f1c88c5cfed5270d78dbdb6573/ghc >--------------------------------------------------------------- commit b2e6350fb23403f1c88c5cfed5270d78dbdb6573 Author: Simon Peyton Jones Date: Wed Jan 20 16:04:20 2016 +0000 Strip casts in checkValidInstHead This patch addresses Trac #11464. The fix is a bit crude (traverse the type to remove CastTys), but it's also simple. See Note [Casts during validity checking] in TcValidity >--------------------------------------------------------------- b2e6350fb23403f1c88c5cfed5270d78dbdb6573 compiler/typecheck/TcType.hs | 35 ------------- compiler/typecheck/TcValidity.hs | 61 +++++++++++++++++++++- testsuite/tests/typecheck/should_fail/T11464.hs | 5 ++ .../tests/typecheck/should_fail/T11464.stderr | 6 +++ testsuite/tests/typecheck/should_fail/all.T | 1 + 5 files changed, 71 insertions(+), 37 deletions(-) diff --git a/compiler/typecheck/TcType.hs b/compiler/typecheck/TcType.hs index 1b9ae29..c5edfb5 100644 --- a/compiler/typecheck/TcType.hs +++ b/compiler/typecheck/TcType.hs @@ -60,7 +60,6 @@ module TcType ( tcSplitTyConApp, tcSplitTyConApp_maybe, tcRepSplitTyConApp_maybe, tcTyConAppTyCon, tcTyConAppArgs, tcSplitAppTy_maybe, tcSplitAppTy, tcSplitAppTys, tcRepSplitAppTy_maybe, - tcInstHeadTyNotSynonym, tcInstHeadTyAppAllTyVars, tcGetTyVar_maybe, tcGetTyVar, nextRole, tcSplitSigmaTy, tcDeepSplitSigmaTy_maybe, @@ -205,7 +204,6 @@ import Util import Bag import Maybes import Pair -import ListSetOps import Outputable import FastString import ErrUtils( Validity(..), MsgDoc, isValid ) @@ -1259,39 +1257,6 @@ tcSplitDFunTy ty tcSplitDFunHead :: Type -> (Class, [Type]) tcSplitDFunHead = getClassPredTys -tcInstHeadTyNotSynonym :: Type -> Bool --- Used in Haskell-98 mode, for the argument types of an instance head --- These must not be type synonyms, but everywhere else type synonyms --- are transparent, so we need a special function here -tcInstHeadTyNotSynonym ty - = case ty of - TyConApp tc _ -> not (isTypeSynonymTyCon tc) - _ -> True - -tcInstHeadTyAppAllTyVars :: Type -> Bool --- Used in Haskell-98 mode, for the argument types of an instance head --- These must be a constructor applied to type variable arguments. --- But we allow kind instantiations. -tcInstHeadTyAppAllTyVars ty - | Just ty' <- coreView ty -- Look through synonyms - = tcInstHeadTyAppAllTyVars ty' - | otherwise - = case ty of - TyConApp tc tys -> ok (filterOutInvisibleTypes tc tys) - -- avoid kinds - - ForAllTy (Anon arg) res -> ok [arg, res] - _ -> False - where - -- Check that all the types are type variables, - -- and that each is distinct - ok tys = equalLength tvs tys && hasNoDups tvs - where - tvs = mapMaybe get_tv tys - - get_tv (TyVarTy tv) = Just tv -- through synonyms - get_tv _ = Nothing - tcEqKind :: TcKind -> TcKind -> Bool tcEqKind = tcEqType diff --git a/compiler/typecheck/TcValidity.hs b/compiler/typecheck/TcValidity.hs index 21accdb..407a01e 100644 --- a/compiler/typecheck/TcValidity.hs +++ b/compiler/typecheck/TcValidity.hs @@ -1009,6 +1009,48 @@ checkValidInstHead ctxt clas cls_args abstract_class_msg = text "Manual instances of this class are not permitted." +tcInstHeadTyNotSynonym :: Type -> Bool +-- Used in Haskell-98 mode, for the argument types of an instance head +-- These must not be type synonyms, but everywhere else type synonyms +-- are transparent, so we need a special function here +tcInstHeadTyNotSynonym ty + = case ty of -- Do not use splitTyConApp, + -- because that expands synonyms! + TyConApp tc _ -> not (isTypeSynonymTyCon tc) + _ -> True + +tcInstHeadTyAppAllTyVars :: Type -> Bool +-- Used in Haskell-98 mode, for the argument types of an instance head +-- These must be a constructor applied to type variable arguments. +-- But we allow kind instantiations. +tcInstHeadTyAppAllTyVars ty + | Just (tc, tys) <- tcSplitTyConApp_maybe (dropCasts ty) + = ok (filterOutInvisibleTypes tc tys) -- avoid kinds + + | otherwise + = False + where + -- Check that all the types are type variables, + -- and that each is distinct + ok tys = equalLength tvs tys && hasNoDups tvs + where + tvs = mapMaybe tcGetTyVar_maybe tys + +dropCasts :: Type -> Type +-- See Note [Casts during validity checking] +-- This function can turn a well-kinded type into an ill-kinded +-- one, so I've kept it local to this module +-- To consider: drop only UnivCo(HoleProv) casts +dropCasts (CastTy ty _) = dropCasts ty +dropCasts (AppTy t1 t2) = mkAppTy (dropCasts t1) (dropCasts t2) +dropCasts (TyConApp tc tys) = mkTyConApp tc (map dropCasts tys) +dropCasts (ForAllTy b ty) = ForAllTy (dropCastsB b) (dropCasts ty) +dropCasts ty = ty -- LitTy, TyVarTy, CoercionTy + +dropCastsB :: TyBinder -> TyBinder +dropCastsB (Anon ty) = Anon (dropCasts ty) +dropCastsB b = b -- Don't bother in the kind of a forall + abstractClassKeys :: [Unique] abstractClassKeys = [ heqTyConKey , eqTyConKey @@ -1021,8 +1063,23 @@ instTypeErr cls tys msg 2 (quotes (pprClassPred cls tys))) 2 msg -{- Note [Valid 'deriving' predicate] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +{- Note [Casts during validity checking] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Consider the (bogus) + instance Eq Char# +We elaborate to 'Eq (Char# |> UnivCo(hole))' where the hole is an +insoluble equality constraint for * ~ #. We'll report the insoluble +constraint separately, but we don't want to *also* complain that Eq is +not applied to a type constructor. So we look gaily look through +CastTys here. + +Another example: Eq (Either a). Then we actually get a cast in +the middle: + Eq ((Either |> g) a) + + +Note [Valid 'deriving' predicate] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ validDerivPred checks for OK 'deriving' context. See Note [Exotic derived instance contexts] in TcDeriv. However the predicate is here because it uses sizeTypes, fvTypes. diff --git a/testsuite/tests/typecheck/should_fail/T11464.hs b/testsuite/tests/typecheck/should_fail/T11464.hs new file mode 100644 index 0000000..88246aa --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T11464.hs @@ -0,0 +1,5 @@ +{-# LANGUAGE MagicHash, PolyKinds #-} + +module Foo where + +instance Eq (Either a) diff --git a/testsuite/tests/typecheck/should_fail/T11464.stderr b/testsuite/tests/typecheck/should_fail/T11464.stderr new file mode 100644 index 0000000..f340291 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T11464.stderr @@ -0,0 +1,6 @@ + +T11464.hs:5:14: error: + ? Expecting one more argument to ?Either a? + Expected a type, but ?Either a? has kind ?* -> *? + ? In the first argument of ?Eq?, namely ?Either a? + In the instance declaration for ?Eq (Either a)? diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T index 88ab499..1c4e86e 100644 --- a/testsuite/tests/typecheck/should_fail/all.T +++ b/testsuite/tests/typecheck/should_fail/all.T @@ -403,3 +403,4 @@ test('T10619', normal, compile_fail, ['']) test('T11347', normal, compile_fail, ['']) test('T11356', normal, compile_fail, ['']) test('T11355', normal, compile_fail, ['']) +test('T11464', normal, compile_fail, ['']) From git at git.haskell.org Thu Jan 21 12:27:19 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Jan 2016 12:27:19 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Typos in comments (8cc82bc) Message-ID: <20160121122719.43D033A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/8cc82bce18f7834c941a10cc4e94eac237aed323/ghc >--------------------------------------------------------------- commit 8cc82bce18f7834c941a10cc4e94eac237aed323 Author: Gabor Greif Date: Tue Jan 19 12:10:13 2016 +0100 Typos in comments (cherry picked from commit 80265c4c3c827695e92dd9620faf47e064b5da37) >--------------------------------------------------------------- 8cc82bce18f7834c941a10cc4e94eac237aed323 compiler/typecheck/TcRnDriver.hs | 2 +- compiler/typecheck/TcTyClsDecls.hs | 2 +- compiler/typecheck/TcValidity.hs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/typecheck/TcRnDriver.hs b/compiler/typecheck/TcRnDriver.hs index 3ded08a..90d07a3 100644 --- a/compiler/typecheck/TcRnDriver.hs +++ b/compiler/typecheck/TcRnDriver.hs @@ -657,7 +657,7 @@ tcRnHsBootDecls hsc_src decls ; mapM_ (badBootDecl hsc_src "rule") rule_decls ; mapM_ (badBootDecl hsc_src "vect") vect_decls - -- Typecheck type/class/isntance decls + -- Typecheck type/class/instance decls ; traceTc "Tc2 (boot)" empty ; (tcg_env, inst_infos, _deriv_binds) <- tcTyClsInstDecls tycl_decls inst_decls deriv_decls val_binds diff --git a/compiler/typecheck/TcTyClsDecls.hs b/compiler/typecheck/TcTyClsDecls.hs index 4ad453d..2b3a570 100644 --- a/compiler/typecheck/TcTyClsDecls.hs +++ b/compiler/typecheck/TcTyClsDecls.hs @@ -1026,7 +1026,7 @@ However we store the default rhs (Proxy x -> y) in F's TyCon, using F's own type variables, so we need to convert it to (Proxy a -> b). We do this by calling tcMatchTys to match them up. This also ensures that x's kind matches a's and similarly for y and b. The error -message isnt' great, mind you. (Trac #11361 was caused by not doing a +message isn't great, mind you. (Trac #11361 was caused by not doing a proper tcMatchTys here.) -} ------------------------- diff --git a/compiler/typecheck/TcValidity.hs b/compiler/typecheck/TcValidity.hs index 2ee94d0..ac6a125 100644 --- a/compiler/typecheck/TcValidity.hs +++ b/compiler/typecheck/TcValidity.hs @@ -946,7 +946,7 @@ checkValidInstHead ctxt clas cls_args (instTypeErr clas cls_args abstract_class_msg) -- Check language restrictions; - -- but not for SPECIALISE isntance pragmas + -- but not for SPECIALISE instance pragmas ; let ty_args = filterOutInvisibleTypes (classTyCon clas) cls_args ; unless spec_inst_prag $ do { checkTc (xopt LangExt.TypeSynonymInstances dflags || From git at git.haskell.org Thu Jan 21 12:27:22 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Jan 2016 12:27:22 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Fix IfaceType generation for TyCons without TyVars (6722f8d) Message-ID: <20160121122722.305533A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/6722f8d152a71ad7bccea37bd808fe5e3fd1c4e4/ghc >--------------------------------------------------------------- commit 6722f8d152a71ad7bccea37bd808fe5e3fd1c4e4 Author: ?mer Sinan A?acan Date: Tue Jan 19 14:56:59 2016 -0500 Fix IfaceType generation for TyCons without TyVars - This is only used for printing purposes (in :browse etc.). - Fixes #11266. Reviewers: goldfire, bgamari, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1799 GHC Trac Issues: #11266 (cherry picked from commit 952eda2ec98e6fde27d25a8c6f398674062e398e) >--------------------------------------------------------------- 6722f8d152a71ad7bccea37bd808fe5e3fd1c4e4 compiler/iface/MkIface.hs | 8 +++++++- testsuite/tests/ghci/scripts/T11266.script | 2 ++ testsuite/tests/ghci/scripts/all.T | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/compiler/iface/MkIface.hs b/compiler/iface/MkIface.hs index 74bd8ae..7766856 100644 --- a/compiler/iface/MkIface.hs +++ b/compiler/iface/MkIface.hs @@ -1409,16 +1409,22 @@ tyConToIfaceDecl env tycon -- For pretty printing purposes only. = ( env , IfaceData { ifName = getOccName tycon, + ifKind = + -- These don't have `tyConTyVars`, so we use an empty + -- environment here, instead of `tc_env1` defined below. + tidyToIfaceType emptyTidyEnv (tyConKind tycon), ifCType = Nothing, ifTyVars = funAndPrimTyVars, ifRoles = tyConRoles tycon, - ifKind = if_kind, ifCtxt = [], ifCons = IfDataTyCon [] False [], ifRec = boolToRecFlag False, ifGadtSyntax = False, ifParent = IfNoParent }) where + -- NOTE: Not all TyCons have `tyConTyVars` field. Forcing this when `tycon` + -- is one of these TyCons (FunTyCon, PrimTyCon, PromotedDataCon) will cause + -- an error. (tc_env1, tc_tyvars) = tidyTyClTyCoVarBndrs env (tyConTyVars tycon) if_tc_tyvars = toIfaceTvBndrs tc_tyvars if_kind = tidyToIfaceType tc_env1 (tyConKind tycon) diff --git a/testsuite/tests/ghci/scripts/T11266.script b/testsuite/tests/ghci/scripts/T11266.script new file mode 100644 index 0000000..9b3df76 --- /dev/null +++ b/testsuite/tests/ghci/scripts/T11266.script @@ -0,0 +1,2 @@ +:m + GHC.Prim +:browse GHC.Prim diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T index 7a6225c..17bee5f 100755 --- a/testsuite/tests/ghci/scripts/all.T +++ b/testsuite/tests/ghci/scripts/all.T @@ -239,3 +239,4 @@ test('T10576a', expect_broken(10576), ghci_script, ['T10576a.script']) test('T10576b', expect_broken(10576), ghci_script, ['T10576b.script']) test('T11051a', normal, ghci_script, ['T11051a.script']) test('T11051b', normal, ghci_script, ['T11051b.script']) +test('T11266', check_stdout(lambda *args: 1), ghci_script, ['T11266.script']) From git at git.haskell.org Thu Jan 21 12:27:24 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Jan 2016 12:27:24 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: T11266: Improve the test by adding more of the other problematic modules (910b7ee) Message-ID: <20160121122724.D53F53A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/910b7eeadfd532608d19e74ed65c562136ed1073/ghc >--------------------------------------------------------------- commit 910b7eeadfd532608d19e74ed65c562136ed1073 Author: ?mer Sinan A?acan Date: Tue Jan 19 15:23:50 2016 -0500 T11266: Improve the test by adding more of the other problematic modules (cherry picked from commit 975bdacb2c72b2ffd4eb8108896f9f984c5d4fcf) >--------------------------------------------------------------- 910b7eeadfd532608d19e74ed65c562136ed1073 testsuite/tests/ghci/scripts/T11266.script | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/testsuite/tests/ghci/scripts/T11266.script b/testsuite/tests/ghci/scripts/T11266.script index 9b3df76..713dbab 100644 --- a/testsuite/tests/ghci/scripts/T11266.script +++ b/testsuite/tests/ghci/scripts/T11266.script @@ -1,2 +1,4 @@ -:m + GHC.Prim +:m + GHC.Prim GHC.Base GHC.Exts :browse GHC.Prim +:browse GHC.Base +:browse GHC.Exts From git at git.haskell.org Thu Jan 21 12:27:27 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Jan 2016 12:27:27 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Fix combineIdenticalAlts (fc5f857) Message-ID: <20160121122727.E5A0E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/fc5f85768c297c51a2366aa8af8afa33a85dd19c/ghc >--------------------------------------------------------------- commit fc5f85768c297c51a2366aa8af8afa33a85dd19c Author: Simon Peyton Jones Date: Wed Jan 20 08:07:43 2016 +0000 Fix combineIdenticalAlts This long-standing bug in CoreUtils.combineIdenticalAlts was shown up by Trac #11172. The effect was that it returned a correct set of alternatives, but a bogus set of "impossible default constructors". That meant that we subsequently removed all the alternatives from a case, and hence ended up with a bogusly empty case that should not have been empty. See Note [Care with impossible-constructors when combining alternatives] in CoreUtils. (cherry picked from commit 514bac264cb60db26ff9da10c6b79c3f5bd6e96d) >--------------------------------------------------------------- fc5f85768c297c51a2366aa8af8afa33a85dd19c compiler/coreSyn/CoreUtils.hs | 67 ++++++++++++++++------ testsuite/tests/simplCore/should_run/T11172.hs | 41 +++++++++++++ testsuite/tests/simplCore/should_run/T11172.stdout | 1 + testsuite/tests/simplCore/should_run/all.T | 1 + 4 files changed, 93 insertions(+), 17 deletions(-) diff --git a/compiler/coreSyn/CoreUtils.hs b/compiler/coreSyn/CoreUtils.hs index 9c2f16c..e2a4bb9 100644 --- a/compiler/coreSyn/CoreUtils.hs +++ b/compiler/coreSyn/CoreUtils.hs @@ -585,7 +585,10 @@ filterAlts _tycon inst_tys imposs_cons alts impossible_alt inst_tys (DataAlt con, _, _) = dataConCannotMatch inst_tys con impossible_alt _ _ = False -refineDefaultAlt :: [Unique] -> TyCon -> [Type] -> [AltCon] -> [CoreAlt] -> (Bool, [CoreAlt]) +refineDefaultAlt :: [Unique] -> TyCon -> [Type] + -> [AltCon] -- Constructors tha cannot match the DEFAULT (if any) + -> [CoreAlt] + -> (Bool, [CoreAlt]) -- Refine the default alterantive to a DataAlt, -- if there is a unique way to do so refineDefaultAlt us tycon tys imposs_deflt_cons all_alts @@ -667,42 +670,72 @@ defeats combineIdenticalAlts (see Trac #7360). Note [Care with impossible-constructors when combining alternatives] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Suppose we have (Trac #10538) - data T = A | B | C + data T = A | B | C | D - ... case x::T of + case x::T of (Imposs-default-cons {A,B}) DEFAULT -> e1 A -> e2 B -> e1 -When calling combineIdentialAlts, we'll have computed that the "impossible -constructors" for the DEFAULT alt is {A,B}, since if x is A or B we'll -take the other alternatives. But suppose we combine B into the DEFAULT, -to get - ... case x::T of +When calling combineIdentialAlts, we'll have computed that the +"impossible constructors" for the DEFAULT alt is {A,B}, since if x is +A or B we'll take the other alternatives. But suppose we combine B +into the DEFAULT, to get + + case x::T of (Imposs-default-cons {A}) DEFAULT -> e1 A -> e2 + Then we must be careful to trim the impossible constructors to just {A}, else we risk compiling 'e1' wrong! --} +Not only that, but we take care when there is no DEFAULT beforehand, +because we are introducing one. Consider + + case x of (Imposs-default-cons {A,B,C}) + A -> e1 + B -> e2 + C -> e1 + +Then when combining the A and C alternatives we get -combineIdenticalAlts :: [AltCon] -> [CoreAlt] -> (Bool, [AltCon], [CoreAlt]) + case x of (Imposs-default-cons {B}) + DEFAULT -> e1 + B -> e2 + +Note that we have a new DEFAULT branch that we didn't have before. So +we need delete from the "impossible-default-constructors" all the +known-con alternatives that we have eliminated. (In Trac #11172 we +missed the first one.) + +-} + +combineIdenticalAlts :: [AltCon] -- Constructors that cannot match DEFAULT + -> [CoreAlt] + -> (Bool, -- True <=> something happened + [AltCon], -- New contructors that cannot match DEFAULT + [CoreAlt]) -- New alternatives -- See Note [Combine identical alternatives] --- See Note [Care with impossible-constructors when combining alternatives] -- True <=> we did some combining, result is a single DEFAULT alternative -combineIdenticalAlts imposs_cons ((_con1,bndrs1,rhs1) : con_alts) +combineIdenticalAlts imposs_deflt_cons ((con1,bndrs1,rhs1) : rest_alts) | all isDeadBinder bndrs1 -- Remember the default - , not (null eliminated_alts) -- alternative comes first - = (True, imposs_cons', deflt_alt : filtered_alts) + , not (null elim_rest) -- alternative comes first + = (True, imposs_deflt_cons', deflt_alt : filtered_rest) where - (eliminated_alts, filtered_alts) = partition identical_to_alt1 con_alts + (elim_rest, filtered_rest) = partition identical_to_alt1 rest_alts deflt_alt = (DEFAULT, [], mkTicks (concat tickss) rhs1) - imposs_cons' = imposs_cons `minusList` map fstOf3 eliminated_alts + + -- See Note [Care with impossible-constructors when combining alternatives] + imposs_deflt_cons' = imposs_deflt_cons `minusList` elim_cons + elim_cons = elim_con1 ++ map fstOf3 elim_rest + elim_con1 = case con1 of -- Don't forget con1! + DEFAULT -> [] -- See Note [ + _ -> [con1] cheapEqTicked e1 e2 = cheapEqExpr' tickishFloatable e1 e2 identical_to_alt1 (_con,bndrs,rhs) = all isDeadBinder bndrs && rhs `cheapEqTicked` rhs1 - tickss = map (stripTicksT tickishFloatable . thdOf3) eliminated_alts + tickss = map (stripTicksT tickishFloatable . thdOf3) elim_rest combineIdenticalAlts imposs_cons alts = (False, imposs_cons, alts) diff --git a/testsuite/tests/simplCore/should_run/T11172.hs b/testsuite/tests/simplCore/should_run/T11172.hs new file mode 100644 index 0000000..6cf5216 --- /dev/null +++ b/testsuite/tests/simplCore/should_run/T11172.hs @@ -0,0 +1,41 @@ +{-# LANGUAGE UnboxedTuples #-} +{-# OPTIONS_GHC -fno-warn-incomplete-patterns #-} +module Main where + +data JSONState = JSONState [()] () () deriving Show + +weta_s6yD :: Either a (b, c) -> (# (Either a b, JSONState) #) +weta_s6yD ww_s6ys = case ww_s6ys of + Left l -> (# (Left l, JSONState [] () ()) #) + Right (x, _) -> (# (Right x, JSONState [] () ()) #) + +eta_B1 :: (Either a (b, c), t) -> Either a1 (Either a b, JSONState) +eta_B1 (ww_s6ys, _) = case weta_s6yD ww_s6ys of + (# ww_s6zb #) -> Right ww_s6zb + +wks_s6yS :: Either a b -> (# (Either a b, JSONState) #) +wks_s6yS ww_s6yH = + case case ww_s6yH of + Left l_a4ay -> eta_B1 (Left l_a4ay, ()) + Right r_a4aB -> eta_B1 (Right (r_a4aB, ()), ()) + of + Right ww_s6ze -> (# ww_s6ze #) + +ks_a49u :: (Either a b, t) -> Either a1 (Either a b, JSONState) +ks_a49u (ww_s6yH, _) = case wks_s6yS ww_s6yH of + (# ww_s6ze #) -> Right ww_s6ze + +wks_s6z7 :: Either a b -> (# (Either a b, JSONState) #) +wks_s6z7 ww_s6yW = case ( + case ww_s6yW of + Left _ -> ks_a49u (ww_s6yW, JSONState [()] () ()) + Right _ -> ks_a49u (ww_s6yW, JSONState [] () ()) + ) of + Right ww_s6zh -> (# ww_s6zh #) + +ks_X3Sb :: Either () Int -> Either String (Either () Int, JSONState) +ks_X3Sb ww_s6yW = case wks_s6z7 ww_s6yW of + (# ww_s6zh #) -> Right ww_s6zh + +main :: IO () +main = print $ ks_X3Sb (Left ()) diff --git a/testsuite/tests/simplCore/should_run/T11172.stdout b/testsuite/tests/simplCore/should_run/T11172.stdout new file mode 100644 index 0000000..9173c65 --- /dev/null +++ b/testsuite/tests/simplCore/should_run/T11172.stdout @@ -0,0 +1 @@ +Right (Left (),JSONState [] () ()) diff --git a/testsuite/tests/simplCore/should_run/all.T b/testsuite/tests/simplCore/should_run/all.T index ba775b7..9c15b0f 100644 --- a/testsuite/tests/simplCore/should_run/all.T +++ b/testsuite/tests/simplCore/should_run/all.T @@ -70,3 +70,4 @@ test('T457', [ only_ways(['normal','optasm']), exit_code(1) ], compile_and_run, test('T9128', normal, compile_and_run, ['']) test('T9390', normal, compile_and_run, ['']) test('T10830', extra_run_opts('+RTS -K100k -RTS'), compile_and_run, ['']) +test('T11172', normal, compile_and_run, ['']) From git at git.haskell.org Thu Jan 21 12:27:31 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Jan 2016 12:27:31 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Use (&&) instead of `if` in Ix derivation (82efc3e) Message-ID: <20160121122731.1221E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/82efc3e6f7664d7e744c533dea62ab61786486af/ghc >--------------------------------------------------------------- commit 82efc3e6f7664d7e744c533dea62ab61786486af Author: Ben Gamari Date: Tue Jan 19 16:30:26 2016 +0100 Use (&&) instead of `if` in Ix derivation We were previously using `if` in the derivation of `Ix` instances. This interacts badly with RebindableSyntax as the typechecker doesn't infer the type of the argument we give to `tagToEnum#`. Previously we produced, `if (ch >= ah) then (ch <= bh) else False`. We now produce `(ch >= ah) && (ch <= bh)` Fixes #11396. Test Plan: Validate Reviewers: austin, simonpj Reviewed By: simonpj Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1797 GHC Trac Issues: #11396 (cherry picked from commit 5cce09543db827e662539523ffff4513deb92777) >--------------------------------------------------------------- 82efc3e6f7664d7e744c533dea62ab61786486af compiler/typecheck/TcGenDeriv.hs | 13 ++++++++----- testsuite/tests/deriving/should_compile/T11396.hs | 11 +++++++++++ testsuite/tests/deriving/should_compile/all.T | 1 + 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/compiler/typecheck/TcGenDeriv.hs b/compiler/typecheck/TcGenDeriv.hs index 95c44c8..cd632b5 100644 --- a/compiler/typecheck/TcGenDeriv.hs +++ b/compiler/typecheck/TcGenDeriv.hs @@ -786,16 +786,19 @@ gen_Ix_binds loc tycon )) ) + -- This produces something like `(ch >= ah) && (ch <= bh)` enum_inRange = mk_easy_FunBind loc inRange_RDR [nlTuplePat [a_Pat, b_Pat] Boxed, c_Pat] $ untag_Expr tycon [(a_RDR, ah_RDR)] ( untag_Expr tycon [(b_RDR, bh_RDR)] ( untag_Expr tycon [(c_RDR, ch_RDR)] ( - nlHsIf (genPrimOpApp (nlHsVar ch_RDR) geInt_RDR (nlHsVar ah_RDR)) ( - (genPrimOpApp (nlHsVar ch_RDR) leInt_RDR (nlHsVar bh_RDR)) - ) {-else-} ( - false_Expr - )))) + -- This used to use `if`, which interacts badly with RebindableSyntax. + -- See #11396. + nlHsApps and_RDR + [ genPrimOpApp (nlHsVar ch_RDR) geInt_RDR (nlHsVar ah_RDR) + , genPrimOpApp (nlHsVar ch_RDR) leInt_RDR (nlHsVar bh_RDR) + ] + ))) -------------------------------------------------------------- single_con_ixes diff --git a/testsuite/tests/deriving/should_compile/T11396.hs b/testsuite/tests/deriving/should_compile/T11396.hs new file mode 100644 index 0000000..ecb930c --- /dev/null +++ b/testsuite/tests/deriving/should_compile/T11396.hs @@ -0,0 +1,11 @@ +{-# LANGUAGE RebindableSyntax #-} +module IfThenElseIx where + +import Data.Ix (Ix, ) +import Prelude + +ifThenElse :: Bool -> a -> a -> a +ifThenElse True x _ = x +ifThenElse False _ x = x + +data T = A | B deriving (Eq, Ord, Ix) diff --git a/testsuite/tests/deriving/should_compile/all.T b/testsuite/tests/deriving/should_compile/all.T index a18a257..4589a86 100644 --- a/testsuite/tests/deriving/should_compile/all.T +++ b/testsuite/tests/deriving/should_compile/all.T @@ -62,3 +62,4 @@ test('T11148', normal, run_command, ['$MAKE -s --no-print-directory T11148']) test('T9968', normal, compile, ['']) test('T11416', normal, compile, ['']) +test('T11396', normal, compile, ['']) From git at git.haskell.org Thu Jan 21 12:27:34 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Jan 2016 12:27:34 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Rework derivation of type representations for wired-in things (19dc3cb) Message-ID: <20160121122734.7D6A33A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/19dc3cb3a73f72d62bc758e73a1fb3fee5039185/ghc >--------------------------------------------------------------- commit 19dc3cb3a73f72d62bc758e73a1fb3fee5039185 Author: Ben Gamari Date: Wed Jan 20 16:06:31 2016 +0100 Rework derivation of type representations for wired-in things Previously types defined by `GHC.Types` and `GHC.Prim` had their `Typeable` representations manually defined in `GHC.Typeable.Internals`. This was terrible, resulting in a great deal of boilerplate and a number of bugs due to missing or inconsistent representations (see #11120). Here we take a different tack, initially proposed by Richard Eisenberg: We wire-in the `Module`, `TrName`, and `TyCon` types, allowing them to be used in `GHC.Types`. We then allow the usual type representation generation logic to handle this module. `GHC.Prim`, on the other hand, is a bit tricky as it has no object code of its own. To handle this we instead place the type representations for the types defined here in `GHC.Types`. On the whole this eliminates several special-cases as well as a fair amount of boilerplate from hand-written representations. Moreover, we get full coverage of primitive types for free. Test Plan: Validate Reviewers: goldfire, simonpj, austin, hvr Subscribers: goldfire, simonpj, thomie Differential Revision: https://phabricator.haskell.org/D1774 GHC Trac Issues: #11120 (cherry picked from commit 84b0ebedd09fcfbda8efd7576dce9f52a2b6e6ca) >--------------------------------------------------------------- 19dc3cb3a73f72d62bc758e73a1fb3fee5039185 compiler/basicTypes/OccName.hs | 13 +- compiler/basicTypes/Unique.hs | 16 +-- compiler/iface/BuildTyCl.hs | 4 +- compiler/prelude/PrelNames.hs | 40 +++--- compiler/prelude/TysPrim.hs | 4 +- compiler/prelude/TysWiredIn.hs | 113 ++++++++------- compiler/typecheck/TcRnDriver.hs | 5 +- compiler/typecheck/TcTypeable.hs | 155 ++++++++++++--------- compiler/types/TyCon.hs | 31 ++++- compiler/vectorise/Vectorise/Type/TyConDecl.hs | 2 +- libraries/base/Data/Typeable/Internal.hs | 94 +++---------- libraries/ghc-prim/GHC/Types.hs | 12 -- .../tests/ghci.debugger/scripts/print019.stderr | 2 +- testsuite/tests/typecheck/should_run/T11120.hs | 10 ++ testsuite/tests/typecheck/should_run/T11120.stdout | 1 + testsuite/tests/typecheck/should_run/all.T | 1 + 16 files changed, 255 insertions(+), 248 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 19dc3cb3a73f72d62bc758e73a1fb3fee5039185 From git at git.haskell.org Thu Jan 21 12:27:37 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Jan 2016 12:27:37 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: substTy to substTyUnchecked to fix Travis build (1018345) Message-ID: <20160121122737.3481F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/10183451279b97183addfea0382748fbb2e59e48/ghc >--------------------------------------------------------------- commit 10183451279b97183addfea0382748fbb2e59e48 Author: Bartosz Nitka Date: Wed Jan 20 08:58:52 2016 -0800 substTy to substTyUnchecked to fix Travis build This fixes the immediate problem from https://s3.amazonaws.com/archive.travis-ci.org/jobs/103319396/log.txt Test Plan: ./validate Reviewers: bgamari, austin, thomie Differential Revision: https://phabricator.haskell.org/D1802 GHC Trac Issues: #11371 (cherry picked from commit 48d4bc53c517d5e2ac3ff734a7d7a0e2d9454717) >--------------------------------------------------------------- 10183451279b97183addfea0382748fbb2e59e48 compiler/main/HscTypes.hs | 2 +- compiler/main/InteractiveEval.hs | 5 +++-- compiler/typecheck/FunDeps.hs | 4 ++-- compiler/types/OptCoercion.hs | 8 ++++---- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/compiler/main/HscTypes.hs b/compiler/main/HscTypes.hs index 1922717..bf6ad1e 100644 --- a/compiler/main/HscTypes.hs +++ b/compiler/main/HscTypes.hs @@ -1530,7 +1530,7 @@ substInteractiveContext ictxt at InteractiveContext{ ic_tythings = tts } subst | isEmptyTCvSubst subst = ictxt | otherwise = ictxt { ic_tythings = map subst_ty tts } where - subst_ty (AnId id) = AnId $ id `setIdType` substTy subst (idType id) + subst_ty (AnId id) = AnId $ id `setIdType` substTyUnchecked subst (idType id) subst_ty tt = tt instance Outputable InteractiveImport where diff --git a/compiler/main/InteractiveEval.hs b/compiler/main/InteractiveEval.hs index 6356928..b7ed44f 100644 --- a/compiler/main/InteractiveEval.hs +++ b/compiler/main/InteractiveEval.hs @@ -533,12 +533,13 @@ bindLocalsAtBreakpoint hsc_env apStack_fhv (Just BreakInfo{..}) = do let tv_subst = newTyVars us free_tvs filtered_ids = [ id | (id, Just _hv) <- zip ids mb_hValues ] (_,tidy_tys) = tidyOpenTypes emptyTidyEnv $ - map (substTy tv_subst . idType) filtered_ids + map (substTyUnchecked tv_subst . idType) filtered_ids new_ids <- zipWith3M mkNewId occs tidy_tys filtered_ids result_name <- newInteractiveBinder hsc_env (mkVarOccFS result_fs) span - let result_id = Id.mkVanillaGlobal result_name (substTy tv_subst result_ty) + let result_id = Id.mkVanillaGlobal result_name + (substTyUnchecked tv_subst result_ty) result_ok = isPointer result_id final_ids | result_ok = result_id : new_ids diff --git a/compiler/typecheck/FunDeps.hs b/compiler/typecheck/FunDeps.hs index 5768448..bf8c260 100644 --- a/compiler/typecheck/FunDeps.hs +++ b/compiler/typecheck/FunDeps.hs @@ -292,7 +292,7 @@ improveClsFD clas_tvs fd -- executed. What we're doing instead is recording the partial -- work of the ls1/ls2 unification leaving a smaller unification problem where - rtys1' = map (substTy subst) rtys1 + rtys1' = map (substTyUnchecked subst) rtys1 fdeqs = zipAndComputeFDEqs (\_ _ -> False) rtys1' rtys2 -- Don't discard anything! @@ -300,7 +300,7 @@ improveClsFD clas_tvs fd -- eqType again, since we know for sure that /at least one/ -- equation in there is useful) - meta_tvs = [ setVarType tv (substTy subst (varType tv)) + meta_tvs = [ setVarType tv (substTyUnchecked subst (varType tv)) | tv <- qtvs, tv `notElemTCvSubst` subst ] -- meta_tvs are the quantified type variables -- that have not been substituted out diff --git a/compiler/types/OptCoercion.hs b/compiler/types/OptCoercion.hs index 8e7a08d..b867259 100644 --- a/compiler/types/OptCoercion.hs +++ b/compiler/types/OptCoercion.hs @@ -91,8 +91,8 @@ optCoercion env co (Pair in_ty1 in_ty2, in_role) = coercionKindRole co (Pair out_ty1 out_ty2, out_role) = coercionKindRole out_co in - ASSERT2( substTy env in_ty1 `eqType` out_ty1 && - substTy env in_ty2 `eqType` out_ty2 && + ASSERT2( substTyUnchecked env in_ty1 `eqType` out_ty1 && + substTyUnchecked env in_ty2 `eqType` out_ty2 && in_role == out_role , text "optCoercion changed types!" $$ hang (text "in_co:") 2 (ppr co) @@ -371,8 +371,8 @@ opt_univ env sym prov role oty1 oty2 mkForAllCo tv1' eta' (opt_univ env' sym prov role ty1 ty2') | otherwise - = let ty1 = substTy (lcSubstLeft env) oty1 - ty2 = substTy (lcSubstRight env) oty2 + = let ty1 = substTyUnchecked (lcSubstLeft env) oty1 + ty2 = substTyUnchecked (lcSubstRight env) oty2 (a, b) | sym = (ty2, ty1) | otherwise = (ty1, ty2) in From git at git.haskell.org Thu Jan 21 12:27:39 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Jan 2016 12:27:39 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Check InScopeSet in substTy and provide substTyUnchecked (481ff7a) Message-ID: <20160121122739.EAD8B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/481ff7a08304011d7b9d95e399f7501d44951505/ghc >--------------------------------------------------------------- commit 481ff7a08304011d7b9d95e399f7501d44951505 Author: Bartosz Nitka Date: Tue Jan 19 03:25:39 2016 -0800 Check InScopeSet in substTy and provide substTyUnchecked This adds sanity checks to `substTy` that implement: > when calling substTy subst ty it should be the case that the in-scope > set in the substitution is a superset of > * The free vars of the range of the substitution > * The free vars of ty minus the domain of the substitution and replaces violators with unchecked version. The violators were found by running the GHC test suite. This ensures that I can work on this incrementally and that what I fix won't be undone by some other change. It also includes a couple of fixes that I've already done. Test Plan: ./validate Reviewers: simonmar, goldfire, simonpj, austin, bgamari Reviewed By: simonpj, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1792 GHC Trac Issues: #11371 (cherry picked from commit 9d33adb6f352ad4e488067a8756928b3778920e0) >--------------------------------------------------------------- 481ff7a08304011d7b9d95e399f7501d44951505 compiler/basicTypes/MkId.hs | 2 +- compiler/basicTypes/VarEnv.hs | 4 ++ compiler/coreSyn/CoreSubst.hs | 2 +- compiler/coreSyn/CoreUtils.hs | 4 +- compiler/iface/BuildTyCl.hs | 2 +- compiler/typecheck/Inst.hs | 9 ++-- compiler/typecheck/TcClassDcl.hs | 4 +- compiler/typecheck/TcExpr.hs | 2 +- compiler/typecheck/TcFlatten.hs | 2 +- compiler/typecheck/TcHsType.hs | 4 +- compiler/typecheck/TcInteract.hs | 4 +- compiler/typecheck/TcMType.hs | 25 ++++++---- compiler/typecheck/TcPatSyn.hs | 2 +- compiler/typecheck/TcSMonad.hs | 8 ++-- compiler/typecheck/TcTyClsDecls.hs | 2 +- compiler/typecheck/TcType.hs | 1 + compiler/types/FamInstEnv.hs | 2 +- compiler/types/TyCoRep.hs | 96 ++++++++++++++++++++++++++++++-------- compiler/types/Type.hs | 3 +- compiler/utils/UniqFM.hs | 3 ++ 20 files changed, 130 insertions(+), 51 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 481ff7a08304011d7b9d95e399f7501d44951505 From git at git.haskell.org Thu Jan 21 12:27:43 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Jan 2016 12:27:43 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Add test for Data.Typeable.typeOf (5497ee4) Message-ID: <20160121122743.299FC3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/5497ee440faa88cbd6142665079b35b52424f12e/ghc >--------------------------------------------------------------- commit 5497ee440faa88cbd6142665079b35b52424f12e Author: Ben Gamari Date: Wed Jan 13 14:53:21 2016 +0100 Add test for Data.Typeable.typeOf Test Plan: Validate Reviewers: goldfire, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1770 GHC Trac Issues: #11120 >--------------------------------------------------------------- 5497ee440faa88cbd6142665079b35b52424f12e testsuite/tests/typecheck/should_run/TypeOf.hs | 34 ++++++++++++++++++++++ testsuite/tests/typecheck/should_run/TypeOf.stdout | 23 +++++++++++++++ testsuite/tests/typecheck/should_run/all.T | 1 + 3 files changed, 58 insertions(+) diff --git a/testsuite/tests/typecheck/should_run/TypeOf.hs b/testsuite/tests/typecheck/should_run/TypeOf.hs new file mode 100644 index 0000000..12184e7 --- /dev/null +++ b/testsuite/tests/typecheck/should_run/TypeOf.hs @@ -0,0 +1,34 @@ +{-# LANGUAGE DataKinds #-} + +import Data.Typeable +import GHC.Types + +-- Test that Typeable works for various wired-in types. +-- See, for instance, #11120. + +main :: IO () +main = do + print $ typeOf "hello world" + print $ typeOf '4' + print $ typeOf (42 :: Int) + print $ typeOf (42 :: Word) + print $ typeOf (3.1415 :: Double) + print $ typeOf (return () :: IO ()) + print $ typeOf ('a', 1::Int, "hello") + print $ typeOf (typeOf "hi") + print $ typeOf True + print $ typeOf EQ + print $ typeOf (id :: Int -> Int) + + print $ typeOf (Proxy :: Proxy (Eq Int)) + print $ typeOf (Proxy :: Proxy (Int, Int)) + print $ typeOf (Proxy :: Proxy "hello world") + print $ typeOf (Proxy :: Proxy 1) + print $ typeOf (Proxy :: Proxy [1,2,3]) + print $ typeOf (Proxy :: Proxy 'EQ) + print $ typeOf (Proxy :: Proxy TYPE) + print $ typeOf (Proxy :: Proxy (TYPE 'Lifted)) + print $ typeOf (Proxy :: Proxy *) + print $ typeOf (Proxy :: Proxy ?) + print $ typeOf (Proxy :: Proxy 'Lifted) + print $ typeOf (Proxy :: Proxy (~~)) diff --git a/testsuite/tests/typecheck/should_run/TypeOf.stdout b/testsuite/tests/typecheck/should_run/TypeOf.stdout new file mode 100644 index 0000000..ffc2133 --- /dev/null +++ b/testsuite/tests/typecheck/should_run/TypeOf.stdout @@ -0,0 +1,23 @@ +[Char] +Char +Int +Word +Double +IO () +(Char,Int,[Char]) +TypeRep +Bool +Ordering +Int -> Int +Proxy Constraint (Eq Int) +Proxy Constraint (Int,Int) +Proxy Symbol "hello world" +Proxy Nat 1 +Proxy [Nat] (': Nat 1 (': Nat 2 (': Nat 3 '[]))) +Proxy Ordering 'EQ +Proxy (Levity -> Constraint) TYPE +Proxy Constraint Constraint +Proxy Constraint Constraint +Proxy Constraint Constraint +Proxy Levity 'Lifted +Proxy (Constraint -> Constraint -> Constraint) ~~ diff --git a/testsuite/tests/typecheck/should_run/all.T b/testsuite/tests/typecheck/should_run/all.T index 8c60777..cfd35e4 100755 --- a/testsuite/tests/typecheck/should_run/all.T +++ b/testsuite/tests/typecheck/should_run/all.T @@ -113,4 +113,5 @@ test('T9858d', normal, compile_and_run, ['']) test('T10284', exit_code(1), compile_and_run, ['']) test('T11049', exit_code(1), compile_and_run, ['']) test('T11230', normal, compile_and_run, ['']) +test('TypeOf', normal, compile_and_run, ['']) test('T11120', normal, compile_and_run, ['']) From git at git.haskell.org Thu Jan 21 12:28:21 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Jan 2016 12:28:21 +0000 (UTC) Subject: [commit: ghc] master: Allow implicit parameters in constraint synonyms (395ec41) Message-ID: <20160121122821.912313A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/395ec414ff21bc37439194bb31a8f764b38b0fca/ghc >--------------------------------------------------------------- commit 395ec414ff21bc37439194bb31a8f764b38b0fca Author: Simon Peyton Jones Date: Thu Jan 21 12:26:50 2016 +0000 Allow implicit parameters in constraint synonyms This fixes Trac #11466. It went bad by accident in commit ffc21506894c7887d3620423aaf86bc6113a1071 Refactor tuple constraints >--------------------------------------------------------------- 395ec414ff21bc37439194bb31a8f764b38b0fca compiler/typecheck/TcValidity.hs | 32 +++++++++++++++++++++++++++----- testsuite/tests/polykinds/T11466.hs | 16 ++++++++++++++++ testsuite/tests/polykinds/all.T | 1 + 3 files changed, 44 insertions(+), 5 deletions(-) diff --git a/compiler/typecheck/TcValidity.hs b/compiler/typecheck/TcValidity.hs index 407a01e..e885e98 100644 --- a/compiler/typecheck/TcValidity.hs +++ b/compiler/typecheck/TcValidity.hs @@ -686,12 +686,33 @@ check_valid_theta env ctxt theta (_,dups) = removeDups cmpType theta ------------------------- +{- Note [Validity checking for constraints] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +We look through constraint synonyms so that we can see the underlying +constraint(s). For example + type Foo = ?x::Int + instance Foo => C T +We should reject the instance because it has an implicit parameter in +the context. + +But we record, in 'under_syn', whether we have looked under a synonym +to avoid requiring language extensions at the use site. Main example +(Trac #9838): + + {-# LANGUAGE ConstraintKinds #-} + module A where + type EqShow a = (Eq a, Show a) + + module B where + import A + foo :: EqShow a => a -> String + +We don't want to require ConstraintKinds in module B. +-} + check_pred_ty :: TidyEnv -> DynFlags -> UserTypeCtxt -> PredType -> TcM () -- Check the validity of a predicate in a signature --- Do not look through any type synonyms; any constraint kinded --- type synonyms have been checked at their definition site --- C.f. Trac #9838 - +-- See Note [Validity checking for constraints] check_pred_ty env dflags ctxt pred = do { check_type env SigmaCtxt MustBeMonoType pred ; check_pred_help False env dflags ctxt pred } @@ -825,11 +846,12 @@ okIPCtxt GhciCtxt = True okIPCtxt SigmaCtxt = True okIPCtxt (DataTyCtxt {}) = True okIPCtxt (PatSynCtxt {}) = True +okIPCtxt (TySynCtxt {}) = True -- e.g. type Blah = ?x::Int + -- Trac #11466 okIPCtxt (ClassSCCtxt {}) = False okIPCtxt (InstDeclCtxt {}) = False okIPCtxt (SpecInstCtxt {}) = False -okIPCtxt (TySynCtxt {}) = False okIPCtxt (RuleSigCtxt {}) = False okIPCtxt DefaultDeclCtxt = False diff --git a/testsuite/tests/polykinds/T11466.hs b/testsuite/tests/polykinds/T11466.hs new file mode 100644 index 0000000..e479af0 --- /dev/null +++ b/testsuite/tests/polykinds/T11466.hs @@ -0,0 +1,16 @@ +{-# LANGUAGE ImplicitParams, ConstraintKinds #-} + +module T11466 where + +-- This should be ok +type Bla = ?x::Int + +-- This should be ook +f :: Bla => Int -> Int +f y = ?x + y + +data T = T + +-- But this should be rejected +instance Bla => Eq T + diff --git a/testsuite/tests/polykinds/all.T b/testsuite/tests/polykinds/all.T index 899e47c..f1f25ce 100644 --- a/testsuite/tests/polykinds/all.T +++ b/testsuite/tests/polykinds/all.T @@ -133,3 +133,4 @@ test('T11248', normal, compile, ['']) test('T11278', normal, compile, ['']) test('T11255', normal, compile, ['']) test('T11459', normal, compile_fail, ['']) +test('T11466', normal, compile_fail, ['']) From git at git.haskell.org Thu Jan 21 12:29:07 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Jan 2016 12:29:07 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Re-add missing kind generalisation (e7e2ac8) Message-ID: <20160121122907.CE2143A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/e7e2ac8b740264527dd530c35cbbb6b63dc93640/ghc >--------------------------------------------------------------- commit e7e2ac8b740264527dd530c35cbbb6b63dc93640 Author: Simon Peyton Jones Date: Tue Jan 19 13:18:39 2016 +0000 Re-add missing kind generalisation When splitting H98/GADT syntax in ConDecl we lost a key kind-generalisation step. I also renamed tcHsTyVarBndrs to tcExplicitTKBnders, by analogy with tcImplicitTkBndrs. This fixes Trac #11459. Merge to 8.0. (cherry picked from commit c572430cdade1d8c66fa9c4f1f251dfce09243f0) >--------------------------------------------------------------- e7e2ac8b740264527dd530c35cbbb6b63dc93640 compiler/typecheck/TcBinds.hs | 2 +- compiler/typecheck/TcHsType.hs | 18 ++++++------- compiler/typecheck/TcPatSyn.hs | 6 ++--- compiler/typecheck/TcTyClsDecls.hs | 31 ++++++++++++---------- compiler/typecheck/TcValidity.hs | 2 +- testsuite/tests/ghci/scripts/T7873.stdout | 8 +++--- testsuite/tests/polykinds/T11459.hs | 14 ++++++++++ testsuite/tests/polykinds/T11459.stderr | 9 +++++++ testsuite/tests/polykinds/all.T | 1 + .../tests/rename/should_fail/rnfail055.stderr | 3 +-- 10 files changed, 60 insertions(+), 34 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc e7e2ac8b740264527dd530c35cbbb6b63dc93640 From git at git.haskell.org Thu Jan 21 13:57:57 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Jan 2016 13:57:57 +0000 (UTC) Subject: [commit: ghc] master: user-guide:: Improve -D description (f23b578) Message-ID: <20160121135757.D85983A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/f23b578f792a357fa754604188eea46ca46cf613/ghc >--------------------------------------------------------------- commit f23b578f792a357fa754604188eea46ca46cf613 Author: Ben Gamari Date: Thu Jan 21 11:36:00 2016 +0100 user-guide:: Improve -D description >--------------------------------------------------------------- f23b578f792a357fa754604188eea46ca46cf613 docs/users_guide/phases.rst | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/users_guide/phases.rst b/docs/users_guide/phases.rst index 0428956..bc4e90f 100644 --- a/docs/users_guide/phases.rst +++ b/docs/users_guide/phases.rst @@ -161,11 +161,14 @@ Options affecting the C pre-processor large system with significant doses of conditional compilation, you really shouldn't need it. -.. ghc-flag:: -D ?symbol?[=?value?] +.. ghc-flag:: -D [=] Define macro ?symbol? in the usual way. NB: does *not* affect ``-D`` - macros passed to the C?compiler when compiling via C! For those, use - the ``-optc-Dfoo`` hack? (see :ref:`forcing-options-through`). + macros passed to the C?compiler when compiling with :ghc-flag:`-fvia-C`! For + those, use the ``-optc-Dfoo`` hack? (see :ref:`forcing-options-through`). + + When no value is given, the value is taken to be ``1``. For instance, + ``-DUSE_MYLIB`` is equivalent to ``-DUSE_MYLIB=1``. .. ghc-flag:: -U ?symbol? From git at git.haskell.org Thu Jan 21 13:58:00 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Jan 2016 13:58:00 +0000 (UTC) Subject: [commit: ghc] master: Update and improve documentation in Data.Foldable (7cb893f) Message-ID: <20160121135800.930B43A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/7cb893f562346d5aa986bd88863335aabbf7e95f/ghc >--------------------------------------------------------------- commit 7cb893f562346d5aa986bd88863335aabbf7e95f Author: Ben Gamari Date: Thu Jan 21 14:51:01 2016 +0100 Update and improve documentation in Data.Foldable Previously there were a few obsolete references to `Data.List` and the descriptions were lacking examples. Fixes #11065. Test Plan: Read it. Reviewers: ekmett, goldfire, hvr, austin Reviewed By: hvr Subscribers: nomeata, thomie Differential Revision: https://phabricator.haskell.org/D1617 GHC Trac Issues: #11065 >--------------------------------------------------------------- 7cb893f562346d5aa986bd88863335aabbf7e95f libraries/base/Data/Foldable.hs | 64 +++++++++++++++++++++++++++++++++++------ 1 file changed, 55 insertions(+), 9 deletions(-) diff --git a/libraries/base/Data/Foldable.hs b/libraries/base/Data/Foldable.hs index 722b68f..3d518d5 100644 --- a/libraries/base/Data/Foldable.hs +++ b/libraries/base/Data/Foldable.hs @@ -125,28 +125,74 @@ class Foldable t where -- | Right-associative fold of a structure. -- - -- @'foldr' f z = 'Prelude.foldr' f z . 'toList'@ + -- In the case of lists, 'foldr', when applied to a binary operator, a + -- starting value (typically the right-identity of the operator), and a + -- list, reduces the list using the binary operator, from right to left: + -- + -- > foldr f z [x1, x2, ..., xn] == x1 `f` (x2 `f` ... (xn `f` z)...) + -- + -- Note that, since the head of the resulting expression is produced by + -- an application of the operator to the first element of the list, + -- 'foldr' can produce a terminating expression from an infinite list. + -- + -- For a general 'Foldable' structure this should be semantically identical + -- to, + -- + -- @foldr f z = 'List.foldr' f z . 'toList'@ + -- foldr :: (a -> b -> b) -> b -> t a -> b foldr f z t = appEndo (foldMap (Endo #. f) t) z - -- | Right-associative fold of a structure, - -- but with strict application of the operator. + -- | Right-associative fold of a structure, but with strict application of + -- the operator. + -- foldr' :: (a -> b -> b) -> b -> t a -> b foldr' f z0 xs = foldl f' id xs z0 where f' k x z = k $! f x z -- | Left-associative fold of a structure. -- - -- @'foldl' f z = 'Prelude.foldl' f z . 'toList'@ + -- In the case of lists, 'foldl', when applied to a binary + -- operator, a starting value (typically the left-identity of the operator), + -- and a list, reduces the list using the binary operator, from left to + -- right: + -- + -- > foldl f z [x1, x2, ..., xn] == (...((z `f` x1) `f` x2) `f`...) `f` xn + -- + -- Note that to produce the outermost application of the operator the + -- entire input list must be traversed. This means that 'foldl'' will + -- diverge if given an infinite list. + -- + -- Also note that if you want an efficient left-fold, you probably want to + -- use 'foldl'' instead of 'foldl'. The reason for this is that latter does + -- not force the "inner" results (e.g. @z `f` x1@ in the above example) + -- before applying them to the operator (e.g. to @(`f` x2)@). This results + -- in a thunk chain @O(n)@ elements long, which then must be evaluated from + -- the outside-in. + -- + -- For a general 'Foldable' structure this should be semantically identical + -- to, + -- + -- @foldl f z = 'List.foldl' f z . 'toList'@ + -- foldl :: (b -> a -> b) -> b -> t a -> b foldl f z t = appEndo (getDual (foldMap (Dual . Endo . flip f) t)) z -- There's no point mucking around with coercions here, -- because flip forces us to build a new function anyway. - -- | Left-associative fold of a structure. - -- but with strict application of the operator. + -- | Left-associative fold of a structure but with strict application of + -- the operator. + -- + -- This ensures that each step of the fold is forced to weak head normal + -- form before being applied, avoiding the collection of thunks that would + -- otherwise occur. This is often what you want to strictly reduce a finite + -- list to a single, monolithic result (e.g. 'length'). + -- + -- For a general 'Foldable' structure this should be semantically identical + -- to, + -- + -- @foldl f z = 'List.foldl'' f z . 'toList'@ -- - -- @'foldl' f z = 'List.foldl'' f z . 'toList'@ foldl' :: (b -> a -> b) -> b -> t a -> b foldl' f z0 xs = foldr f' id xs z0 where f' x k z = k $! f z x @@ -154,7 +200,7 @@ class Foldable t where -- | A variant of 'foldr' that has no base case, -- and thus may only be applied to non-empty structures. -- - -- @'foldr1' f = 'Prelude.foldr1' f . 'toList'@ + -- @'foldr1' f = 'List.foldr1' f . 'toList'@ foldr1 :: (a -> a -> a) -> t a -> a foldr1 f xs = fromMaybe (errorWithoutStackTrace "foldr1: empty structure") (foldr mf Nothing xs) @@ -166,7 +212,7 @@ class Foldable t where -- | A variant of 'foldl' that has no base case, -- and thus may only be applied to non-empty structures. -- - -- @'foldl1' f = 'Prelude.foldl1' f . 'toList'@ + -- @'foldl1' f = 'List.foldl1' f . 'toList'@ foldl1 :: (a -> a -> a) -> t a -> a foldl1 f xs = fromMaybe (errorWithoutStackTrace "foldl1: empty structure") (foldl mf Nothing xs) From git at git.haskell.org Thu Jan 21 13:58:03 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Jan 2016 13:58:03 +0000 (UTC) Subject: [commit: ghc] master: rel-notes: Note the return of -Wmonomorphism-restriction (3883f99) Message-ID: <20160121135803.543F73A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/3883f99c7ea99204a2f15c1e4b7521a4c0b1c527/ghc >--------------------------------------------------------------- commit 3883f99c7ea99204a2f15c1e4b7521a4c0b1c527 Author: Ben Gamari Date: Thu Jan 21 14:49:01 2016 +0100 rel-notes: Note the return of -Wmonomorphism-restriction >--------------------------------------------------------------- 3883f99c7ea99204a2f15c1e4b7521a4c0b1c527 docs/users_guide/8.0.1-notes.rst | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/users_guide/8.0.1-notes.rst b/docs/users_guide/8.0.1-notes.rst index c36c721..e8a2c0e 100644 --- a/docs/users_guide/8.0.1-notes.rst +++ b/docs/users_guide/8.0.1-notes.rst @@ -200,7 +200,7 @@ Compiler compilers. The old ``-f``-based warning flags will remain functional for the forseeable future. -- Added the option :ghc-flag:`-dth-dec-file`. This dumps out a .th.hs file of +- Added the option :ghc-flag:`-dth-dec-file`. This dumps out a ``.th.hs`` file of all Template Haskell declarations in a corresponding .hs file. The idea is that application developers can check this into their repository so that they can grep for identifiers used elsewhere that @@ -210,6 +210,13 @@ Compiler code that does not exist in the .hs file and a comment for the splice location in the original file. +- After a long hiatus (see :ghc-ticket:`10935`) the + :ghc-flag:`-Wmonomorphism-restriction` (formerly + :ghc-flag:`-fwarn-monomorphism-restriction`) flag has returned. + The functionality of this flag was inadvertently removed by a commit in 2010; + this has been fixed and the flag should now issue warnings as it + previously did. + - Added the option :ghc-flag:`-fprint-expanded-types`. When enabled, GHC also prints type-synonym-expanded types in type errors. From git at git.haskell.org Thu Jan 21 13:58:06 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Jan 2016 13:58:06 +0000 (UTC) Subject: [commit: ghc] master: TyCoRep: Restore compatibility with 7.10.1 (ede055e) Message-ID: <20160121135806.0CB2E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/ede055eb230ac33da276f1416678f99e32e83da2/ghc >--------------------------------------------------------------- commit ede055eb230ac33da276f1416678f99e32e83da2 Author: Ben Gamari Date: Thu Jan 21 11:19:23 2016 +0100 TyCoRep: Restore compatibility with 7.10.1 Sadly CallStack wasn't present in 7.10.1, breaking the build when bootstrapping from this version. This patch essentially disables CallStack support for stage1 builds with 7.10.*. This doesn't seem so unreasonable though as stage2 will still work. Test Plan: Validate with 7.10.1 Reviewers: gridaphobe, jstolarek, austin Reviewed By: jstolarek Subscribers: thomie, jstolarek Differential Revision: https://phabricator.haskell.org/D1812 GHC Trac Issues: #11472 >--------------------------------------------------------------- ede055eb230ac33da276f1416678f99e32e83da2 compiler/types/TyCoRep.hs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/compiler/types/TyCoRep.hs b/compiler/types/TyCoRep.hs index 85d91f5..04fb02c 100644 --- a/compiler/types/TyCoRep.hs +++ b/compiler/types/TyCoRep.hs @@ -151,7 +151,9 @@ import UniqFM import qualified Data.Data as Data hiding ( TyCon ) import Data.List import Data.IORef ( IORef ) -- for CoercionHole +#if MIN_VERSION_GLASGOW_HASKELL(7,10,2,0) import GHC.Stack (CallStack) +#endif {- %************************************************************************ @@ -1844,7 +1846,13 @@ isValidTCvSubst (TCvSubst in_scope tenv cenv) = -- | Substitute within a 'Type' -- The substitution has to satisfy the invariants described in -- Note [Generating the in-scope set for a substitution]. -substTy :: (?callStack :: CallStack) => TCvSubst -> Type -> Type + +substTy :: +-- CallStack wasn't present in GHC 7.10.1, disable callstacks in stage 1 +#if MIN_VERSION_GLASGOW_HASKELL(7,10,2,0) + (?callStack :: CallStack) => +#endif + TCvSubst -> Type -> Type substTy subst@(TCvSubst in_scope tenv cenv) ty | isEmptyTCvSubst subst = ty | otherwise = ASSERT2( isValidTCvSubst subst, From git at git.haskell.org Thu Jan 21 13:58:08 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Jan 2016 13:58:08 +0000 (UTC) Subject: [commit: ghc] master: user-guide: Refer to MIN_VERSION_GLASGOW_HASKELL from intro (928484d) Message-ID: <20160121135808.D73CB3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/928484d2b021fc968d5f2dfe490dc0ad201dc7df/ghc >--------------------------------------------------------------- commit 928484d2b021fc968d5f2dfe490dc0ad201dc7df Author: Ben Gamari Date: Thu Jan 21 11:30:24 2016 +0100 user-guide: Refer to MIN_VERSION_GLASGOW_HASKELL from intro And fix markup. >--------------------------------------------------------------- 928484d2b021fc968d5f2dfe490dc0ad201dc7df docs/users_guide/intro.rst | 3 +++ docs/users_guide/phases.rst | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/users_guide/intro.rst b/docs/users_guide/intro.rst index 281c04a..677f462 100644 --- a/docs/users_guide/intro.rst +++ b/docs/users_guide/intro.rst @@ -175,3 +175,6 @@ numbering GHC versions: The version number of your copy of GHC can be found by invoking ``ghc`` with the ``--version`` flag (see :ref:`options-help`). +The compiler version can be tested within compiled code with the +``MIN_VERSION_GLASGOW_HASKELL`` CPP macro (defined only when +:ghc-flag:`-XCPP` is used). See :ref:`standard-cpp-macros` for details. diff --git a/docs/users_guide/phases.rst b/docs/users_guide/phases.rst index bc4e90f..e9637fa 100644 --- a/docs/users_guide/phases.rst +++ b/docs/users_guide/phases.rst @@ -182,6 +182,11 @@ Options affecting the C pre-processor The GHC driver pre-defines several macros when processing Haskell source code (``.hs`` or ``.lhs`` files). +.. _standard-cpp-macros: + +Standard CPP macros +~~~~~~~~~~~~~~~~~~~ + The symbols defined by GHC are listed below. To check which symbols are defined by your local GHC installation, the following trick is useful: @@ -258,7 +263,7 @@ defined by your local GHC installation, the following trick is useful: is required, the presence of the ``MIN_VERSION_GLASGOW_HASKELL`` macro needs to be ensured before it is called, e.g.: - .. code-block: c + .. code-block:: c #ifdef MIN_VERSION_GLASGOW_HASKELL #if MIN_VERSION_GLASGOW_HASKELL(7,10,2,0) @@ -451,6 +456,7 @@ Options affecting code generation no-op on that platform. .. ghc-flag:: -dynamic + :noindex: When generating code, assume that entities imported from a different package will reside in a different shared library or binary. From git at git.haskell.org Thu Jan 21 16:17:04 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Jan 2016 16:17:04 +0000 (UTC) Subject: [commit: ghc] master: Add a missing .gitignore entry in annotations tests (96303db) Message-ID: <20160121161704.583CF3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/96303db507aa1ee9044bb1c9804879dcbf0b1fad/ghc >--------------------------------------------------------------- commit 96303db507aa1ee9044bb1c9804879dcbf0b1fad Author: Reid Barton Date: Thu Jan 21 11:16:47 2016 -0500 Add a missing .gitignore entry in annotations tests >--------------------------------------------------------------- 96303db507aa1ee9044bb1c9804879dcbf0b1fad testsuite/tests/ghc-api/annotations/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/testsuite/tests/ghc-api/annotations/.gitignore b/testsuite/tests/ghc-api/annotations/.gitignore index 9880335..fbd2765 100644 --- a/testsuite/tests/ghc-api/annotations/.gitignore +++ b/testsuite/tests/ghc-api/annotations/.gitignore @@ -17,6 +17,7 @@ t10357 t10358 t10396 t10399 +t11430 stringSource *.hi *.o From git at git.haskell.org Thu Jan 21 18:49:09 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Jan 2016 18:49:09 +0000 (UTC) Subject: [commit: ghc] master: Add -ignore-dot-ghci to tests that use --interactive (2ffc260) Message-ID: <20160121184909.65D713A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/2ffc2606cfc58768ddc6dd53f270ba7088c43f3c/ghc >--------------------------------------------------------------- commit 2ffc2606cfc58768ddc6dd53f270ba7088c43f3c Author: Reid Barton Date: Thu Jan 21 13:50:00 2016 -0500 Add -ignore-dot-ghci to tests that use --interactive >--------------------------------------------------------------- 2ffc2606cfc58768ddc6dd53f270ba7088c43f3c testsuite/tests/driver/all.T | 4 ++-- testsuite/tests/ghci/linking/dyn/Makefile | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/testsuite/tests/driver/all.T b/testsuite/tests/driver/all.T index e0022d7..69d18d9 100644 --- a/testsuite/tests/driver/all.T +++ b/testsuite/tests/driver/all.T @@ -459,8 +459,8 @@ test('T365', compile_fail, ['']) -test('T9360a', normal, run_command, ['{compiler} --interactive -e ""']) -test('T9360b', normal, run_command, ['{compiler} -e "" --interactive']) +test('T9360a', normal, run_command, ['{compiler} --interactive -e "" -ignore-dot-ghci']) +test('T9360b', normal, run_command, ['{compiler} -e "" --interactive -ignore-dot-ghci']) test('T10970', normal, compile_and_run, ['-hide-all-packages -package base -package containers']) test('T10970a', normal, compile_and_run, ['']) diff --git a/testsuite/tests/ghci/linking/dyn/Makefile b/testsuite/tests/ghci/linking/dyn/Makefile index 0f2d6e1..56e27b1 100644 --- a/testsuite/tests/ghci/linking/dyn/Makefile +++ b/testsuite/tests/ghci/linking/dyn/Makefile @@ -32,7 +32,7 @@ load_short_name: mkdir bin_short '$(TEST_HC)' $(MY_TEST_HC_OPTS) -odir "bin_short" -shared A.c -o "bin_short/$(call DLL,A)" rm -f bin_short/*.a - echo ":q" | "$(TEST_HC)" --interactive -L"./bin_short" -lA -v0 + echo ":q" | "$(TEST_HC)" --interactive -ignore-dot-ghci -L"./bin_short" -lA -v0 .PHONY: compile_libAS compile_libAS: From git at git.haskell.org Thu Jan 21 20:16:51 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Jan 2016 20:16:51 +0000 (UTC) Subject: [commit: ghc] master: Fix docstring GHC.IO.Handle.FD.openFileBLocking (4c4a0a5) Message-ID: <20160121201651.40A9B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/4c4a0a52d3ca5befd2a632544e9541703007e356/ghc >--------------------------------------------------------------- commit 4c4a0a52d3ca5befd2a632544e9541703007e356 Author: Thomas Miedema Date: Thu Jan 21 21:16:05 2016 +0100 Fix docstring GHC.IO.Handle.FD.openFileBLocking Fixes #4248. >--------------------------------------------------------------- 4c4a0a52d3ca5befd2a632544e9541703007e356 libraries/base/GHC/IO/Handle/FD.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/base/GHC/IO/Handle/FD.hs b/libraries/base/GHC/IO/Handle/FD.hs index 181aad7..b2c971c 100644 --- a/libraries/base/GHC/IO/Handle/FD.hs +++ b/libraries/base/GHC/IO/Handle/FD.hs @@ -153,9 +153,9 @@ openFile fp im = (\e -> ioError (addFilePathToIOError "openFile" fp e)) -- | Like 'openFile', but opens the file in ordinary blocking mode. --- This can be useful for opening a FIFO for reading: if we open in --- non-blocking mode then the open will fail if there are no writers, --- whereas a blocking open will block until a writer appears. +-- This can be useful for opening a FIFO for writing: if we open in +-- non-blocking mode then the open will fail if there are no readers, +-- whereas a blocking open will block until a reader appear. -- -- @since 4.4.0.0 openFileBlocking :: FilePath -> IOMode -> IO Handle From git at git.haskell.org Thu Jan 21 21:42:43 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Jan 2016 21:42:43 +0000 (UTC) Subject: [commit: ghc] master: sphinx-build: fix python stack overflow (Trac #10950) (4c11db6) Message-ID: <20160121214243.EFAF63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/4c11db6377aa4fba0c4d70a1e9508247fd053bce/ghc >--------------------------------------------------------------- commit 4c11db6377aa4fba0c4d70a1e9508247fd053bce Author: Sergei Trofimovich Date: Thu Jan 21 21:43:37 2016 +0000 sphinx-build: fix python stack overflow (Trac #10950) Summary: commit a034031a102bc08c76a6cdb104b72922ae22c96b did not fix problem completely. Stack overflows still occasionally happen. Easy to test by the following Torture Test: while sphinx-build -T -N -E -a -b html \ -d docs/users_guide/.doctrees-html \ -D latex_paper_size=letter \ docs/users_guide docs/users_guide/build-html/users_guide do echo again done sphinx build large nested data structures when parses GHC manual (docs/users_guide/glasgow_exts.rst is 455KB in size) which can't be serialized useing default python call stack depth of 1000 calls. The patch increases stack depth 10 times. Survived 2 hours of Torture Test. Signed-off-by: Sergei Trofimovich Test Plan: ran Torture Test to make sure it is stable Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1809 GHC Trac Issues: #10950 >--------------------------------------------------------------- 4c11db6377aa4fba0c4d70a1e9508247fd053bce docs/users_guide/conf.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/users_guide/conf.py b/docs/users_guide/conf.py index 119223a..f9c326e 100644 --- a/docs/users_guide/conf.py +++ b/docs/users_guide/conf.py @@ -147,6 +147,8 @@ def parse_flag(env, sig, signode): def setup(app): from sphinx.util.docfields import Field, TypedField + increase_python_stack() + # the :ghci-cmd: directive used in ghci.rst app.add_object_type('ghci-cmd', 'ghci-cmd', parse_node=parse_ghci_cmd, @@ -171,3 +173,11 @@ def setup(app): Field('since', label='Introduced in GHC version', names=['since']), Field('static') ]) + +def increase_python_stack(): + # Workaround sphinx-build recursion limit overflow: + # pickle.dump(doctree, f, pickle.HIGHEST_PROTOCOL) + # RuntimeError: maximum recursion depth exceeded while pickling an object + # + # Default python allows recursion depth of 1000 calls. + sys.setrecursionlimit(10000) From git at git.haskell.org Thu Jan 21 21:58:36 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 21 Jan 2016 21:58:36 +0000 (UTC) Subject: [commit: ghc] master: Improve comments in CmmSwitch (b617e9f) Message-ID: <20160121215836.ADC053A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/b617e9fe9ce22fb108b7e4a6694167dd893b9dfc/ghc >--------------------------------------------------------------- commit b617e9fe9ce22fb108b7e4a6694167dd893b9dfc Author: Joachim Breitner Date: Thu Jan 21 17:55:48 2016 +0100 Improve comments in CmmSwitch addressing some valuable feedback by thomie at https://phabricator.haskell.org/rGHCde1160be0477 Differential Revision: https://phabricator.haskell.org/D1816 >--------------------------------------------------------------- b617e9fe9ce22fb108b7e4a6694167dd893b9dfc compiler/cmm/CmmSwitch.hs | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/compiler/cmm/CmmSwitch.hs b/compiler/cmm/CmmSwitch.hs index 604e759..514cf38 100644 --- a/compiler/cmm/CmmSwitch.hs +++ b/compiler/cmm/CmmSwitch.hs @@ -48,7 +48,7 @@ import qualified Data.Map as M -- separated. ----------------------------------------------------------------------------- --- Magic Constants +-- Note [Magic Constants in CmmSwitch] -- -- There are a lot of heuristics here that depend on magic values where it is -- hard to determine the "best" value (for whatever that means). These are the @@ -120,7 +120,7 @@ mkSwitchTargets signed range@(lo,hi) mbdef ids | otherwise = Nothing -- Drop entries outside the range, if there is a range - restrict = M.filterWithKey (\x _ -> lo <= x && x <= hi) + restrict = restrictMap (lo,hi) -- Drop entries that equal the default, if there is a default dropDefault | Just l <- mbdef = M.filter (/= l) @@ -152,9 +152,13 @@ switchTargetsSigned :: SwitchTargets -> Bool switchTargetsSigned (SwitchTargets signed _ _ _) = signed -- | switchTargetsToTable creates a dense jump table, usable for code generation. --- Returns an offset to add to the value; the list is 0-based on the result. --- The conversion from Integer to Int is a bit of a wart, but works due to --- wrap-around arithmetic (as verified by the CmmSwitchTest test case). +-- +-- Also returns an offset to add to the value; the list is 0-based on the +-- result of that addition. +-- +-- The conversion from Integer to Int is a bit of a wart, as the actual +-- scrutinee might be an unsigned word, but it just works, due to wrap-around +-- arithmetic (as verified by the CmmSwitchTest test case). switchTargetsToTable :: SwitchTargets -> (Int, [Maybe Label]) switchTargetsToTable (SwitchTargets _ (lo,hi) mbdef branches) = (fromIntegral (-start), [ labelFor i | i <- [start..hi] ]) @@ -219,7 +223,7 @@ eqSwitchTargetWith eq (SwitchTargets signed1 range1 mbdef1 ids1) (SwitchTargets -- Code generation for Switches --- | A SwitchPlan abstractly descries how a Switch statement ought to be +-- | A SwitchPlan abstractly describes how a Switch statement ought to be -- implemented. See Note [createSwitchPlan] data SwitchPlan = Unconditionally Label @@ -235,19 +239,17 @@ data SwitchPlan -- smaller pieces suitable for code generation. -- -- createSwitchPlan creates such a switch plan, in these steps: --- 1. it splits the switch statement at segments of non-default values that --- are too large. See splitAtHoles and Note [When to split SwitchTargets] +-- 1. It splits the switch statement at segments of non-default values that +-- are too large. See splitAtHoles and Note [Magic Constants in CmmSwitch] -- 2. Too small jump tables should be avoided, so we break up smaller pieces -- in breakTooSmall. --- 3. We will in the segments between those pieces with a jump to the default +-- 3. We fill in the segments between those pieces with a jump to the default -- label (if there is one), returning a SeparatedList in mkFlatSwitchPlan --- 4. We find replace two less-than branches by a single equal-to-test in +-- 4. We find and replace two less-than branches by a single equal-to-test in -- findSingleValues -- 5. The thus collected pieces are assembled to a balanced binary tree. -type FlatSwitchPlan = SeparatedList Integer SwitchPlan - -- | Does the target support switch out of the box? Then leave this to the -- target! targetSupportsSwitch :: HscTarget -> Bool @@ -305,9 +307,12 @@ breakTooSmall m --- Step 3: Fill in the blanks --- --- A FlatSwitchPlan is a list of SwitchPlans, seperated by a integer dividing the range. --- So if we have [plan1] n [plan2], then we use plan1 if the expression is < --- n, and plan2 otherwise. +-- | A FlatSwitchPlan is a list of SwitchPlans, with an integer inbetween every +-- two entries, dividing the range. +-- So if we have (abusing list syntax) [plan1,n,plan2], then we use plan1 if +-- the expression is < n, and plan2 otherwise. + +type FlatSwitchPlan = SeparatedList Integer SwitchPlan mkFlatSwitchPlan :: Bool -> Maybe Label -> (Integer, Integer) -> [M.Map Integer Label] -> FlatSwitchPlan @@ -350,7 +355,7 @@ mkLeafPlan signed mbdef m --- Step 4: Reduce the number of branches using == --- --- A seqence of three unconditional jumps, with the outer two pointing to the +-- A sequence of three unconditional jumps, with the outer two pointing to the -- same value and the bounds off by exactly one can be improved findSingleValues :: FlatSwitchPlan -> FlatSwitchPlan findSingleValues (Unconditionally l, (i, Unconditionally l2) : (i', Unconditionally l3) : xs) @@ -394,7 +399,7 @@ divideSL (p,xs) = ((p, xs1), m, (p', xs2)) -- Other Utilities -- -restrictMap :: Integral a => (a,a) -> M.Map a b -> M.Map a b +restrictMap :: (Integer,Integer) -> M.Map Integer b -> M.Map Integer b restrictMap (lo,hi) m = mid where (_, mid_hi) = M.split (lo-1) m (mid, _) = M.split (hi+1) mid_hi From git at git.haskell.org Fri Jan 22 02:10:28 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 22 Jan 2016 02:10:28 +0000 (UTC) Subject: [commit: ghc] master: Always run test T9407 (85e147e) Message-ID: <20160122021028.6E5743A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/85e147e0807ffa1f24666e93658d9608752b351a/ghc >--------------------------------------------------------------- commit 85e147e0807ffa1f24666e93658d9608752b351a Author: Reid Barton Date: Thu Jan 21 21:09:21 2016 -0500 Always run test T9407 We don't know what the cause of the bug was, or what commit fixed it. or why it was Windows only. So it seems prudent to run it in all configurations, in case the bug should crop up again. >--------------------------------------------------------------- 85e147e0807ffa1f24666e93658d9608752b351a testsuite/tests/numeric/should_run/all.T | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/testsuite/tests/numeric/should_run/all.T b/testsuite/tests/numeric/should_run/all.T index b097c7f..527ce27 100644 --- a/testsuite/tests/numeric/should_run/all.T +++ b/testsuite/tests/numeric/should_run/all.T @@ -62,11 +62,7 @@ test('T7233', normal, compile_and_run, ['']) test('NumDecimals', normal, compile_and_run, ['']) test('T8726', normal, compile_and_run, ['']) test('CarryOverflow', omit_ways(['ghci']), compile_and_run, ['']) -test('T9407', [ - unless(opsys('mingw32') and wordsize(64), skip), - only_ways(['optasm']) - ], - compile_and_run, ['']) +test('T9407', normal, compile_and_run, ['']) test('T9810', normal, compile_and_run, ['']) test('T10011', normal, compile_and_run, ['']) test('T10962', omit_ways(['ghci']), compile_and_run, ['']) From git at git.haskell.org Fri Jan 22 09:50:44 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 22 Jan 2016 09:50:44 +0000 (UTC) Subject: [commit: ghc] master: Add expected stderr for #11466 test case (36b174d) Message-ID: <20160122095044.DCD1A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/36b174df5433b217b4178da59917766e663337e7/ghc >--------------------------------------------------------------- commit 36b174df5433b217b4178da59917766e663337e7 Author: Joachim Breitner Date: Fri Jan 22 10:51:46 2016 +0100 Add expected stderr for #11466 test case >--------------------------------------------------------------- 36b174df5433b217b4178da59917766e663337e7 testsuite/tests/polykinds/T11466.stderr | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/testsuite/tests/polykinds/T11466.stderr b/testsuite/tests/polykinds/T11466.stderr new file mode 100644 index 0000000..f584731 --- /dev/null +++ b/testsuite/tests/polykinds/T11466.stderr @@ -0,0 +1,6 @@ + +T11466.hs:15:10: error: + ? Illegal implicit parameter ??x::Int? + ? In the context: Bla + While checking an instance declaration + In the instance declaration for ?Eq T? From git at git.haskell.org Fri Jan 22 12:19:39 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 22 Jan 2016 12:19:39 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Comments only (ff6783d) Message-ID: <20160122121939.A68843A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/ff6783d6a245d53ae77649608d98e118c85db070/ghc >--------------------------------------------------------------- commit ff6783d6a245d53ae77649608d98e118c85db070 Author: Simon Peyton Jones Date: Wed Jan 20 14:09:35 2016 +0000 Comments only (cherry picked from commit 6f95e23249c18d2e808b6586d2efecd3f3f0fb50) >--------------------------------------------------------------- ff6783d6a245d53ae77649608d98e118c85db070 compiler/typecheck/TcSimplify.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/typecheck/TcSimplify.hs b/compiler/typecheck/TcSimplify.hs index 40edf93..81ea3aa 100644 --- a/compiler/typecheck/TcSimplify.hs +++ b/compiler/typecheck/TcSimplify.hs @@ -154,7 +154,7 @@ simpl_top wanteds ; if something_happened then do { wc_residual <- nestTcS (solveWantedsAndDrop wc) ; try_class_defaulting wc_residual } - -- See Note [Overview of implicit CallStacks] + -- See Note [Overview of implicit CallStacks] in TcEvidence else try_callstack_defaulting wc } try_callstack_defaulting :: WantedConstraints -> TcS WantedConstraints @@ -166,7 +166,7 @@ simpl_top wanteds -- | Default any remaining @CallStack@ constraints to empty @CallStack at s. defaultCallStacks :: WantedConstraints -> TcS WantedConstraints --- See Note [Overview of implicit CallStacks] +-- See Note [Overview of implicit CallStacks] in TcEvidence defaultCallStacks wanteds = do simples <- handle_simples (wc_simple wanteds) implics <- mapBagM handle_implic (wc_impl wanteds) From git at git.haskell.org Fri Jan 22 12:19:42 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 22 Jan 2016 12:19:42 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Improve pretty-printing of UnivCo (91c3424) Message-ID: <20160122121942.530233A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/91c342479bcb3e1cdab0b5bddef925d607f6d203/ghc >--------------------------------------------------------------- commit 91c342479bcb3e1cdab0b5bddef925d607f6d203 Author: Simon Peyton Jones Date: Wed Jan 20 14:10:08 2016 +0000 Improve pretty-printing of UnivCo We really need to know the UnivCoProvenance to make sense of UnivCos in debug output (cherry picked from commit b3ee37ce2b4ebde0f0e5574e2e50b2177bddf361) >--------------------------------------------------------------- 91c342479bcb3e1cdab0b5bddef925d607f6d203 compiler/types/Coercion.hs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/compiler/types/Coercion.hs b/compiler/types/Coercion.hs index 42405d6..6835f02 100644 --- a/compiler/types/Coercion.hs +++ b/compiler/types/Coercion.hs @@ -233,12 +233,18 @@ ppr_co p (InstCo co arg) = maybeParen p TyConPrec $ ppr_co p (UnivCo UnsafeCoerceProv r ty1 ty2) = pprPrefixApp p (text "UnsafeCo" <+> ppr r) [pprParendType ty1, pprParendType ty2] -ppr_co _ (UnivCo p r t1 t2)= angleBrackets ( ppr t1 <> comma <+> ppr t2 ) <> ppr_role r <> ppr_prov +ppr_co _ (UnivCo p r t1 t2) + = char 'U' + <> parens (ppr_prov <> comma <+> ppr t1 <> comma <+> ppr t2) + <> ppr_role r where ppr_prov = case p of - HoleProv h -> ppr h - PhantomProv kind_co -> braces (ppr kind_co) - _ -> empty + HoleProv h -> text "hole:" <> ppr h + PhantomProv kind_co -> text "phant:" <> ppr kind_co + ProofIrrelProv co -> text "irrel:" <> ppr co + PluginProv s -> text "plugin:" <> text s + UnsafeCoerceProv -> text "unsafe" + ppr_co p (SymCo co) = pprPrefixApp p (text "Sym") [pprParendCo co] ppr_co p (NthCo n co) = pprPrefixApp p (text "Nth:" <> int n) [pprParendCo co] ppr_co p (LRCo sel co) = pprPrefixApp p (ppr sel) [pprParendCo co] From git at git.haskell.org Fri Jan 22 12:19:45 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 22 Jan 2016 12:19:45 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Strip casts in checkValidInstHead (76d8549) Message-ID: <20160122121945.BD52F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/76d8549d07df1fffa87a820cea1c556104ff382c/ghc >--------------------------------------------------------------- commit 76d8549d07df1fffa87a820cea1c556104ff382c Author: Simon Peyton Jones Date: Wed Jan 20 16:04:20 2016 +0000 Strip casts in checkValidInstHead This patch addresses Trac #11464. The fix is a bit crude (traverse the type to remove CastTys), but it's also simple. See Note [Casts during validity checking] in TcValidity (cherry picked from commit b2e6350fb23403f1c88c5cfed5270d78dbdb6573) >--------------------------------------------------------------- 76d8549d07df1fffa87a820cea1c556104ff382c compiler/typecheck/TcType.hs | 35 ------------- compiler/typecheck/TcValidity.hs | 61 +++++++++++++++++++++- testsuite/tests/typecheck/should_fail/T11464.hs | 5 ++ .../tests/typecheck/should_fail/T11464.stderr | 6 +++ testsuite/tests/typecheck/should_fail/all.T | 1 + 5 files changed, 71 insertions(+), 37 deletions(-) diff --git a/compiler/typecheck/TcType.hs b/compiler/typecheck/TcType.hs index c363303..0182c02 100644 --- a/compiler/typecheck/TcType.hs +++ b/compiler/typecheck/TcType.hs @@ -60,7 +60,6 @@ module TcType ( tcSplitTyConApp, tcSplitTyConApp_maybe, tcRepSplitTyConApp_maybe, tcTyConAppTyCon, tcTyConAppArgs, tcSplitAppTy_maybe, tcSplitAppTy, tcSplitAppTys, tcRepSplitAppTy_maybe, - tcInstHeadTyNotSynonym, tcInstHeadTyAppAllTyVars, tcGetTyVar_maybe, tcGetTyVar, nextRole, tcSplitSigmaTy, tcDeepSplitSigmaTy_maybe, @@ -205,7 +204,6 @@ import Util import Bag import Maybes import Pair -import ListSetOps import Outputable import FastString import ErrUtils( Validity(..), MsgDoc, isValid ) @@ -1262,39 +1260,6 @@ tcSplitDFunTy ty tcSplitDFunHead :: Type -> (Class, [Type]) tcSplitDFunHead = getClassPredTys -tcInstHeadTyNotSynonym :: Type -> Bool --- Used in Haskell-98 mode, for the argument types of an instance head --- These must not be type synonyms, but everywhere else type synonyms --- are transparent, so we need a special function here -tcInstHeadTyNotSynonym ty - = case ty of - TyConApp tc _ -> not (isTypeSynonymTyCon tc) - _ -> True - -tcInstHeadTyAppAllTyVars :: Type -> Bool --- Used in Haskell-98 mode, for the argument types of an instance head --- These must be a constructor applied to type variable arguments. --- But we allow kind instantiations. -tcInstHeadTyAppAllTyVars ty - | Just ty' <- coreView ty -- Look through synonyms - = tcInstHeadTyAppAllTyVars ty' - | otherwise - = case ty of - TyConApp tc tys -> ok (filterOutInvisibleTypes tc tys) - -- avoid kinds - - ForAllTy (Anon arg) res -> ok [arg, res] - _ -> False - where - -- Check that all the types are type variables, - -- and that each is distinct - ok tys = equalLength tvs tys && hasNoDups tvs - where - tvs = mapMaybe get_tv tys - - get_tv (TyVarTy tv) = Just tv -- through synonyms - get_tv _ = Nothing - tcEqKind :: TcKind -> TcKind -> Bool tcEqKind = tcEqType diff --git a/compiler/typecheck/TcValidity.hs b/compiler/typecheck/TcValidity.hs index bf2d6d5..a33fd40 100644 --- a/compiler/typecheck/TcValidity.hs +++ b/compiler/typecheck/TcValidity.hs @@ -998,6 +998,48 @@ checkValidInstHead ctxt clas cls_args abstract_class_msg = text "Manual instances of this class are not permitted." +tcInstHeadTyNotSynonym :: Type -> Bool +-- Used in Haskell-98 mode, for the argument types of an instance head +-- These must not be type synonyms, but everywhere else type synonyms +-- are transparent, so we need a special function here +tcInstHeadTyNotSynonym ty + = case ty of -- Do not use splitTyConApp, + -- because that expands synonyms! + TyConApp tc _ -> not (isTypeSynonymTyCon tc) + _ -> True + +tcInstHeadTyAppAllTyVars :: Type -> Bool +-- Used in Haskell-98 mode, for the argument types of an instance head +-- These must be a constructor applied to type variable arguments. +-- But we allow kind instantiations. +tcInstHeadTyAppAllTyVars ty + | Just (tc, tys) <- tcSplitTyConApp_maybe (dropCasts ty) + = ok (filterOutInvisibleTypes tc tys) -- avoid kinds + + | otherwise + = False + where + -- Check that all the types are type variables, + -- and that each is distinct + ok tys = equalLength tvs tys && hasNoDups tvs + where + tvs = mapMaybe tcGetTyVar_maybe tys + +dropCasts :: Type -> Type +-- See Note [Casts during validity checking] +-- This function can turn a well-kinded type into an ill-kinded +-- one, so I've kept it local to this module +-- To consider: drop only UnivCo(HoleProv) casts +dropCasts (CastTy ty _) = dropCasts ty +dropCasts (AppTy t1 t2) = mkAppTy (dropCasts t1) (dropCasts t2) +dropCasts (TyConApp tc tys) = mkTyConApp tc (map dropCasts tys) +dropCasts (ForAllTy b ty) = ForAllTy (dropCastsB b) (dropCasts ty) +dropCasts ty = ty -- LitTy, TyVarTy, CoercionTy + +dropCastsB :: TyBinder -> TyBinder +dropCastsB (Anon ty) = Anon (dropCasts ty) +dropCastsB b = b -- Don't bother in the kind of a forall + abstractClassKeys :: [Unique] abstractClassKeys = [ heqTyConKey , eqTyConKey @@ -1010,8 +1052,23 @@ instTypeErr cls tys msg 2 (quotes (pprClassPred cls tys))) 2 msg -{- Note [Valid 'deriving' predicate] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +{- Note [Casts during validity checking] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Consider the (bogus) + instance Eq Char# +We elaborate to 'Eq (Char# |> UnivCo(hole))' where the hole is an +insoluble equality constraint for * ~ #. We'll report the insoluble +constraint separately, but we don't want to *also* complain that Eq is +not applied to a type constructor. So we look gaily look through +CastTys here. + +Another example: Eq (Either a). Then we actually get a cast in +the middle: + Eq ((Either |> g) a) + + +Note [Valid 'deriving' predicate] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ validDerivPred checks for OK 'deriving' context. See Note [Exotic derived instance contexts] in TcDeriv. However the predicate is here because it uses sizeTypes, fvTypes. diff --git a/testsuite/tests/typecheck/should_fail/T11464.hs b/testsuite/tests/typecheck/should_fail/T11464.hs new file mode 100644 index 0000000..88246aa --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T11464.hs @@ -0,0 +1,5 @@ +{-# LANGUAGE MagicHash, PolyKinds #-} + +module Foo where + +instance Eq (Either a) diff --git a/testsuite/tests/typecheck/should_fail/T11464.stderr b/testsuite/tests/typecheck/should_fail/T11464.stderr new file mode 100644 index 0000000..f340291 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T11464.stderr @@ -0,0 +1,6 @@ + +T11464.hs:5:14: error: + ? Expecting one more argument to ?Either a? + Expected a type, but ?Either a? has kind ?* -> *? + ? In the first argument of ?Eq?, namely ?Either a? + In the instance declaration for ?Eq (Either a)? diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T index 88ab499..1c4e86e 100644 --- a/testsuite/tests/typecheck/should_fail/all.T +++ b/testsuite/tests/typecheck/should_fail/all.T @@ -403,3 +403,4 @@ test('T10619', normal, compile_fail, ['']) test('T11347', normal, compile_fail, ['']) test('T11356', normal, compile_fail, ['']) test('T11355', normal, compile_fail, ['']) +test('T11464', normal, compile_fail, ['']) From git at git.haskell.org Fri Jan 22 12:19:48 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 22 Jan 2016 12:19:48 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: user-guide: Refer to MIN_VERSION_GLASGOW_HASKELL from intro (dcf4b4c) Message-ID: <20160122121948.8C3A53A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/dcf4b4c4c16a5fcab250deb532c9b40e342df04f/ghc >--------------------------------------------------------------- commit dcf4b4c4c16a5fcab250deb532c9b40e342df04f Author: Ben Gamari Date: Thu Jan 21 11:30:24 2016 +0100 user-guide: Refer to MIN_VERSION_GLASGOW_HASKELL from intro And fix markup. (cherry picked from commit 928484d2b021fc968d5f2dfe490dc0ad201dc7df) >--------------------------------------------------------------- dcf4b4c4c16a5fcab250deb532c9b40e342df04f docs/users_guide/intro.rst | 3 +++ docs/users_guide/phases.rst | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/users_guide/intro.rst b/docs/users_guide/intro.rst index 281c04a..677f462 100644 --- a/docs/users_guide/intro.rst +++ b/docs/users_guide/intro.rst @@ -175,3 +175,6 @@ numbering GHC versions: The version number of your copy of GHC can be found by invoking ``ghc`` with the ``--version`` flag (see :ref:`options-help`). +The compiler version can be tested within compiled code with the +``MIN_VERSION_GLASGOW_HASKELL`` CPP macro (defined only when +:ghc-flag:`-XCPP` is used). See :ref:`standard-cpp-macros` for details. diff --git a/docs/users_guide/phases.rst b/docs/users_guide/phases.rst index bc4e90f..e9637fa 100644 --- a/docs/users_guide/phases.rst +++ b/docs/users_guide/phases.rst @@ -182,6 +182,11 @@ Options affecting the C pre-processor The GHC driver pre-defines several macros when processing Haskell source code (``.hs`` or ``.lhs`` files). +.. _standard-cpp-macros: + +Standard CPP macros +~~~~~~~~~~~~~~~~~~~ + The symbols defined by GHC are listed below. To check which symbols are defined by your local GHC installation, the following trick is useful: @@ -258,7 +263,7 @@ defined by your local GHC installation, the following trick is useful: is required, the presence of the ``MIN_VERSION_GLASGOW_HASKELL`` macro needs to be ensured before it is called, e.g.: - .. code-block: c + .. code-block:: c #ifdef MIN_VERSION_GLASGOW_HASKELL #if MIN_VERSION_GLASGOW_HASKELL(7,10,2,0) @@ -451,6 +456,7 @@ Options affecting code generation no-op on that platform. .. ghc-flag:: -dynamic + :noindex: When generating code, assume that entities imported from a different package will reside in a different shared library or binary. From git at git.haskell.org Fri Jan 22 12:19:51 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 22 Jan 2016 12:19:51 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: rel-notes: Note the return of -Wmonomorphism-restriction (83c393f) Message-ID: <20160122121951.435123A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/83c393fbc78e48506d546e62e0a1629edd85cd64/ghc >--------------------------------------------------------------- commit 83c393fbc78e48506d546e62e0a1629edd85cd64 Author: Ben Gamari Date: Thu Jan 21 14:49:01 2016 +0100 rel-notes: Note the return of -Wmonomorphism-restriction (cherry picked from commit 3883f99c7ea99204a2f15c1e4b7521a4c0b1c527) >--------------------------------------------------------------- 83c393fbc78e48506d546e62e0a1629edd85cd64 docs/users_guide/8.0.1-notes.rst | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/users_guide/8.0.1-notes.rst b/docs/users_guide/8.0.1-notes.rst index 364c725..42a02f9 100644 --- a/docs/users_guide/8.0.1-notes.rst +++ b/docs/users_guide/8.0.1-notes.rst @@ -200,7 +200,7 @@ Compiler compilers. The old ``-f``-based warning flags will remain functional for the forseeable future. -- Added the option :ghc-flag:`-dth-dec-file`. This dumps out a .th.hs file of +- Added the option :ghc-flag:`-dth-dec-file`. This dumps out a ``.th.hs`` file of all Template Haskell declarations in a corresponding .hs file. The idea is that application developers can check this into their repository so that they can grep for identifiers used elsewhere that @@ -210,6 +210,13 @@ Compiler code that does not exist in the .hs file and a comment for the splice location in the original file. +- After a long hiatus (see :ghc-ticket:`10935`) the + :ghc-flag:`-Wmonomorphism-restriction` (formerly + :ghc-flag:`-fwarn-monomorphism-restriction`) flag has returned. + The functionality of this flag was inadvertently removed by a commit in 2010; + this has been fixed and the flag should now issue warnings as it + previously did. + - Added the option :ghc-flag:`-fprint-expanded-types`. When enabled, GHC also prints type-synonym-expanded types in type errors. From git at git.haskell.org Fri Jan 22 12:19:53 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 22 Jan 2016 12:19:53 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: TyCoRep: Restore compatibility with 7.10.1 (56a9f93) Message-ID: <20160122121953.F100C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/56a9f936357be739fefde111f918531661bede4a/ghc >--------------------------------------------------------------- commit 56a9f936357be739fefde111f918531661bede4a Author: Ben Gamari Date: Thu Jan 21 11:19:23 2016 +0100 TyCoRep: Restore compatibility with 7.10.1 Sadly CallStack wasn't present in 7.10.1, breaking the build when bootstrapping from this version. This patch essentially disables CallStack support for stage1 builds with 7.10.*. This doesn't seem so unreasonable though as stage2 will still work. Test Plan: Validate with 7.10.1 Reviewers: gridaphobe, jstolarek, austin Reviewed By: jstolarek Subscribers: thomie, jstolarek Differential Revision: https://phabricator.haskell.org/D1812 GHC Trac Issues: #11472 (cherry picked from commit ede055eb230ac33da276f1416678f99e32e83da2) >--------------------------------------------------------------- 56a9f936357be739fefde111f918531661bede4a compiler/types/TyCoRep.hs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/compiler/types/TyCoRep.hs b/compiler/types/TyCoRep.hs index bd5745a..1522464 100644 --- a/compiler/types/TyCoRep.hs +++ b/compiler/types/TyCoRep.hs @@ -151,7 +151,9 @@ import UniqFM import qualified Data.Data as Data hiding ( TyCon ) import Data.List import Data.IORef ( IORef ) -- for CoercionHole +#if MIN_VERSION_GLASGOW_HASKELL(7,10,2,0) import GHC.Stack (CallStack) +#endif {- %************************************************************************ @@ -1816,7 +1818,13 @@ isValidTCvSubst (TCvSubst in_scope tenv cenv) = -- | Substitute within a 'Type' -- The substitution has to satisfy the invariants described in -- Note [Generating the in-scope set for a substitution]. -substTy :: (?callStack :: CallStack) => TCvSubst -> Type -> Type + +substTy :: +-- CallStack wasn't present in GHC 7.10.1, disable callstacks in stage 1 +#if MIN_VERSION_GLASGOW_HASKELL(7,10,2,0) + (?callStack :: CallStack) => +#endif + TCvSubst -> Type -> Type substTy subst@(TCvSubst in_scope tenv cenv) ty | isEmptyTCvSubst subst = ty | otherwise = ASSERT2( isValidTCvSubst subst, From git at git.haskell.org Fri Jan 22 12:19:56 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 22 Jan 2016 12:19:56 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: user-guide:: Improve -D description (47b84b6) Message-ID: <20160122121956.9F3903A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/47b84b6ce811f5a4be3fcf95e24f384c5cadc09b/ghc >--------------------------------------------------------------- commit 47b84b6ce811f5a4be3fcf95e24f384c5cadc09b Author: Ben Gamari Date: Thu Jan 21 11:36:00 2016 +0100 user-guide:: Improve -D description (cherry picked from commit f23b578f792a357fa754604188eea46ca46cf613) >--------------------------------------------------------------- 47b84b6ce811f5a4be3fcf95e24f384c5cadc09b docs/users_guide/phases.rst | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/users_guide/phases.rst b/docs/users_guide/phases.rst index 0428956..bc4e90f 100644 --- a/docs/users_guide/phases.rst +++ b/docs/users_guide/phases.rst @@ -161,11 +161,14 @@ Options affecting the C pre-processor large system with significant doses of conditional compilation, you really shouldn't need it. -.. ghc-flag:: -D ?symbol?[=?value?] +.. ghc-flag:: -D [=] Define macro ?symbol? in the usual way. NB: does *not* affect ``-D`` - macros passed to the C?compiler when compiling via C! For those, use - the ``-optc-Dfoo`` hack? (see :ref:`forcing-options-through`). + macros passed to the C?compiler when compiling with :ghc-flag:`-fvia-C`! For + those, use the ``-optc-Dfoo`` hack? (see :ref:`forcing-options-through`). + + When no value is given, the value is taken to be ``1``. For instance, + ``-DUSE_MYLIB`` is equivalent to ``-DUSE_MYLIB=1``. .. ghc-flag:: -U ?symbol? From git at git.haskell.org Fri Jan 22 12:19:59 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 22 Jan 2016 12:19:59 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Allow implicit parameters in constraint synonyms (f3354fc) Message-ID: <20160122121959.D3CE73A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/f3354fc784ba6056a2b83698f8771b7cb8e40f5e/ghc >--------------------------------------------------------------- commit f3354fc784ba6056a2b83698f8771b7cb8e40f5e Author: Simon Peyton Jones Date: Thu Jan 21 12:26:50 2016 +0000 Allow implicit parameters in constraint synonyms This fixes Trac #11466. It went bad by accident in commit ffc21506894c7887d3620423aaf86bc6113a1071 Refactor tuple constraints (cherry picked from commit 395ec414ff21bc37439194bb31a8f764b38b0fca) >--------------------------------------------------------------- f3354fc784ba6056a2b83698f8771b7cb8e40f5e compiler/typecheck/TcValidity.hs | 32 +++++++++++++++++++++++++++----- testsuite/tests/polykinds/T11466.hs | 16 ++++++++++++++++ testsuite/tests/polykinds/T11466.stderr | 6 ++++++ testsuite/tests/polykinds/all.T | 1 + 4 files changed, 50 insertions(+), 5 deletions(-) diff --git a/compiler/typecheck/TcValidity.hs b/compiler/typecheck/TcValidity.hs index a33fd40..517d059 100644 --- a/compiler/typecheck/TcValidity.hs +++ b/compiler/typecheck/TcValidity.hs @@ -675,12 +675,33 @@ check_valid_theta env ctxt theta (_,dups) = removeDups cmpType theta ------------------------- +{- Note [Validity checking for constraints] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +We look through constraint synonyms so that we can see the underlying +constraint(s). For example + type Foo = ?x::Int + instance Foo => C T +We should reject the instance because it has an implicit parameter in +the context. + +But we record, in 'under_syn', whether we have looked under a synonym +to avoid requiring language extensions at the use site. Main example +(Trac #9838): + + {-# LANGUAGE ConstraintKinds #-} + module A where + type EqShow a = (Eq a, Show a) + + module B where + import A + foo :: EqShow a => a -> String + +We don't want to require ConstraintKinds in module B. +-} + check_pred_ty :: TidyEnv -> DynFlags -> UserTypeCtxt -> PredType -> TcM () -- Check the validity of a predicate in a signature --- Do not look through any type synonyms; any constraint kinded --- type synonyms have been checked at their definition site --- C.f. Trac #9838 - +-- See Note [Validity checking for constraints] check_pred_ty env dflags ctxt pred = do { check_type env SigmaCtxt MustBeMonoType pred ; check_pred_help False env dflags ctxt pred } @@ -814,11 +835,12 @@ okIPCtxt GhciCtxt = True okIPCtxt SigmaCtxt = True okIPCtxt (DataTyCtxt {}) = True okIPCtxt (PatSynCtxt {}) = True +okIPCtxt (TySynCtxt {}) = True -- e.g. type Blah = ?x::Int + -- Trac #11466 okIPCtxt (ClassSCCtxt {}) = False okIPCtxt (InstDeclCtxt {}) = False okIPCtxt (SpecInstCtxt {}) = False -okIPCtxt (TySynCtxt {}) = False okIPCtxt (RuleSigCtxt {}) = False okIPCtxt DefaultDeclCtxt = False diff --git a/testsuite/tests/polykinds/T11466.hs b/testsuite/tests/polykinds/T11466.hs new file mode 100644 index 0000000..e479af0 --- /dev/null +++ b/testsuite/tests/polykinds/T11466.hs @@ -0,0 +1,16 @@ +{-# LANGUAGE ImplicitParams, ConstraintKinds #-} + +module T11466 where + +-- This should be ok +type Bla = ?x::Int + +-- This should be ook +f :: Bla => Int -> Int +f y = ?x + y + +data T = T + +-- But this should be rejected +instance Bla => Eq T + diff --git a/testsuite/tests/polykinds/T11466.stderr b/testsuite/tests/polykinds/T11466.stderr new file mode 100644 index 0000000..f584731 --- /dev/null +++ b/testsuite/tests/polykinds/T11466.stderr @@ -0,0 +1,6 @@ + +T11466.hs:15:10: error: + ? Illegal implicit parameter ??x::Int? + ? In the context: Bla + While checking an instance declaration + In the instance declaration for ?Eq T? diff --git a/testsuite/tests/polykinds/all.T b/testsuite/tests/polykinds/all.T index 899e47c..f1f25ce 100644 --- a/testsuite/tests/polykinds/all.T +++ b/testsuite/tests/polykinds/all.T @@ -133,3 +133,4 @@ test('T11248', normal, compile, ['']) test('T11278', normal, compile, ['']) test('T11255', normal, compile, ['']) test('T11459', normal, compile_fail, ['']) +test('T11466', normal, compile_fail, ['']) From git at git.haskell.org Fri Jan 22 12:20:02 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 22 Jan 2016 12:20:02 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Update and improve documentation in Data.Foldable (00fc0d7) Message-ID: <20160122122002.88C4C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/00fc0d7ff51e9f2b23a4834056df22e3dfe7d8db/ghc >--------------------------------------------------------------- commit 00fc0d7ff51e9f2b23a4834056df22e3dfe7d8db Author: Ben Gamari Date: Thu Jan 21 14:51:01 2016 +0100 Update and improve documentation in Data.Foldable Previously there were a few obsolete references to `Data.List` and the descriptions were lacking examples. Fixes #11065. Test Plan: Read it. Reviewers: ekmett, goldfire, hvr, austin Reviewed By: hvr Subscribers: nomeata, thomie Differential Revision: https://phabricator.haskell.org/D1617 GHC Trac Issues: #11065 (cherry picked from commit 7cb893f562346d5aa986bd88863335aabbf7e95f) >--------------------------------------------------------------- 00fc0d7ff51e9f2b23a4834056df22e3dfe7d8db libraries/base/Data/Foldable.hs | 64 +++++++++++++++++++++++++++++++++++------ 1 file changed, 55 insertions(+), 9 deletions(-) diff --git a/libraries/base/Data/Foldable.hs b/libraries/base/Data/Foldable.hs index 722b68f..3d518d5 100644 --- a/libraries/base/Data/Foldable.hs +++ b/libraries/base/Data/Foldable.hs @@ -125,28 +125,74 @@ class Foldable t where -- | Right-associative fold of a structure. -- - -- @'foldr' f z = 'Prelude.foldr' f z . 'toList'@ + -- In the case of lists, 'foldr', when applied to a binary operator, a + -- starting value (typically the right-identity of the operator), and a + -- list, reduces the list using the binary operator, from right to left: + -- + -- > foldr f z [x1, x2, ..., xn] == x1 `f` (x2 `f` ... (xn `f` z)...) + -- + -- Note that, since the head of the resulting expression is produced by + -- an application of the operator to the first element of the list, + -- 'foldr' can produce a terminating expression from an infinite list. + -- + -- For a general 'Foldable' structure this should be semantically identical + -- to, + -- + -- @foldr f z = 'List.foldr' f z . 'toList'@ + -- foldr :: (a -> b -> b) -> b -> t a -> b foldr f z t = appEndo (foldMap (Endo #. f) t) z - -- | Right-associative fold of a structure, - -- but with strict application of the operator. + -- | Right-associative fold of a structure, but with strict application of + -- the operator. + -- foldr' :: (a -> b -> b) -> b -> t a -> b foldr' f z0 xs = foldl f' id xs z0 where f' k x z = k $! f x z -- | Left-associative fold of a structure. -- - -- @'foldl' f z = 'Prelude.foldl' f z . 'toList'@ + -- In the case of lists, 'foldl', when applied to a binary + -- operator, a starting value (typically the left-identity of the operator), + -- and a list, reduces the list using the binary operator, from left to + -- right: + -- + -- > foldl f z [x1, x2, ..., xn] == (...((z `f` x1) `f` x2) `f`...) `f` xn + -- + -- Note that to produce the outermost application of the operator the + -- entire input list must be traversed. This means that 'foldl'' will + -- diverge if given an infinite list. + -- + -- Also note that if you want an efficient left-fold, you probably want to + -- use 'foldl'' instead of 'foldl'. The reason for this is that latter does + -- not force the "inner" results (e.g. @z `f` x1@ in the above example) + -- before applying them to the operator (e.g. to @(`f` x2)@). This results + -- in a thunk chain @O(n)@ elements long, which then must be evaluated from + -- the outside-in. + -- + -- For a general 'Foldable' structure this should be semantically identical + -- to, + -- + -- @foldl f z = 'List.foldl' f z . 'toList'@ + -- foldl :: (b -> a -> b) -> b -> t a -> b foldl f z t = appEndo (getDual (foldMap (Dual . Endo . flip f) t)) z -- There's no point mucking around with coercions here, -- because flip forces us to build a new function anyway. - -- | Left-associative fold of a structure. - -- but with strict application of the operator. + -- | Left-associative fold of a structure but with strict application of + -- the operator. + -- + -- This ensures that each step of the fold is forced to weak head normal + -- form before being applied, avoiding the collection of thunks that would + -- otherwise occur. This is often what you want to strictly reduce a finite + -- list to a single, monolithic result (e.g. 'length'). + -- + -- For a general 'Foldable' structure this should be semantically identical + -- to, + -- + -- @foldl f z = 'List.foldl'' f z . 'toList'@ -- - -- @'foldl' f z = 'List.foldl'' f z . 'toList'@ foldl' :: (b -> a -> b) -> b -> t a -> b foldl' f z0 xs = foldr f' id xs z0 where f' x k z = k $! f z x @@ -154,7 +200,7 @@ class Foldable t where -- | A variant of 'foldr' that has no base case, -- and thus may only be applied to non-empty structures. -- - -- @'foldr1' f = 'Prelude.foldr1' f . 'toList'@ + -- @'foldr1' f = 'List.foldr1' f . 'toList'@ foldr1 :: (a -> a -> a) -> t a -> a foldr1 f xs = fromMaybe (errorWithoutStackTrace "foldr1: empty structure") (foldr mf Nothing xs) @@ -166,7 +212,7 @@ class Foldable t where -- | A variant of 'foldl' that has no base case, -- and thus may only be applied to non-empty structures. -- - -- @'foldl1' f = 'Prelude.foldl1' f . 'toList'@ + -- @'foldl1' f = 'List.foldl1' f . 'toList'@ foldl1 :: (a -> a -> a) -> t a -> a foldl1 f xs = fromMaybe (errorWithoutStackTrace "foldl1: empty structure") (foldl mf Nothing xs) From git at git.haskell.org Fri Jan 22 12:20:05 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 22 Jan 2016 12:20:05 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Add -ignore-dot-ghci to tests that use --interactive (31d8718) Message-ID: <20160122122005.387C53A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/31d871851d77767c28ab28a2a975477572e143c3/ghc >--------------------------------------------------------------- commit 31d871851d77767c28ab28a2a975477572e143c3 Author: Reid Barton Date: Thu Jan 21 13:50:00 2016 -0500 Add -ignore-dot-ghci to tests that use --interactive (cherry picked from commit 2ffc2606cfc58768ddc6dd53f270ba7088c43f3c) >--------------------------------------------------------------- 31d871851d77767c28ab28a2a975477572e143c3 testsuite/tests/driver/all.T | 4 ++-- testsuite/tests/ghci/linking/dyn/Makefile | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/testsuite/tests/driver/all.T b/testsuite/tests/driver/all.T index e0022d7..69d18d9 100644 --- a/testsuite/tests/driver/all.T +++ b/testsuite/tests/driver/all.T @@ -459,8 +459,8 @@ test('T365', compile_fail, ['']) -test('T9360a', normal, run_command, ['{compiler} --interactive -e ""']) -test('T9360b', normal, run_command, ['{compiler} -e "" --interactive']) +test('T9360a', normal, run_command, ['{compiler} --interactive -e "" -ignore-dot-ghci']) +test('T9360b', normal, run_command, ['{compiler} -e "" --interactive -ignore-dot-ghci']) test('T10970', normal, compile_and_run, ['-hide-all-packages -package base -package containers']) test('T10970a', normal, compile_and_run, ['']) diff --git a/testsuite/tests/ghci/linking/dyn/Makefile b/testsuite/tests/ghci/linking/dyn/Makefile index 0f2d6e1..56e27b1 100644 --- a/testsuite/tests/ghci/linking/dyn/Makefile +++ b/testsuite/tests/ghci/linking/dyn/Makefile @@ -32,7 +32,7 @@ load_short_name: mkdir bin_short '$(TEST_HC)' $(MY_TEST_HC_OPTS) -odir "bin_short" -shared A.c -o "bin_short/$(call DLL,A)" rm -f bin_short/*.a - echo ":q" | "$(TEST_HC)" --interactive -L"./bin_short" -lA -v0 + echo ":q" | "$(TEST_HC)" --interactive -ignore-dot-ghci -L"./bin_short" -lA -v0 .PHONY: compile_libAS compile_libAS: From git at git.haskell.org Fri Jan 22 12:20:07 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 22 Jan 2016 12:20:07 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Fix docstring GHC.IO.Handle.FD.openFileBLocking (ede37fd) Message-ID: <20160122122007.D9CE13A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/ede37fd29e6dc1b4a832172b29eee3baff165306/ghc >--------------------------------------------------------------- commit ede37fd29e6dc1b4a832172b29eee3baff165306 Author: Thomas Miedema Date: Thu Jan 21 21:16:05 2016 +0100 Fix docstring GHC.IO.Handle.FD.openFileBLocking Fixes #4248. (cherry picked from commit 4c4a0a52d3ca5befd2a632544e9541703007e356) >--------------------------------------------------------------- ede37fd29e6dc1b4a832172b29eee3baff165306 libraries/base/GHC/IO/Handle/FD.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/base/GHC/IO/Handle/FD.hs b/libraries/base/GHC/IO/Handle/FD.hs index 181aad7..b2c971c 100644 --- a/libraries/base/GHC/IO/Handle/FD.hs +++ b/libraries/base/GHC/IO/Handle/FD.hs @@ -153,9 +153,9 @@ openFile fp im = (\e -> ioError (addFilePathToIOError "openFile" fp e)) -- | Like 'openFile', but opens the file in ordinary blocking mode. --- This can be useful for opening a FIFO for reading: if we open in --- non-blocking mode then the open will fail if there are no writers, --- whereas a blocking open will block until a writer appears. +-- This can be useful for opening a FIFO for writing: if we open in +-- non-blocking mode then the open will fail if there are no readers, +-- whereas a blocking open will block until a reader appear. -- -- @since 4.4.0.0 openFileBlocking :: FilePath -> IOMode -> IO Handle From git at git.haskell.org Fri Jan 22 12:20:10 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 22 Jan 2016 12:20:10 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: sphinx-build: fix python stack overflow (Trac #10950) (e6bbaef) Message-ID: <20160122122010.8E4493A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/e6bbaefcf7d0aa9ce5d6845cf82329e473fd88c0/ghc >--------------------------------------------------------------- commit e6bbaefcf7d0aa9ce5d6845cf82329e473fd88c0 Author: Sergei Trofimovich Date: Thu Jan 21 21:43:37 2016 +0000 sphinx-build: fix python stack overflow (Trac #10950) Summary: commit a034031a102bc08c76a6cdb104b72922ae22c96b did not fix problem completely. Stack overflows still occasionally happen. Easy to test by the following Torture Test: while sphinx-build -T -N -E -a -b html \ -d docs/users_guide/.doctrees-html \ -D latex_paper_size=letter \ docs/users_guide docs/users_guide/build-html/users_guide do echo again done sphinx build large nested data structures when parses GHC manual (docs/users_guide/glasgow_exts.rst is 455KB in size) which can't be serialized useing default python call stack depth of 1000 calls. The patch increases stack depth 10 times. Survived 2 hours of Torture Test. Signed-off-by: Sergei Trofimovich Test Plan: ran Torture Test to make sure it is stable Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1809 GHC Trac Issues: #10950 (cherry picked from commit 4c11db6377aa4fba0c4d70a1e9508247fd053bce) >--------------------------------------------------------------- e6bbaefcf7d0aa9ce5d6845cf82329e473fd88c0 docs/users_guide/conf.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/users_guide/conf.py b/docs/users_guide/conf.py index 119223a..f9c326e 100644 --- a/docs/users_guide/conf.py +++ b/docs/users_guide/conf.py @@ -147,6 +147,8 @@ def parse_flag(env, sig, signode): def setup(app): from sphinx.util.docfields import Field, TypedField + increase_python_stack() + # the :ghci-cmd: directive used in ghci.rst app.add_object_type('ghci-cmd', 'ghci-cmd', parse_node=parse_ghci_cmd, @@ -171,3 +173,11 @@ def setup(app): Field('since', label='Introduced in GHC version', names=['since']), Field('static') ]) + +def increase_python_stack(): + # Workaround sphinx-build recursion limit overflow: + # pickle.dump(doctree, f, pickle.HIGHEST_PROTOCOL) + # RuntimeError: maximum recursion depth exceeded while pickling an object + # + # Default python allows recursion depth of 1000 calls. + sys.setrecursionlimit(10000) From git at git.haskell.org Fri Jan 22 12:20:13 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 22 Jan 2016 12:20:13 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Improve comments in CmmSwitch (4504243) Message-ID: <20160122122013.3FCF33A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/4504243f54d44ceb24e26664ea4e54f7492adb29/ghc >--------------------------------------------------------------- commit 4504243f54d44ceb24e26664ea4e54f7492adb29 Author: Joachim Breitner Date: Thu Jan 21 17:55:48 2016 +0100 Improve comments in CmmSwitch addressing some valuable feedback by thomie at https://phabricator.haskell.org/rGHCde1160be0477 Differential Revision: https://phabricator.haskell.org/D1816 (cherry picked from commit b617e9fe9ce22fb108b7e4a6694167dd893b9dfc) >--------------------------------------------------------------- 4504243f54d44ceb24e26664ea4e54f7492adb29 compiler/cmm/CmmSwitch.hs | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/compiler/cmm/CmmSwitch.hs b/compiler/cmm/CmmSwitch.hs index 604e759..514cf38 100644 --- a/compiler/cmm/CmmSwitch.hs +++ b/compiler/cmm/CmmSwitch.hs @@ -48,7 +48,7 @@ import qualified Data.Map as M -- separated. ----------------------------------------------------------------------------- --- Magic Constants +-- Note [Magic Constants in CmmSwitch] -- -- There are a lot of heuristics here that depend on magic values where it is -- hard to determine the "best" value (for whatever that means). These are the @@ -120,7 +120,7 @@ mkSwitchTargets signed range@(lo,hi) mbdef ids | otherwise = Nothing -- Drop entries outside the range, if there is a range - restrict = M.filterWithKey (\x _ -> lo <= x && x <= hi) + restrict = restrictMap (lo,hi) -- Drop entries that equal the default, if there is a default dropDefault | Just l <- mbdef = M.filter (/= l) @@ -152,9 +152,13 @@ switchTargetsSigned :: SwitchTargets -> Bool switchTargetsSigned (SwitchTargets signed _ _ _) = signed -- | switchTargetsToTable creates a dense jump table, usable for code generation. --- Returns an offset to add to the value; the list is 0-based on the result. --- The conversion from Integer to Int is a bit of a wart, but works due to --- wrap-around arithmetic (as verified by the CmmSwitchTest test case). +-- +-- Also returns an offset to add to the value; the list is 0-based on the +-- result of that addition. +-- +-- The conversion from Integer to Int is a bit of a wart, as the actual +-- scrutinee might be an unsigned word, but it just works, due to wrap-around +-- arithmetic (as verified by the CmmSwitchTest test case). switchTargetsToTable :: SwitchTargets -> (Int, [Maybe Label]) switchTargetsToTable (SwitchTargets _ (lo,hi) mbdef branches) = (fromIntegral (-start), [ labelFor i | i <- [start..hi] ]) @@ -219,7 +223,7 @@ eqSwitchTargetWith eq (SwitchTargets signed1 range1 mbdef1 ids1) (SwitchTargets -- Code generation for Switches --- | A SwitchPlan abstractly descries how a Switch statement ought to be +-- | A SwitchPlan abstractly describes how a Switch statement ought to be -- implemented. See Note [createSwitchPlan] data SwitchPlan = Unconditionally Label @@ -235,19 +239,17 @@ data SwitchPlan -- smaller pieces suitable for code generation. -- -- createSwitchPlan creates such a switch plan, in these steps: --- 1. it splits the switch statement at segments of non-default values that --- are too large. See splitAtHoles and Note [When to split SwitchTargets] +-- 1. It splits the switch statement at segments of non-default values that +-- are too large. See splitAtHoles and Note [Magic Constants in CmmSwitch] -- 2. Too small jump tables should be avoided, so we break up smaller pieces -- in breakTooSmall. --- 3. We will in the segments between those pieces with a jump to the default +-- 3. We fill in the segments between those pieces with a jump to the default -- label (if there is one), returning a SeparatedList in mkFlatSwitchPlan --- 4. We find replace two less-than branches by a single equal-to-test in +-- 4. We find and replace two less-than branches by a single equal-to-test in -- findSingleValues -- 5. The thus collected pieces are assembled to a balanced binary tree. -type FlatSwitchPlan = SeparatedList Integer SwitchPlan - -- | Does the target support switch out of the box? Then leave this to the -- target! targetSupportsSwitch :: HscTarget -> Bool @@ -305,9 +307,12 @@ breakTooSmall m --- Step 3: Fill in the blanks --- --- A FlatSwitchPlan is a list of SwitchPlans, seperated by a integer dividing the range. --- So if we have [plan1] n [plan2], then we use plan1 if the expression is < --- n, and plan2 otherwise. +-- | A FlatSwitchPlan is a list of SwitchPlans, with an integer inbetween every +-- two entries, dividing the range. +-- So if we have (abusing list syntax) [plan1,n,plan2], then we use plan1 if +-- the expression is < n, and plan2 otherwise. + +type FlatSwitchPlan = SeparatedList Integer SwitchPlan mkFlatSwitchPlan :: Bool -> Maybe Label -> (Integer, Integer) -> [M.Map Integer Label] -> FlatSwitchPlan @@ -350,7 +355,7 @@ mkLeafPlan signed mbdef m --- Step 4: Reduce the number of branches using == --- --- A seqence of three unconditional jumps, with the outer two pointing to the +-- A sequence of three unconditional jumps, with the outer two pointing to the -- same value and the bounds off by exactly one can be improved findSingleValues :: FlatSwitchPlan -> FlatSwitchPlan findSingleValues (Unconditionally l, (i, Unconditionally l2) : (i', Unconditionally l3) : xs) @@ -394,7 +399,7 @@ divideSL (p,xs) = ((p, xs1), m, (p', xs2)) -- Other Utilities -- -restrictMap :: Integral a => (a,a) -> M.Map a b -> M.Map a b +restrictMap :: (Integer,Integer) -> M.Map Integer b -> M.Map Integer b restrictMap (lo,hi) m = mid where (_, mid_hi) = M.split (lo-1) m (mid, _) = M.split (hi+1) mid_hi From git at git.haskell.org Fri Jan 22 12:20:15 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 22 Jan 2016 12:20:15 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Make a constraint synonym for repeated BinaryStringRep and use it. (c698f1f) Message-ID: <20160122122015.DC7F73A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/c698f1f322fded4609f326e6e6f5866f821721a1/ghc >--------------------------------------------------------------- commit c698f1f322fded4609f326e6e6f5866f821721a1 Author: Edward Z. Yang Date: Thu Jan 21 19:27:58 2016 +0100 Make a constraint synonym for repeated BinaryStringRep and use it. Test Plan: validate Reviewers: austin, thomie, bgamari Reviewed By: thomie, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1810 (cherry picked from commit adb721bd0eb60ab4c55d5197933e8090fe6297c5) >--------------------------------------------------------------- c698f1f322fded4609f326e6e6f5866f821721a1 libraries/ghc-boot/GHC/PackageDb.hs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/libraries/ghc-boot/GHC/PackageDb.hs b/libraries/ghc-boot/GHC/PackageDb.hs index cc03c3b..7ca6497 100644 --- a/libraries/ghc-boot/GHC/PackageDb.hs +++ b/libraries/ghc-boot/GHC/PackageDb.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE ConstraintKinds #-} {-# OPTIONS_GHC -fno-warn-name-shadowing #-} ----------------------------------------------------------------------------- -- | @@ -92,6 +93,12 @@ data InstalledPackageInfo srcpkgid srcpkgname unitid modulename } deriving (Eq, Show) +-- | A convenience constraint synonym for common constraints over parameters +-- to 'InstalledPackageInfo'. +type RepInstalledPackageInfo srcpkgid srcpkgname unitid modulename = + (BinaryStringRep srcpkgid, BinaryStringRep srcpkgname, + BinaryStringRep unitid, BinaryStringRep modulename) + -- | An original module is a fully-qualified module name (installed package ID -- plus module name) representing where a module was *originally* defined -- (i.e., the 'exposedReexport' field of the original ExposedModule entry should @@ -127,8 +134,7 @@ class BinaryStringRep a where fromStringRep :: BS.ByteString -> a toStringRep :: a -> BS.ByteString -emptyInstalledPackageInfo :: (BinaryStringRep a, BinaryStringRep b, - BinaryStringRep c) +emptyInstalledPackageInfo :: RepInstalledPackageInfo a b c d => InstalledPackageInfo a b c d emptyInstalledPackageInfo = InstalledPackageInfo { @@ -159,8 +165,7 @@ emptyInstalledPackageInfo = -- | Read the part of the package DB that GHC is interested in. -- -readPackageDbForGhc :: (BinaryStringRep a, BinaryStringRep b, BinaryStringRep c, - BinaryStringRep d) => +readPackageDbForGhc :: RepInstalledPackageInfo a b c d => FilePath -> IO [InstalledPackageInfo a b c d] readPackageDbForGhc file = decodeFromFile file getDbForGhc @@ -193,8 +198,7 @@ readPackageDbForGhcPkg file = -- | Write the whole of the package DB, both parts. -- -writePackageDb :: (Binary pkgs, BinaryStringRep a, BinaryStringRep b, - BinaryStringRep c, BinaryStringRep d) => +writePackageDb :: (Binary pkgs, RepInstalledPackageInfo a b c d) => FilePath -> [InstalledPackageInfo a b c d] -> pkgs -> IO () writePackageDb file ghcPkgs ghcPkgPart = writeFileAtomic file (runPut putDbForGhcPkg) @@ -281,8 +285,7 @@ writeFileAtomic targetPath content = do hClose handle renameFile tmpPath targetPath) -instance (BinaryStringRep a, BinaryStringRep b, BinaryStringRep c, - BinaryStringRep d) => +instance (RepInstalledPackageInfo a b c d) => Binary (InstalledPackageInfo a b c d) where put (InstalledPackageInfo unitId sourcePackageId From git at git.haskell.org Fri Jan 22 13:20:15 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 22 Jan 2016 13:20:15 +0000 (UTC) Subject: [commit: ghc] master: Make a constraint synonym for repeated BinaryStringRep and use it. (adb721b) Message-ID: <20160122132015.AD48A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/adb721bd0eb60ab4c55d5197933e8090fe6297c5/ghc >--------------------------------------------------------------- commit adb721bd0eb60ab4c55d5197933e8090fe6297c5 Author: Edward Z. Yang Date: Thu Jan 21 19:27:58 2016 +0100 Make a constraint synonym for repeated BinaryStringRep and use it. Test Plan: validate Reviewers: austin, thomie, bgamari Reviewed By: thomie, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1810 >--------------------------------------------------------------- adb721bd0eb60ab4c55d5197933e8090fe6297c5 libraries/ghc-boot/GHC/PackageDb.hs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/libraries/ghc-boot/GHC/PackageDb.hs b/libraries/ghc-boot/GHC/PackageDb.hs index cc03c3b..7ca6497 100644 --- a/libraries/ghc-boot/GHC/PackageDb.hs +++ b/libraries/ghc-boot/GHC/PackageDb.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE ConstraintKinds #-} {-# OPTIONS_GHC -fno-warn-name-shadowing #-} ----------------------------------------------------------------------------- -- | @@ -92,6 +93,12 @@ data InstalledPackageInfo srcpkgid srcpkgname unitid modulename } deriving (Eq, Show) +-- | A convenience constraint synonym for common constraints over parameters +-- to 'InstalledPackageInfo'. +type RepInstalledPackageInfo srcpkgid srcpkgname unitid modulename = + (BinaryStringRep srcpkgid, BinaryStringRep srcpkgname, + BinaryStringRep unitid, BinaryStringRep modulename) + -- | An original module is a fully-qualified module name (installed package ID -- plus module name) representing where a module was *originally* defined -- (i.e., the 'exposedReexport' field of the original ExposedModule entry should @@ -127,8 +134,7 @@ class BinaryStringRep a where fromStringRep :: BS.ByteString -> a toStringRep :: a -> BS.ByteString -emptyInstalledPackageInfo :: (BinaryStringRep a, BinaryStringRep b, - BinaryStringRep c) +emptyInstalledPackageInfo :: RepInstalledPackageInfo a b c d => InstalledPackageInfo a b c d emptyInstalledPackageInfo = InstalledPackageInfo { @@ -159,8 +165,7 @@ emptyInstalledPackageInfo = -- | Read the part of the package DB that GHC is interested in. -- -readPackageDbForGhc :: (BinaryStringRep a, BinaryStringRep b, BinaryStringRep c, - BinaryStringRep d) => +readPackageDbForGhc :: RepInstalledPackageInfo a b c d => FilePath -> IO [InstalledPackageInfo a b c d] readPackageDbForGhc file = decodeFromFile file getDbForGhc @@ -193,8 +198,7 @@ readPackageDbForGhcPkg file = -- | Write the whole of the package DB, both parts. -- -writePackageDb :: (Binary pkgs, BinaryStringRep a, BinaryStringRep b, - BinaryStringRep c, BinaryStringRep d) => +writePackageDb :: (Binary pkgs, RepInstalledPackageInfo a b c d) => FilePath -> [InstalledPackageInfo a b c d] -> pkgs -> IO () writePackageDb file ghcPkgs ghcPkgPart = writeFileAtomic file (runPut putDbForGhcPkg) @@ -281,8 +285,7 @@ writeFileAtomic targetPath content = do hClose handle renameFile tmpPath targetPath) -instance (BinaryStringRep a, BinaryStringRep b, BinaryStringRep c, - BinaryStringRep d) => +instance (RepInstalledPackageInfo a b c d) => Binary (InstalledPackageInfo a b c d) where put (InstalledPackageInfo unitId sourcePackageId From git at git.haskell.org Fri Jan 22 13:20:19 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 22 Jan 2016 13:20:19 +0000 (UTC) Subject: [commit: ghc] master: Default non-canonical CallStack constraints (835a2a2) Message-ID: <20160122132019.21B7E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/835a2a24a605f8e458f57c71aa67e9983593b5e4/ghc >--------------------------------------------------------------- commit 835a2a24a605f8e458f57c71aa67e9983593b5e4 Author: Eric Seidel Date: Fri Jan 22 12:45:53 2016 +0100 Default non-canonical CallStack constraints Test Plan: `make test TEST=T11462` Reviewers: austin, bgamari, simonpj Reviewed By: simonpj Subscribers: thomie Projects: #ghc Differential Revision: https://phabricator.haskell.org/D1804 GHC Trac Issues: #11462 >--------------------------------------------------------------- 835a2a24a605f8e458f57c71aa67e9983593b5e4 compiler/typecheck/TcInteract.hs | 2 +- compiler/typecheck/TcRnTypes.hs | 10 +++++----- compiler/typecheck/TcSimplify.hs | 7 ++++--- testsuite/tests/typecheck/should_compile/T11462.hs | 6 ++++++ testsuite/tests/typecheck/should_compile/T11462_Plugin.hs | 14 ++++++++++++++ testsuite/tests/typecheck/should_compile/all.T | 7 +++++++ 6 files changed, 37 insertions(+), 9 deletions(-) diff --git a/compiler/typecheck/TcInteract.hs b/compiler/typecheck/TcInteract.hs index 1853cb3..86cc8b3 100644 --- a/compiler/typecheck/TcInteract.hs +++ b/compiler/typecheck/TcInteract.hs @@ -680,7 +680,7 @@ interactIrred _ wi = pprPanic "interactIrred" (ppr wi) interactDict :: InertCans -> Ct -> TcS (StopOrContinue Ct) interactDict inerts workItem@(CDictCan { cc_ev = ev_w, cc_class = cls, cc_tyargs = tys }) | isWanted ev_w - , Just ip_name <- isCallStackCt workItem + , Just ip_name <- isCallStackDict cls tys , OccurrenceOf func <- ctLocOrigin (ctEvLoc ev_w) -- If we're given a CallStack constraint that arose from a function -- call, we need to push the current call-site onto the stack instead diff --git a/compiler/typecheck/TcRnTypes.hs b/compiler/typecheck/TcRnTypes.hs index 60abfca..07037c7 100644 --- a/compiler/typecheck/TcRnTypes.hs +++ b/compiler/typecheck/TcRnTypes.hs @@ -69,7 +69,7 @@ module TcRnTypes( isCDictCan_Maybe, isCFunEqCan_maybe, isCIrredEvCan, isCNonCanonical, isWantedCt, isDerivedCt, isGivenCt, isHoleCt, isOutOfScopeCt, isExprHoleCt, isTypeHoleCt, - isUserTypeErrorCt, isCallStackCt, getUserTypeErrorMsg, + isUserTypeErrorCt, isCallStackDict, getUserTypeErrorMsg, ctEvidence, ctLoc, setCtLoc, ctPred, ctFlavour, ctEqRel, ctOrigin, mkTcEqPredLikeEv, mkNonCanonical, mkNonCanonicalCt, @@ -1756,18 +1756,18 @@ isUserTypeErrorCt ct = case getUserTypeErrorMsg ct of Just _ -> True _ -> False --- | Is the constraint for an Implicit CallStack +-- | Are we looking at an Implicit CallStack -- (i.e. @IP "name" CallStack@)? -- -- If so, returns @Just "name"@. -isCallStackCt :: Ct -> Maybe FastString -isCallStackCt CDictCan { cc_class = cls, cc_tyargs = tys } +isCallStackDict :: Class -> [Type] -> Maybe FastString +isCallStackDict cls tys | cls `hasKey` ipClassKey , [ip_name_ty, ty] <- tys , Just (tc, _) <- splitTyConApp_maybe ty , tc `hasKey` callStackTyConKey = isStrLitTy ip_name_ty -isCallStackCt _ +isCallStackDict _ _ = Nothing instance Outputable Ct where diff --git a/compiler/typecheck/TcSimplify.hs b/compiler/typecheck/TcSimplify.hs index 9ea3d91..499b53a 100644 --- a/compiler/typecheck/TcSimplify.hs +++ b/compiler/typecheck/TcSimplify.hs @@ -173,9 +173,10 @@ defaultCallStacks wanteds wanteds <- defaultCallStacks (ic_wanted implic) return (implic { ic_wanted = wanteds }) - defaultCallStack ct@(CDictCan { cc_ev = ev_w }) - | Just _ <- isCallStackCt ct - = do { solveCallStack ev_w EvCsEmpty + defaultCallStack ct + | Just (cls, tys) <- getClassPredTys_maybe (ctPred ct) + , Just _ <- isCallStackDict cls tys + = do { solveCallStack (cc_ev ct) EvCsEmpty ; return Nothing } defaultCallStack ct diff --git a/testsuite/tests/typecheck/should_compile/T11462.hs b/testsuite/tests/typecheck/should_compile/T11462.hs new file mode 100644 index 0000000..a9d7815 --- /dev/null +++ b/testsuite/tests/typecheck/should_compile/T11462.hs @@ -0,0 +1,6 @@ +{-# OPTIONS_GHC -fplugin=T11462_Plugin #-} + +module T11462 where + +impossible :: a +impossible = undefined diff --git a/testsuite/tests/typecheck/should_compile/T11462_Plugin.hs b/testsuite/tests/typecheck/should_compile/T11462_Plugin.hs new file mode 100644 index 0000000..5d98395 --- /dev/null +++ b/testsuite/tests/typecheck/should_compile/T11462_Plugin.hs @@ -0,0 +1,14 @@ +module T11462_Plugin(plugin) where + +import TcRnMonad ( TcPlugin(..), TcPluginResult(..) ) +import Plugins ( defaultPlugin, Plugin(..), CommandLineOption ) + +plugin :: Plugin +plugin = defaultPlugin { tcPlugin = Just . thePlugin } + +thePlugin :: [CommandLineOption] -> TcPlugin +thePlugin opts = TcPlugin + { tcPluginInit = return () + , tcPluginSolve = \_ _ _ _ -> return $ TcPluginOk [] [] + , tcPluginStop = \_ -> return () + } diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T index 46ab53b..90f42bf 100644 --- a/testsuite/tests/typecheck/should_compile/all.T +++ b/testsuite/tests/typecheck/should_compile/all.T @@ -489,3 +489,10 @@ test('T10592', normal, compile, ['']) test('T11305', normal, compile, ['']) test('T11254', normal, compile, ['']) test('T11379', normal, compile, ['']) +test('T11462', + [extra_clean(['T11462_Plugin.hi', 'T11462_Plugin.o']), + unless(have_dynamic(), expect_broken(10301))], + multi_compile, + ['', [('T11462_Plugin.hs', '-package ghc'), + ('T11462.hs', '')], + '-dynamic']) From git at git.haskell.org Fri Jan 22 13:20:22 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 22 Jan 2016 13:20:22 +0000 (UTC) Subject: [commit: ghc] master: Add tests for #11465 and the kind invariant (2df4221) Message-ID: <20160122132022.8BD0A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/2df422161bccf7c0fad97e468085ebab1a17e19e/ghc >--------------------------------------------------------------- commit 2df422161bccf7c0fad97e468085ebab1a17e19e Author: Ben Gamari Date: Fri Jan 22 13:01:55 2016 +0100 Add tests for #11465 and the kind invariant >--------------------------------------------------------------- 2df422161bccf7c0fad97e468085ebab1a17e19e testsuite/tests/indexed-types/should_run/T11465a.hs | 19 +++++++++++++++++++ .../tests/indexed-types/should_run/T11465a.stdout | 1 + testsuite/tests/indexed-types/should_run/all.T | 1 + .../tests/typecheck/should_run/KindInvariant.script | 12 ++++++++++++ .../tests/typecheck/should_run/KindInvariant.stderr | 5 +++++ .../tests/typecheck/should_run/KindInvariant.stdout | 2 ++ testsuite/tests/typecheck/should_run/all.T | 1 + 7 files changed, 41 insertions(+) diff --git a/testsuite/tests/indexed-types/should_run/T11465a.hs b/testsuite/tests/indexed-types/should_run/T11465a.hs new file mode 100644 index 0000000..41fc197 --- /dev/null +++ b/testsuite/tests/indexed-types/should_run/T11465a.hs @@ -0,0 +1,19 @@ +{-# LANGUAGE PolyKinds #-} +{-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE MagicHash #-} +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE TypeInType #-} + +import GHC.Exts +import GHC.Types + +class BoxIt (a :: TYPE 'Unlifted) where + type Boxed a :: * + boxed :: a -> Boxed a + +instance BoxIt Char# where + type Boxed Char# = Char + boxed x = C# x + +main :: IO () +main = print $ boxed 'c'# diff --git a/testsuite/tests/indexed-types/should_run/T11465a.stdout b/testsuite/tests/indexed-types/should_run/T11465a.stdout new file mode 100644 index 0000000..4076583 --- /dev/null +++ b/testsuite/tests/indexed-types/should_run/T11465a.stdout @@ -0,0 +1 @@ +'c' diff --git a/testsuite/tests/indexed-types/should_run/all.T b/testsuite/tests/indexed-types/should_run/all.T index f5c8c5c..8d72c46 100644 --- a/testsuite/tests/indexed-types/should_run/all.T +++ b/testsuite/tests/indexed-types/should_run/all.T @@ -6,3 +6,4 @@ test('T4235', normal, compile_and_run, ['']) test('GMapAssoc', normal, compile_and_run, ['-package containers']) test('GMapTop', normal, compile_and_run, ['-package containers']) test('T5719', normal, compile_and_run, ['']) +test('T11465a', normal, compile_and_run, ['']) \ No newline at end of file diff --git a/testsuite/tests/typecheck/should_run/KindInvariant.script b/testsuite/tests/typecheck/should_run/KindInvariant.script new file mode 100644 index 0000000..a993d51 --- /dev/null +++ b/testsuite/tests/typecheck/should_run/KindInvariant.script @@ -0,0 +1,12 @@ +:set -XTypeInType -XDataKinds -XKindSignatures -XMagicHash -XPolyKinds +:m + Data.Kind GHC.Exts + +data T (a :: k -> k') +:kind T State# + +data T (a :: * -> k') +:kind T State# + +-- this should fail +data T (a :: * -> *) +:kind T State# diff --git a/testsuite/tests/typecheck/should_run/KindInvariant.stderr b/testsuite/tests/typecheck/should_run/KindInvariant.stderr new file mode 100644 index 0000000..777b802 --- /dev/null +++ b/testsuite/tests/typecheck/should_run/KindInvariant.stderr @@ -0,0 +1,5 @@ + +:1:3: error: + ? Expected kind ?* -> *?, but ?State#? has kind ?* -> #? + ? In the first argument of ?T?, namely ?State#? + In the type ?T State#? diff --git a/testsuite/tests/typecheck/should_run/KindInvariant.stdout b/testsuite/tests/typecheck/should_run/KindInvariant.stdout new file mode 100644 index 0000000..d7cbaed --- /dev/null +++ b/testsuite/tests/typecheck/should_run/KindInvariant.stdout @@ -0,0 +1,2 @@ +T State# :: * +T State# :: * diff --git a/testsuite/tests/typecheck/should_run/all.T b/testsuite/tests/typecheck/should_run/all.T index 79bf208..a9f973f 100755 --- a/testsuite/tests/typecheck/should_run/all.T +++ b/testsuite/tests/typecheck/should_run/all.T @@ -115,3 +115,4 @@ test('T11049', exit_code(1), compile_and_run, ['']) test('T11230', normal, compile_and_run, ['']) test('TypeOf', normal, compile_and_run, ['']) test('T11120', normal, compile_and_run, ['']) +test('KindInvariant', normal, ghci_script, ['KindInvariant.script']) \ No newline at end of file From git at git.haskell.org Fri Jan 22 14:05:51 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 22 Jan 2016 14:05:51 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Default non-canonical CallStack constraints (38dc961) Message-ID: <20160122140551.2A9233A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/38dc961bf8459577b8a57d5e04a90b470c79fe0c/ghc >--------------------------------------------------------------- commit 38dc961bf8459577b8a57d5e04a90b470c79fe0c Author: Eric Seidel Date: Fri Jan 22 12:45:53 2016 +0100 Default non-canonical CallStack constraints Test Plan: `make test TEST=T11462` Reviewers: austin, bgamari, simonpj Reviewed By: simonpj Subscribers: thomie Projects: #ghc Differential Revision: https://phabricator.haskell.org/D1804 GHC Trac Issues: #11462 (cherry picked from commit 835a2a24a605f8e458f57c71aa67e9983593b5e4) >--------------------------------------------------------------- 38dc961bf8459577b8a57d5e04a90b470c79fe0c compiler/typecheck/TcInteract.hs | 2 +- compiler/typecheck/TcRnTypes.hs | 10 +++++----- compiler/typecheck/TcSimplify.hs | 7 ++++--- testsuite/tests/typecheck/should_compile/T11462.hs | 6 ++++++ testsuite/tests/typecheck/should_compile/T11462_Plugin.hs | 14 ++++++++++++++ testsuite/tests/typecheck/should_compile/all.T | 7 +++++++ 6 files changed, 37 insertions(+), 9 deletions(-) diff --git a/compiler/typecheck/TcInteract.hs b/compiler/typecheck/TcInteract.hs index cc2148f..d326966 100644 --- a/compiler/typecheck/TcInteract.hs +++ b/compiler/typecheck/TcInteract.hs @@ -680,7 +680,7 @@ interactIrred _ wi = pprPanic "interactIrred" (ppr wi) interactDict :: InertCans -> Ct -> TcS (StopOrContinue Ct) interactDict inerts workItem@(CDictCan { cc_ev = ev_w, cc_class = cls, cc_tyargs = tys }) | isWanted ev_w - , Just ip_name <- isCallStackCt workItem + , Just ip_name <- isCallStackDict cls tys , OccurrenceOf func <- ctLocOrigin (ctEvLoc ev_w) -- If we're given a CallStack constraint that arose from a function -- call, we need to push the current call-site onto the stack instead diff --git a/compiler/typecheck/TcRnTypes.hs b/compiler/typecheck/TcRnTypes.hs index 8bfc8c7..9edc6a7 100644 --- a/compiler/typecheck/TcRnTypes.hs +++ b/compiler/typecheck/TcRnTypes.hs @@ -69,7 +69,7 @@ module TcRnTypes( isCDictCan_Maybe, isCFunEqCan_maybe, isCIrredEvCan, isCNonCanonical, isWantedCt, isDerivedCt, isGivenCt, isHoleCt, isOutOfScopeCt, isExprHoleCt, isTypeHoleCt, - isUserTypeErrorCt, isCallStackCt, getUserTypeErrorMsg, + isUserTypeErrorCt, isCallStackDict, getUserTypeErrorMsg, ctEvidence, ctLoc, setCtLoc, ctPred, ctFlavour, ctEqRel, ctOrigin, mkTcEqPredLikeEv, mkNonCanonical, mkNonCanonicalCt, @@ -1756,18 +1756,18 @@ isUserTypeErrorCt ct = case getUserTypeErrorMsg ct of Just _ -> True _ -> False --- | Is the constraint for an Implicit CallStack +-- | Are we looking at an Implicit CallStack -- (i.e. @IP "name" CallStack@)? -- -- If so, returns @Just "name"@. -isCallStackCt :: Ct -> Maybe FastString -isCallStackCt CDictCan { cc_class = cls, cc_tyargs = tys } +isCallStackDict :: Class -> [Type] -> Maybe FastString +isCallStackDict cls tys | cls `hasKey` ipClassKey , [ip_name_ty, ty] <- tys , Just (tc, _) <- splitTyConApp_maybe ty , tc `hasKey` callStackTyConKey = isStrLitTy ip_name_ty -isCallStackCt _ +isCallStackDict _ _ = Nothing instance Outputable Ct where diff --git a/compiler/typecheck/TcSimplify.hs b/compiler/typecheck/TcSimplify.hs index 81ea3aa..47d4009 100644 --- a/compiler/typecheck/TcSimplify.hs +++ b/compiler/typecheck/TcSimplify.hs @@ -181,9 +181,10 @@ defaultCallStacks wanteds wanteds <- defaultCallStacks (ic_wanted implic) return (implic { ic_wanted = wanteds }) - defaultCallStack ct@(CDictCan { cc_ev = ev_w }) - | Just _ <- isCallStackCt ct - = do { solveCallStack ev_w EvCsEmpty + defaultCallStack ct + | Just (cls, tys) <- getClassPredTys_maybe (ctPred ct) + , Just _ <- isCallStackDict cls tys + = do { solveCallStack (cc_ev ct) EvCsEmpty ; return Nothing } defaultCallStack ct diff --git a/testsuite/tests/typecheck/should_compile/T11462.hs b/testsuite/tests/typecheck/should_compile/T11462.hs new file mode 100644 index 0000000..a9d7815 --- /dev/null +++ b/testsuite/tests/typecheck/should_compile/T11462.hs @@ -0,0 +1,6 @@ +{-# OPTIONS_GHC -fplugin=T11462_Plugin #-} + +module T11462 where + +impossible :: a +impossible = undefined diff --git a/testsuite/tests/typecheck/should_compile/T11462_Plugin.hs b/testsuite/tests/typecheck/should_compile/T11462_Plugin.hs new file mode 100644 index 0000000..5d98395 --- /dev/null +++ b/testsuite/tests/typecheck/should_compile/T11462_Plugin.hs @@ -0,0 +1,14 @@ +module T11462_Plugin(plugin) where + +import TcRnMonad ( TcPlugin(..), TcPluginResult(..) ) +import Plugins ( defaultPlugin, Plugin(..), CommandLineOption ) + +plugin :: Plugin +plugin = defaultPlugin { tcPlugin = Just . thePlugin } + +thePlugin :: [CommandLineOption] -> TcPlugin +thePlugin opts = TcPlugin + { tcPluginInit = return () + , tcPluginSolve = \_ _ _ _ -> return $ TcPluginOk [] [] + , tcPluginStop = \_ -> return () + } diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T index 46ab53b..90f42bf 100644 --- a/testsuite/tests/typecheck/should_compile/all.T +++ b/testsuite/tests/typecheck/should_compile/all.T @@ -489,3 +489,10 @@ test('T10592', normal, compile, ['']) test('T11305', normal, compile, ['']) test('T11254', normal, compile, ['']) test('T11379', normal, compile, ['']) +test('T11462', + [extra_clean(['T11462_Plugin.hi', 'T11462_Plugin.o']), + unless(have_dynamic(), expect_broken(10301))], + multi_compile, + ['', [('T11462_Plugin.hs', '-package ghc'), + ('T11462.hs', '')], + '-dynamic']) From git at git.haskell.org Fri Jan 22 14:59:45 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 22 Jan 2016 14:59:45 +0000 (UTC) Subject: [commit: ghc] master: Don't print "Loaded GHCi configuration" message in ghc -e (#11478) (9048c3d) Message-ID: <20160122145945.E36313A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/9048c3dfee1c7c9171114c349714095b3abcc47a/ghc >--------------------------------------------------------------- commit 9048c3dfee1c7c9171114c349714095b3abcc47a Author: Reid Barton Date: Fri Jan 22 09:59:20 2016 -0500 Don't print "Loaded GHCi configuration" message in ghc -e (#11478) Summary: Also don't print it if the user specifically requested non-verbose output with -v0. Since this means there is no longer any test that checks for the message, add such a test. Test Plan: validate Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1817 GHC Trac Issues: #11478 >--------------------------------------------------------------- 9048c3dfee1c7c9171114c349714095b3abcc47a ghc/GHCi/UI.hs | 6 +++++- testsuite/tests/ghc-e/should_run/Makefile | 4 ++++ .../tests/ghc-e/should_run/T11478.script | 0 .../4876.stdout => testsuite/tests/ghc-e/should_run/T11478.stdout | 0 testsuite/tests/ghc-e/should_run/all.T | 1 + testsuite/tests/ghci/scripts/Makefile | 7 +++++++ testsuite/tests/ghci/scripts/T10408.stdout | 2 -- .../IO/T4144.stdout => testsuite/tests/ghci/scripts/T11389.script | 0 testsuite/tests/ghci/scripts/T11389.stdout | 1 + testsuite/tests/ghci/scripts/all.T | 2 ++ 10 files changed, 20 insertions(+), 3 deletions(-) diff --git a/ghc/GHCi/UI.hs b/ghc/GHCi/UI.hs index 30e70e0..fc03b5f 100644 --- a/ghc/GHCi/UI.hs +++ b/ghc/GHCi/UI.hs @@ -527,7 +527,11 @@ runGHCi paths maybe_exprs = do do runInputTWithPrefs defaultPrefs defaultSettings $ runCommands $ fileLoop hdl liftIO (hClose hdl `catchIO` \_ -> return ()) - liftIO $ putStrLn ("Loaded GHCi configuration from " ++ file) + -- Don't print a message if this is really ghc -e (#11478). + -- Also, let the user silence the message with -v0 + -- (the default verbosity in GHCi is 1). + when (isNothing maybe_exprs && verbosity dflags > 0) $ + liftIO $ putStrLn ("Loaded GHCi configuration from " ++ file) -- diff --git a/testsuite/tests/ghc-e/should_run/Makefile b/testsuite/tests/ghc-e/should_run/Makefile index 54ce8a3..c98b98a 100644 --- a/testsuite/tests/ghc-e/should_run/Makefile +++ b/testsuite/tests/ghc-e/should_run/Makefile @@ -41,3 +41,7 @@ T9905: T9905b: '$(TEST_HC)' $(TEST_HC_OPTS) -ignore-dot-ghci -e "import qualified Data.List as L" -e "L.sort [2,1]" + +# Ensure that ghc -e does not output extra messages about GHCi configuration files +T11478: + '$(TEST_HC)' $(TEST_HC_OPTS) -ignore-dot-ghci -ghci-script T11478.script -e 3 diff --git a/libraries/base/tests/IO/misc001.stdout b/testsuite/tests/ghc-e/should_run/T11478.script similarity index 100% copy from libraries/base/tests/IO/misc001.stdout copy to testsuite/tests/ghc-e/should_run/T11478.script diff --git a/libraries/base/tests/Concurrent/4876.stdout b/testsuite/tests/ghc-e/should_run/T11478.stdout similarity index 100% copy from libraries/base/tests/Concurrent/4876.stdout copy to testsuite/tests/ghc-e/should_run/T11478.stdout diff --git a/testsuite/tests/ghc-e/should_run/all.T b/testsuite/tests/ghc-e/should_run/all.T index dcb7207..ae28653 100644 --- a/testsuite/tests/ghc-e/should_run/all.T +++ b/testsuite/tests/ghc-e/should_run/all.T @@ -16,3 +16,4 @@ test('T7299', req_interp, run_command, ['$MAKE --no-print-directory -s T7299']) test('T9086', req_interp, run_command, ['$MAKE --no-print-directory -s T9086']) test('T9905', req_interp, run_command, ['$MAKE --no-print-directory -s T9905']) test('T9905b', req_interp, run_command, ['$MAKE --no-print-directory -s T9905b']) +test('T11478', req_interp, run_command, ['$MAKE --no-print-directory -s T11478']) diff --git a/testsuite/tests/ghci/scripts/Makefile b/testsuite/tests/ghci/scripts/Makefile index 017555b..0b70318 100644 --- a/testsuite/tests/ghci/scripts/Makefile +++ b/testsuite/tests/ghci/scripts/Makefile @@ -54,3 +54,10 @@ T10408: # and not be ignored when `-ignore-dot-ghci` is specified. '$(TEST_HC)' $(TEST_HC_OPTS) --interactive -v0 -ignore-dot-ghci \ -ghci-script T10408A.script -ghci-script T10408B.script < /dev/null + +.PHONY: T11389 +T11389: + # Test that "Loaded GHCi configuration" message is printed by default + # (without -v0) + '$(TEST_HC)' $(TEST_HC_OPTS) --interactive -ignore-dot-ghci \ + -ghci-script T11389.script < /dev/null | grep 'configuration' diff --git a/testsuite/tests/ghci/scripts/T10408.stdout b/testsuite/tests/ghci/scripts/T10408.stdout index cef83bc..b13d0a4 100644 --- a/testsuite/tests/ghci/scripts/T10408.stdout +++ b/testsuite/tests/ghci/scripts/T10408.stdout @@ -1,4 +1,2 @@ "T10408A" -Loaded GHCi configuration from T10408A.script "T10408B" -Loaded GHCi configuration from T10408B.script diff --git a/libraries/base/tests/IO/T4144.stdout b/testsuite/tests/ghci/scripts/T11389.script similarity index 100% copy from libraries/base/tests/IO/T4144.stdout copy to testsuite/tests/ghci/scripts/T11389.script diff --git a/testsuite/tests/ghci/scripts/T11389.stdout b/testsuite/tests/ghci/scripts/T11389.stdout new file mode 100644 index 0000000..c92bf91 --- /dev/null +++ b/testsuite/tests/ghci/scripts/T11389.stdout @@ -0,0 +1 @@ +Loaded GHCi configuration from T11389.script diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T index 17bee5f..d954899 100755 --- a/testsuite/tests/ghci/scripts/all.T +++ b/testsuite/tests/ghci/scripts/all.T @@ -240,3 +240,5 @@ test('T10576b', expect_broken(10576), ghci_script, ['T10576b.script']) test('T11051a', normal, ghci_script, ['T11051a.script']) test('T11051b', normal, ghci_script, ['T11051b.script']) test('T11266', check_stdout(lambda *args: 1), ghci_script, ['T11266.script']) + +test('T11389', req_interp, run_command, ['$MAKE -s --no-print-directory T11389']) From git at git.haskell.org Fri Jan 22 14:59:48 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 22 Jan 2016 14:59:48 +0000 (UTC) Subject: [commit: ghc] master: Mark some ghci tests as req_interp (65881c0) Message-ID: <20160122145948.CE0A13A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/65881c014f81f62f90dcb0977528411010b1d1a7/ghc >--------------------------------------------------------------- commit 65881c014f81f62f90dcb0977528411010b1d1a7 Author: Reid Barton Date: Fri Jan 22 10:00:27 2016 -0500 Mark some ghci tests as req_interp Test Plan: validate Reviewers: bgamari, austin Reviewed By: bgamari, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1819 >--------------------------------------------------------------- 65881c014f81f62f90dcb0977528411010b1d1a7 testsuite/tests/ghci/scripts/all.T | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T index d954899..d7af290 100755 --- a/testsuite/tests/ghci/scripts/all.T +++ b/testsuite/tests/ghci/scripts/all.T @@ -39,11 +39,11 @@ test('ghci022', normal, ghci_script, ['ghci022.script']) test('ghci023', normal, ghci_script, ['ghci023.script']) test('ghci024', - when(fast(), skip), + [req_interp, when(fast(), skip)], run_command, ['$MAKE -s --no-print-directory ghci024']) test('T9367', - when(fast() or config.os != 'mingw32', skip), + [req_interp, when(fast() or config.os != 'mingw32', skip)], run_command, ['$MAKE -s --no-print-directory T9367']) test('ghci025', normal, ghci_script, ['ghci025.script']) @@ -215,7 +215,7 @@ test('T10122', normal, ghci_script, ['T10122.script']) test('T10321', normal, ghci_script, ['T10321.script']) -test('T10408', normal, run_command, +test('T10408', req_interp, run_command, ['$MAKE -s --no-print-directory T10408']) test('T10248', normal, ghci_script, ['T10248.script']) test('T10110', normal, ghci_script, ['T10110.script']) From git at git.haskell.org Fri Jan 22 17:49:10 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 22 Jan 2016 17:49:10 +0000 (UTC) Subject: [commit: ghc] master: Do not count void arguments when considering a function for loopification. (4d51bfc) Message-ID: <20160122174910.440D53A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/4d51bfc8975f9c6c3ab6d293c48f98da85210d5f/ghc >--------------------------------------------------------------- commit 4d51bfc8975f9c6c3ab6d293c48f98da85210d5f Author: Jonas Scholl Date: Fri Jan 22 16:21:57 2016 +0100 Do not count void arguments when considering a function for loopification. This fixes #11372 by omitting arguments with a void-type when checking whether a self-recursive tail call can be optimized to a local jump. Previously, a function taking a real argument and a State# token would report an arity of 1 in the SelfLoopInfo in getCallMethod, but a self-recursive call would apply it to 2 arguments, one of them being the State# token, thus no local jump would be generated. As the State# token is not represented by anything at runtime, we can ignore it and thus trigger the loopification optimization. Test Plan: ./validate Reviewers: austin, bgamari, simonmar Reviewed By: bgamari Subscribers: simonmar, thomie Differential Revision: https://phabricator.haskell.org/D1767 GHC Trac Issues: #11372 >--------------------------------------------------------------- 4d51bfc8975f9c6c3ab6d293c48f98da85210d5f compiler/codeGen/StgCmmClosure.hs | 29 +++++++++++++++++------------ compiler/codeGen/StgCmmExpr.hs | 34 +++++++++++++++++++++++++++++----- 2 files changed, 46 insertions(+), 17 deletions(-) diff --git a/compiler/codeGen/StgCmmClosure.hs b/compiler/codeGen/StgCmmClosure.hs index d3b9fac..97224c6 100644 --- a/compiler/codeGen/StgCmmClosure.hs +++ b/compiler/codeGen/StgCmmClosure.hs @@ -496,6 +496,7 @@ getCallMethod :: DynFlags -- itself -> LambdaFormInfo -- Its info -> RepArity -- Number of available arguments + -> RepArity -- Number of them being void arguments -> CgLoc -- Passed in from cgIdApp so that we can -- handle let-no-escape bindings and self-recursive -- tail calls using the same data constructor, @@ -504,30 +505,34 @@ getCallMethod :: DynFlags -> Maybe SelfLoopInfo -- can we perform a self-recursive tail call? -> CallMethod -getCallMethod dflags _ id _ n_args _cg_loc (Just (self_loop_id, block_id, args)) - | gopt Opt_Loopification dflags, id == self_loop_id, n_args == length args +getCallMethod dflags _ id _ n_args v_args _cg_loc + (Just (self_loop_id, block_id, args)) + | gopt Opt_Loopification dflags + , id == self_loop_id + , n_args - v_args == length args -- If these patterns match then we know that: -- * loopification optimisation is turned on -- * function is performing a self-recursive call in a tail position - -- * number of parameters of the function matches functions arity. - -- See Note [Self-recursive tail calls] in StgCmmExpr for more details + -- * number of non-void parameters of the function matches functions arity. + -- See Note [Self-recursive tail calls] and Note [Void arguments in + -- self-recursive tail calls] in StgCmmExpr for more details = JumpToIt block_id args -getCallMethod dflags name id (LFReEntrant _ arity _ _) n_args _cg_loc +getCallMethod dflags name id (LFReEntrant _ arity _ _) n_args _v_args _cg_loc _self_loop_info | n_args == 0 = ASSERT( arity /= 0 ) ReturnIt -- No args at all | n_args < arity = SlowCall -- Not enough args | otherwise = DirectEntry (enterIdLabel dflags name (idCafInfo id)) arity -getCallMethod _ _name _ LFUnLifted n_args _cg_loc _self_loop_info +getCallMethod _ _name _ LFUnLifted n_args _v_args _cg_loc _self_loop_info = ASSERT( n_args == 0 ) ReturnIt -getCallMethod _ _name _ (LFCon _) n_args _cg_loc _self_loop_info +getCallMethod _ _name _ (LFCon _) n_args _v_args _cg_loc _self_loop_info = ASSERT( n_args == 0 ) ReturnIt getCallMethod dflags name id (LFThunk _ _ updatable std_form_info is_fun) - n_args _cg_loc _self_loop_info + n_args _v_args _cg_loc _self_loop_info | is_fun -- it *might* be a function, so we must "call" it (which is always safe) = SlowCall -- We cannot just enter it [in eval/apply, the entry code -- is the fast-entry code] @@ -558,18 +563,18 @@ getCallMethod dflags name id (LFThunk _ _ updatable std_form_info is_fun) DirectEntry (thunkEntryLabel dflags name (idCafInfo id) std_form_info updatable) 0 -getCallMethod _ _name _ (LFUnknown True) _n_arg _cg_locs _self_loop_info +getCallMethod _ _name _ (LFUnknown True) _n_arg _v_args _cg_locs _self_loop_info = SlowCall -- might be a function -getCallMethod _ name _ (LFUnknown False) n_args _cg_loc _self_loop_info +getCallMethod _ name _ (LFUnknown False) n_args _v_args _cg_loc _self_loop_info = ASSERT2( n_args == 0, ppr name <+> ppr n_args ) EnterIt -- Not a function -getCallMethod _ _name _ LFLetNoEscape _n_args (LneLoc blk_id lne_regs) +getCallMethod _ _name _ LFLetNoEscape _n_args _v_args (LneLoc blk_id lne_regs) _self_loop_info = JumpToIt blk_id lne_regs -getCallMethod _ _ _ _ _ _ _ = panic "Unknown call method" +getCallMethod _ _ _ _ _ _ _ _ = panic "Unknown call method" ----------------------------------------------------------------------------- -- staticClosureRequired diff --git a/compiler/codeGen/StgCmmExpr.hs b/compiler/codeGen/StgCmmExpr.hs index c4ff11a..8e74c22 100644 --- a/compiler/codeGen/StgCmmExpr.hs +++ b/compiler/codeGen/StgCmmExpr.hs @@ -697,8 +697,10 @@ cgIdApp fun_id args = do fun_name = idName cg_fun_id fun = idInfoToAmode fun_info lf_info = cg_lf fun_info + n_args = length args + v_args = length $ filter (isVoidTy . stgArgType) args node_points dflags = nodeMustPointToIt dflags lf_info - case (getCallMethod dflags fun_name cg_fun_id lf_info (length args) (cg_loc fun_info) self_loop_info) of + case getCallMethod dflags fun_name cg_fun_id lf_info n_args v_args (cg_loc fun_info) self_loop_info of -- A value in WHNF, so we can just return it. ReturnIt -> emitReturn [fun] -- ToDo: does ReturnIt guarantee tagged? @@ -802,14 +804,36 @@ cgIdApp fun_id args = do -- of call will be generated. getCallMethod decides to generate a self -- recursive tail call when (a) environment stores information about -- possible self tail-call; (b) that tail call is to a function currently --- being compiled; (c) number of passed arguments is equal to function's --- arity. (d) loopification is turned on via -floopification command-line --- option. +-- being compiled; (c) number of passed non-void arguments is equal to +-- function's arity. (d) loopification is turned on via -floopification +-- command-line option. -- -- * Command line option to turn loopification on and off is implemented in -- DynFlags. -- - +-- +-- Note [Void arguments in self-recursive tail calls] +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-- +-- State# tokens can get in the way of the loopification optimization as seen in +-- #11372. Consider this: +-- +-- foo :: [a] +-- -> (a -> State# s -> (# State s, Bool #)) +-- -> State# s +-- -> (# State# s, Maybe a #) +-- foo [] f s = (# s, Nothing #) +-- foo (x:xs) f s = case f x s of +-- (# s', b #) -> case b of +-- True -> (# s', Just x #) +-- False -> foo xs f s' +-- +-- We would like to compile the call to foo as a local jump instead of a call +-- (see Note [Self-recursive tail calls]). However, the generated function has +-- an arity of 2 while we apply it to 3 arguments, one of them being of void +-- type. Thus, we mustn't count arguments of void type when checking whether +-- we can turn a call into a self-recursive jump. +-- emitEnter :: CmmExpr -> FCode ReturnKind emitEnter fun = do From git at git.haskell.org Fri Jan 22 17:49:12 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 22 Jan 2016 17:49:12 +0000 (UTC) Subject: [commit: ghc] master: rts: Disable tick timer unless really needed (b01288d) Message-ID: <20160122174912.F042B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/b01288d509b0f9e45f23ae48f2366f85f489089c/ghc >--------------------------------------------------------------- commit b01288d509b0f9e45f23ae48f2366f85f489089c Author: Ben Gamari Date: Fri Jan 22 16:22:13 2016 +0100 rts: Disable tick timer unless really needed Trac #9105 notes significant CPU usage by an otherwise idle process when compiled with profiling. The reason for this is that we keep the tick timer active in the profiling RTS even if profiling wasn't requested at runtime. If the user requests any sort of profiling then we need to keep the timer active to ensure that samples are collected. Test Plan: Validate, check CPU usage, ensure profiling still works Reviewers: simonmar, austin Reviewed By: simonmar, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1822 GHC Trac Issues: #9105 >--------------------------------------------------------------- b01288d509b0f9e45f23ae48f2366f85f489089c rts/Timer.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/rts/Timer.c b/rts/Timer.c index 99c09b0..bf7240b 100644 --- a/rts/Timer.c +++ b/rts/Timer.c @@ -72,10 +72,15 @@ handle_tick(int unused STG_UNUSED) #endif } else { recent_activity = ACTIVITY_DONE_GC; - // disable timer signals (see #1623, #5991) - // but only if we're not profiling + // disable timer signals (see #1623, #5991, #9105) + // but only if we're not profiling (e.g. passed -h or -p RTS + // flags). If we are profiling we need to keep the timer active + // so that samples continue to be collected. #ifndef PROFILING - stopTimer(); + if (!(RtsFlags.ProfFlags.doHeapProfile + || RtsFlags.CcFlags.doCostCentres)) { + stopTimer(); + } #endif } } else { From git at git.haskell.org Fri Jan 22 17:49:15 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 22 Jan 2016 17:49:15 +0000 (UTC) Subject: [commit: ghc] master: Fix a formatting error in the user's guide (6e5f828) Message-ID: <20160122174915.AFC2E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/6e5f8285005895fe4f1915ddea99b72f8ee91834/ghc >--------------------------------------------------------------- commit 6e5f8285005895fe4f1915ddea99b72f8ee91834 Author: Eric Seidel Date: Fri Jan 22 16:16:46 2016 +0100 Fix a formatting error in the user's guide ``` ``CallStack``s ``` seems to confuse ReST into producing an extended code-span ``` ``CallStack``\s ``` fixes it, but there may be a better solution Test Plan: build the user's guide and inspect the last paragraph of "9.14.4.5. Implicit CallStacks" Reviewers: bgamari Reviewed By: bgamari Projects: #ghc Differential Revision: https://phabricator.haskell.org/D1798 >--------------------------------------------------------------- 6e5f8285005895fe4f1915ddea99b72f8ee91834 docs/users_guide/glasgow_exts.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index 4323b3a..d4ca508 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -8125,7 +8125,7 @@ ordinary implicit parameters. ``GHC.Stack`` additionally exports a function ``freezeCallStack`` that allows users to freeze a ``CallStack``, preventing any future push operations from having an effect. This can be used by library authors -to prevent ``CallStack``s from exposing unecessary implementation +to prevent ``CallStack``\s from exposing unecessary implementation details. Consider the ``head`` example above, the ``myerror`` line in the printed stack is not particularly enlightening, so we might choose to surpress it by freezing the ``CallStack`` that we pass to ``myerror``. From git at git.haskell.org Sat Jan 23 12:43:07 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 23 Jan 2016 12:43:07 +0000 (UTC) Subject: [commit: ghc] master: Add test for Trac #11056 (4e04043) Message-ID: <20160123124307.40DD83A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/4e04043d1bb458439d3c3db3ffa9851bff780083/ghc >--------------------------------------------------------------- commit 4e04043d1bb458439d3c3db3ffa9851bff780083 Author: RyanGlScott Date: Sat Jan 23 13:03:26 2016 +0100 Add test for Trac #11056 Reviewers: thomie, austin, bgamari Reviewed By: bgamari Subscribers: rwbarton Differential Revision: https://phabricator.haskell.org/D1823 GHC Trac Issues: #11056 >--------------------------------------------------------------- 4e04043d1bb458439d3c3db3ffa9851bff780083 testsuite/tests/typecheck/should_compile/T11056.hs | 14 ++++++++++++++ testsuite/tests/typecheck/should_compile/all.T | 1 + 2 files changed, 15 insertions(+) diff --git a/testsuite/tests/typecheck/should_compile/T11056.hs b/testsuite/tests/typecheck/should_compile/T11056.hs new file mode 100644 index 0000000..ffb843b --- /dev/null +++ b/testsuite/tests/typecheck/should_compile/T11056.hs @@ -0,0 +1,14 @@ +{-# LANGUAGE PolyKinds, DataKinds #-} +module T11056 where +import Data.Typeable + +data T = A | B Int + +bar :: TypeRep +bar = typeRep (Proxy :: Proxy '[True]) + +baz :: TypeRep +baz = typeRep (Proxy :: Proxy 'A) + +quux :: TypeRep +quux = typeRep (Proxy :: Proxy 'B) diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T index 90f42bf..7d7ec60 100644 --- a/testsuite/tests/typecheck/should_compile/all.T +++ b/testsuite/tests/typecheck/should_compile/all.T @@ -480,6 +480,7 @@ test('T10642', normal, compile, ['']) test('T10744', normal, compile, ['']) test('update-existential', normal, compile, ['']) test('T10347', expect_broken(10347), compile, ['']) +test('T11056', normal, compile, ['']) test('T10770a', expect_broken(10770), compile, ['']) test('T10770b', expect_broken(10770), compile, ['']) test('T10935', normal, compile, ['']) From git at git.haskell.org Sat Jan 23 12:43:10 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 23 Jan 2016 12:43:10 +0000 (UTC) Subject: [commit: ghc] master: Remove unused IND_PERM (f42db15) Message-ID: <20160123124310.2D4543A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/f42db1574935b088cfc13cca7c935990002651dc/ghc >--------------------------------------------------------------- commit f42db1574935b088cfc13cca7c935990002651dc Author: Joachim Breitner Date: Sat Jan 23 13:12:10 2016 +0100 Remove unused IND_PERM it seems that this closure type has not been in use since 5d52d9, so all this is dead and untested code. This removes it. Some of the code might be useful for a counting indirection as described in #10613, so when implementing that, have a look at what this commit removes. Test Plan: validate on harbormaster Reviewers: austin, bgamari, simonmar Reviewed By: simonmar Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1821 >--------------------------------------------------------------- f42db1574935b088cfc13cca7c935990002651dc includes/Cmm.h | 1 - includes/rts/storage/ClosureMacros.h | 1 - includes/rts/storage/ClosureTypes.h | 73 ++++++++++++++++++------------------ includes/stg/MiscClosures.h | 1 - rts/CheckUnload.c | 1 - rts/ClosureFlags.c | 3 +- rts/Interpreter.c | 1 - rts/LdvProfile.c | 1 - rts/Printer.c | 10 +---- rts/ProfHeap.c | 1 - rts/RetainerProfile.c | 3 -- rts/Stable.c | 1 - rts/StgMiscClosures.cmm | 39 ------------------- rts/sm/Compact.c | 1 - rts/sm/Evac.c | 3 -- rts/sm/GCAux.c | 1 - rts/sm/Sanity.c | 1 - rts/sm/Scav.c | 8 ---- utils/genapply/Main.hs | 4 +- 19 files changed, 39 insertions(+), 115 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc f42db1574935b088cfc13cca7c935990002651dc From git at git.haskell.org Sat Jan 23 12:43:12 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 23 Jan 2016 12:43:12 +0000 (UTC) Subject: [commit: ghc] master: Small doc fix (06c2547) Message-ID: <20160123124312.DC87C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/06c2547326773db85af9c8a076d6ad2710aa5912/ghc >--------------------------------------------------------------- commit 06c2547326773db85af9c8a076d6ad2710aa5912 Author: Adam Sandberg Eriksson Date: Sat Jan 23 13:13:07 2016 +0100 Small doc fix Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1828 >--------------------------------------------------------------- 06c2547326773db85af9c8a076d6ad2710aa5912 docs/users_guide/glasgow_exts.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index d4ca508..055a558 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -12623,7 +12623,7 @@ optionally had by adding ``!`` in front of a variable. ``Strict`` implies :ref:`StrictData `. -- **Function definitions.** +- **Function definitions** When the user writes :: @@ -12635,7 +12635,7 @@ optionally had by adding ``!`` in front of a variable. Adding ``~`` in front of ``x`` gives the regular lazy behavior. -- **Let/where bindings.** +- **Let/where bindings** When the user writes :: @@ -12691,7 +12691,7 @@ optionally had by adding ``!`` in front of a variable. all get implicit bangs on the ``x`` pattern. -- ** Nested patterns ** +- **Nested patterns** Notice that we do *not* put bangs on nested patterns. For example :: @@ -12710,7 +12710,7 @@ optionally had by adding ``!`` in front of a variable. :ref:`strict-modularity` below). So ``p`` and ``q`` may end up bound to undefined. See also :ref:`recursive-and-polymorphic-let-bindings` below. -- **Top level bindings.** +- **Top level bindings** are unaffected by ``Strict``. For example: :: @@ -12720,7 +12720,7 @@ optionally had by adding ``!`` in front of a variable. Here ``x`` and the pattern binding ``(y,z)`` remain lazy. Reason: there is no good moment to force them, until first use. -- **Newtypes.** +- **Newtypes** There is no effect on newtypes, which simply rename existing types. For example: :: From git at git.haskell.org Sat Jan 23 12:43:15 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 23 Jan 2016 12:43:15 +0000 (UTC) Subject: [commit: ghc] master: Give a more verbose error message when desugaring a HsTypeOut (7cd37c5) Message-ID: <20160123124315.8E5E03A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/7cd37c599fa83817b51234ff2ff79e4e4896b117/ghc >--------------------------------------------------------------- commit 7cd37c599fa83817b51234ff2ff79e4e4896b117 Author: Reid Barton Date: Sat Jan 23 13:13:31 2016 +0100 Give a more verbose error message when desugaring a HsTypeOut Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1826 >--------------------------------------------------------------- 7cd37c599fa83817b51234ff2ff79e4e4896b117 compiler/deSugar/DsExpr.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/compiler/deSugar/DsExpr.hs b/compiler/deSugar/DsExpr.hs index 22a8707..c3c17c7 100644 --- a/compiler/deSugar/DsExpr.hs +++ b/compiler/deSugar/DsExpr.hs @@ -732,10 +732,14 @@ dsExpr (EAsPat {}) = panic "dsExpr:EAsPat" dsExpr (EViewPat {}) = panic "dsExpr:EViewPat" dsExpr (ELazyPat {}) = panic "dsExpr:ELazyPat" dsExpr (HsType {}) = panic "dsExpr:HsType" -- removed by typechecker -dsExpr (HsTypeOut {}) = panic "dsExpr:HsTypeOut" -- handled in HsApp case dsExpr (HsDo {}) = panic "dsExpr:HsDo" dsExpr (HsRecFld {}) = panic "dsExpr:HsRecFld" +-- Normally handled in HsApp case, but a GHC API user might try to desugar +-- an HsTypeOut, since it is an HsExpr in a typechecked module after all. +-- (Such as ghci itself, in #11456.) So improve the error message slightly. +dsExpr (HsTypeOut {}) + = panic "dsExpr: tried to desugar a naked type application argument (HsTypeOut)" findField :: [LHsRecField Id arg] -> Name -> [arg] findField rbinds sel From git at git.haskell.org Sat Jan 23 20:28:10 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 23 Jan 2016 20:28:10 +0000 (UTC) Subject: [commit: ghc] master: Remove -Wredundant-superclasses from standard warnings (8e9a870) Message-ID: <20160123202810.5D6A13A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/8e9a87025f954a2704850bc71cb497f768d5d595/ghc >--------------------------------------------------------------- commit 8e9a87025f954a2704850bc71cb497f768d5d595 Author: Ben Gamari Date: Sat Jan 23 18:40:33 2016 +0100 Remove -Wredundant-superclasses from standard warnings It is impossible to write warning-free code under the three-release policy with this flag enabled by default. See #11370 for details. >--------------------------------------------------------------- 8e9a87025f954a2704850bc71cb497f768d5d595 compiler/main/DynFlags.hs | 1 - testsuite/tests/typecheck/should_compile/all.T | 4 ++-- testsuite/tests/typecheck/should_compile/tc056.stderr | 4 ---- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index ea0bc53..79406a7 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -3474,7 +3474,6 @@ standardWarnings -- see Note [Documenting warning flags] Opt_WarnTypedHoles, Opt_WarnPartialTypeSignatures, Opt_WarnUnrecognisedPragmas, - Opt_WarnRedundantConstraints, Opt_WarnDuplicateExports, Opt_WarnOverflowedLiterals, Opt_WarnEmptyEnumerations, diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T index 7d7ec60..eb4f1fb 100644 --- a/testsuite/tests/typecheck/should_compile/all.T +++ b/testsuite/tests/typecheck/should_compile/all.T @@ -442,7 +442,7 @@ test('T9497c', normal, compile, ['-fdefer-type-errors -fno-warn-typed-holes']) test('T7643', normal, compile, ['']) test('T9834', normal, compile, ['']) test('T9892', normal, compile, ['']) -test('T9939', normal, compile, ['']) +test('T9939', normal, compile, ['-Wredundant-constraints']) test('T9973', normal, compile, ['']) test('T9971', normal, compile, ['']) test('T10031', normal, compile, ['']) @@ -475,7 +475,7 @@ test('T10564', normal, compile, ['']) test('Vta1', normal, compile, ['']) test('Vta2', normal, compile, ['']) test('PushHRIf', normal, compile, ['']) -test('T10632', normal, compile, ['']) +test('T10632', normal, compile, ['-Wredundant-constraints']) test('T10642', normal, compile, ['']) test('T10744', normal, compile, ['']) test('update-existential', normal, compile, ['']) diff --git a/testsuite/tests/typecheck/should_compile/tc056.stderr b/testsuite/tests/typecheck/should_compile/tc056.stderr index a6f7cd4..e69de29 100644 --- a/testsuite/tests/typecheck/should_compile/tc056.stderr +++ b/testsuite/tests/typecheck/should_compile/tc056.stderr @@ -1,4 +0,0 @@ - -tc056.hs:16:10: Warning: - Redundant constraints: (Eq' a, Eq' a) - In the instance declaration for ?Eq' [a]? From git at git.haskell.org Sat Jan 23 20:28:13 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 23 Jan 2016 20:28:13 +0000 (UTC) Subject: [commit: ghc] master: mkUserGuidePart: Better flag cross-referencing (1be8491) Message-ID: <20160123202813.1290E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/1be8491b0c3b07be2ec91feb557502ca06d1e078/ghc >--------------------------------------------------------------- commit 1be8491b0c3b07be2ec91feb557502ca06d1e078 Author: Ben Gamari Date: Sat Jan 23 19:10:59 2016 +0100 mkUserGuidePart: Better flag cross-referencing >--------------------------------------------------------------- 1be8491b0c3b07be2ec91feb557502ca06d1e078 utils/mkUserGuidePart/Main.hs | 12 ++-- utils/mkUserGuidePart/Options/Language.hs | 70 +++++++++++----------- utils/mkUserGuidePart/Options/Linking.hs | 4 +- utils/mkUserGuidePart/Options/Misc.hs | 2 +- utils/mkUserGuidePart/Options/Optimizations.hs | 50 ++++++++-------- utils/mkUserGuidePart/Options/Phases.hs | 2 +- .../Options/RecompilationChecking.hs | 2 +- utils/mkUserGuidePart/Options/Verbosity.hs | 6 +- utils/mkUserGuidePart/Options/Warnings.hs | 35 +++++------ 9 files changed, 94 insertions(+), 89 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 1be8491b0c3b07be2ec91feb557502ca06d1e078 From git at git.haskell.org Sat Jan 23 20:28:15 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 23 Jan 2016 20:28:15 +0000 (UTC) Subject: [commit: ghc] master: user-guide: Reformat warning lists (6f96109) Message-ID: <20160123202815.B5E7A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/6f96109b283dd5e4364062c5f71e0b11a9dfb9cd/ghc >--------------------------------------------------------------- commit 6f96109b283dd5e4364062c5f71e0b11a9dfb9cd Author: Ben Gamari Date: Sat Jan 23 19:17:45 2016 +0100 user-guide: Reformat warning lists >--------------------------------------------------------------- 6f96109b283dd5e4364062c5f71e0b11a9dfb9cd docs/users_guide/using-warnings.rst | 43 ++++++++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 12 deletions(-) diff --git a/docs/users_guide/using-warnings.rst b/docs/users_guide/using-warnings.rst index 0ba36aa..07ddbb1 100644 --- a/docs/users_guide/using-warnings.rst +++ b/docs/users_guide/using-warnings.rst @@ -37,21 +37,34 @@ The following flags are simple ways to select standard "packages" of warnings: .. ghc-flag:: -W - Provides the standard warnings plus :ghc-flag:`-Wunused-binds`, - :ghc-flag:`-Wunused-matches`, :ghc-flag:`-Wunused-imports`, - :ghc-flag:`-Wincomplete-patterns`, :ghc-flag:`-Wdodgy-exports`, and - :ghc-flag:`-Wdodgy-imports`. + Provides the standard warnings plus + + .. hlist:: + :columns: 3 + + * :ghc-flag:`-Wunused-binds` + * :ghc-flag:`-Wunused-matches` + * :ghc-flag:`-Wunused-imports` + * :ghc-flag:`-Wincomplete-patterns` + * :ghc-flag:`-Wdodgy-exports` + * :ghc-flag:`-Wdodgy-imports` .. ghc-flag:: -Wall Turns on all warning options that indicate potentially suspicious code. The warnings that are *not* enabled by :ghc-flag:`-Wall` are - :ghc-flag:`-Wincomplete-uni-patterns`, - :ghc-flag:`-Wincomplete-record-updates`, - :ghc-flag:`-Wmonomorphism-restriction`, - :ghc-flag:`-Wimplicit-prelude`, :ghc-flag:`-Wmissing-local-sigs`, - :ghc-flag:`-Wmissing-exported-sigs`, :ghc-flag:`-Wmissing-import-lists` - and :ghc-flag:`-Widentities`. + + .. hlist:: + :columns: 3 + + * :ghc-flag:`-Wincomplete-uni-patterns` + * :ghc-flag:`-Wincomplete-record-updates` + * :ghc-flag:`-Wmonomorphism-restriction` + * :ghc-flag:`-Wimplicit-prelude` + * :ghc-flag:`-Wmissing-local-sigs` + * :ghc-flag:`-Wmissing-exported-sigs` + * :ghc-flag:`-Wmissing-import-lists` + * :ghc-flag:`-Widentities` .. ghc-flag:: -Wcompat @@ -60,8 +73,14 @@ The following flags are simple ways to select standard "packages" of warnings: eager to make their code future compatible to adapt to new features before they even generate warnings. - This currently enables :ghc-flag:`-Wmissing-monadfail-instance`, - :ghc-flag:`-Wsemigroup`, and :ghc-flag:`-Wnoncanonical-monoid-instances`. + This currently enables + + .. hlist:: + :columns: 3 + + * :ghc-flag:`-Wmissing-monadfail-instance` + * :ghc-flag:`-Wsemigroup` + * :ghc-flag:`-Wnoncanonical-monoid-instances` .. ghc-flag:: -Wno-compat From git at git.haskell.org Sat Jan 23 20:28:18 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 23 Jan 2016 20:28:18 +0000 (UTC) Subject: [commit: ghc] master: user-guide: Fix typos (b5e52bf) Message-ID: <20160123202818.799393A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/b5e52bfc9e331a9ed2b3a30b790cfa331935aebe/ghc >--------------------------------------------------------------- commit b5e52bfc9e331a9ed2b3a30b790cfa331935aebe Author: Ben Gamari Date: Sat Jan 23 21:12:24 2016 +0100 user-guide: Fix typos >--------------------------------------------------------------- b5e52bfc9e331a9ed2b3a30b790cfa331935aebe docs/users_guide/glasgow_exts.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index 055a558..d753266 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -8125,10 +8125,10 @@ ordinary implicit parameters. ``GHC.Stack`` additionally exports a function ``freezeCallStack`` that allows users to freeze a ``CallStack``, preventing any future push operations from having an effect. This can be used by library authors -to prevent ``CallStack``\s from exposing unecessary implementation +to prevent ``CallStack``\s from exposing unnecessary implementation details. Consider the ``head`` example above, the ``myerror`` line in the printed stack is not particularly enlightening, so we might choose -to surpress it by freezing the ``CallStack`` that we pass to ``myerror``. +to suppress it by freezing the ``CallStack`` that we pass to ``myerror``. .. code-block:: none From git at git.haskell.org Sat Jan 23 20:29:32 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 23 Jan 2016 20:29:32 +0000 (UTC) Subject: [commit: ghc] master: Don't add ticks around type applications (#11329) (ec87788) Message-ID: <20160123202932.3794C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/ec8778862aeb9c3f6b861bc732045db9f58b9b61/ghc >--------------------------------------------------------------- commit ec8778862aeb9c3f6b861bc732045db9f58b9b61 Author: Reid Barton Date: Sat Jan 23 15:30:04 2016 -0500 Don't add ticks around type applications (#11329) Test Plan: validate --slow Reviewers: austin, bgamari, goldfire Reviewed By: goldfire Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1824 >--------------------------------------------------------------- ec8778862aeb9c3f6b861bc732045db9f58b9b61 compiler/deSugar/Coverage.hs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/compiler/deSugar/Coverage.hs b/compiler/deSugar/Coverage.hs index ae8b6ab..b7a578f 100644 --- a/compiler/deSugar/Coverage.hs +++ b/compiler/deSugar/Coverage.hs @@ -515,7 +515,9 @@ addBinTickLHsExpr boxLabel (L pos e0) -- ----------------------------------------------------------------------------- --- Decoarate an HsExpr with ticks +-- Decorate the body of an HsExpr with ticks. +-- (Whether to put a tick around the whole expression was already decided, +-- in the addTickLHsExpr family of functions.) addTickHsExpr :: HsExpr Id -> TM (HsExpr Id) addTickHsExpr e@(HsVar (L _ id)) = do freeVar id; return e @@ -526,7 +528,13 @@ addTickHsExpr e@(HsOverLabel _) = return e addTickHsExpr e@(HsLit _) = return e addTickHsExpr (HsLam matchgroup) = liftM HsLam (addTickMatchGroup True matchgroup) addTickHsExpr (HsLamCase ty mgs) = liftM (HsLamCase ty) (addTickMatchGroup True mgs) -addTickHsExpr (HsApp e1 e2) = liftM2 HsApp (addTickLHsExprNever e1) (addTickLHsExpr e2) +addTickHsExpr (HsApp e1 e2) = liftM2 HsApp (addTickLHsExprNever e1) e2' + -- This might be a type application. Then don't put a tick around e2, + -- or dsExpr won't recognize it as a type application any more (#11329). + -- It doesn't make sense to put a tick on a type anyways. + where e2' + | isLHsTypeExpr e2 = return e2 + | otherwise = addTickLHsExpr e2 addTickHsExpr (OpApp e1 e2 fix e3) = liftM4 OpApp @@ -658,8 +666,6 @@ addTickHsExpr (ExprWithTySigOut e ty) = (addTickLHsExprNever e) -- No need to tick the inner expression (return ty) -- for expressions with signatures -addTickHsExpr e@(HsTypeOut _) = return e - -- Others should never happen in expression content. addTickHsExpr e = pprPanic "addTickHsExpr" (ppr e) From git at git.haskell.org Sat Jan 23 21:48:49 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 23 Jan 2016 21:48:49 +0000 (UTC) Subject: [commit: ghc] master: Add test for #11473 (89bdac7) Message-ID: <20160123214849.BCB7B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/89bdac7635e6ed08927d760aa885d3e7ef3edb81/ghc >--------------------------------------------------------------- commit 89bdac7635e6ed08927d760aa885d3e7ef3edb81 Author: Ben Gamari Date: Fri Jan 22 13:33:36 2016 +0100 Add test for #11473 >--------------------------------------------------------------- 89bdac7635e6ed08927d760aa885d3e7ef3edb81 testsuite/tests/typecheck/should_fail/T11473.hs | 20 ++++++++++++++++++++ testsuite/tests/typecheck/should_fail/all.T | 1 + 2 files changed, 21 insertions(+) diff --git a/testsuite/tests/typecheck/should_fail/T11473.hs b/testsuite/tests/typecheck/should_fail/T11473.hs new file mode 100644 index 0000000..cb9f791 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T11473.hs @@ -0,0 +1,20 @@ +{-# LANGUAGE PolyKinds, TypeFamilies, MagicHash, DataKinds, TypeInType, RankNTypes #-} + +module T11473 where +import GHC.Exts +import GHC.Types + +type family Boxed (a :: k) :: * +type instance Boxed Char# = Char +type instance Boxed Char = Char + +class BoxIt (a :: TYPE lev) where + boxed :: a -> Boxed a + +instance BoxIt Char# where boxed x = C# x +instance BoxIt Char where boxed = id + +-- This should be an error: there is no way we can produce code for both Lifted +-- and Unlifted levities +hello :: forall (lev :: Levity). forall (a :: TYPE lev). BoxIt a => a -> Boxed a +hello x = boxed x diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T index 1c4e86e..3b090f7 100644 --- a/testsuite/tests/typecheck/should_fail/all.T +++ b/testsuite/tests/typecheck/should_fail/all.T @@ -404,3 +404,4 @@ test('T11347', normal, compile_fail, ['']) test('T11356', normal, compile_fail, ['']) test('T11355', normal, compile_fail, ['']) test('T11464', normal, compile_fail, ['']) +test('T11473', expect_broken(11473), compile_fail, ['']) From git at git.haskell.org Sat Jan 23 21:48:52 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 23 Jan 2016 21:48:52 +0000 (UTC) Subject: [commit: ghc] master: user-guide: Document -L RTS flag (923d215) Message-ID: <20160123214852.77BED3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/923d2151db261cac36577bcaffa6be41c3f374f9/ghc >--------------------------------------------------------------- commit 923d2151db261cac36577bcaffa6be41c3f374f9 Author: Ben Gamari Date: Sat Jan 23 22:03:04 2016 +0100 user-guide: Document -L RTS flag See #5641. >--------------------------------------------------------------- 923d2151db261cac36577bcaffa6be41c3f374f9 docs/users_guide/runtime_control.rst | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/docs/users_guide/runtime_control.rst b/docs/users_guide/runtime_control.rst index db983fa..7c4159a 100644 --- a/docs/users_guide/runtime_control.rst +++ b/docs/users_guide/runtime_control.rst @@ -797,13 +797,18 @@ executables: .. rts-flag:: -hT - (can be shortened to ``-h``.) Generates a basic heap profile, in the - file :file:`prog.hp`. To produce the heap profile graph, use :command:`hp2ps` - (see :ref:`hp2ps`). The basic heap profile is broken down by data - constructor, with other types of closures (functions, thunks, etc.) - grouped into broad categories (e.g. ``FUN``, ``THUNK``). To get a - more detailed profile, use the full profiling support - (:ref:`profiling`). + Generates a basic heap profile, in the file :file:`prog.hp`. To produce the + heap profile graph, use :command:`hp2ps` (see :ref:`hp2ps`). The basic heap + profile is broken down by data constructor, with other types of closures + (functions, thunks, etc.) grouped into broad categories (e.g. ``FUN``, + ``THUNK``). To get a more detailed profile, use the full profiling support + (:ref:`profiling`). Can be shortened to ``-h``. + +.. rts-flag:: -L + + :default: 25 characters + + Sets the maximum length of the cost-centre names listed in the heap profile. .. _rts-eventlog: From git at git.haskell.org Sun Jan 24 14:33:36 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 24 Jan 2016 14:33:36 +0000 (UTC) Subject: [commit: ghc] master: User's guide: fix singular/plural typo in flagnames (8b5ea7c) Message-ID: <20160124143336.D569A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/8b5ea7ce66647a3b918ab39fd05ad8be6a0d50b4/ghc >--------------------------------------------------------------- commit 8b5ea7ce66647a3b918ab39fd05ad8be6a0d50b4 Author: Herbert Valerio Riedel Date: Sun Jan 24 15:33:48 2016 +0100 User's guide: fix singular/plural typo in flagnames >--------------------------------------------------------------- 8b5ea7ce66647a3b918ab39fd05ad8be6a0d50b4 utils/mkUserGuidePart/Options/Warnings.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utils/mkUserGuidePart/Options/Warnings.hs b/utils/mkUserGuidePart/Options/Warnings.hs index a9b754d..e7c93e1 100644 --- a/utils/mkUserGuidePart/Options/Warnings.hs +++ b/utils/mkUserGuidePart/Options/Warnings.hs @@ -188,22 +188,22 @@ warningsOptions = , flagType = DynamicFlag , flagReverse = "-Wno-name-shadowing" } - , flag { flagName = "-Wnoncanonical-monad-instance" + , flag { flagName = "-Wnoncanonical-monad-instances" , flagDescription = "warn when ``Applicative`` or ``Monad`` instances have "++ "noncanonical definitions of ``return``, ``pure``, ``(>>)``, "++ "or ``(*>)``. "++ "See flag description in :ref:`options-sanity` for more details." , flagType = DynamicFlag - , flagReverse = "-Wno-noncanonical-monad-instance" + , flagReverse = "-Wno-noncanonical-monad-instances" } - , flag { flagName = "-Wnoncanonical-monoid-instance" + , flag { flagName = "-Wnoncanonical-monoid-instances" , flagDescription = "warn when ``Semigroup`` or ``Monoid`` instances have "++ "noncanonical definitions of ``(<>)`` or ``mappend``. "++ "See flag description in :ref:`options-sanity` for more details." , flagType = DynamicFlag - , flagReverse = "-Wno-noncanonical-monoid-instance" + , flagReverse = "-Wno-noncanonical-monoid-instances" } , flag { flagName = "-Worphans" , flagDescription = From git at git.haskell.org Sun Jan 24 14:34:59 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 24 Jan 2016 14:34:59 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: User's guide: fix singular/plural typo in flagnames (a11e9a6) Message-ID: <20160124143459.712F53A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/a11e9a682a363e35618eee95a81d7f3554256933/ghc >--------------------------------------------------------------- commit a11e9a682a363e35618eee95a81d7f3554256933 Author: Herbert Valerio Riedel Date: Sun Jan 24 15:33:48 2016 +0100 User's guide: fix singular/plural typo in flagnames (cherry picked from commit 8b5ea7ce66647a3b918ab39fd05ad8be6a0d50b4) >--------------------------------------------------------------- a11e9a682a363e35618eee95a81d7f3554256933 utils/mkUserGuidePart/Options/Warnings.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utils/mkUserGuidePart/Options/Warnings.hs b/utils/mkUserGuidePart/Options/Warnings.hs index c775af4..8cb4655 100644 --- a/utils/mkUserGuidePart/Options/Warnings.hs +++ b/utils/mkUserGuidePart/Options/Warnings.hs @@ -188,22 +188,22 @@ warningsOptions = , flagType = DynamicFlag , flagReverse = "-Wno-name-shadowing" } - , flag { flagName = "-Wnoncanonical-monad-instance" + , flag { flagName = "-Wnoncanonical-monad-instances" , flagDescription = "warn when ``Applicative`` or ``Monad`` instances have "++ "noncanonical definitions of ``return``, ``pure``, ``(>>)``, "++ "or ``(*>)``. "++ "See flag description in :ref:`options-sanity` for more details." , flagType = DynamicFlag - , flagReverse = "-Wno-noncanonical-monad-instance" + , flagReverse = "-Wno-noncanonical-monad-instances" } - , flag { flagName = "-Wnoncanonical-monoid-instance" + , flag { flagName = "-Wnoncanonical-monoid-instances" , flagDescription = "warn when ``Semigroup`` or ``Monoid`` instances have "++ "noncanonical definitions of ``(<>)`` or ``mappend``. "++ "See flag description in :ref:`options-sanity` for more details." , flagType = DynamicFlag - , flagReverse = "-Wno-noncanonical-monoid-instance" + , flagReverse = "-Wno-noncanonical-monoid-instances" } , flag { flagName = "-Worphans" , flagDescription = From git at git.haskell.org Sun Jan 24 17:29:32 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 24 Jan 2016 17:29:32 +0000 (UTC) Subject: [commit: ghc] wip/gadtpm: Overhaul the Overhauled Pattern Match Checker (be3e867) Message-ID: <20160124172932.25EF13A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/gadtpm Link : http://ghc.haskell.org/trac/ghc/changeset/be3e867db82201c1b54728f425916f4b50999dda/ghc >--------------------------------------------------------------- commit be3e867db82201c1b54728f425916f4b50999dda Author: George Karachalias Date: Sun Jan 24 18:29:01 2016 +0100 Overhaul the Overhauled Pattern Match Checker * Changed the representation of Value Set Abstractions. Instead of using a prefix tree, we now use a list of Value Vector Abstractions. The set of constraints Delta for every Value Vector Abstraction is the oracle state so that we solve everything only once. * Instead of doing everything lazily, we prune at once (and in general everything is much stricter). Hence, an example written with pattern guards is checked in almost the same time as the equivalent with pattern matching. * Do not store the covered and the divergent sets at all. Since what we only need is a yes/no (does this clause cover anything? Does it force any thunk?) We just keep a boolean for each. * Removed flags `-Wtoo-many-guards` and `-ffull-guard-reasoning`. Replaced with `fmax-pmcheck-iterations=n`. Still debatable what should the default `n` be. * When a guard is for sure not going to contribute anything, we treat it as such: The oracle is not called and cases CGuard, UGuard and DGuard from the paper are not happening at all (the generation of a fresh variable, the unfolding of the pattern list etc.). This combined with the above seems to be enough to drop the memory increase for test T783 down to 18.7%. * Added testcases T11195, T11303b (data families) and T11374 (Expected to address at least: #11195, #11276, #11303, #11374, #11162) >--------------------------------------------------------------- be3e867db82201c1b54728f425916f4b50999dda compiler/deSugar/Check.hs | 1134 ++++++++------------ compiler/deSugar/DsMonad.hs | 36 +- compiler/deSugar/Match.hs | 13 +- compiler/deSugar/TmOracle.hs | 18 +- compiler/ghci/RtClosureInspect.hs | 3 - compiler/main/DynFlags.hs | 12 +- compiler/nativeGen/Dwarf/Constants.hs | 4 - compiler/typecheck/TcRnTypes.hs | 3 +- compiler/types/OptCoercion.hs | 4 +- docs/users_guide/8.0.1-notes.rst | 9 - docs/users_guide/bugs.rst | 10 - docs/users_guide/using-warnings.rst | 34 - libraries/base/Foreign/C/Error.hs | 1 - testsuite/tests/pmcheck/should_compile/T11195.hs | 189 ++++ testsuite/tests/pmcheck/should_compile/T11303b.hs | 25 + testsuite/tests/pmcheck/should_compile/T11374.hs | 59 + .../tests/pmcheck/should_compile/T2204.stderr | 6 +- .../tests/pmcheck/should_compile/T9951b.stderr | 6 +- testsuite/tests/pmcheck/should_compile/all.T | 3 + .../tests/pmcheck/should_compile/pmc001.stderr | 12 +- .../tests/pmcheck/should_compile/pmc007.stderr | 12 +- utils/mkUserGuidePart/Options/Warnings.hs | 13 - 22 files changed, 799 insertions(+), 807 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc be3e867db82201c1b54728f425916f4b50999dda From git at git.haskell.org Sun Jan 24 17:29:34 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 24 Jan 2016 17:29:34 +0000 (UTC) Subject: [commit: ghc] wip/gadtpm's head updated: Overhaul the Overhauled Pattern Match Checker (be3e867) Message-ID: <20160124172934.7D48F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Branch 'wip/gadtpm' now includes: d1ce1aa users-guide: Clean manpage build artifacts and fix usage of clean-target b3eb8fa Complete operators properly 65b810b Show TYPE 'Lifted/TYPE 'Unlifted as */# in Show TypeRep instance f3a867e Add testcase for #11414 2fd407c validate: Use gz compression during bindist check a7b751d un-wire-in error, undefined, CallStack, and IP 5a62b6a Simplify API to tcMatchTys f02200f Layout only cb24e68 Fix typecheck of default associated type decls b7e5c30 White space only 6e0c0fd Improve debug printing/warnings ec8a188 Refactoring on IdInfo and system derived names 8e6a68d Add Trac #11427 to Note [Recursive superclasses] e2c7b7e Implement scoped type variables in pattern synonyms 8e50301 Test Trac #11379 5412899 Typo in comment 817dd92 Fixes to "make clean" for the iserv dir b8abd85 Replace calls to `ptext . sLit` with `text` 240ddd7 Switch from -this-package-key to -this-unit-id. cbc03f1 ghci: Kill global macros list d2ea7f9 Hide derived OccNames from user 38666bd user-guide: Delete errant fragment aff51af users-guide: Begin documenting --frontend 80265c4 Typos in comments 9d33adb Check InScopeSet in substTy and provide substTyUnchecked 713aa90 Re-export ghc-boot:GHC.Serialized as Serialized 952eda2 Fix IfaceType generation for TyCons without TyVars 975bdac T11266: Improve the test by adding more of the other problematic modules 514bac2 Fix combineIdenticalAlts 0373a84 Oops. Add missing close-comment 5cce095 Use (&&) instead of `if` in Ix derivation 84b0ebe Rework derivation of type representations for wired-in things 225afc4 Add test T9407 (Windows) 6ddc991 Update submodule stm + random 48d4bc5 substTy to substTyUnchecked to fix Travis build 1ce1371 MkId: Update OpenKind reference 2e65aae Add comments about tyCoVarsOfType e604e91 Comments only c572430 Re-add missing kind generalisation 6f95e23 Comments only b3ee37c Improve pretty-printing of UnivCo 07afe44 Remove the check_lifted check in TcValidity b2e6350 Strip casts in checkValidInstHead 395ec41 Allow implicit parameters in constraint synonyms ede055e TyCoRep: Restore compatibility with 7.10.1 f23b578 user-guide:: Improve -D description 928484d user-guide: Refer to MIN_VERSION_GLASGOW_HASKELL from intro 3883f99 rel-notes: Note the return of -Wmonomorphism-restriction 7cb893f Update and improve documentation in Data.Foldable 96303db Add a missing .gitignore entry in annotations tests 2ffc260 Add -ignore-dot-ghci to tests that use --interactive be3e867 Overhaul the Overhauled Pattern Match Checker From git at git.haskell.org Sun Jan 24 19:32:49 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 24 Jan 2016 19:32:49 +0000 (UTC) Subject: [commit: ghc] master: Docs: delete section on Hierarchical Modules (98d6a29) Message-ID: <20160124193249.E375F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/98d6a29e534350efd6aa72c0bf9d9e3ac4a76107/ghc >--------------------------------------------------------------- commit 98d6a29e534350efd6aa72c0bf9d9e3ac4a76107 Author: Thomas Miedema Date: Sun Jan 24 13:07:47 2016 +0100 Docs: delete section on Hierarchical Modules This information is mostly useless, since hierarchical modules are valid Haskell2010 and everybody knows how to use them. Reviewed by: bgamari Differential Revision: https://phabricator.haskell.org/D1835 >--------------------------------------------------------------- 98d6a29e534350efd6aa72c0bf9d9e3ac4a76107 docs/users_guide/glasgow_exts.rst | 34 ------------------------------- docs/users_guide/separate_compilation.rst | 6 ------ 2 files changed, 40 deletions(-) diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index d753266..6d02391 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -380,40 +380,6 @@ integer literals in binary notation with the prefix ``0b`` or ``0B``. For instance, the binary integer literal ``0b11001001`` will be desugared into ``fromInteger 201`` when :ghc-flag:`-XBinaryLiterals` is enabled. -.. _hierarchical-modules: - -Hierarchical Modules --------------------- - -GHC supports a small extension to the syntax of module names: a module -name is allowed to contain a dot ``?.?``. This is also known as the -?hierarchical module namespace? extension, because it extends the -normally flat Haskell module namespace into a more flexible hierarchy of -modules. - -This extension has very little impact on the language itself; modules -names are *always* fully qualified, so you can just think of the fully -qualified module name as ?the module name?. In particular, this means -that the full module name must be given after the ``module`` keyword at -the beginning of the module; for example, the module ``A.B.C`` must -begin :: - - module A.B.C - -It is a common strategy to use the ``as`` keyword to save some typing -when using qualified names with hierarchical modules. For example: :: - - import qualified Control.Monad.ST.Strict as ST - -For details on how GHC searches for source and interface files in the -presence of hierarchical modules, see :ref:`search-path`. - -GHC comes with a large collection of libraries arranged hierarchically; -see the accompanying `library -documentation <../libraries/index.html>`__. More libraries to install -are available from -`HackageDB `__. - .. _pattern-guards: Pattern guards diff --git a/docs/users_guide/separate_compilation.rst b/docs/users_guide/separate_compilation.rst index 0f5f029..afdde83 100644 --- a/docs/users_guide/separate_compilation.rst +++ b/docs/users_guide/separate_compilation.rst @@ -12,12 +12,6 @@ This section describes what files GHC expects to find, what files it creates, where these files are stored, and what options affect this behaviour. -Note that this section is written with hierarchical modules in mind (see -:ref:`hierarchical-modules`); hierarchical modules are an extension to -Haskell 98 which extends the lexical syntax of module names to include a -dot ``.``. Non-hierarchical modules are thus a special case in which none -of the module names contain dots. - Pathname conventions vary from system to system. In particular, the directory separator is "``/``" on Unix systems and "``\``" on Windows systems. In the sections that follow, we shall consistently use From git at git.haskell.org Sun Jan 24 19:32:52 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 24 Jan 2016 19:32:52 +0000 (UTC) Subject: [commit: ghc] master: Remove `replaceDynFlags` from `ContainsDynFlags` (edc68b2) Message-ID: <20160124193252.8FFB23A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/edc68b2ffe833e487ae6b2b04cd9be18e40a5a5e/ghc >--------------------------------------------------------------- commit edc68b2ffe833e487ae6b2b04cd9be18e40a5a5e Author: Thomas Miedema Date: Tue Jan 19 11:54:36 2016 +0100 Remove `replaceDynFlags` from `ContainsDynFlags` Refactoring only. It's shorter, and brings `HasDynFlags/ContainsDynFLags` in line with `HasModule/ContainsModule`. Introduce `updTopEnv`. Reviewed by: bgamari Differential Revision: https://phabricator.haskell.org/D1832 >--------------------------------------------------------------- edc68b2ffe833e487ae6b2b04cd9be18e40a5a5e compiler/main/DriverPipeline.hs | 2 +- compiler/main/DynFlags.hs | 1 - compiler/main/HscTypes.hs | 4 ---- compiler/typecheck/TcRnMonad.hs | 24 +++++++++++++----------- compiler/typecheck/TcRnTypes.hs | 2 -- 5 files changed, 14 insertions(+), 19 deletions(-) diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs index f40efd0..3de94fd 100644 --- a/compiler/main/DriverPipeline.hs +++ b/compiler/main/DriverPipeline.hs @@ -611,7 +611,7 @@ runPipeline stop_phase hsc_env0 (input_fn, mb_phase) -- If we are compiling a Haskell module, and doing -- -dynamic-too, but couldn't do the -dynamic-too fast -- path, then rerun the pipeline for the dyn way - let dflags = extractDynFlags hsc_env + let dflags = hsc_dflags hsc_env -- NB: Currently disabled on Windows (ref #7134, #8228, and #5987) when (not $ platformOS (targetPlatform dflags) == OSMinGW32) $ do when isHaskellishFile $ whenCannotGenerateDynamicToo dflags $ do diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 79406a7..c9b7a99 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -905,7 +905,6 @@ instance (Monad m, HasDynFlags m) => HasDynFlags (ExceptT e m) where class ContainsDynFlags t where extractDynFlags :: t -> DynFlags - replaceDynFlags :: t -> DynFlags -> t data ProfAuto = NoProfAuto -- ^ no SCC annotations added diff --git a/compiler/main/HscTypes.hs b/compiler/main/HscTypes.hs index 16a1ebd..6d43ec0 100644 --- a/compiler/main/HscTypes.hs +++ b/compiler/main/HscTypes.hs @@ -408,10 +408,6 @@ data HscEnv #endif } -instance ContainsDynFlags HscEnv where - extractDynFlags env = hsc_dflags env - replaceDynFlags env dflags = env {hsc_dflags = dflags} - #ifdef GHCI data IServ = IServ { iservPipe :: Pipe diff --git a/compiler/typecheck/TcRnMonad.hs b/compiler/typecheck/TcRnMonad.hs index b0b1e3d..692e9f3 100644 --- a/compiler/typecheck/TcRnMonad.hs +++ b/compiler/typecheck/TcRnMonad.hs @@ -278,6 +278,10 @@ discardResult a = a >> return () getTopEnv :: TcRnIf gbl lcl HscEnv getTopEnv = do { env <- getEnv; return (env_top env) } +updTopEnv :: (HscEnv -> HscEnv) -> TcRnIf gbl lcl a -> TcRnIf gbl lcl a +updTopEnv upd = updEnv (\ env@(Env { env_top = top }) -> + env { env_top = upd top }) + getGblEnv :: TcRnIf gbl lcl gbl getGblEnv = do { env <- getEnv; return (env_gbl env) } @@ -319,16 +323,16 @@ woptM :: WarningFlag -> TcRnIf gbl lcl Bool woptM flag = do { dflags <- getDynFlags; return (wopt flag dflags) } setXOptM :: LangExt.Extension -> TcRnIf gbl lcl a -> TcRnIf gbl lcl a -setXOptM flag = updEnv (\ env@(Env { env_top = top }) -> - env { env_top = top { hsc_dflags = xopt_set (hsc_dflags top) flag}} ) +setXOptM flag = + updTopEnv (\top -> top { hsc_dflags = xopt_set (hsc_dflags top) flag}) unsetGOptM :: GeneralFlag -> TcRnIf gbl lcl a -> TcRnIf gbl lcl a -unsetGOptM flag = updEnv (\ env@(Env { env_top = top }) -> - env { env_top = top { hsc_dflags = gopt_unset (hsc_dflags top) flag}} ) +unsetGOptM flag = + updTopEnv (\top -> top { hsc_dflags = gopt_unset (hsc_dflags top) flag}) unsetWOptM :: WarningFlag -> TcRnIf gbl lcl a -> TcRnIf gbl lcl a -unsetWOptM flag = updEnv (\ env@(Env { env_top = top }) -> - env { env_top = top { hsc_dflags = wopt_unset (hsc_dflags top) flag}} ) +unsetWOptM flag = + updTopEnv (\top -> top { hsc_dflags = wopt_unset (hsc_dflags top) flag}) -- | Do it flag is true whenDOptM :: DumpFlag -> TcRnIf gbl lcl () -> TcRnIf gbl lcl () @@ -351,11 +355,9 @@ getGhcMode :: TcRnIf gbl lcl GhcMode getGhcMode = do { env <- getTopEnv; return (ghcMode (hsc_dflags env)) } withDoDynamicToo :: TcRnIf gbl lcl a -> TcRnIf gbl lcl a -withDoDynamicToo m = do env <- getEnv - let dflags = extractDynFlags env - dflags' = dynamicTooMkDynamicDynFlags dflags - env' = replaceDynFlags env dflags' - setEnv env' m +withDoDynamicToo = + updTopEnv (\top@(HscEnv { hsc_dflags = dflags }) -> + top { hsc_dflags = dynamicTooMkDynamicDynFlags dflags }) getEpsVar :: TcRnIf gbl lcl (TcRef ExternalPackageState) getEpsVar = do { env <- getTopEnv; return (hsc_EPS env) } diff --git a/compiler/typecheck/TcRnTypes.hs b/compiler/typecheck/TcRnTypes.hs index 07037c7..d7670f1 100644 --- a/compiler/typecheck/TcRnTypes.hs +++ b/compiler/typecheck/TcRnTypes.hs @@ -237,8 +237,6 @@ data Env gbl lcl instance ContainsDynFlags (Env gbl lcl) where extractDynFlags env = hsc_dflags (env_top env) - replaceDynFlags env dflags - = env {env_top = replaceDynFlags (env_top env) dflags} instance ContainsModule gbl => ContainsModule (Env gbl lcl) where extractModule env = extractModule (env_gbl env) From git at git.haskell.org Sun Jan 24 19:32:55 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 24 Jan 2016 19:32:55 +0000 (UTC) Subject: [commit: ghc] master: Add -fwarn-redundant-constrains to test for #9708 (2c6fe5b) Message-ID: <20160124193255.324C63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/2c6fe5b8a854f06ea9574f7dca545b4c2d35b811/ghc >--------------------------------------------------------------- commit 2c6fe5b8a854f06ea9574f7dca545b4c2d35b811 Author: Thomas Miedema Date: Sun Jan 24 02:49:42 2016 +0100 Add -fwarn-redundant-constrains to test for #9708 Fixes validate on Travis. Reviewed by: bgamari Differential Revision: https://phabricator.haskell.org/D1834 >--------------------------------------------------------------- 2c6fe5b8a854f06ea9574f7dca545b4c2d35b811 testsuite/tests/typecheck/should_compile/T9708.hs | 9 +++++++++ testsuite/tests/typecheck/should_compile/T9708.stderr | 0 2 files changed, 9 insertions(+) diff --git a/testsuite/tests/typecheck/should_compile/T9708.hs b/testsuite/tests/typecheck/should_compile/T9708.hs index cb0e847..3878857 100644 --- a/testsuite/tests/typecheck/should_compile/T9708.hs +++ b/testsuite/tests/typecheck/should_compile/T9708.hs @@ -1,4 +1,5 @@ {-# LANGUAGE DataKinds, TypeOperators, TypeFamilies #-} +{-# OPTIONS_GHC -fwarn-redundant-constraints #-} module TcTypeNatSimple where import GHC.TypeLits @@ -16,5 +17,13 @@ type family SomeFun (n :: Nat) -- with the change to stop Deriveds from rewriting Deriveds (around Dec. 12, 2014), -- this failed again +-- 2016-01-23: it just started passing again, when +-- -fwarn-redundant-constraints was removed from the default warning set. +-- Turning the warning back on for this module, ghc reports (and probably has +-- for some time): +-- Redundant constraints: (x <= y, y <= x) +-- In the type signature for: +-- ti7 :: (x <= y, y <= x) => Proxy (SomeFun x) -> Proxy y -> () + ti7 :: (x <= y, y <= x) => Proxy (SomeFun x) -> Proxy y -> () ti7 _ _ = () diff --git a/testsuite/tests/typecheck/should_compile/T9708.stderr b/testsuite/tests/typecheck/should_compile/T9708.stderr deleted file mode 100644 index e69de29..0000000 From git at git.haskell.org Sun Jan 24 20:45:12 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 24 Jan 2016 20:45:12 +0000 (UTC) Subject: [commit: ghc] master: Implement `-Wnoncanonical-monadfail-instances` warning (fd6dd41) Message-ID: <20160124204512.890423A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/fd6dd41c67f3bd23bbf074357219cfd251eb53d6/ghc >--------------------------------------------------------------- commit fd6dd41c67f3bd23bbf074357219cfd251eb53d6 Author: Herbert Valerio Riedel Date: Sun Jan 24 14:46:44 2016 +0100 Implement `-Wnoncanonical-monadfail-instances` warning The MonadFail proposal implemented so far via #10751 only warns about missing `MonadFail` instances based on existence of failible pattern matches in `do`-blocks. However, based on the noncanonical Monad warnings implemented via #11150 we can provide a different mechanism for detecting missing `MonadFail` instances quite cheaply. That is, by checking for canonical `fail` definitions. In the case of `Monad`/`MonadFail`, we define the canonical implementation of `fail` to be such that the soft-deprecated method shall (iff overridden) be defined in terms of the non-deprecated method. Consequently, in case of `MonadFail`, the `Monad(fail)` method shall be defined as alias of the `MonadFail(fail)` method. This allows us at some distant point in the future to remove `fail` from the `Monad` class, while having GHC ignore/tolerate such literal canonical method definitions. Reviewed By: bgamari, RyanGlScott Differential Revision: https://phabricator.haskell.org/D1838 >--------------------------------------------------------------- fd6dd41c67f3bd23bbf074357219cfd251eb53d6 compiler/main/DynFlags.hs | 3 ++ compiler/rename/RnSource.hs | 38 ++++++++++++++++++++++ docs/users_guide/8.0.1-notes.rst | 5 +-- docs/users_guide/using-warnings.rst | 24 ++++++++++++++ .../should_compile/{T11128.hs => T11128b.hs} | 22 ++++++++++--- .../tests/warnings/should_compile/T11128b.stderr | 10 ++++++ testsuite/tests/warnings/should_compile/all.T | 1 + utils/mkUserGuidePart/Options/Warnings.hs | 8 +++++ 8 files changed, 105 insertions(+), 6 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc fd6dd41c67f3bd23bbf074357219cfd251eb53d6 From git at git.haskell.org Sun Jan 24 21:24:28 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 24 Jan 2016 21:24:28 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Implement `-Wnoncanonical-monadfail-instances` warning (e4c96ca) Message-ID: <20160124212428.B4DD33A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/e4c96ca31770e6b2a16dae5bfc0e4d844a105410/ghc >--------------------------------------------------------------- commit e4c96ca31770e6b2a16dae5bfc0e4d844a105410 Author: Herbert Valerio Riedel Date: Sun Jan 24 14:46:44 2016 +0100 Implement `-Wnoncanonical-monadfail-instances` warning The MonadFail proposal implemented so far via #10751 only warns about missing `MonadFail` instances based on existence of failible pattern matches in `do`-blocks. However, based on the noncanonical Monad warnings implemented via #11150 we can provide a different mechanism for detecting missing `MonadFail` instances quite cheaply. That is, by checking for canonical `fail` definitions. In the case of `Monad`/`MonadFail`, we define the canonical implementation of `fail` to be such that the soft-deprecated method shall (iff overridden) be defined in terms of the non-deprecated method. Consequently, in case of `MonadFail`, the `Monad(fail)` method shall be defined as alias of the `MonadFail(fail)` method. This allows us at some distant point in the future to remove `fail` from the `Monad` class, while having GHC ignore/tolerate such literal canonical method definitions. Reviewed By: bgamari, RyanGlScott Differential Revision: https://phabricator.haskell.org/D1838 (cherry picked from commit fd6dd41c67f3bd23bbf074357219cfd251eb53d6) >--------------------------------------------------------------- e4c96ca31770e6b2a16dae5bfc0e4d844a105410 compiler/main/DynFlags.hs | 3 ++ compiler/rename/RnSource.hs | 38 ++++++++++++++++++++++ docs/users_guide/8.0.1-notes.rst | 5 +-- docs/users_guide/using-warnings.rst | 24 ++++++++++++++ .../should_compile/{T11128.hs => T11128b.hs} | 22 ++++++++++--- .../tests/warnings/should_compile/T11128b.stderr | 10 ++++++ testsuite/tests/warnings/should_compile/all.T | 1 + utils/mkUserGuidePart/Options/Warnings.hs | 8 +++++ 8 files changed, 105 insertions(+), 6 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc e4c96ca31770e6b2a16dae5bfc0e4d844a105410 From git at git.haskell.org Mon Jan 25 11:31:18 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Jan 2016 11:31:18 +0000 (UTC) Subject: [commit: ghc] master: Special-case implicit params in superclass expansion (ff21795) Message-ID: <20160125113118.1045A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/ff21795a0b9253e811a45626d5686e981ed07f82/ghc >--------------------------------------------------------------- commit ff21795a0b9253e811a45626d5686e981ed07f82 Author: Simon Peyton Jones Date: Fri Jan 22 16:34:18 2016 +0000 Special-case implicit params in superclass expansion This issue came up in Trac #11480, and is documented in Note [When superclasses help] in TcRnTypes. We were getting a spurious warning T11480.hs:1:1: warning: solveWanteds: too many iterations (limit = 4) The fix is easy. A bit of refactoring along the way. The original bug report in Trac #11480 appears to work fine in HEAD and the 8.0 branch but I added a regression test in this commit as well. >--------------------------------------------------------------- ff21795a0b9253e811a45626d5686e981ed07f82 compiler/typecheck/TcCanonical.hs | 11 +-- compiler/typecheck/TcRnTypes.hs | 81 +++++++++++++++++----- compiler/typecheck/TcSMonad.hs | 9 +-- compiler/typecheck/TcSimplify.hs | 12 +++- testsuite/tests/polykinds/T11480a.hs | 26 +++++++ testsuite/tests/polykinds/all.T | 1 + testsuite/tests/typecheck/should_compile/T11480.hs | 9 +++ testsuite/tests/typecheck/should_compile/all.T | 1 + 8 files changed, 118 insertions(+), 32 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc ff21795a0b9253e811a45626d5686e981ed07f82 From git at git.haskell.org Mon Jan 25 11:31:20 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Jan 2016 11:31:20 +0000 (UTC) Subject: [commit: ghc] master: Refactor validity checking for type/data instances (746764c) Message-ID: <20160125113120.C3FB83A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/746764cce9a111a082a13bc3cd34b50e34fd2a31/ghc >--------------------------------------------------------------- commit 746764cce9a111a082a13bc3cd34b50e34fd2a31 Author: Simon Peyton Jones Date: Fri Jan 22 16:40:55 2016 +0000 Refactor validity checking for type/data instances I found that there was some code duplication going on, so I've put more into the shared function checkValidFamPats. I did some refactoring in checkConsistentFamInst too, preparatory to #11450; the error messages change a little but no change in behaviour. >--------------------------------------------------------------- 746764cce9a111a082a13bc3cd34b50e34fd2a31 compiler/typecheck/TcInstDcls.hs | 9 +- compiler/typecheck/TcTyClsDecls.hs | 2 + compiler/typecheck/TcValidity.hs | 152 ++++++++++++--------- .../indexed-types/should_fail/SimpleFail2a.stderr | 11 +- 4 files changed, 100 insertions(+), 74 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 746764cce9a111a082a13bc3cd34b50e34fd2a31 From git at git.haskell.org Mon Jan 25 11:31:23 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Jan 2016 11:31:23 +0000 (UTC) Subject: [commit: ghc] master: Avoid recursive use of immSuperClasses (42c6263) Message-ID: <20160125113123.6D78B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/42c6263f23cf3f00035389637862944e0594bc7a/ghc >--------------------------------------------------------------- commit 42c6263f23cf3f00035389637862944e0594bc7a Author: Simon Peyton Jones Date: Mon Jan 25 08:29:12 2016 +0000 Avoid recursive use of immSuperClasses In fixing Trac #11480 I had omitted to deal with FunDeps.oclose, which was making recursive use of immSuperClasses, and hence going into a loop in the recursive case. Solution: use transSuperClasses, which takes care not to. >--------------------------------------------------------------- 42c6263f23cf3f00035389637862944e0594bc7a compiler/typecheck/FunDeps.hs | 15 +++++++-------- compiler/typecheck/TcType.hs | 4 ++-- testsuite/tests/polykinds/T11480a.hs | 2 +- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/compiler/typecheck/FunDeps.hs b/compiler/typecheck/FunDeps.hs index 1a0c310..72d8345 100644 --- a/compiler/typecheck/FunDeps.hs +++ b/compiler/typecheck/FunDeps.hs @@ -23,7 +23,7 @@ import Name import Var import Class import Type -import TcType( immSuperClasses ) +import TcType( transSuperClasses ) import Unify import InstEnv import VarSet @@ -510,18 +510,17 @@ oclose preds fixed_tvs tv_fds :: [(TyCoVarSet,TyCoVarSet)] tv_fds = [ (tyCoVarsOfTypes ls, tyCoVarsOfTypes rs) | pred <- preds - , (ls, rs) <- determined pred ] + , pred' <- pred : transSuperClasses pred + -- Look for fundeps in superclasses too + , (ls, rs) <- determined pred' ] determined :: PredType -> [([Type],[Type])] determined pred = case classifyPredType pred of EqPred NomEq t1 t2 -> [([t1],[t2]), ([t2],[t1])] - ClassPred cls tys -> local_fds ++ concatMap determined superclasses - where - local_fds = [ instFD fd cls_tvs tys - | fd <- cls_fds ] - (cls_tvs, cls_fds) = classTvsFds cls - superclasses = immSuperClasses cls tys + ClassPred cls tys -> [ instFD fd cls_tvs tys + | let (cls_tvs, cls_fds) = classTvsFds cls + , fd <- cls_fds ] _ -> [] {- diff --git a/compiler/typecheck/TcType.hs b/compiler/typecheck/TcType.hs index c5edfb5..62095c7 100644 --- a/compiler/typecheck/TcType.hs +++ b/compiler/typecheck/TcType.hs @@ -1720,8 +1720,8 @@ mkMinimalBySCs ptys = go preds_with_scs [] in_cloud p ps = or [ p `eqType` p' | (_, scs) <- ps, p' <- scs ] transSuperClasses :: PredType -> [PredType] --- (transSuperClasses p) returns (p's superclasses) --- not including p +-- (transSuperClasses p) returns (p's superclasses) not including p +-- Stop if you encounter the same class again -- See Note [Expanding superclasses] transSuperClasses p = go emptyNameSet p diff --git a/testsuite/tests/polykinds/T11480a.hs b/testsuite/tests/polykinds/T11480a.hs index 3d17168..eeeaf34 100644 --- a/testsuite/tests/polykinds/T11480a.hs +++ b/testsuite/tests/polykinds/T11480a.hs @@ -1,7 +1,7 @@ {-# language KindSignatures, PolyKinds, TypeFamilies, NoImplicitPrelude, FlexibleContexts, MultiParamTypeClasses, GADTs, - ConstraintKinds, FlexibleInstances, + ConstraintKinds, FlexibleInstances, UndecidableInstances, FunctionalDependencies, UndecidableSuperClasses #-} module T11480a where From git at git.haskell.org Mon Jan 25 11:31:26 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Jan 2016 11:31:26 +0000 (UTC) Subject: [commit: ghc] master: Improve tracing in checkValidInstance (f7e0e5f) Message-ID: <20160125113126.2EDDB3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/f7e0e5f957f1b061eda057282504fca3de061220/ghc >--------------------------------------------------------------- commit f7e0e5f957f1b061eda057282504fca3de061220 Author: Simon Peyton Jones Date: Mon Jan 25 08:31:51 2016 +0000 Improve tracing in checkValidInstance >--------------------------------------------------------------- f7e0e5f957f1b061eda057282504fca3de061220 compiler/typecheck/TcValidity.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/compiler/typecheck/TcValidity.hs b/compiler/typecheck/TcValidity.hs index 1866f51..3aa8d78 100644 --- a/compiler/typecheck/TcValidity.hs +++ b/compiler/typecheck/TcValidity.hs @@ -1149,6 +1149,7 @@ checkValidInstance ctxt hs_type ty | Just (clas,inst_tys) <- getClassPredTys_maybe tau , inst_tys `lengthIs` classArity clas = do { setSrcSpan head_loc (checkValidInstHead ctxt clas inst_tys) + ; traceTc "checkValidInstance {" (ppr ty) ; checkValidTheta ctxt theta -- The Termination and Coverate Conditions @@ -1162,15 +1163,18 @@ checkValidInstance ctxt hs_type ty -- the termination condition, because 'a' appears more often -- in the constraint than in the head ; undecidable_ok <- xoptM LangExt.UndecidableInstances - ; traceTc "cvi" (ppr undecidable_ok $$ ppr ty) ; if undecidable_ok then checkAmbiguity ctxt ty else checkInstTermination inst_tys theta + ; traceTc "cvi 2" (ppr ty) + ; case (checkInstCoverage undecidable_ok clas theta inst_tys) of IsValid -> return () -- Check succeeded NotValid msg -> addErrTc (instTypeErr clas inst_tys msg) + ; traceTc "End checkValidInstance }" empty + ; return (tvs, theta, clas, inst_tys) } | otherwise From git at git.haskell.org Mon Jan 25 11:31:28 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Jan 2016 11:31:28 +0000 (UTC) Subject: [commit: ghc] master: Fix exprIsHNF (Trac #11248) (3c060f3) Message-ID: <20160125113128.EDDC43A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/3c060f36f6eb4d359f252168e2f97b573d017080/ghc >--------------------------------------------------------------- commit 3c060f36f6eb4d359f252168e2f97b573d017080 Author: Simon Peyton Jones Date: Mon Jan 25 11:16:18 2016 +0000 Fix exprIsHNF (Trac #11248) Blimey! CoreUtils.exprIsHNFlike had not one but two bugs. * is_hnf_like treated coercion args like type args (result: exprIsHNF might wrongly say True) * app_is_value treated type args like value args (result: exprIsHNF might wrongly say False) Bizarre. This goes back to at least 2012. It's amazing that it hasn't caused more trouble. It was discovered by a Lint error when compiling Trac #11248 with -O. >--------------------------------------------------------------- 3c060f36f6eb4d359f252168e2f97b573d017080 compiler/coreSyn/CoreUtils.hs | 31 +++++++++++++++++-------------- testsuite/tests/polykinds/T11248.hs | 3 +++ 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/compiler/coreSyn/CoreUtils.hs b/compiler/coreSyn/CoreUtils.hs index 3664d8e..eaccb33 100644 --- a/compiler/coreSyn/CoreUtils.hs +++ b/compiler/coreSyn/CoreUtils.hs @@ -1459,22 +1459,25 @@ exprIsHNFlike is_con is_con_unf = is_hnf_like is_hnf_like (Tick tickish e) = not (tickishCounts tickish) && is_hnf_like e -- See Note [exprIsHNF Tick] - is_hnf_like (Cast e _) = is_hnf_like e - is_hnf_like (App e (Type _)) = is_hnf_like e - is_hnf_like (App e (Coercion _)) = is_hnf_like e - is_hnf_like (App e a) = app_is_value e [a] - is_hnf_like (Let _ e) = is_hnf_like e -- Lazy let(rec)s don't affect us - is_hnf_like _ = False + is_hnf_like (Cast e _) = is_hnf_like e + is_hnf_like (App e a) + | isValArg a = app_is_value e 1 + | otherwise = is_hnf_like e + is_hnf_like (Let _ e) = is_hnf_like e -- Lazy let(rec)s don't affect us + is_hnf_like _ = False -- There is at least one value argument - app_is_value :: CoreExpr -> [CoreArg] -> Bool - app_is_value (Var fun) args - = idArity fun > valArgCount args -- Under-applied function - || is_con fun -- or constructor-like - app_is_value (Tick _ f) as = app_is_value f as - app_is_value (Cast f _) as = app_is_value f as - app_is_value (App f a) as = app_is_value f (a:as) - app_is_value _ _ = False + -- 'n' is number of value args to which the expression is applied + app_is_value :: CoreExpr -> Int -> Bool + app_is_value (Var fun) n_val_args + = idArity fun > n_val_args -- Under-applied function + || is_con fun -- or constructor-like + app_is_value (Tick _ f) nva = app_is_value f nva + app_is_value (Cast f _) nva = app_is_value f nva + app_is_value (App f a) nva + | isValArg a = app_is_value f (nva + 1) + | otherwise = app_is_value f nva + app_is_value _ _ = False {- Note [exprIsHNF Tick] diff --git a/testsuite/tests/polykinds/T11248.hs b/testsuite/tests/polykinds/T11248.hs index e1c8fcc..b3a32e3 100644 --- a/testsuite/tests/polykinds/T11248.hs +++ b/testsuite/tests/polykinds/T11248.hs @@ -1,3 +1,6 @@ +{-# OPTIONS_GHC -O #-} + -- Trac #11248, comment:6 showed that this tests failed with -O + {-# LANGUAGE DataKinds, TypeOperators, TypeFamilies, KindSignatures, ConstraintKinds #-} From git at git.haskell.org Mon Jan 25 12:52:24 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Jan 2016 12:52:24 +0000 (UTC) Subject: [commit: ghc] wip/exp-types: Refactor the typechecker to use ExpTypes. (c600e23) Message-ID: <20160125125224.906EF3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/exp-types Link : http://ghc.haskell.org/trac/ghc/changeset/c600e2383ce069f50b49beb2b86aa88dce68e89a/ghc >--------------------------------------------------------------- commit c600e2383ce069f50b49beb2b86aa88dce68e89a Author: Richard Eisenberg Date: Wed Jan 13 23:29:17 2016 -0500 Refactor the typechecker to use ExpTypes. The idea here is described in [wiki:Typechecker]. Briefly, this refactor keeps solid track of "synthesis" mode vs "checking" in GHC's bidirectional type-checking algorithm. When in synthesis mode, the expected type is just an IORef to write to. In addition, this patch does a significant reworking of RebindableSyntax, allowing much more freedom in the types of the rebindable operators. For example, we can now have `negate :: Int -> Bool` and `(>>=) :: m a -> (forall x. a x -> m b) -> m b`. The magic is in tcSyntaxOp. This addresses tickets #11397, #11452, and #11458. Tests: typecheck/should_compile/{RebindHR,RebindNegate,T11397,T11458} th/T11452 >--------------------------------------------------------------- c600e2383ce069f50b49beb2b86aa88dce68e89a compiler/deSugar/Check.hs | 157 +++---- compiler/deSugar/DsArrows.hs | 4 +- compiler/deSugar/DsMeta.hs | 4 +- compiler/deSugar/Match.hs | 8 +- compiler/deSugar/MatchLit.hs | 36 +- compiler/ghci/RtClosureInspect.hs | 4 - compiler/hsSyn/HsPat.hs | 16 +- compiler/hsSyn/HsUtils.hs | 12 +- compiler/hsSyn/PlaceHolder.hs | 23 +- compiler/rename/RnPat.hs | 8 +- compiler/typecheck/Inst.hs | 50 ++- compiler/typecheck/TcArrows.hs | 41 +- compiler/typecheck/TcBinds.hs | 18 +- compiler/typecheck/TcErrors.hs | 112 +++-- compiler/typecheck/TcEvidence.hs | 38 +- compiler/typecheck/TcExpr.hs | 410 +++++++++++++------ compiler/typecheck/TcExpr.hs-boot | 23 +- compiler/typecheck/TcGenDeriv.hs | 32 +- compiler/typecheck/TcHsSyn.hs | 17 +- compiler/typecheck/TcHsType.hs | 11 +- compiler/typecheck/TcInstDcls.hs | 3 +- compiler/typecheck/TcMType.hs | 239 +++++++---- compiler/typecheck/TcMatches.hs | 385 ++++++++++-------- compiler/typecheck/TcMatches.hs-boot | 4 +- compiler/typecheck/TcPat.hs | 249 ++++++++---- compiler/typecheck/TcPatSyn.hs | 26 +- compiler/typecheck/TcRnDriver.hs | 6 +- compiler/typecheck/TcRnMonad.hs | 4 +- compiler/typecheck/TcRnTypes.hs | 26 +- compiler/typecheck/TcRules.hs | 3 +- compiler/typecheck/TcSplice.hs | 41 +- compiler/typecheck/TcSplice.hs-boot | 8 +- compiler/typecheck/TcType.hs | 111 ++--- compiler/typecheck/TcUnify.hs | 449 +++++++++++++-------- compiler/typecheck/TcValidity.hs | 2 +- compiler/utils/MonadUtils.hs | 7 +- testsuite/tests/ado/ado004.stderr | 30 +- .../tests/annotations/should_fail/annfail10.stderr | 12 +- testsuite/tests/determinism/typecheck/A.hs | 2 +- testsuite/tests/gadt/gadt-escape1.stderr | 16 +- testsuite/tests/gadt/gadt13.stderr | 10 +- testsuite/tests/gadt/gadt7.stderr | 20 +- .../tests/ghci.debugger/scripts/break003.stderr | 2 +- .../tests/ghci.debugger/scripts/break003.stdout | 8 +- .../tests/ghci.debugger/scripts/break005.stdout | 4 +- .../tests/ghci.debugger/scripts/break006.stderr | 12 +- .../tests/ghci.debugger/scripts/break006.stdout | 10 +- .../tests/ghci.debugger/scripts/break012.stdout | 8 +- .../tests/ghci.debugger/scripts/hist001.stdout | 28 +- .../tests/ghci.debugger/scripts/print022.stdout | 4 +- testsuite/tests/ghci/scripts/T2182ghci.stderr | 30 +- testsuite/tests/ghci/scripts/T8959.script | 8 +- testsuite/tests/ghci/scripts/T8959.stderr | 48 +-- testsuite/tests/ghci/scripts/T8959.stdout | 11 +- .../tests/indexed-types/should_compile/T3484.hs | 4 +- .../tests/indexed-types/should_compile/T4120.hs | 4 +- .../tests/indexed-types/should_compile/T4494.hs | 3 +- .../tests/indexed-types/should_compile/T9090.hs | 2 +- .../tests/indexed-types/should_compile/T9316.hs | 2 +- .../tests/indexed-types/should_fail/T3330a.hs | 3 +- .../tests/indexed-types/should_fail/T5934.stderr | 11 +- .../tests/indexed-types/should_fail/T7788.stderr | 7 +- .../tests/indexed-types/should_fail/T8518.stderr | 33 +- testsuite/tests/module/mod71.stderr | 6 +- .../should_fail/overloadedlistsfail03.hs | 2 +- .../should_fail/overloadedlistsfail03.stderr | 13 +- .../should_fail/overloadedlistsfail05.hs | 2 +- .../should_fail/overloadedlistsfail05.stderr | 15 +- .../tests/parser/should_compile/read014.stderr | 8 +- testsuite/tests/parser/should_fail/T7848.stderr | 42 +- .../partial-sigs/should_compile/T10438.stderr | 16 +- .../partial-sigs/should_compile/T11192.stderr | 12 +- testsuite/tests/polykinds/T7438.stderr | 16 +- testsuite/tests/rebindable/rebindable6.hs | 5 +- testsuite/tests/rebindable/rebindable6.stderr | 24 +- .../tests/rename/should_compile/T3103/GHC/Num.hs | 9 + .../tests/rename/should_compile/T3103/GHC/Word.hs | 2 +- testsuite/tests/th/T11452.hs | 6 + testsuite/tests/th/T11452.stderr | 15 + testsuite/tests/th/T2222.stderr | 2 +- testsuite/tests/th/all.T | 1 + .../tests/typecheck/should_compile/RebindHR.hs | 26 ++ .../tests/typecheck/should_compile/RebindNegate.hs | 9 + testsuite/tests/typecheck/should_compile/T11397.hs | 69 ++++ testsuite/tests/typecheck/should_compile/T11458.hs | 5 + testsuite/tests/typecheck/should_compile/T2683.hs | 2 +- testsuite/tests/typecheck/should_compile/T7888.hs | 4 + testsuite/tests/typecheck/should_compile/all.T | 4 + .../tests/typecheck/should_compile/tc141.stderr | 6 +- testsuite/tests/typecheck/should_compile/tc158.hs | 2 +- testsuite/tests/typecheck/should_compile/twins.hs | 2 +- .../tests/typecheck/should_fail/FDsFromGivens2.hs | 1 + .../typecheck/should_fail/FDsFromGivens2.stderr | 26 +- .../tests/typecheck/should_fail/T10619.stderr | 4 +- testsuite/tests/typecheck/should_fail/T3613.stderr | 4 +- testsuite/tests/typecheck/should_fail/T5570.stderr | 3 +- testsuite/tests/typecheck/should_fail/T7453.stderr | 50 +-- testsuite/tests/typecheck/should_fail/T7734.stderr | 12 +- testsuite/tests/typecheck/should_fail/T8603.stderr | 8 +- testsuite/tests/typecheck/should_fail/T9109.stderr | 11 +- .../tests/typecheck/should_fail/tcfail014.stderr | 6 +- .../tests/typecheck/should_fail/tcfail016.stderr | 25 +- .../tests/typecheck/should_fail/tcfail032.stderr | 6 +- .../tests/typecheck/should_fail/tcfail099.stderr | 6 +- .../tests/typecheck/should_fail/tcfail104.stderr | 14 +- .../tests/typecheck/should_fail/tcfail140.stderr | 7 +- .../tests/typecheck/should_fail/tcfail159.stderr | 9 +- .../tests/typecheck/should_fail/tcfail181.stderr | 2 +- 108 files changed, 2081 insertions(+), 1357 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc c600e2383ce069f50b49beb2b86aa88dce68e89a From git at git.haskell.org Mon Jan 25 12:52:27 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Jan 2016 12:52:27 +0000 (UTC) Subject: [commit: ghc] wip/exp-types's head updated: Refactor the typechecker to use ExpTypes. (c600e23) Message-ID: <20160125125227.4F2703A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Branch 'wip/exp-types' now includes: 00c8076 fix typo causing compilation failure on SPARC (ArchSparc -> ArchSPARC) 6cb860a Add -prof stack trace to assert 3e796e1 A little closer to supporting breakpoints with -fexternal-interpreter 88d6d5a Use implicit CallStacks for ASSERT when available d44bc5c TemplateHaskell: revive isStrict, notStrict and unpacked ac3cf68 Add missing type representations e782e88 Add test for Data.Typeable.typeOf c3f9246 Print a message when loading a .ghci file. 6ea24af Handle over-applied custom type errors too. c313327 Minor improvement in CoreDump outputs: c73333a Minor code refactoring 61011b4 users-guide: Wibbles 91dcc65 GHC.Generics: Fix documentation f0c4e46 Add tests for #11391 b0641ad INSTALL.md: Mention -j and other wibbles 78a4c72 Rename InjectiveTypeFamilies to TypeFamilyDependencies 4dbc31b users-guide: Update language extension implications b355b8f users-guide: Add since annotations for language extensions 83c13c2 user-guide: Use ghc-flag for dump formatting flags fd686c4 API Annotations: use AnnValue for (~) db371c1 T11300: Fix test on windows 49e414a Remove lookup of sections by name instead use the index numbers as offsets 91f1c60 Fix #11015 with a nice note. 8959b03 ANNOUNCE: Mention powerpc code generator b90cac6 user-guide: Note Cabal version limitation faf3f96 users-guide: Fix cabal version number c6a3e22 Link command line libs to temp so e7eec3a Use XZ compression by default 7cf16aa Don't output manpage in same directory as source 756b228 Refactor lookupFixityRn-related code following D1744 67fc3f3 configure.ac: Export MAKECMD to build system 443bf04 Allow pattern synonyms which have several clauses. 165ae44 Expand type/kind synonyms in TyVars before deriving-related typechecking e6ca930 Fix #11355. d4af57f Test #11252 in ghci/scripts/T11252 d459f55 Fix #10872. 6c07f14 Fix #11311 3a7f204 Clarify topological sorting of spec vars in manual 39ea4b4 Fix #11254. bafbde7 Constrained types have kind * in validity check. 072191f Fix #11404 33950aa Tiny refactoring in TcUnify 80b4c71 Fix typo in error message (#11409) 3c6635e Fix #11405. 148a50b Fix some typos 3a1babd Work SourceText in for all integer literals 9308c73 Fix a number of subtle solver bugs 3b6a490 Add missing T11408.hs ae1c48c rts/posix: Fail with HEAPOVERFLOW when out of memory during mmap d1ce1aa users-guide: Clean manpage build artifacts and fix usage of clean-target b3eb8fa Complete operators properly 65b810b Show TYPE 'Lifted/TYPE 'Unlifted as */# in Show TypeRep instance f3a867e Add testcase for #11414 2fd407c validate: Use gz compression during bindist check a7b751d un-wire-in error, undefined, CallStack, and IP 5a62b6a Simplify API to tcMatchTys f02200f Layout only cb24e68 Fix typecheck of default associated type decls b7e5c30 White space only 6e0c0fd Improve debug printing/warnings ec8a188 Refactoring on IdInfo and system derived names 8e6a68d Add Trac #11427 to Note [Recursive superclasses] e2c7b7e Implement scoped type variables in pattern synonyms 8e50301 Test Trac #11379 5412899 Typo in comment 817dd92 Fixes to "make clean" for the iserv dir b8abd85 Replace calls to `ptext . sLit` with `text` 240ddd7 Switch from -this-package-key to -this-unit-id. cbc03f1 ghci: Kill global macros list d2ea7f9 Hide derived OccNames from user 38666bd user-guide: Delete errant fragment aff51af users-guide: Begin documenting --frontend 80265c4 Typos in comments 9d33adb Check InScopeSet in substTy and provide substTyUnchecked 713aa90 Re-export ghc-boot:GHC.Serialized as Serialized 952eda2 Fix IfaceType generation for TyCons without TyVars 975bdac T11266: Improve the test by adding more of the other problematic modules 514bac2 Fix combineIdenticalAlts 0373a84 Oops. Add missing close-comment 5cce095 Use (&&) instead of `if` in Ix derivation 84b0ebe Rework derivation of type representations for wired-in things 225afc4 Add test T9407 (Windows) 6ddc991 Update submodule stm + random 48d4bc5 substTy to substTyUnchecked to fix Travis build 1ce1371 MkId: Update OpenKind reference 2e65aae Add comments about tyCoVarsOfType e604e91 Comments only c572430 Re-add missing kind generalisation 6f95e23 Comments only b3ee37c Improve pretty-printing of UnivCo 07afe44 Remove the check_lifted check in TcValidity b2e6350 Strip casts in checkValidInstHead 395ec41 Allow implicit parameters in constraint synonyms ede055e TyCoRep: Restore compatibility with 7.10.1 f23b578 user-guide:: Improve -D description 928484d user-guide: Refer to MIN_VERSION_GLASGOW_HASKELL from intro 3883f99 rel-notes: Note the return of -Wmonomorphism-restriction 7cb893f Update and improve documentation in Data.Foldable 96303db Add a missing .gitignore entry in annotations tests 2ffc260 Add -ignore-dot-ghci to tests that use --interactive 4c4a0a5 Fix docstring GHC.IO.Handle.FD.openFileBLocking 4c11db6 sphinx-build: fix python stack overflow (Trac #10950) b617e9f Improve comments in CmmSwitch 85e147e Always run test T9407 36b174d Add expected stderr for #11466 test case adb721b Make a constraint synonym for repeated BinaryStringRep and use it. 835a2a2 Default non-canonical CallStack constraints 2df4221 Add tests for #11465 and the kind invariant 9048c3d Don't print "Loaded GHCi configuration" message in ghc -e (#11478) 65881c0 Mark some ghci tests as req_interp 6e5f828 Fix a formatting error in the user's guide 4d51bfc Do not count void arguments when considering a function for loopification. b01288d rts: Disable tick timer unless really needed 4e04043 Add test for Trac #11056 f42db15 Remove unused IND_PERM 06c2547 Small doc fix 7cd37c5 Give a more verbose error message when desugaring a HsTypeOut c600e23 Refactor the typechecker to use ExpTypes. From git at git.haskell.org Mon Jan 25 14:13:12 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Jan 2016 14:13:12 +0000 (UTC) Subject: [commit: ghc] master: Show error message for unknown symbol on Elf_Rel platforms (5c82333) Message-ID: <20160125141312.B0AB53A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/5c8233388983a5af9fda5f3395ad28f4e0392f98/ghc >--------------------------------------------------------------- commit 5c8233388983a5af9fda5f3395ad28f4e0392f98 Author: Reid Barton Date: Mon Jan 25 09:12:40 2016 -0500 Show error message for unknown symbol on Elf_Rel platforms Summary: This is already the behavior on Elf_Rela platforms, and is helpful. Reviewers: simonmar, austin, bgamari, erikd Reviewed By: erikd Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1841 >--------------------------------------------------------------- 5c8233388983a5af9fda5f3395ad28f4e0392f98 rts/Linker.c | 1 - 1 file changed, 1 deletion(-) diff --git a/rts/Linker.c b/rts/Linker.c index 1c76a00..b9a1d34 100644 --- a/rts/Linker.c +++ b/rts/Linker.c @@ -5009,7 +5009,6 @@ do_Elf_Rel_relocations ( ObjectCode* oc, char* ehdrC, } else { symbol = strtab + sym.st_name; S_tmp = lookupSymbol_( symbol ); - if (S_tmp == NULL) return 0; S = (Elf_Addr)S_tmp; } if (!S) { From git at git.haskell.org Mon Jan 25 14:13:15 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Jan 2016 14:13:15 +0000 (UTC) Subject: [commit: ghc] master: Comments only: more alternate names for ARM registers [skip ci] (edb30fd) Message-ID: <20160125141315.646E83A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/edb30fd4d21fb7d41fe718fc52a800c93607953f/ghc >--------------------------------------------------------------- commit edb30fd4d21fb7d41fe718fc52a800c93607953f Author: Reid Barton Date: Mon Jan 25 09:13:04 2016 -0500 Comments only: more alternate names for ARM registers [skip ci] Summary: These are the names used by arm-linux-androideabi-objdump, so it's helpful to have them here next to the Stg register mapping. Reviewers: austin, erikd, bgamari Reviewed By: erikd, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1840 >--------------------------------------------------------------- edb30fd4d21fb7d41fe718fc52a800c93607953f includes/stg/MachRegs.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/includes/stg/MachRegs.h b/includes/stg/MachRegs.h index b1a0ef0..ce4ebf4 100644 --- a/includes/stg/MachRegs.h +++ b/includes/stg/MachRegs.h @@ -485,14 +485,15 @@ the stack. See Note [Overlapping global registers] for implications. Here we consider ARM mode (i.e. 32bit isns) and also CPU with full VFPv3 implementation - ARM registers (see Chapter 5.1 in ARM IHI 0042D) + ARM registers (see Chapter 5.1 in ARM IHI 0042D and + Section 9.2.2 in ARM Software Development Toolkit Reference Guide) r15 PC The Program Counter. r14 LR The Link Register. r13 SP The Stack Pointer. r12 IP The Intra-Procedure-call scratch register. - r11 v8 Variable-register 8. - r10 v7 Variable-register 7. + r11 v8/fp Variable-register 8. + r10 v7/sl Variable-register 7. r9 v6/SB/TR Platform register. The meaning of this register is defined by the platform standard. r8 v5 Variable-register 5. From git at git.haskell.org Mon Jan 25 15:03:46 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Jan 2016 15:03:46 +0000 (UTC) Subject: [commit: ghc] master: HscTypes: Fix typo in comment (bc1e085) Message-ID: <20160125150346.F1DBC3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/bc1e085c5dc239b66e970fdc5117aec0933a9a37/ghc >--------------------------------------------------------------- commit bc1e085c5dc239b66e970fdc5117aec0933a9a37 Author: Ben Gamari Date: Sat Jan 23 22:51:51 2016 +0100 HscTypes: Fix typo in comment >--------------------------------------------------------------- bc1e085c5dc239b66e970fdc5117aec0933a9a37 compiler/main/HscTypes.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/main/HscTypes.hs b/compiler/main/HscTypes.hs index 6d43ec0..541f0af 100644 --- a/compiler/main/HscTypes.hs +++ b/compiler/main/HscTypes.hs @@ -399,7 +399,7 @@ data HscEnv hsc_type_env_var :: Maybe (Module, IORef TypeEnv) -- ^ Used for one-shot compilation only, to initialise -- the 'IfGblEnv'. See 'TcRnTypes.tcg_type_env_var' for - -- 'TcRunTypes.TcGblEnv' + -- 'TcRnTypes.TcGblEnv' #ifdef GHCI , hsc_iserv :: MVar (Maybe IServ) From git at git.haskell.org Mon Jan 25 15:03:49 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Jan 2016 15:03:49 +0000 (UTC) Subject: [commit: ghc] master: user-guide: Note order-dependence of flags (128b678) Message-ID: <20160125150349.D7B433A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/128b678061120270d3d4fe3eccd1b7dc76a8de35/ghc >--------------------------------------------------------------- commit 128b678061120270d3d4fe3eccd1b7dc76a8de35 Author: Ben Gamari Date: Mon Jan 25 15:18:13 2016 +0100 user-guide: Note order-dependence of flags This supplements the description previously added in 6400c7687223c5b2141176aa92f7ff987f61aba6. See #10560 for details. Test Plan: read it Reviewers: austin Subscribers: thomie, hvr Differential Revision: https://phabricator.haskell.org/D1831 GHC Trac Issues: #10560 >--------------------------------------------------------------- 128b678061120270d3d4fe3eccd1b7dc76a8de35 docs/users_guide/using.rst | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/docs/users_guide/using.rst b/docs/users_guide/using.rst index 91b6291..3b192ef 100644 --- a/docs/users_guide/using.rst +++ b/docs/users_guide/using.rst @@ -85,6 +85,28 @@ all files; you cannot, for example, invoke ``ghc -c -O1 Foo.hs -O2 Bar.hs`` to apply different optimisation levels to the files ``Foo.hs`` and ``Bar.hs``. +.. note:: + + .. index:: + single: command-line; order of arguments + + Note that command-line options are *order-dependent*, with arguments being + evaluated from left-to-right. This can have seemingly strange effects in the + presence of flag implication. For instance, consider + :ghc-flag:`-fno-specialise` and :ghc-flag:`-O1` (which implies + :ghc-flag:`-fspecialise`). These two command lines mean very different + things: + + ``-fno-specialise -O1`` + + ``-fspecialise`` will be enabled as the ``-fno-specialise`` is overriden + by the ``-O1``. + + ``-O1 -fno-specialise`` + + ``-fspecialise`` will not be enabled, since the ``-fno-specialise`` + overrides the ``-fspecialise`` implied by ``-O1``. + .. _source-file-options: Command line options in source files From git at git.haskell.org Mon Jan 25 15:03:52 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Jan 2016 15:03:52 +0000 (UTC) Subject: [commit: ghc] master: Rename -Wmissing-monadfail-instance to plural-form (132c208) Message-ID: <20160125150352.95D6C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/132c20894d102558cc8f3aee5bc289425d0ddb24/ghc >--------------------------------------------------------------- commit 132c20894d102558cc8f3aee5bc289425d0ddb24 Author: Herbert Valerio Riedel Date: Mon Jan 25 14:51:50 2016 +0100 Rename -Wmissing-monadfail-instance to plural-form This warning flag was recently introduced as part of #10751. However, it was missed during code-review that almost all existing warning flags use a plural-form, so for consistency this commit renames that warning flag to `-Wmissing-monadfail-instances`. Test Plan: local validate (still running) Reviewers: quchen, goldfire, austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1842 GHC Trac Issues: #10751 >--------------------------------------------------------------- 132c20894d102558cc8f3aee5bc289425d0ddb24 compiler/main/DynFlags.hs | 6 +++--- compiler/typecheck/TcMatches.hs | 4 ++-- docs/users_guide/using-warnings.rst | 6 +++--- testsuite/tests/monadfail/MonadFailWarnings.hs | 2 +- testsuite/tests/monadfail/MonadFailWarningsWithRebindableSyntax.hs | 2 +- .../tests/monadfail/MonadFailWarningsWithRebindableSyntax.stderr | 2 +- testsuite/tests/rebindable/rebindable1.hs | 2 +- utils/mkUserGuidePart/Options/Warnings.hs | 4 ++-- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 5189e23..0a7b6d2 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -566,7 +566,7 @@ data WarningFlag = | Opt_WarnWarningsDeprecations | Opt_WarnDeprecatedFlags | Opt_WarnAMP -- Introduced in GHC 7.8, obsolete since 7.10 - | Opt_WarnMissingMonadFailInstance -- since 8.0 + | Opt_WarnMissingMonadFailInstances -- since 8.0 | Opt_WarnSemigroup -- since 8.0 | Opt_WarnDodgyExports | Opt_WarnDodgyImports @@ -2926,7 +2926,7 @@ wWarningFlags = [ flagSpec "missing-import-lists" Opt_WarnMissingImportList, flagSpec "missing-local-sigs" Opt_WarnMissingLocalSigs, flagSpec "missing-methods" Opt_WarnMissingMethods, - flagSpec "missing-monadfail-instance" Opt_WarnMissingMonadFailInstance, + flagSpec "missing-monadfail-instances" Opt_WarnMissingMonadFailInstances, flagSpec "semigroup" Opt_WarnSemigroup, flagSpec "missing-signatures" Opt_WarnMissingSigs, flagSpec "missing-exported-sigs" Opt_WarnMissingExportedSigs, @@ -3526,7 +3526,7 @@ minusWallOpts -- code future compatible to fix issues before they even generate warnings. minusWcompatOpts :: [WarningFlag] minusWcompatOpts - = [ Opt_WarnMissingMonadFailInstance + = [ Opt_WarnMissingMonadFailInstances , Opt_WarnSemigroup , Opt_WarnNonCanonicalMonoidInstances ] diff --git a/compiler/typecheck/TcMatches.hs b/compiler/typecheck/TcMatches.hs index 216f25b..f4d2e12 100644 --- a/compiler/typecheck/TcMatches.hs +++ b/compiler/typecheck/TcMatches.hs @@ -926,7 +926,7 @@ tcMonadFailOp orig pat fail_op res_ty = do { -- Issue MonadFail warnings rebindableSyntax <- xoptM LangExt.RebindableSyntax ; desugarFlag <- xoptM LangExt.MonadFailDesugaring - ; missingWarning <- woptM Opt_WarnMissingMonadFailInstance + ; missingWarning <- woptM Opt_WarnMissingMonadFailInstances ; if | rebindableSyntax && (desugarFlag || missingWarning) -> warnRebindableClash pat | not desugarFlag && missingWarning @@ -956,7 +956,7 @@ warnRebindableClash pattern = addWarnAt (getLoc pattern) nest 2 (text "is used together with -XRebindableSyntax." <+> text "If this is intentional," $$ - text "compile with -fno-warn-missing-monadfail-instance.")) + text "compile with -Wno-missing-monadfail-instances.")) {- Note [typechecking ApplicativeStmt] diff --git a/docs/users_guide/using-warnings.rst b/docs/users_guide/using-warnings.rst index fb9c913..de8be63 100644 --- a/docs/users_guide/using-warnings.rst +++ b/docs/users_guide/using-warnings.rst @@ -78,7 +78,7 @@ The following flags are simple ways to select standard "packages" of warnings: .. hlist:: :columns: 3 - * :ghc-flag:`-Wmissing-monadfail-instance` + * :ghc-flag:`-Wmissing-monadfail-instances` * :ghc-flag:`-Wsemigroup` * :ghc-flag:`-Wnoncanonical-monoid-instances` @@ -242,7 +242,7 @@ of ``-W(no-)*``. * Warn if ``fail`` is defined backwards (i.e. ``fail = Control.Monad.fail``). - See also :ghc-flag:`-Wmissing-monadfail-instance`. + See also :ghc-flag:`-Wmissing-monadfail-instances`. This option is off by default. @@ -266,7 +266,7 @@ of ``-W(no-)*``. This warning is off by default. However, it is part of the :ghc-flag:`-Wcompat` option group. -.. ghc-flag:: -Wmissing-monadfail-instance +.. ghc-flag:: -Wmissing-monadfail-instances .. index:: single: MFP diff --git a/testsuite/tests/monadfail/MonadFailWarnings.hs b/testsuite/tests/monadfail/MonadFailWarnings.hs index 3b786cc..a1d3729 100644 --- a/testsuite/tests/monadfail/MonadFailWarnings.hs +++ b/testsuite/tests/monadfail/MonadFailWarnings.hs @@ -2,7 +2,7 @@ -- Ensure that MonadFail warnings are issued correctly if the warning flag -- is enabled -{-# OPTIONS_GHC -fwarn-missing-monadfail-instance #-} +{-# OPTIONS_GHC -Wmissing-monadfail-instances #-} module MonadFailWarnings where diff --git a/testsuite/tests/monadfail/MonadFailWarningsWithRebindableSyntax.hs b/testsuite/tests/monadfail/MonadFailWarningsWithRebindableSyntax.hs index c9f2502..6126e24 100644 --- a/testsuite/tests/monadfail/MonadFailWarningsWithRebindableSyntax.hs +++ b/testsuite/tests/monadfail/MonadFailWarningsWithRebindableSyntax.hs @@ -2,7 +2,7 @@ -- RebindableSyntax does not play that well with MonadFail, so here we ensure -- that when both settings are enabled we get the proper warning. -{-# OPTIONS_GHC -fwarn-missing-monadfail-instance #-} +{-# OPTIONS_GHC -Wmissing-monadfail-instances #-} {-# LANGUAGE RebindableSyntax #-} module MonadFailWarningsWithRebindableSyntax where diff --git a/testsuite/tests/monadfail/MonadFailWarningsWithRebindableSyntax.stderr b/testsuite/tests/monadfail/MonadFailWarningsWithRebindableSyntax.stderr index 819c878..9610f89 100644 --- a/testsuite/tests/monadfail/MonadFailWarningsWithRebindableSyntax.stderr +++ b/testsuite/tests/monadfail/MonadFailWarningsWithRebindableSyntax.stderr @@ -2,4 +2,4 @@ MonadFailWarningsWithRebindableSyntax.hs:13:5: warning: The failable pattern ?Just x? is used together with -XRebindableSyntax. If this is intentional, - compile with -fno-warn-missing-monadfail-instance. + compile with -Wno-missing-monadfail-instances. diff --git a/testsuite/tests/rebindable/rebindable1.hs b/testsuite/tests/rebindable/rebindable1.hs index 7bf3e23..4ff8ed2 100644 --- a/testsuite/tests/rebindable/rebindable1.hs +++ b/testsuite/tests/rebindable/rebindable1.hs @@ -1,4 +1,4 @@ -{-# OPTIONS_GHC -fno-warn-missing-monadfail-instance #-} +{-# OPTIONS_GHC -Wno-missing-monadfail-instances #-} {-# LANGUAGE RebindableSyntax, NPlusKPatterns #-} module RebindableCase1 where diff --git a/utils/mkUserGuidePart/Options/Warnings.hs b/utils/mkUserGuidePart/Options/Warnings.hs index 0c5260f..3c69de7 100644 --- a/utils/mkUserGuidePart/Options/Warnings.hs +++ b/utils/mkUserGuidePart/Options/Warnings.hs @@ -152,12 +152,12 @@ warningsOptions = , flagType = DynamicFlag , flagReverse = "-Wno-missing-local-sigs" } - , flag { flagName = "-Wmissing-monadfail-instance" + , flag { flagName = "-Wmissing-monadfail-instances" , flagDescription = "warn when a failable pattern is used in a do-block that does " ++ "not have a ``MonadFail`` instance." , flagType = DynamicFlag - , flagReverse = "-Wno-missing-monadfail-instance" + , flagReverse = "-Wno-missing-monadfail-instances" } , flag { flagName = "-Wsemigroup" , flagDescription = From git at git.haskell.org Mon Jan 25 15:03:55 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Jan 2016 15:03:55 +0000 (UTC) Subject: [commit: ghc] master: Better document behavior of -Wmissed-specialisations (6e2658f) Message-ID: <20160125150355.47CAF3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/6e2658f67bcdbc7fd0ebd2ef6abcd13a6bec80bc/ghc >--------------------------------------------------------------- commit 6e2658f67bcdbc7fd0ebd2ef6abcd13a6bec80bc Author: Ben Gamari Date: Mon Jan 25 15:18:04 2016 +0100 Better document behavior of -Wmissed-specialisations Test Plan: Read it Reviewers: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1829 >--------------------------------------------------------------- 6e2658f67bcdbc7fd0ebd2ef6abcd13a6bec80bc docs/users_guide/using-warnings.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/users_guide/using-warnings.rst b/docs/users_guide/using-warnings.rst index de8be63..4f9a741 100644 --- a/docs/users_guide/using-warnings.rst +++ b/docs/users_guide/using-warnings.rst @@ -19,7 +19,6 @@ generally likely to indicate bugs in your program. These are: * :ghc-flag:`-Wwarnings-deprecations` * :ghc-flag:`-Wdeprecated-flags` * :ghc-flag:`-Wunrecognised-pragmas` - * :ghc-flag:`-Wmissed-specialisations` * :ghc-flag:`-Wduplicate-constraints` * :ghc-flag:`-Wduplicate-exports` * :ghc-flag:`-Woverflowed-literals` @@ -180,6 +179,8 @@ of ``-W(no-)*``. that is marked as ``INLINEABLE`` (presumably to enable specialisation) cannot be specialised as it calls other functions that are themselves not specialised. + Note that these warnings will not throw errors if used with :ghc-flag:`-Werror`. + These options are both off by default. .. ghc-flag:: -Wwarnings-deprecations From git at git.haskell.org Mon Jan 25 15:57:11 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Jan 2016 15:57:11 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: TyCoRep: Restore compatibility with GHC 7.8 (d6adfaa) Message-ID: <20160125155711.C90C03A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/d6adfaaa7333b0ba47d27756d228905a46ec96ca/ghc >--------------------------------------------------------------- commit d6adfaaa7333b0ba47d27756d228905a46ec96ca Author: Ben Gamari Date: Sat Jan 23 18:00:38 2016 +0100 TyCoRep: Restore compatibility with GHC 7.8 MIN_VERSION_GLASGOW_HASKELL was only introduced in 7.10. >--------------------------------------------------------------- d6adfaaa7333b0ba47d27756d228905a46ec96ca compiler/types/TyCoRep.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/types/TyCoRep.hs b/compiler/types/TyCoRep.hs index 1522464..4a92bdf 100644 --- a/compiler/types/TyCoRep.hs +++ b/compiler/types/TyCoRep.hs @@ -151,7 +151,7 @@ import UniqFM import qualified Data.Data as Data hiding ( TyCon ) import Data.List import Data.IORef ( IORef ) -- for CoercionHole -#if MIN_VERSION_GLASGOW_HASKELL(7,10,2,0) +#if __GLASGOW_HASKELL__ > 710 import GHC.Stack (CallStack) #endif @@ -1821,7 +1821,7 @@ isValidTCvSubst (TCvSubst in_scope tenv cenv) = substTy :: -- CallStack wasn't present in GHC 7.10.1, disable callstacks in stage 1 -#if MIN_VERSION_GLASGOW_HASKELL(7,10,2,0) +#if __GLASGOW_HASKELL__ > 710 (?callStack :: CallStack) => #endif TCvSubst -> Type -> Type From git at git.haskell.org Mon Jan 25 15:57:14 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Jan 2016 15:57:14 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Add test for #11473 (4eed412) Message-ID: <20160125155714.E41DC3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/4eed4126d2f8a6afd8cc342a56ac5a4534188925/ghc >--------------------------------------------------------------- commit 4eed4126d2f8a6afd8cc342a56ac5a4534188925 Author: Ben Gamari Date: Fri Jan 22 13:33:36 2016 +0100 Add test for #11473 (cherry picked from commit 89bdac7635e6ed08927d760aa885d3e7ef3edb81) >--------------------------------------------------------------- 4eed4126d2f8a6afd8cc342a56ac5a4534188925 testsuite/tests/typecheck/should_fail/T11473.hs | 20 ++++++++++++++++++++ testsuite/tests/typecheck/should_fail/all.T | 1 + 2 files changed, 21 insertions(+) diff --git a/testsuite/tests/typecheck/should_fail/T11473.hs b/testsuite/tests/typecheck/should_fail/T11473.hs new file mode 100644 index 0000000..cb9f791 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T11473.hs @@ -0,0 +1,20 @@ +{-# LANGUAGE PolyKinds, TypeFamilies, MagicHash, DataKinds, TypeInType, RankNTypes #-} + +module T11473 where +import GHC.Exts +import GHC.Types + +type family Boxed (a :: k) :: * +type instance Boxed Char# = Char +type instance Boxed Char = Char + +class BoxIt (a :: TYPE lev) where + boxed :: a -> Boxed a + +instance BoxIt Char# where boxed x = C# x +instance BoxIt Char where boxed = id + +-- This should be an error: there is no way we can produce code for both Lifted +-- and Unlifted levities +hello :: forall (lev :: Levity). forall (a :: TYPE lev). BoxIt a => a -> Boxed a +hello x = boxed x diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T index 1c4e86e..3b090f7 100644 --- a/testsuite/tests/typecheck/should_fail/all.T +++ b/testsuite/tests/typecheck/should_fail/all.T @@ -404,3 +404,4 @@ test('T11347', normal, compile_fail, ['']) test('T11356', normal, compile_fail, ['']) test('T11355', normal, compile_fail, ['']) test('T11464', normal, compile_fail, ['']) +test('T11473', expect_broken(11473), compile_fail, ['']) From git at git.haskell.org Mon Jan 25 15:57:18 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Jan 2016 15:57:18 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Don't print "Loaded GHCi configuration" message in ghc -e (#11478) (70f01d0) Message-ID: <20160125155718.03A5D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/70f01d0ec4953eff985c856f5c9c3179e96fa8eb/ghc >--------------------------------------------------------------- commit 70f01d0ec4953eff985c856f5c9c3179e96fa8eb Author: Reid Barton Date: Fri Jan 22 09:59:20 2016 -0500 Don't print "Loaded GHCi configuration" message in ghc -e (#11478) Summary: Also don't print it if the user specifically requested non-verbose output with -v0. Since this means there is no longer any test that checks for the message, add such a test. Test Plan: validate Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1817 GHC Trac Issues: #11478 (cherry picked from commit 9048c3dfee1c7c9171114c349714095b3abcc47a) >--------------------------------------------------------------- 70f01d0ec4953eff985c856f5c9c3179e96fa8eb ghc/GHCi/UI.hs | 6 +++++- testsuite/tests/ghc-e/should_run/Makefile | 4 ++++ .../tests/ghc-e/should_run/T11478.script | 0 .../4876.stdout => testsuite/tests/ghc-e/should_run/T11478.stdout | 0 testsuite/tests/ghc-e/should_run/all.T | 1 + testsuite/tests/ghci/scripts/Makefile | 7 +++++++ testsuite/tests/ghci/scripts/T10408.stdout | 2 -- .../IO/T4144.stdout => testsuite/tests/ghci/scripts/T11389.script | 0 testsuite/tests/ghci/scripts/T11389.stdout | 1 + testsuite/tests/ghci/scripts/all.T | 2 ++ 10 files changed, 20 insertions(+), 3 deletions(-) diff --git a/ghc/GHCi/UI.hs b/ghc/GHCi/UI.hs index 30e70e0..fc03b5f 100644 --- a/ghc/GHCi/UI.hs +++ b/ghc/GHCi/UI.hs @@ -527,7 +527,11 @@ runGHCi paths maybe_exprs = do do runInputTWithPrefs defaultPrefs defaultSettings $ runCommands $ fileLoop hdl liftIO (hClose hdl `catchIO` \_ -> return ()) - liftIO $ putStrLn ("Loaded GHCi configuration from " ++ file) + -- Don't print a message if this is really ghc -e (#11478). + -- Also, let the user silence the message with -v0 + -- (the default verbosity in GHCi is 1). + when (isNothing maybe_exprs && verbosity dflags > 0) $ + liftIO $ putStrLn ("Loaded GHCi configuration from " ++ file) -- diff --git a/testsuite/tests/ghc-e/should_run/Makefile b/testsuite/tests/ghc-e/should_run/Makefile index 54ce8a3..c98b98a 100644 --- a/testsuite/tests/ghc-e/should_run/Makefile +++ b/testsuite/tests/ghc-e/should_run/Makefile @@ -41,3 +41,7 @@ T9905: T9905b: '$(TEST_HC)' $(TEST_HC_OPTS) -ignore-dot-ghci -e "import qualified Data.List as L" -e "L.sort [2,1]" + +# Ensure that ghc -e does not output extra messages about GHCi configuration files +T11478: + '$(TEST_HC)' $(TEST_HC_OPTS) -ignore-dot-ghci -ghci-script T11478.script -e 3 diff --git a/libraries/base/tests/IO/misc001.stdout b/testsuite/tests/ghc-e/should_run/T11478.script similarity index 100% copy from libraries/base/tests/IO/misc001.stdout copy to testsuite/tests/ghc-e/should_run/T11478.script diff --git a/libraries/base/tests/Concurrent/4876.stdout b/testsuite/tests/ghc-e/should_run/T11478.stdout similarity index 100% copy from libraries/base/tests/Concurrent/4876.stdout copy to testsuite/tests/ghc-e/should_run/T11478.stdout diff --git a/testsuite/tests/ghc-e/should_run/all.T b/testsuite/tests/ghc-e/should_run/all.T index dcb7207..ae28653 100644 --- a/testsuite/tests/ghc-e/should_run/all.T +++ b/testsuite/tests/ghc-e/should_run/all.T @@ -16,3 +16,4 @@ test('T7299', req_interp, run_command, ['$MAKE --no-print-directory -s T7299']) test('T9086', req_interp, run_command, ['$MAKE --no-print-directory -s T9086']) test('T9905', req_interp, run_command, ['$MAKE --no-print-directory -s T9905']) test('T9905b', req_interp, run_command, ['$MAKE --no-print-directory -s T9905b']) +test('T11478', req_interp, run_command, ['$MAKE --no-print-directory -s T11478']) diff --git a/testsuite/tests/ghci/scripts/Makefile b/testsuite/tests/ghci/scripts/Makefile index 017555b..0b70318 100644 --- a/testsuite/tests/ghci/scripts/Makefile +++ b/testsuite/tests/ghci/scripts/Makefile @@ -54,3 +54,10 @@ T10408: # and not be ignored when `-ignore-dot-ghci` is specified. '$(TEST_HC)' $(TEST_HC_OPTS) --interactive -v0 -ignore-dot-ghci \ -ghci-script T10408A.script -ghci-script T10408B.script < /dev/null + +.PHONY: T11389 +T11389: + # Test that "Loaded GHCi configuration" message is printed by default + # (without -v0) + '$(TEST_HC)' $(TEST_HC_OPTS) --interactive -ignore-dot-ghci \ + -ghci-script T11389.script < /dev/null | grep 'configuration' diff --git a/testsuite/tests/ghci/scripts/T10408.stdout b/testsuite/tests/ghci/scripts/T10408.stdout index cef83bc..b13d0a4 100644 --- a/testsuite/tests/ghci/scripts/T10408.stdout +++ b/testsuite/tests/ghci/scripts/T10408.stdout @@ -1,4 +1,2 @@ "T10408A" -Loaded GHCi configuration from T10408A.script "T10408B" -Loaded GHCi configuration from T10408B.script diff --git a/libraries/base/tests/IO/T4144.stdout b/testsuite/tests/ghci/scripts/T11389.script similarity index 100% copy from libraries/base/tests/IO/T4144.stdout copy to testsuite/tests/ghci/scripts/T11389.script diff --git a/testsuite/tests/ghci/scripts/T11389.stdout b/testsuite/tests/ghci/scripts/T11389.stdout new file mode 100644 index 0000000..c92bf91 --- /dev/null +++ b/testsuite/tests/ghci/scripts/T11389.stdout @@ -0,0 +1 @@ +Loaded GHCi configuration from T11389.script diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T index 17bee5f..d954899 100755 --- a/testsuite/tests/ghci/scripts/all.T +++ b/testsuite/tests/ghci/scripts/all.T @@ -240,3 +240,5 @@ test('T10576b', expect_broken(10576), ghci_script, ['T10576b.script']) test('T11051a', normal, ghci_script, ['T11051a.script']) test('T11051b', normal, ghci_script, ['T11051b.script']) test('T11266', check_stdout(lambda *args: 1), ghci_script, ['T11266.script']) + +test('T11389', req_interp, run_command, ['$MAKE -s --no-print-directory T11389']) From git at git.haskell.org Mon Jan 25 15:57:20 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Jan 2016 15:57:20 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Mark some ghci tests as req_interp (5627ff4) Message-ID: <20160125155720.A8CC53A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/5627ff4b37f69edbf220d88b5072b9808b0fcfc9/ghc >--------------------------------------------------------------- commit 5627ff4b37f69edbf220d88b5072b9808b0fcfc9 Author: Reid Barton Date: Fri Jan 22 10:00:27 2016 -0500 Mark some ghci tests as req_interp Test Plan: validate Reviewers: bgamari, austin Reviewed By: bgamari, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1819 (cherry picked from commit 65881c014f81f62f90dcb0977528411010b1d1a7) >--------------------------------------------------------------- 5627ff4b37f69edbf220d88b5072b9808b0fcfc9 testsuite/tests/ghci/scripts/all.T | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T index d954899..d7af290 100755 --- a/testsuite/tests/ghci/scripts/all.T +++ b/testsuite/tests/ghci/scripts/all.T @@ -39,11 +39,11 @@ test('ghci022', normal, ghci_script, ['ghci022.script']) test('ghci023', normal, ghci_script, ['ghci023.script']) test('ghci024', - when(fast(), skip), + [req_interp, when(fast(), skip)], run_command, ['$MAKE -s --no-print-directory ghci024']) test('T9367', - when(fast() or config.os != 'mingw32', skip), + [req_interp, when(fast() or config.os != 'mingw32', skip)], run_command, ['$MAKE -s --no-print-directory T9367']) test('ghci025', normal, ghci_script, ['ghci025.script']) @@ -215,7 +215,7 @@ test('T10122', normal, ghci_script, ['T10122.script']) test('T10321', normal, ghci_script, ['T10321.script']) -test('T10408', normal, run_command, +test('T10408', req_interp, run_command, ['$MAKE -s --no-print-directory T10408']) test('T10248', normal, ghci_script, ['T10248.script']) test('T10110', normal, ghci_script, ['T10110.script']) From git at git.haskell.org Mon Jan 25 15:57:23 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Jan 2016 15:57:23 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Fix a formatting error in the user's guide (0ace13a) Message-ID: <20160125155723.5BA383A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/0ace13a486503cb17e6c9b5ed650f14247c78865/ghc >--------------------------------------------------------------- commit 0ace13a486503cb17e6c9b5ed650f14247c78865 Author: Eric Seidel Date: Fri Jan 22 16:16:46 2016 +0100 Fix a formatting error in the user's guide ``` ``CallStack``s ``` seems to confuse ReST into producing an extended code-span ``` ``CallStack``\s ``` fixes it, but there may be a better solution Test Plan: build the user's guide and inspect the last paragraph of "9.14.4.5. Implicit CallStacks" Reviewers: bgamari Reviewed By: bgamari Projects: #ghc Differential Revision: https://phabricator.haskell.org/D1798 (cherry picked from commit 6e5f8285005895fe4f1915ddea99b72f8ee91834) >--------------------------------------------------------------- 0ace13a486503cb17e6c9b5ed650f14247c78865 docs/users_guide/glasgow_exts.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index 656b9d8..f4eb7e2 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -8125,7 +8125,7 @@ ordinary implicit parameters. ``GHC.Stack`` additionally exports a function ``freezeCallStack`` that allows users to freeze a ``CallStack``, preventing any future push operations from having an effect. This can be used by library authors -to prevent ``CallStack``s from exposing unecessary implementation +to prevent ``CallStack``\s from exposing unecessary implementation details. Consider the ``head`` example above, the ``myerror`` line in the printed stack is not particularly enlightening, so we might choose to surpress it by freezing the ``CallStack`` that we pass to ``myerror``. From git at git.haskell.org Mon Jan 25 15:57:26 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Jan 2016 15:57:26 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Do not count void arguments when considering a function for loopification. (4b4d4c3) Message-ID: <20160125155726.138A03A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/4b4d4c34cb10ba34fa25e90bdd3b381440f9c43d/ghc >--------------------------------------------------------------- commit 4b4d4c34cb10ba34fa25e90bdd3b381440f9c43d Author: Jonas Scholl Date: Fri Jan 22 16:21:57 2016 +0100 Do not count void arguments when considering a function for loopification. This fixes #11372 by omitting arguments with a void-type when checking whether a self-recursive tail call can be optimized to a local jump. Previously, a function taking a real argument and a State# token would report an arity of 1 in the SelfLoopInfo in getCallMethod, but a self-recursive call would apply it to 2 arguments, one of them being the State# token, thus no local jump would be generated. As the State# token is not represented by anything at runtime, we can ignore it and thus trigger the loopification optimization. Test Plan: ./validate Reviewers: austin, bgamari, simonmar Reviewed By: bgamari Subscribers: simonmar, thomie Differential Revision: https://phabricator.haskell.org/D1767 GHC Trac Issues: #11372 (cherry picked from commit 4d51bfc8975f9c6c3ab6d293c48f98da85210d5f) >--------------------------------------------------------------- 4b4d4c34cb10ba34fa25e90bdd3b381440f9c43d compiler/codeGen/StgCmmClosure.hs | 29 +++++++++++++++++------------ compiler/codeGen/StgCmmExpr.hs | 34 +++++++++++++++++++++++++++++----- 2 files changed, 46 insertions(+), 17 deletions(-) diff --git a/compiler/codeGen/StgCmmClosure.hs b/compiler/codeGen/StgCmmClosure.hs index d3b9fac..97224c6 100644 --- a/compiler/codeGen/StgCmmClosure.hs +++ b/compiler/codeGen/StgCmmClosure.hs @@ -496,6 +496,7 @@ getCallMethod :: DynFlags -- itself -> LambdaFormInfo -- Its info -> RepArity -- Number of available arguments + -> RepArity -- Number of them being void arguments -> CgLoc -- Passed in from cgIdApp so that we can -- handle let-no-escape bindings and self-recursive -- tail calls using the same data constructor, @@ -504,30 +505,34 @@ getCallMethod :: DynFlags -> Maybe SelfLoopInfo -- can we perform a self-recursive tail call? -> CallMethod -getCallMethod dflags _ id _ n_args _cg_loc (Just (self_loop_id, block_id, args)) - | gopt Opt_Loopification dflags, id == self_loop_id, n_args == length args +getCallMethod dflags _ id _ n_args v_args _cg_loc + (Just (self_loop_id, block_id, args)) + | gopt Opt_Loopification dflags + , id == self_loop_id + , n_args - v_args == length args -- If these patterns match then we know that: -- * loopification optimisation is turned on -- * function is performing a self-recursive call in a tail position - -- * number of parameters of the function matches functions arity. - -- See Note [Self-recursive tail calls] in StgCmmExpr for more details + -- * number of non-void parameters of the function matches functions arity. + -- See Note [Self-recursive tail calls] and Note [Void arguments in + -- self-recursive tail calls] in StgCmmExpr for more details = JumpToIt block_id args -getCallMethod dflags name id (LFReEntrant _ arity _ _) n_args _cg_loc +getCallMethod dflags name id (LFReEntrant _ arity _ _) n_args _v_args _cg_loc _self_loop_info | n_args == 0 = ASSERT( arity /= 0 ) ReturnIt -- No args at all | n_args < arity = SlowCall -- Not enough args | otherwise = DirectEntry (enterIdLabel dflags name (idCafInfo id)) arity -getCallMethod _ _name _ LFUnLifted n_args _cg_loc _self_loop_info +getCallMethod _ _name _ LFUnLifted n_args _v_args _cg_loc _self_loop_info = ASSERT( n_args == 0 ) ReturnIt -getCallMethod _ _name _ (LFCon _) n_args _cg_loc _self_loop_info +getCallMethod _ _name _ (LFCon _) n_args _v_args _cg_loc _self_loop_info = ASSERT( n_args == 0 ) ReturnIt getCallMethod dflags name id (LFThunk _ _ updatable std_form_info is_fun) - n_args _cg_loc _self_loop_info + n_args _v_args _cg_loc _self_loop_info | is_fun -- it *might* be a function, so we must "call" it (which is always safe) = SlowCall -- We cannot just enter it [in eval/apply, the entry code -- is the fast-entry code] @@ -558,18 +563,18 @@ getCallMethod dflags name id (LFThunk _ _ updatable std_form_info is_fun) DirectEntry (thunkEntryLabel dflags name (idCafInfo id) std_form_info updatable) 0 -getCallMethod _ _name _ (LFUnknown True) _n_arg _cg_locs _self_loop_info +getCallMethod _ _name _ (LFUnknown True) _n_arg _v_args _cg_locs _self_loop_info = SlowCall -- might be a function -getCallMethod _ name _ (LFUnknown False) n_args _cg_loc _self_loop_info +getCallMethod _ name _ (LFUnknown False) n_args _v_args _cg_loc _self_loop_info = ASSERT2( n_args == 0, ppr name <+> ppr n_args ) EnterIt -- Not a function -getCallMethod _ _name _ LFLetNoEscape _n_args (LneLoc blk_id lne_regs) +getCallMethod _ _name _ LFLetNoEscape _n_args _v_args (LneLoc blk_id lne_regs) _self_loop_info = JumpToIt blk_id lne_regs -getCallMethod _ _ _ _ _ _ _ = panic "Unknown call method" +getCallMethod _ _ _ _ _ _ _ _ = panic "Unknown call method" ----------------------------------------------------------------------------- -- staticClosureRequired diff --git a/compiler/codeGen/StgCmmExpr.hs b/compiler/codeGen/StgCmmExpr.hs index de23443..2718cef 100644 --- a/compiler/codeGen/StgCmmExpr.hs +++ b/compiler/codeGen/StgCmmExpr.hs @@ -699,8 +699,10 @@ cgIdApp fun_id args = do fun_name = idName cg_fun_id fun = idInfoToAmode fun_info lf_info = cg_lf fun_info + n_args = length args + v_args = length $ filter (isVoidTy . stgArgType) args node_points dflags = nodeMustPointToIt dflags lf_info - case (getCallMethod dflags fun_name cg_fun_id lf_info (length args) (cg_loc fun_info) self_loop_info) of + case getCallMethod dflags fun_name cg_fun_id lf_info n_args v_args (cg_loc fun_info) self_loop_info of -- A value in WHNF, so we can just return it. ReturnIt -> emitReturn [fun] -- ToDo: does ReturnIt guarantee tagged? @@ -804,14 +806,36 @@ cgIdApp fun_id args = do -- of call will be generated. getCallMethod decides to generate a self -- recursive tail call when (a) environment stores information about -- possible self tail-call; (b) that tail call is to a function currently --- being compiled; (c) number of passed arguments is equal to function's --- arity. (d) loopification is turned on via -floopification command-line --- option. +-- being compiled; (c) number of passed non-void arguments is equal to +-- function's arity. (d) loopification is turned on via -floopification +-- command-line option. -- -- * Command line option to turn loopification on and off is implemented in -- DynFlags. -- - +-- +-- Note [Void arguments in self-recursive tail calls] +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-- +-- State# tokens can get in the way of the loopification optimization as seen in +-- #11372. Consider this: +-- +-- foo :: [a] +-- -> (a -> State# s -> (# State s, Bool #)) +-- -> State# s +-- -> (# State# s, Maybe a #) +-- foo [] f s = (# s, Nothing #) +-- foo (x:xs) f s = case f x s of +-- (# s', b #) -> case b of +-- True -> (# s', Just x #) +-- False -> foo xs f s' +-- +-- We would like to compile the call to foo as a local jump instead of a call +-- (see Note [Self-recursive tail calls]). However, the generated function has +-- an arity of 2 while we apply it to 3 arguments, one of them being of void +-- type. Thus, we mustn't count arguments of void type when checking whether +-- we can turn a call into a self-recursive jump. +-- emitEnter :: CmmExpr -> FCode ReturnKind emitEnter fun = do From git at git.haskell.org Mon Jan 25 15:57:29 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Jan 2016 15:57:29 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Add test for Trac #11056 (46d7840) Message-ID: <20160125155729.4FFB23A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/46d784021737912706f21fcee40e3750dc2dcd9c/ghc >--------------------------------------------------------------- commit 46d784021737912706f21fcee40e3750dc2dcd9c Author: RyanGlScott Date: Sat Jan 23 13:03:26 2016 +0100 Add test for Trac #11056 Reviewers: thomie, austin, bgamari Reviewed By: bgamari Subscribers: rwbarton Differential Revision: https://phabricator.haskell.org/D1823 GHC Trac Issues: #11056 (cherry picked from commit 4e04043d1bb458439d3c3db3ffa9851bff780083) >--------------------------------------------------------------- 46d784021737912706f21fcee40e3750dc2dcd9c testsuite/tests/typecheck/should_compile/T11056.hs | 14 ++++++++++++++ testsuite/tests/typecheck/should_compile/all.T | 1 + 2 files changed, 15 insertions(+) diff --git a/testsuite/tests/typecheck/should_compile/T11056.hs b/testsuite/tests/typecheck/should_compile/T11056.hs new file mode 100644 index 0000000..ffb843b --- /dev/null +++ b/testsuite/tests/typecheck/should_compile/T11056.hs @@ -0,0 +1,14 @@ +{-# LANGUAGE PolyKinds, DataKinds #-} +module T11056 where +import Data.Typeable + +data T = A | B Int + +bar :: TypeRep +bar = typeRep (Proxy :: Proxy '[True]) + +baz :: TypeRep +baz = typeRep (Proxy :: Proxy 'A) + +quux :: TypeRep +quux = typeRep (Proxy :: Proxy 'B) diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T index 90f42bf..7d7ec60 100644 --- a/testsuite/tests/typecheck/should_compile/all.T +++ b/testsuite/tests/typecheck/should_compile/all.T @@ -480,6 +480,7 @@ test('T10642', normal, compile, ['']) test('T10744', normal, compile, ['']) test('update-existential', normal, compile, ['']) test('T10347', expect_broken(10347), compile, ['']) +test('T11056', normal, compile, ['']) test('T10770a', expect_broken(10770), compile, ['']) test('T10770b', expect_broken(10770), compile, ['']) test('T10935', normal, compile, ['']) From git at git.haskell.org Mon Jan 25 15:57:32 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Jan 2016 15:57:32 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Small doc fix (07dc7fc) Message-ID: <20160125155732.0F8453A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/07dc7fc4ba38dace276b446a1149c7e36ec39024/ghc >--------------------------------------------------------------- commit 07dc7fc4ba38dace276b446a1149c7e36ec39024 Author: Adam Sandberg Eriksson Date: Sat Jan 23 13:13:07 2016 +0100 Small doc fix Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1828 (cherry picked from commit 06c2547326773db85af9c8a076d6ad2710aa5912) >--------------------------------------------------------------- 07dc7fc4ba38dace276b446a1149c7e36ec39024 docs/users_guide/glasgow_exts.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index f4eb7e2..769acd4 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -12623,7 +12623,7 @@ optionally had by adding ``!`` in front of a variable. ``Strict`` implies :ref:`StrictData `. -- **Function definitions.** +- **Function definitions** When the user writes :: @@ -12635,7 +12635,7 @@ optionally had by adding ``!`` in front of a variable. Adding ``~`` in front of ``x`` gives the regular lazy behavior. -- **Let/where bindings.** +- **Let/where bindings** When the user writes :: @@ -12691,7 +12691,7 @@ optionally had by adding ``!`` in front of a variable. all get implicit bangs on the ``x`` pattern. -- ** Nested patterns ** +- **Nested patterns** Notice that we do *not* put bangs on nested patterns. For example :: @@ -12710,7 +12710,7 @@ optionally had by adding ``!`` in front of a variable. :ref:`strict-modularity` below). So ``p`` and ``q`` may end up bound to undefined. See also :ref:`recursive-and-polymorphic-let-bindings` below. -- **Top level bindings.** +- **Top level bindings** are unaffected by ``Strict``. For example: :: @@ -12720,7 +12720,7 @@ optionally had by adding ``!`` in front of a variable. Here ``x`` and the pattern binding ``(y,z)`` remain lazy. Reason: there is no good moment to force them, until first use. -- **Newtypes.** +- **Newtypes** There is no effect on newtypes, which simply rename existing types. For example: :: From git at git.haskell.org Mon Jan 25 15:57:34 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Jan 2016 15:57:34 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Give a more verbose error message when desugaring a HsTypeOut (ddbb711) Message-ID: <20160125155734.CC9483A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/ddbb7116495a7a5b52ace5429bea16da56d8a555/ghc >--------------------------------------------------------------- commit ddbb7116495a7a5b52ace5429bea16da56d8a555 Author: Reid Barton Date: Sat Jan 23 13:13:31 2016 +0100 Give a more verbose error message when desugaring a HsTypeOut Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1826 (cherry picked from commit 7cd37c599fa83817b51234ff2ff79e4e4896b117) >--------------------------------------------------------------- ddbb7116495a7a5b52ace5429bea16da56d8a555 compiler/deSugar/DsExpr.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/compiler/deSugar/DsExpr.hs b/compiler/deSugar/DsExpr.hs index 22a8707..c3c17c7 100644 --- a/compiler/deSugar/DsExpr.hs +++ b/compiler/deSugar/DsExpr.hs @@ -732,10 +732,14 @@ dsExpr (EAsPat {}) = panic "dsExpr:EAsPat" dsExpr (EViewPat {}) = panic "dsExpr:EViewPat" dsExpr (ELazyPat {}) = panic "dsExpr:ELazyPat" dsExpr (HsType {}) = panic "dsExpr:HsType" -- removed by typechecker -dsExpr (HsTypeOut {}) = panic "dsExpr:HsTypeOut" -- handled in HsApp case dsExpr (HsDo {}) = panic "dsExpr:HsDo" dsExpr (HsRecFld {}) = panic "dsExpr:HsRecFld" +-- Normally handled in HsApp case, but a GHC API user might try to desugar +-- an HsTypeOut, since it is an HsExpr in a typechecked module after all. +-- (Such as ghci itself, in #11456.) So improve the error message slightly. +dsExpr (HsTypeOut {}) + = panic "dsExpr: tried to desugar a naked type application argument (HsTypeOut)" findField :: [LHsRecField Id arg] -> Name -> [arg] findField rbinds sel From git at git.haskell.org Mon Jan 25 15:57:37 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Jan 2016 15:57:37 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Remove -Wredundant-superclasses from standard warnings (57bce48) Message-ID: <20160125155737.873CB3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/57bce48fccc3e8034767dff0d308f88ecbb907ec/ghc >--------------------------------------------------------------- commit 57bce48fccc3e8034767dff0d308f88ecbb907ec Author: Ben Gamari Date: Sat Jan 23 18:40:33 2016 +0100 Remove -Wredundant-superclasses from standard warnings It is impossible to write warning-free code under the three-release policy with this flag enabled by default. See #11370 for details. (cherry picked from commit 8e9a87025f954a2704850bc71cb497f768d5d595) >--------------------------------------------------------------- 57bce48fccc3e8034767dff0d308f88ecbb907ec compiler/main/DynFlags.hs | 1 - testsuite/tests/typecheck/should_compile/all.T | 4 ++-- testsuite/tests/typecheck/should_compile/tc056.stderr | 4 ---- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 532ba6f..e9fed4b 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -3482,7 +3482,6 @@ standardWarnings -- see Note [Documenting warning flags] Opt_WarnTypedHoles, Opt_WarnPartialTypeSignatures, Opt_WarnUnrecognisedPragmas, - Opt_WarnRedundantConstraints, Opt_WarnDuplicateExports, Opt_WarnOverflowedLiterals, Opt_WarnEmptyEnumerations, diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T index 7d7ec60..eb4f1fb 100644 --- a/testsuite/tests/typecheck/should_compile/all.T +++ b/testsuite/tests/typecheck/should_compile/all.T @@ -442,7 +442,7 @@ test('T9497c', normal, compile, ['-fdefer-type-errors -fno-warn-typed-holes']) test('T7643', normal, compile, ['']) test('T9834', normal, compile, ['']) test('T9892', normal, compile, ['']) -test('T9939', normal, compile, ['']) +test('T9939', normal, compile, ['-Wredundant-constraints']) test('T9973', normal, compile, ['']) test('T9971', normal, compile, ['']) test('T10031', normal, compile, ['']) @@ -475,7 +475,7 @@ test('T10564', normal, compile, ['']) test('Vta1', normal, compile, ['']) test('Vta2', normal, compile, ['']) test('PushHRIf', normal, compile, ['']) -test('T10632', normal, compile, ['']) +test('T10632', normal, compile, ['-Wredundant-constraints']) test('T10642', normal, compile, ['']) test('T10744', normal, compile, ['']) test('update-existential', normal, compile, ['']) diff --git a/testsuite/tests/typecheck/should_compile/tc056.stderr b/testsuite/tests/typecheck/should_compile/tc056.stderr index a6f7cd4..e69de29 100644 --- a/testsuite/tests/typecheck/should_compile/tc056.stderr +++ b/testsuite/tests/typecheck/should_compile/tc056.stderr @@ -1,4 +0,0 @@ - -tc056.hs:16:10: Warning: - Redundant constraints: (Eq' a, Eq' a) - In the instance declaration for ?Eq' [a]? From git at git.haskell.org Mon Jan 25 15:57:40 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Jan 2016 15:57:40 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: mkUserGuidePart: Better flag cross-referencing (56d0867) Message-ID: <20160125155740.42D6F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/56d086718fee7faae925602f9872d4e2c4345325/ghc >--------------------------------------------------------------- commit 56d086718fee7faae925602f9872d4e2c4345325 Author: Ben Gamari Date: Sat Jan 23 19:10:59 2016 +0100 mkUserGuidePart: Better flag cross-referencing (cherry picked from commit 1be8491b0c3b07be2ec91feb557502ca06d1e078) >--------------------------------------------------------------- 56d086718fee7faae925602f9872d4e2c4345325 utils/mkUserGuidePart/Main.hs | 12 ++-- utils/mkUserGuidePart/Options/Language.hs | 70 +++++++++++----------- utils/mkUserGuidePart/Options/Linking.hs | 4 +- utils/mkUserGuidePart/Options/Misc.hs | 2 +- utils/mkUserGuidePart/Options/Optimizations.hs | 50 ++++++++-------- utils/mkUserGuidePart/Options/Phases.hs | 2 +- .../Options/RecompilationChecking.hs | 2 +- utils/mkUserGuidePart/Options/Verbosity.hs | 6 +- utils/mkUserGuidePart/Options/Warnings.hs | 35 +++++------ 9 files changed, 94 insertions(+), 89 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 56d086718fee7faae925602f9872d4e2c4345325 From git at git.haskell.org Mon Jan 25 15:57:42 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Jan 2016 15:57:42 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: user-guide: Reformat warning lists (1a0e993) Message-ID: <20160125155742.F33983A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/1a0e9933aefe668b4552b290d97c3b4aaff2939c/ghc >--------------------------------------------------------------- commit 1a0e9933aefe668b4552b290d97c3b4aaff2939c Author: Ben Gamari Date: Sat Jan 23 19:17:45 2016 +0100 user-guide: Reformat warning lists (cherry picked from commit 6f96109b283dd5e4364062c5f71e0b11a9dfb9cd) >--------------------------------------------------------------- 1a0e9933aefe668b4552b290d97c3b4aaff2939c docs/users_guide/using-warnings.rst | 43 ++++++++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 12 deletions(-) diff --git a/docs/users_guide/using-warnings.rst b/docs/users_guide/using-warnings.rst index 15a2525..fb9c913 100644 --- a/docs/users_guide/using-warnings.rst +++ b/docs/users_guide/using-warnings.rst @@ -37,21 +37,34 @@ The following flags are simple ways to select standard "packages" of warnings: .. ghc-flag:: -W - Provides the standard warnings plus :ghc-flag:`-Wunused-binds`, - :ghc-flag:`-Wunused-matches`, :ghc-flag:`-Wunused-imports`, - :ghc-flag:`-Wincomplete-patterns`, :ghc-flag:`-Wdodgy-exports`, and - :ghc-flag:`-Wdodgy-imports`. + Provides the standard warnings plus + + .. hlist:: + :columns: 3 + + * :ghc-flag:`-Wunused-binds` + * :ghc-flag:`-Wunused-matches` + * :ghc-flag:`-Wunused-imports` + * :ghc-flag:`-Wincomplete-patterns` + * :ghc-flag:`-Wdodgy-exports` + * :ghc-flag:`-Wdodgy-imports` .. ghc-flag:: -Wall Turns on all warning options that indicate potentially suspicious code. The warnings that are *not* enabled by :ghc-flag:`-Wall` are - :ghc-flag:`-Wincomplete-uni-patterns`, - :ghc-flag:`-Wincomplete-record-updates`, - :ghc-flag:`-Wmonomorphism-restriction`, - :ghc-flag:`-Wimplicit-prelude`, :ghc-flag:`-Wmissing-local-sigs`, - :ghc-flag:`-Wmissing-exported-sigs`, :ghc-flag:`-Wmissing-import-lists` - and :ghc-flag:`-Widentities`. + + .. hlist:: + :columns: 3 + + * :ghc-flag:`-Wincomplete-uni-patterns` + * :ghc-flag:`-Wincomplete-record-updates` + * :ghc-flag:`-Wmonomorphism-restriction` + * :ghc-flag:`-Wimplicit-prelude` + * :ghc-flag:`-Wmissing-local-sigs` + * :ghc-flag:`-Wmissing-exported-sigs` + * :ghc-flag:`-Wmissing-import-lists` + * :ghc-flag:`-Widentities` .. ghc-flag:: -Wcompat @@ -60,8 +73,14 @@ The following flags are simple ways to select standard "packages" of warnings: eager to make their code future compatible to adapt to new features before they even generate warnings. - This currently enables :ghc-flag:`-Wmissing-monadfail-instance`, - :ghc-flag:`-Wsemigroup`, and :ghc-flag:`-Wnoncanonical-monoid-instances`. + This currently enables + + .. hlist:: + :columns: 3 + + * :ghc-flag:`-Wmissing-monadfail-instance` + * :ghc-flag:`-Wsemigroup` + * :ghc-flag:`-Wnoncanonical-monoid-instances` .. ghc-flag:: -Wno-compat From git at git.haskell.org Mon Jan 25 15:57:45 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Jan 2016 15:57:45 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: user-guide: Fix typos (d14465b) Message-ID: <20160125155745.BFF233A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/d14465b45cb0bec251c0d4e641613e2e89618ffd/ghc >--------------------------------------------------------------- commit d14465b45cb0bec251c0d4e641613e2e89618ffd Author: Ben Gamari Date: Sat Jan 23 21:12:24 2016 +0100 user-guide: Fix typos (cherry picked from commit b5e52bfc9e331a9ed2b3a30b790cfa331935aebe) >--------------------------------------------------------------- d14465b45cb0bec251c0d4e641613e2e89618ffd docs/users_guide/glasgow_exts.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index 769acd4..2cafd34 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -8125,10 +8125,10 @@ ordinary implicit parameters. ``GHC.Stack`` additionally exports a function ``freezeCallStack`` that allows users to freeze a ``CallStack``, preventing any future push operations from having an effect. This can be used by library authors -to prevent ``CallStack``\s from exposing unecessary implementation +to prevent ``CallStack``\s from exposing unnecessary implementation details. Consider the ``head`` example above, the ``myerror`` line in the printed stack is not particularly enlightening, so we might choose -to surpress it by freezing the ``CallStack`` that we pass to ``myerror``. +to suppress it by freezing the ``CallStack`` that we pass to ``myerror``. .. code-block:: none From git at git.haskell.org Mon Jan 25 15:57:48 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Jan 2016 15:57:48 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Don't add ticks around type applications (#11329) (d56d11f) Message-ID: <20160125155748.B7F353A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/d56d11ffff419875a1fc08e2ff470a5c8bd8785f/ghc >--------------------------------------------------------------- commit d56d11ffff419875a1fc08e2ff470a5c8bd8785f Author: Reid Barton Date: Sat Jan 23 15:30:04 2016 -0500 Don't add ticks around type applications (#11329) Test Plan: validate --slow Reviewers: austin, bgamari, goldfire Reviewed By: goldfire Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1824 (cherry picked from commit ec8778862aeb9c3f6b861bc732045db9f58b9b61) >--------------------------------------------------------------- d56d11ffff419875a1fc08e2ff470a5c8bd8785f compiler/deSugar/Coverage.hs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/compiler/deSugar/Coverage.hs b/compiler/deSugar/Coverage.hs index a8281f5..ad232cb 100644 --- a/compiler/deSugar/Coverage.hs +++ b/compiler/deSugar/Coverage.hs @@ -515,7 +515,9 @@ addBinTickLHsExpr boxLabel (L pos e0) -- ----------------------------------------------------------------------------- --- Decoarate an HsExpr with ticks +-- Decorate the body of an HsExpr with ticks. +-- (Whether to put a tick around the whole expression was already decided, +-- in the addTickLHsExpr family of functions.) addTickHsExpr :: HsExpr Id -> TM (HsExpr Id) addTickHsExpr e@(HsVar (L _ id)) = do freeVar id; return e @@ -526,7 +528,13 @@ addTickHsExpr e@(HsOverLabel _) = return e addTickHsExpr e@(HsLit _) = return e addTickHsExpr (HsLam matchgroup) = liftM HsLam (addTickMatchGroup True matchgroup) addTickHsExpr (HsLamCase ty mgs) = liftM (HsLamCase ty) (addTickMatchGroup True mgs) -addTickHsExpr (HsApp e1 e2) = liftM2 HsApp (addTickLHsExprNever e1) (addTickLHsExpr e2) +addTickHsExpr (HsApp e1 e2) = liftM2 HsApp (addTickLHsExprNever e1) e2' + -- This might be a type application. Then don't put a tick around e2, + -- or dsExpr won't recognize it as a type application any more (#11329). + -- It doesn't make sense to put a tick on a type anyways. + where e2' + | isLHsTypeExpr e2 = return e2 + | otherwise = addTickLHsExpr e2 addTickHsExpr (OpApp e1 e2 fix e3) = liftM4 OpApp @@ -658,8 +666,6 @@ addTickHsExpr (ExprWithTySigOut e ty) = (addTickLHsExprNever e) -- No need to tick the inner expression (return ty) -- for expressions with signatures -addTickHsExpr e@(HsTypeOut _) = return e - -- Others should never happen in expression content. addTickHsExpr e = pprPanic "addTickHsExpr" (ppr e) From git at git.haskell.org Mon Jan 25 15:57:51 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Jan 2016 15:57:51 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: user-guide: Document -L RTS flag (e1b7490) Message-ID: <20160125155751.7A11B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/e1b7490cadc3d08eb9ec2bc207e43f7254158c61/ghc >--------------------------------------------------------------- commit e1b7490cadc3d08eb9ec2bc207e43f7254158c61 Author: Ben Gamari Date: Sat Jan 23 22:03:04 2016 +0100 user-guide: Document -L RTS flag See #5641. (cherry picked from commit 923d2151db261cac36577bcaffa6be41c3f374f9) >--------------------------------------------------------------- e1b7490cadc3d08eb9ec2bc207e43f7254158c61 docs/users_guide/runtime_control.rst | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/docs/users_guide/runtime_control.rst b/docs/users_guide/runtime_control.rst index db983fa..7c4159a 100644 --- a/docs/users_guide/runtime_control.rst +++ b/docs/users_guide/runtime_control.rst @@ -797,13 +797,18 @@ executables: .. rts-flag:: -hT - (can be shortened to ``-h``.) Generates a basic heap profile, in the - file :file:`prog.hp`. To produce the heap profile graph, use :command:`hp2ps` - (see :ref:`hp2ps`). The basic heap profile is broken down by data - constructor, with other types of closures (functions, thunks, etc.) - grouped into broad categories (e.g. ``FUN``, ``THUNK``). To get a - more detailed profile, use the full profiling support - (:ref:`profiling`). + Generates a basic heap profile, in the file :file:`prog.hp`. To produce the + heap profile graph, use :command:`hp2ps` (see :ref:`hp2ps`). The basic heap + profile is broken down by data constructor, with other types of closures + (functions, thunks, etc.) grouped into broad categories (e.g. ``FUN``, + ``THUNK``). To get a more detailed profile, use the full profiling support + (:ref:`profiling`). Can be shortened to ``-h``. + +.. rts-flag:: -L + + :default: 25 characters + + Sets the maximum length of the cost-centre names listed in the heap profile. .. _rts-eventlog: From git at git.haskell.org Mon Jan 25 15:57:54 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Jan 2016 15:57:54 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Docs: delete section on Hierarchical Modules (523e1e5) Message-ID: <20160125155754.374F13A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/523e1e5ad04129e3f4aaa8b36adc6ebd3c39d8fb/ghc >--------------------------------------------------------------- commit 523e1e5ad04129e3f4aaa8b36adc6ebd3c39d8fb Author: Thomas Miedema Date: Sun Jan 24 13:07:47 2016 +0100 Docs: delete section on Hierarchical Modules This information is mostly useless, since hierarchical modules are valid Haskell2010 and everybody knows how to use them. Reviewed by: bgamari Differential Revision: https://phabricator.haskell.org/D1835 (cherry picked from commit 98d6a29e534350efd6aa72c0bf9d9e3ac4a76107) >--------------------------------------------------------------- 523e1e5ad04129e3f4aaa8b36adc6ebd3c39d8fb docs/users_guide/glasgow_exts.rst | 34 ------------------------------- docs/users_guide/separate_compilation.rst | 6 ------ 2 files changed, 40 deletions(-) diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index 2cafd34..827e95b 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -380,40 +380,6 @@ integer literals in binary notation with the prefix ``0b`` or ``0B``. For instance, the binary integer literal ``0b11001001`` will be desugared into ``fromInteger 201`` when :ghc-flag:`-XBinaryLiterals` is enabled. -.. _hierarchical-modules: - -Hierarchical Modules --------------------- - -GHC supports a small extension to the syntax of module names: a module -name is allowed to contain a dot ``?.?``. This is also known as the -?hierarchical module namespace? extension, because it extends the -normally flat Haskell module namespace into a more flexible hierarchy of -modules. - -This extension has very little impact on the language itself; modules -names are *always* fully qualified, so you can just think of the fully -qualified module name as ?the module name?. In particular, this means -that the full module name must be given after the ``module`` keyword at -the beginning of the module; for example, the module ``A.B.C`` must -begin :: - - module A.B.C - -It is a common strategy to use the ``as`` keyword to save some typing -when using qualified names with hierarchical modules. For example: :: - - import qualified Control.Monad.ST.Strict as ST - -For details on how GHC searches for source and interface files in the -presence of hierarchical modules, see :ref:`search-path`. - -GHC comes with a large collection of libraries arranged hierarchically; -see the accompanying `library -documentation <../libraries/index.html>`__. More libraries to install -are available from -`HackageDB `__. - .. _pattern-guards: Pattern guards diff --git a/docs/users_guide/separate_compilation.rst b/docs/users_guide/separate_compilation.rst index 0f5f029..afdde83 100644 --- a/docs/users_guide/separate_compilation.rst +++ b/docs/users_guide/separate_compilation.rst @@ -12,12 +12,6 @@ This section describes what files GHC expects to find, what files it creates, where these files are stored, and what options affect this behaviour. -Note that this section is written with hierarchical modules in mind (see -:ref:`hierarchical-modules`); hierarchical modules are an extension to -Haskell 98 which extends the lexical syntax of module names to include a -dot ``.``. Non-hierarchical modules are thus a special case in which none -of the module names contain dots. - Pathname conventions vary from system to system. In particular, the directory separator is "``/``" on Unix systems and "``\``" on Windows systems. In the sections that follow, we shall consistently use From git at git.haskell.org Mon Jan 25 15:57:56 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Jan 2016 15:57:56 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Remove `replaceDynFlags` from `ContainsDynFlags` (9d30644) Message-ID: <20160125155756.EEF9A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/9d30644100e636966cf4c2c921e72783bec8e299/ghc >--------------------------------------------------------------- commit 9d30644100e636966cf4c2c921e72783bec8e299 Author: Thomas Miedema Date: Tue Jan 19 11:54:36 2016 +0100 Remove `replaceDynFlags` from `ContainsDynFlags` Refactoring only. It's shorter, and brings `HasDynFlags/ContainsDynFLags` in line with `HasModule/ContainsModule`. Introduce `updTopEnv`. Reviewed by: bgamari Differential Revision: https://phabricator.haskell.org/D1832 (cherry picked from commit edc68b2ffe833e487ae6b2b04cd9be18e40a5a5e) >--------------------------------------------------------------- 9d30644100e636966cf4c2c921e72783bec8e299 compiler/main/DriverPipeline.hs | 2 +- compiler/main/DynFlags.hs | 1 - compiler/main/HscTypes.hs | 4 ---- compiler/typecheck/TcRnMonad.hs | 24 +++++++++++++----------- compiler/typecheck/TcRnTypes.hs | 2 -- 5 files changed, 14 insertions(+), 19 deletions(-) diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs index 2805ec8..64c9a96 100644 --- a/compiler/main/DriverPipeline.hs +++ b/compiler/main/DriverPipeline.hs @@ -611,7 +611,7 @@ runPipeline stop_phase hsc_env0 (input_fn, mb_phase) -- If we are compiling a Haskell module, and doing -- -dynamic-too, but couldn't do the -dynamic-too fast -- path, then rerun the pipeline for the dyn way - let dflags = extractDynFlags hsc_env + let dflags = hsc_dflags hsc_env -- NB: Currently disabled on Windows (ref #7134, #8228, and #5987) when (not $ platformOS (targetPlatform dflags) == OSMinGW32) $ do when isHaskellishFile $ whenCannotGenerateDynamicToo dflags $ do diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index e9fed4b..b016a61 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -911,7 +911,6 @@ instance (Monad m, HasDynFlags m) => HasDynFlags (ExceptT e m) where class ContainsDynFlags t where extractDynFlags :: t -> DynFlags - replaceDynFlags :: t -> DynFlags -> t data ProfAuto = NoProfAuto -- ^ no SCC annotations added diff --git a/compiler/main/HscTypes.hs b/compiler/main/HscTypes.hs index bf6ad1e..a2ecea1 100644 --- a/compiler/main/HscTypes.hs +++ b/compiler/main/HscTypes.hs @@ -409,10 +409,6 @@ data HscEnv #endif } -instance ContainsDynFlags HscEnv where - extractDynFlags env = hsc_dflags env - replaceDynFlags env dflags = env {hsc_dflags = dflags} - #ifdef GHCI data IServ = IServ { iservPipe :: Pipe diff --git a/compiler/typecheck/TcRnMonad.hs b/compiler/typecheck/TcRnMonad.hs index b0b1e3d..692e9f3 100644 --- a/compiler/typecheck/TcRnMonad.hs +++ b/compiler/typecheck/TcRnMonad.hs @@ -278,6 +278,10 @@ discardResult a = a >> return () getTopEnv :: TcRnIf gbl lcl HscEnv getTopEnv = do { env <- getEnv; return (env_top env) } +updTopEnv :: (HscEnv -> HscEnv) -> TcRnIf gbl lcl a -> TcRnIf gbl lcl a +updTopEnv upd = updEnv (\ env@(Env { env_top = top }) -> + env { env_top = upd top }) + getGblEnv :: TcRnIf gbl lcl gbl getGblEnv = do { env <- getEnv; return (env_gbl env) } @@ -319,16 +323,16 @@ woptM :: WarningFlag -> TcRnIf gbl lcl Bool woptM flag = do { dflags <- getDynFlags; return (wopt flag dflags) } setXOptM :: LangExt.Extension -> TcRnIf gbl lcl a -> TcRnIf gbl lcl a -setXOptM flag = updEnv (\ env@(Env { env_top = top }) -> - env { env_top = top { hsc_dflags = xopt_set (hsc_dflags top) flag}} ) +setXOptM flag = + updTopEnv (\top -> top { hsc_dflags = xopt_set (hsc_dflags top) flag}) unsetGOptM :: GeneralFlag -> TcRnIf gbl lcl a -> TcRnIf gbl lcl a -unsetGOptM flag = updEnv (\ env@(Env { env_top = top }) -> - env { env_top = top { hsc_dflags = gopt_unset (hsc_dflags top) flag}} ) +unsetGOptM flag = + updTopEnv (\top -> top { hsc_dflags = gopt_unset (hsc_dflags top) flag}) unsetWOptM :: WarningFlag -> TcRnIf gbl lcl a -> TcRnIf gbl lcl a -unsetWOptM flag = updEnv (\ env@(Env { env_top = top }) -> - env { env_top = top { hsc_dflags = wopt_unset (hsc_dflags top) flag}} ) +unsetWOptM flag = + updTopEnv (\top -> top { hsc_dflags = wopt_unset (hsc_dflags top) flag}) -- | Do it flag is true whenDOptM :: DumpFlag -> TcRnIf gbl lcl () -> TcRnIf gbl lcl () @@ -351,11 +355,9 @@ getGhcMode :: TcRnIf gbl lcl GhcMode getGhcMode = do { env <- getTopEnv; return (ghcMode (hsc_dflags env)) } withDoDynamicToo :: TcRnIf gbl lcl a -> TcRnIf gbl lcl a -withDoDynamicToo m = do env <- getEnv - let dflags = extractDynFlags env - dflags' = dynamicTooMkDynamicDynFlags dflags - env' = replaceDynFlags env dflags' - setEnv env' m +withDoDynamicToo = + updTopEnv (\top@(HscEnv { hsc_dflags = dflags }) -> + top { hsc_dflags = dynamicTooMkDynamicDynFlags dflags }) getEpsVar :: TcRnIf gbl lcl (TcRef ExternalPackageState) getEpsVar = do { env <- getTopEnv; return (hsc_EPS env) } diff --git a/compiler/typecheck/TcRnTypes.hs b/compiler/typecheck/TcRnTypes.hs index 9edc6a7..6c278c9 100644 --- a/compiler/typecheck/TcRnTypes.hs +++ b/compiler/typecheck/TcRnTypes.hs @@ -237,8 +237,6 @@ data Env gbl lcl instance ContainsDynFlags (Env gbl lcl) where extractDynFlags env = hsc_dflags (env_top env) - replaceDynFlags env dflags - = env {env_top = replaceDynFlags (env_top env) dflags} instance ContainsModule gbl => ContainsModule (Env gbl lcl) where extractModule env = extractModule (env_gbl env) From git at git.haskell.org Mon Jan 25 15:57:59 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Jan 2016 15:57:59 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Add -fwarn-redundant-constrains to test for #9708 (529e7c2) Message-ID: <20160125155759.B337A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/529e7c2d9d6f0bd406dbb30e408d094ca025283e/ghc >--------------------------------------------------------------- commit 529e7c2d9d6f0bd406dbb30e408d094ca025283e Author: Thomas Miedema Date: Sun Jan 24 02:49:42 2016 +0100 Add -fwarn-redundant-constrains to test for #9708 Fixes validate on Travis. Reviewed by: bgamari Differential Revision: https://phabricator.haskell.org/D1834 (cherry picked from commit 2c6fe5b8a854f06ea9574f7dca545b4c2d35b811) >--------------------------------------------------------------- 529e7c2d9d6f0bd406dbb30e408d094ca025283e testsuite/tests/typecheck/should_compile/T9708.hs | 9 +++++++++ testsuite/tests/typecheck/should_compile/T9708.stderr | 0 2 files changed, 9 insertions(+) diff --git a/testsuite/tests/typecheck/should_compile/T9708.hs b/testsuite/tests/typecheck/should_compile/T9708.hs index cb0e847..3878857 100644 --- a/testsuite/tests/typecheck/should_compile/T9708.hs +++ b/testsuite/tests/typecheck/should_compile/T9708.hs @@ -1,4 +1,5 @@ {-# LANGUAGE DataKinds, TypeOperators, TypeFamilies #-} +{-# OPTIONS_GHC -fwarn-redundant-constraints #-} module TcTypeNatSimple where import GHC.TypeLits @@ -16,5 +17,13 @@ type family SomeFun (n :: Nat) -- with the change to stop Deriveds from rewriting Deriveds (around Dec. 12, 2014), -- this failed again +-- 2016-01-23: it just started passing again, when +-- -fwarn-redundant-constraints was removed from the default warning set. +-- Turning the warning back on for this module, ghc reports (and probably has +-- for some time): +-- Redundant constraints: (x <= y, y <= x) +-- In the type signature for: +-- ti7 :: (x <= y, y <= x) => Proxy (SomeFun x) -> Proxy y -> () + ti7 :: (x <= y, y <= x) => Proxy (SomeFun x) -> Proxy y -> () ti7 _ _ = () diff --git a/testsuite/tests/typecheck/should_compile/T9708.stderr b/testsuite/tests/typecheck/should_compile/T9708.stderr deleted file mode 100644 index e69de29..0000000 From git at git.haskell.org Mon Jan 25 15:58:03 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Jan 2016 15:58:03 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Special-case implicit params in superclass expansion (6217147) Message-ID: <20160125155803.7BB2F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/6217147e0895e98b08e597660ea941a544943a4d/ghc >--------------------------------------------------------------- commit 6217147e0895e98b08e597660ea941a544943a4d Author: Simon Peyton Jones Date: Fri Jan 22 16:34:18 2016 +0000 Special-case implicit params in superclass expansion This issue came up in Trac #11480, and is documented in Note [When superclasses help] in TcRnTypes. We were getting a spurious warning T11480.hs:1:1: warning: solveWanteds: too many iterations (limit = 4) The fix is easy. A bit of refactoring along the way. The original bug report in Trac #11480 appears to work fine in HEAD and the 8.0 branch but I added a regression test in this commit as well. (cherry picked from commit ff21795a0b9253e811a45626d5686e981ed07f82) >--------------------------------------------------------------- 6217147e0895e98b08e597660ea941a544943a4d compiler/typecheck/TcCanonical.hs | 11 +-- compiler/typecheck/TcRnTypes.hs | 81 +++++++++++++++++----- compiler/typecheck/TcSMonad.hs | 9 +-- compiler/typecheck/TcSimplify.hs | 12 +++- testsuite/tests/polykinds/T11480a.hs | 26 +++++++ testsuite/tests/polykinds/all.T | 1 + testsuite/tests/typecheck/should_compile/T11480.hs | 9 +++ testsuite/tests/typecheck/should_compile/all.T | 1 + 8 files changed, 118 insertions(+), 32 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 6217147e0895e98b08e597660ea941a544943a4d From git at git.haskell.org Mon Jan 25 15:58:06 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Jan 2016 15:58:06 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Fix exprIsHNF (Trac #11248) (1e6bdbc) Message-ID: <20160125155806.45D5D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/1e6bdbc83fb795015d48001dcb8c305ab690294c/ghc >--------------------------------------------------------------- commit 1e6bdbc83fb795015d48001dcb8c305ab690294c Author: Simon Peyton Jones Date: Mon Jan 25 11:16:18 2016 +0000 Fix exprIsHNF (Trac #11248) Blimey! CoreUtils.exprIsHNFlike had not one but two bugs. * is_hnf_like treated coercion args like type args (result: exprIsHNF might wrongly say True) * app_is_value treated type args like value args (result: exprIsHNF might wrongly say False) Bizarre. This goes back to at least 2012. It's amazing that it hasn't caused more trouble. It was discovered by a Lint error when compiling Trac #11248 with -O. (cherry picked from commit 3c060f36f6eb4d359f252168e2f97b573d017080) >--------------------------------------------------------------- 1e6bdbc83fb795015d48001dcb8c305ab690294c compiler/coreSyn/CoreUtils.hs | 31 +++++++++++++++++-------------- testsuite/tests/polykinds/T11248.hs | 3 +++ 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/compiler/coreSyn/CoreUtils.hs b/compiler/coreSyn/CoreUtils.hs index 3664d8e..eaccb33 100644 --- a/compiler/coreSyn/CoreUtils.hs +++ b/compiler/coreSyn/CoreUtils.hs @@ -1459,22 +1459,25 @@ exprIsHNFlike is_con is_con_unf = is_hnf_like is_hnf_like (Tick tickish e) = not (tickishCounts tickish) && is_hnf_like e -- See Note [exprIsHNF Tick] - is_hnf_like (Cast e _) = is_hnf_like e - is_hnf_like (App e (Type _)) = is_hnf_like e - is_hnf_like (App e (Coercion _)) = is_hnf_like e - is_hnf_like (App e a) = app_is_value e [a] - is_hnf_like (Let _ e) = is_hnf_like e -- Lazy let(rec)s don't affect us - is_hnf_like _ = False + is_hnf_like (Cast e _) = is_hnf_like e + is_hnf_like (App e a) + | isValArg a = app_is_value e 1 + | otherwise = is_hnf_like e + is_hnf_like (Let _ e) = is_hnf_like e -- Lazy let(rec)s don't affect us + is_hnf_like _ = False -- There is at least one value argument - app_is_value :: CoreExpr -> [CoreArg] -> Bool - app_is_value (Var fun) args - = idArity fun > valArgCount args -- Under-applied function - || is_con fun -- or constructor-like - app_is_value (Tick _ f) as = app_is_value f as - app_is_value (Cast f _) as = app_is_value f as - app_is_value (App f a) as = app_is_value f (a:as) - app_is_value _ _ = False + -- 'n' is number of value args to which the expression is applied + app_is_value :: CoreExpr -> Int -> Bool + app_is_value (Var fun) n_val_args + = idArity fun > n_val_args -- Under-applied function + || is_con fun -- or constructor-like + app_is_value (Tick _ f) nva = app_is_value f nva + app_is_value (Cast f _) nva = app_is_value f nva + app_is_value (App f a) nva + | isValArg a = app_is_value f (nva + 1) + | otherwise = app_is_value f nva + app_is_value _ _ = False {- Note [exprIsHNF Tick] diff --git a/testsuite/tests/polykinds/T11248.hs b/testsuite/tests/polykinds/T11248.hs index e1c8fcc..b3a32e3 100644 --- a/testsuite/tests/polykinds/T11248.hs +++ b/testsuite/tests/polykinds/T11248.hs @@ -1,3 +1,6 @@ +{-# OPTIONS_GHC -O #-} + -- Trac #11248, comment:6 showed that this tests failed with -O + {-# LANGUAGE DataKinds, TypeOperators, TypeFamilies, KindSignatures, ConstraintKinds #-} From git at git.haskell.org Mon Jan 25 15:58:08 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Jan 2016 15:58:08 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Show error message for unknown symbol on Elf_Rel platforms (f48fdee) Message-ID: <20160125155808.E8F8B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/f48fdeeafeb4ca1992c4aba4c35a3009b73f2af8/ghc >--------------------------------------------------------------- commit f48fdeeafeb4ca1992c4aba4c35a3009b73f2af8 Author: Reid Barton Date: Mon Jan 25 09:12:40 2016 -0500 Show error message for unknown symbol on Elf_Rel platforms Summary: This is already the behavior on Elf_Rela platforms, and is helpful. Reviewers: simonmar, austin, bgamari, erikd Reviewed By: erikd Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1841 (cherry picked from commit 5c8233388983a5af9fda5f3395ad28f4e0392f98) >--------------------------------------------------------------- f48fdeeafeb4ca1992c4aba4c35a3009b73f2af8 rts/Linker.c | 1 - 1 file changed, 1 deletion(-) diff --git a/rts/Linker.c b/rts/Linker.c index 1c76a00..b9a1d34 100644 --- a/rts/Linker.c +++ b/rts/Linker.c @@ -5009,7 +5009,6 @@ do_Elf_Rel_relocations ( ObjectCode* oc, char* ehdrC, } else { symbol = strtab + sym.st_name; S_tmp = lookupSymbol_( symbol ); - if (S_tmp == NULL) return 0; S = (Elf_Addr)S_tmp; } if (!S) { From git at git.haskell.org Mon Jan 25 15:58:11 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Jan 2016 15:58:11 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: HscTypes: Fix typo in comment (b53c643) Message-ID: <20160125155811.983823A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/b53c6439fff54407c3da1cf719cb01c54ff63e26/ghc >--------------------------------------------------------------- commit b53c6439fff54407c3da1cf719cb01c54ff63e26 Author: Ben Gamari Date: Sat Jan 23 22:51:51 2016 +0100 HscTypes: Fix typo in comment (cherry picked from commit bc1e085c5dc239b66e970fdc5117aec0933a9a37) >--------------------------------------------------------------- b53c6439fff54407c3da1cf719cb01c54ff63e26 compiler/main/HscTypes.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/main/HscTypes.hs b/compiler/main/HscTypes.hs index a2ecea1..9ed9002 100644 --- a/compiler/main/HscTypes.hs +++ b/compiler/main/HscTypes.hs @@ -400,7 +400,7 @@ data HscEnv hsc_type_env_var :: Maybe (Module, IORef TypeEnv) -- ^ Used for one-shot compilation only, to initialise -- the 'IfGblEnv'. See 'TcRnTypes.tcg_type_env_var' for - -- 'TcRunTypes.TcGblEnv' + -- 'TcRnTypes.TcGblEnv' #ifdef GHCI , hsc_iserv :: MVar (Maybe IServ) From git at git.haskell.org Mon Jan 25 15:58:14 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Jan 2016 15:58:14 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Rename -Wmissing-monadfail-instance to plural-form (b9fd059) Message-ID: <20160125155814.517823A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/b9fd05982d494591c865c3e45366b5508cecd82b/ghc >--------------------------------------------------------------- commit b9fd05982d494591c865c3e45366b5508cecd82b Author: Herbert Valerio Riedel Date: Mon Jan 25 14:51:50 2016 +0100 Rename -Wmissing-monadfail-instance to plural-form This warning flag was recently introduced as part of #10751. However, it was missed during code-review that almost all existing warning flags use a plural-form, so for consistency this commit renames that warning flag to `-Wmissing-monadfail-instances`. Test Plan: local validate (still running) Reviewers: quchen, goldfire, austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1842 GHC Trac Issues: #10751 (cherry picked from commit 132c20894d102558cc8f3aee5bc289425d0ddb24) >--------------------------------------------------------------- b9fd05982d494591c865c3e45366b5508cecd82b compiler/main/DynFlags.hs | 6 +++--- compiler/typecheck/TcMatches.hs | 4 ++-- docs/users_guide/using-warnings.rst | 6 +++--- testsuite/tests/monadfail/MonadFailWarnings.hs | 2 +- testsuite/tests/monadfail/MonadFailWarningsWithRebindableSyntax.hs | 2 +- .../tests/monadfail/MonadFailWarningsWithRebindableSyntax.stderr | 2 +- testsuite/tests/rebindable/rebindable1.hs | 2 +- utils/mkUserGuidePart/Options/Warnings.hs | 4 ++-- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index b016a61..7ce2a3d 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -569,7 +569,7 @@ data WarningFlag = | Opt_WarnWarningsDeprecations | Opt_WarnDeprecatedFlags | Opt_WarnAMP -- Introduced in GHC 7.8, obsolete since 7.10 - | Opt_WarnMissingMonadFailInstance -- since 8.0 + | Opt_WarnMissingMonadFailInstances -- since 8.0 | Opt_WarnSemigroup -- since 8.0 | Opt_WarnDodgyExports | Opt_WarnDodgyImports @@ -2931,7 +2931,7 @@ wWarningFlags = [ flagSpec "missing-import-lists" Opt_WarnMissingImportList, flagSpec "missing-local-sigs" Opt_WarnMissingLocalSigs, flagSpec "missing-methods" Opt_WarnMissingMethods, - flagSpec "missing-monadfail-instance" Opt_WarnMissingMonadFailInstance, + flagSpec "missing-monadfail-instances" Opt_WarnMissingMonadFailInstances, flagSpec "semigroup" Opt_WarnSemigroup, flagSpec "missing-signatures" Opt_WarnMissingSigs, flagSpec "missing-exported-sigs" Opt_WarnMissingExportedSigs, @@ -3531,7 +3531,7 @@ minusWallOpts -- code future compatible to fix issues before they even generate warnings. minusWcompatOpts :: [WarningFlag] minusWcompatOpts - = [ Opt_WarnMissingMonadFailInstance + = [ Opt_WarnMissingMonadFailInstances , Opt_WarnSemigroup , Opt_WarnNonCanonicalMonoidInstances ] diff --git a/compiler/typecheck/TcMatches.hs b/compiler/typecheck/TcMatches.hs index 1307192..da25d67 100644 --- a/compiler/typecheck/TcMatches.hs +++ b/compiler/typecheck/TcMatches.hs @@ -930,7 +930,7 @@ tcMonadFailOp orig pat fail_op res_ty = do { -- Issue MonadFail warnings rebindableSyntax <- xoptM LangExt.RebindableSyntax ; desugarFlag <- xoptM LangExt.MonadFailDesugaring - ; missingWarning <- woptM Opt_WarnMissingMonadFailInstance + ; missingWarning <- woptM Opt_WarnMissingMonadFailInstances ; if | rebindableSyntax && (desugarFlag || missingWarning) -> warnRebindableClash pat | not desugarFlag && missingWarning @@ -960,7 +960,7 @@ warnRebindableClash pattern = addWarnAt (getLoc pattern) nest 2 (text "is used together with -XRebindableSyntax." <+> text "If this is intentional," $$ - text "compile with -fno-warn-missing-monadfail-instance.")) + text "compile with -Wno-missing-monadfail-instances.")) {- Note [typechecking ApplicativeStmt] diff --git a/docs/users_guide/using-warnings.rst b/docs/users_guide/using-warnings.rst index fb9c913..de8be63 100644 --- a/docs/users_guide/using-warnings.rst +++ b/docs/users_guide/using-warnings.rst @@ -78,7 +78,7 @@ The following flags are simple ways to select standard "packages" of warnings: .. hlist:: :columns: 3 - * :ghc-flag:`-Wmissing-monadfail-instance` + * :ghc-flag:`-Wmissing-monadfail-instances` * :ghc-flag:`-Wsemigroup` * :ghc-flag:`-Wnoncanonical-monoid-instances` @@ -242,7 +242,7 @@ of ``-W(no-)*``. * Warn if ``fail`` is defined backwards (i.e. ``fail = Control.Monad.fail``). - See also :ghc-flag:`-Wmissing-monadfail-instance`. + See also :ghc-flag:`-Wmissing-monadfail-instances`. This option is off by default. @@ -266,7 +266,7 @@ of ``-W(no-)*``. This warning is off by default. However, it is part of the :ghc-flag:`-Wcompat` option group. -.. ghc-flag:: -Wmissing-monadfail-instance +.. ghc-flag:: -Wmissing-monadfail-instances .. index:: single: MFP diff --git a/testsuite/tests/monadfail/MonadFailWarnings.hs b/testsuite/tests/monadfail/MonadFailWarnings.hs index 3b786cc..a1d3729 100644 --- a/testsuite/tests/monadfail/MonadFailWarnings.hs +++ b/testsuite/tests/monadfail/MonadFailWarnings.hs @@ -2,7 +2,7 @@ -- Ensure that MonadFail warnings are issued correctly if the warning flag -- is enabled -{-# OPTIONS_GHC -fwarn-missing-monadfail-instance #-} +{-# OPTIONS_GHC -Wmissing-monadfail-instances #-} module MonadFailWarnings where diff --git a/testsuite/tests/monadfail/MonadFailWarningsWithRebindableSyntax.hs b/testsuite/tests/monadfail/MonadFailWarningsWithRebindableSyntax.hs index c9f2502..6126e24 100644 --- a/testsuite/tests/monadfail/MonadFailWarningsWithRebindableSyntax.hs +++ b/testsuite/tests/monadfail/MonadFailWarningsWithRebindableSyntax.hs @@ -2,7 +2,7 @@ -- RebindableSyntax does not play that well with MonadFail, so here we ensure -- that when both settings are enabled we get the proper warning. -{-# OPTIONS_GHC -fwarn-missing-monadfail-instance #-} +{-# OPTIONS_GHC -Wmissing-monadfail-instances #-} {-# LANGUAGE RebindableSyntax #-} module MonadFailWarningsWithRebindableSyntax where diff --git a/testsuite/tests/monadfail/MonadFailWarningsWithRebindableSyntax.stderr b/testsuite/tests/monadfail/MonadFailWarningsWithRebindableSyntax.stderr index 819c878..9610f89 100644 --- a/testsuite/tests/monadfail/MonadFailWarningsWithRebindableSyntax.stderr +++ b/testsuite/tests/monadfail/MonadFailWarningsWithRebindableSyntax.stderr @@ -2,4 +2,4 @@ MonadFailWarningsWithRebindableSyntax.hs:13:5: warning: The failable pattern ?Just x? is used together with -XRebindableSyntax. If this is intentional, - compile with -fno-warn-missing-monadfail-instance. + compile with -Wno-missing-monadfail-instances. diff --git a/testsuite/tests/rebindable/rebindable1.hs b/testsuite/tests/rebindable/rebindable1.hs index 7bf3e23..4ff8ed2 100644 --- a/testsuite/tests/rebindable/rebindable1.hs +++ b/testsuite/tests/rebindable/rebindable1.hs @@ -1,4 +1,4 @@ -{-# OPTIONS_GHC -fno-warn-missing-monadfail-instance #-} +{-# OPTIONS_GHC -Wno-missing-monadfail-instances #-} {-# LANGUAGE RebindableSyntax, NPlusKPatterns #-} module RebindableCase1 where diff --git a/utils/mkUserGuidePart/Options/Warnings.hs b/utils/mkUserGuidePart/Options/Warnings.hs index 0c5260f..3c69de7 100644 --- a/utils/mkUserGuidePart/Options/Warnings.hs +++ b/utils/mkUserGuidePart/Options/Warnings.hs @@ -152,12 +152,12 @@ warningsOptions = , flagType = DynamicFlag , flagReverse = "-Wno-missing-local-sigs" } - , flag { flagName = "-Wmissing-monadfail-instance" + , flag { flagName = "-Wmissing-monadfail-instances" , flagDescription = "warn when a failable pattern is used in a do-block that does " ++ "not have a ``MonadFail`` instance." , flagType = DynamicFlag - , flagReverse = "-Wno-missing-monadfail-instance" + , flagReverse = "-Wno-missing-monadfail-instances" } , flag { flagName = "-Wsemigroup" , flagDescription = From git at git.haskell.org Mon Jan 25 15:58:17 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Jan 2016 15:58:17 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Better document behavior of -Wmissed-specialisations (f31372c) Message-ID: <20160125155817.085143A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/f31372cdca4fdc809dff5c97c07994a23d977c67/ghc >--------------------------------------------------------------- commit f31372cdca4fdc809dff5c97c07994a23d977c67 Author: Ben Gamari Date: Mon Jan 25 15:18:04 2016 +0100 Better document behavior of -Wmissed-specialisations Test Plan: Read it Reviewers: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1829 (cherry picked from commit 6e2658f67bcdbc7fd0ebd2ef6abcd13a6bec80bc) >--------------------------------------------------------------- f31372cdca4fdc809dff5c97c07994a23d977c67 docs/users_guide/using-warnings.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/users_guide/using-warnings.rst b/docs/users_guide/using-warnings.rst index de8be63..4f9a741 100644 --- a/docs/users_guide/using-warnings.rst +++ b/docs/users_guide/using-warnings.rst @@ -19,7 +19,6 @@ generally likely to indicate bugs in your program. These are: * :ghc-flag:`-Wwarnings-deprecations` * :ghc-flag:`-Wdeprecated-flags` * :ghc-flag:`-Wunrecognised-pragmas` - * :ghc-flag:`-Wmissed-specialisations` * :ghc-flag:`-Wduplicate-constraints` * :ghc-flag:`-Wduplicate-exports` * :ghc-flag:`-Woverflowed-literals` @@ -180,6 +179,8 @@ of ``-W(no-)*``. that is marked as ``INLINEABLE`` (presumably to enable specialisation) cannot be specialised as it calls other functions that are themselves not specialised. + Note that these warnings will not throw errors if used with :ghc-flag:`-Werror`. + These options are both off by default. .. ghc-flag:: -Wwarnings-deprecations From git at git.haskell.org Mon Jan 25 15:58:19 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Jan 2016 15:58:19 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: user-guide: Note order-dependence of flags (bf22ede) Message-ID: <20160125155819.BA0823A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/bf22ede413873fba0c03c2af7879d6636b37b888/ghc >--------------------------------------------------------------- commit bf22ede413873fba0c03c2af7879d6636b37b888 Author: Ben Gamari Date: Mon Jan 25 15:18:13 2016 +0100 user-guide: Note order-dependence of flags This supplements the description previously added in 6400c7687223c5b2141176aa92f7ff987f61aba6. See #10560 for details. Test Plan: read it Reviewers: austin Subscribers: thomie, hvr Differential Revision: https://phabricator.haskell.org/D1831 GHC Trac Issues: #10560 (cherry picked from commit 128b678061120270d3d4fe3eccd1b7dc76a8de35) >--------------------------------------------------------------- bf22ede413873fba0c03c2af7879d6636b37b888 docs/users_guide/using.rst | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/docs/users_guide/using.rst b/docs/users_guide/using.rst index 91b6291..3b192ef 100644 --- a/docs/users_guide/using.rst +++ b/docs/users_guide/using.rst @@ -85,6 +85,28 @@ all files; you cannot, for example, invoke ``ghc -c -O1 Foo.hs -O2 Bar.hs`` to apply different optimisation levels to the files ``Foo.hs`` and ``Bar.hs``. +.. note:: + + .. index:: + single: command-line; order of arguments + + Note that command-line options are *order-dependent*, with arguments being + evaluated from left-to-right. This can have seemingly strange effects in the + presence of flag implication. For instance, consider + :ghc-flag:`-fno-specialise` and :ghc-flag:`-O1` (which implies + :ghc-flag:`-fspecialise`). These two command lines mean very different + things: + + ``-fno-specialise -O1`` + + ``-fspecialise`` will be enabled as the ``-fno-specialise`` is overriden + by the ``-O1``. + + ``-O1 -fno-specialise`` + + ``-fspecialise`` will not be enabled, since the ``-fno-specialise`` + overrides the ``-fspecialise`` implied by ``-O1``. + .. _source-file-options: Command line options in source files From git at git.haskell.org Mon Jan 25 17:46:14 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Jan 2016 17:46:14 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Avoid recursive use of immSuperClasses (e37b571) Message-ID: <20160125174614.56FD13A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/e37b571baabf18621eb3b471fddc015a021ecf46/ghc >--------------------------------------------------------------- commit e37b571baabf18621eb3b471fddc015a021ecf46 Author: Simon Peyton Jones Date: Mon Jan 25 08:29:12 2016 +0000 Avoid recursive use of immSuperClasses In fixing Trac #11480 I had omitted to deal with FunDeps.oclose, which was making recursive use of immSuperClasses, and hence going into a loop in the recursive case. Solution: use transSuperClasses, which takes care not to. (cherry picked from commit 42c6263f23cf3f00035389637862944e0594bc7a) >--------------------------------------------------------------- e37b571baabf18621eb3b471fddc015a021ecf46 compiler/typecheck/FunDeps.hs | 15 +++++++-------- compiler/typecheck/TcType.hs | 4 ++-- testsuite/tests/polykinds/T11480a.hs | 2 +- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/compiler/typecheck/FunDeps.hs b/compiler/typecheck/FunDeps.hs index bf8c260..4e64d2e 100644 --- a/compiler/typecheck/FunDeps.hs +++ b/compiler/typecheck/FunDeps.hs @@ -23,7 +23,7 @@ import Name import Var import Class import Type -import TcType( immSuperClasses ) +import TcType( transSuperClasses ) import Unify import InstEnv import VarSet @@ -516,18 +516,17 @@ oclose preds fixed_tvs tv_fds :: [(TyCoVarSet,TyCoVarSet)] tv_fds = [ (tyCoVarsOfTypes ls, tyCoVarsOfTypes rs) | pred <- preds - , (ls, rs) <- determined pred ] + , pred' <- pred : transSuperClasses pred + -- Look for fundeps in superclasses too + , (ls, rs) <- determined pred' ] determined :: PredType -> [([Type],[Type])] determined pred = case classifyPredType pred of EqPred NomEq t1 t2 -> [([t1],[t2]), ([t2],[t1])] - ClassPred cls tys -> local_fds ++ concatMap determined superclasses - where - local_fds = [ instFD fd cls_tvs tys - | fd <- cls_fds ] - (cls_tvs, cls_fds) = classTvsFds cls - superclasses = immSuperClasses cls tys + ClassPred cls tys -> [ instFD fd cls_tvs tys + | let (cls_tvs, cls_fds) = classTvsFds cls + , fd <- cls_fds ] _ -> [] {- diff --git a/compiler/typecheck/TcType.hs b/compiler/typecheck/TcType.hs index 0182c02..8093a0c 100644 --- a/compiler/typecheck/TcType.hs +++ b/compiler/typecheck/TcType.hs @@ -1724,8 +1724,8 @@ mkMinimalBySCs ptys = go preds_with_scs [] in_cloud p ps = or [ p `eqType` p' | (_, scs) <- ps, p' <- scs ] transSuperClasses :: PredType -> [PredType] --- (transSuperClasses p) returns (p's superclasses) --- not including p +-- (transSuperClasses p) returns (p's superclasses) not including p +-- Stop if you encounter the same class again -- See Note [Expanding superclasses] transSuperClasses p = go emptyNameSet p diff --git a/testsuite/tests/polykinds/T11480a.hs b/testsuite/tests/polykinds/T11480a.hs index 3d17168..eeeaf34 100644 --- a/testsuite/tests/polykinds/T11480a.hs +++ b/testsuite/tests/polykinds/T11480a.hs @@ -1,7 +1,7 @@ {-# language KindSignatures, PolyKinds, TypeFamilies, NoImplicitPrelude, FlexibleContexts, MultiParamTypeClasses, GADTs, - ConstraintKinds, FlexibleInstances, + ConstraintKinds, FlexibleInstances, UndecidableInstances, FunctionalDependencies, UndecidableSuperClasses #-} module T11480a where From git at git.haskell.org Mon Jan 25 20:43:52 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Jan 2016 20:43:52 +0000 (UTC) Subject: [commit: ghc] master: Implement -Wunrecognised-warning-flag (f0f63b3) Message-ID: <20160125204352.587993A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/f0f63b39783055b2c0c1a8db8c22749afa6d7329/ghc >--------------------------------------------------------------- commit f0f63b39783055b2c0c1a8db8c22749afa6d7329 Author: Ben Gamari Date: Mon Jan 25 17:14:49 2016 +0100 Implement -Wunrecognised-warning-flag This allows the user to avoid warnings for warning flags that GHC doesn't recognise. See #11429 for details.. Test Plan: Validate with T11429[abc] tests Reviewers: austin, hvr Reviewed By: hvr Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1830 GHC Trac Issues: #11429 >--------------------------------------------------------------- f0f63b39783055b2c0c1a8db8c22749afa6d7329 compiler/main/DynFlags.hs | 22 ++++++++++++++++++---- docs/users_guide/using-warnings.rst | 8 ++++++++ .../{plugins/frontend01.hs => driver/T11429a.hs} | 1 + testsuite/tests/driver/T11429a.stderr | 2 ++ .../{plugins/frontend01.hs => driver/T11429b.hs} | 1 + .../{plugins/frontend01.hs => driver/T11429c.hs} | 1 + testsuite/tests/driver/T11429c.stderr | 5 +++++ testsuite/tests/driver/all.T | 4 ++++ utils/mkUserGuidePart/Options/Warnings.hs | 7 +++++++ 9 files changed, 47 insertions(+), 4 deletions(-) diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 0a7b6d2..f6496d5 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -597,6 +597,7 @@ data WarningFlag = | Opt_WarnNonCanonicalMonadFailInstances -- since 8.0 | Opt_WarnNonCanonicalMonoidInstances -- since 8.0 | Opt_WarnMissingPatSynSigs -- since 8.0 + | Opt_WarnUnrecognisedWarningFlags -- since 8.0 deriving (Eq, Show, Enum) data Language = Haskell98 | Haskell2010 @@ -2744,7 +2745,8 @@ dynamic_flags = [ ++ map (mkFlag turnOff "XNo" unSetExtensionFlag) xFlags ++ map (mkFlag turnOn "X" setLanguage ) languageFlags ++ map (mkFlag turnOn "X" setSafeHaskell ) safeHaskellFlags - ++ [ defFlag "XGenerics" + ++ [ unrecognisedWarning + , defFlag "XGenerics" (NoArg (deprecate $ "it does nothing; look into -XDefaultSignatures " ++ "and -XDeriveGeneric for generic programming support.")) @@ -2753,6 +2755,16 @@ dynamic_flags = [ "it does nothing; look into -XDefaultSignatures and " ++ "-XDeriveGeneric for generic programming support.")) ] +-- | This is where we handle unrecognised warning flags. We only issue a warning +-- if -Wunrecognised-warning-flags is set. See Trac #11429 for context. +unrecognisedWarning :: Flag (CmdLineP DynFlags) +unrecognisedWarning = defFlag "W" (Prefix action) + where + action :: String -> EwM (CmdLineP DynFlags) () + action flag = do + f <- wopt Opt_WarnUnrecognisedWarningFlags <$> liftEwM getCmdLineState + when f $ addWarn $ "unrecognised warning flag: -W"++flag + -- See Note [Supporting CLI completion] package_flags :: [Flag (CmdLineP DynFlags)] package_flags = [ @@ -2965,7 +2977,8 @@ wWarningFlags = [ flagSpec "unused-top-binds" Opt_WarnUnusedTopBinds, flagSpec "warnings-deprecations" Opt_WarnWarningsDeprecations, flagSpec "wrong-do-bind" Opt_WarnWrongDoBind, - flagSpec "missing-pat-syn-sigs" Opt_WarnMissingPatSynSigs] + flagSpec "missing-pat-syn-sigs" Opt_WarnMissingPatSynSigs, + flagSpec "unrecognised-warning-flags" Opt_WarnUnrecognisedWarningFlags ] -- | These @-\@ flags can all be reversed with @-no-\@ negatableFlags :: [FlagSpec GeneralFlag] @@ -3464,7 +3477,7 @@ optLevelFlags -- see Note [Documenting optimisation flags] -- please remember to update the User's Guide. The relevant file is: -- -- * utils/mkUserGuidePart/ --- * docs/users_guide/using.rst +-- * docs/users_guide/using-warnings.rst -- | Warnings enabled unless specified otherwise standardWarnings :: [WarningFlag] @@ -3487,7 +3500,8 @@ standardWarnings -- see Note [Documenting warning flags] Opt_WarnInlineRuleShadowing, Opt_WarnAlternativeLayoutRuleTransitional, Opt_WarnUnsupportedLlvmVersion, - Opt_WarnTabs + Opt_WarnTabs, + Opt_WarnUnrecognisedWarningFlags ] -- | Things you get with -W diff --git a/docs/users_guide/using-warnings.rst b/docs/users_guide/using-warnings.rst index 4f9a741..10fc9df 100644 --- a/docs/users_guide/using-warnings.rst +++ b/docs/users_guide/using-warnings.rst @@ -31,6 +31,7 @@ generally likely to indicate bugs in your program. These are: * :ghc-flag:`-Winline-rule-shadowing` * :ghc-flag:`-Wunsupported-llvm-version` * :ghc-flag:`-Wtabs` + * :ghc-flag:`-Wunrecognised-warning-flags` The following flags are simple ways to select standard "packages" of warnings: @@ -106,6 +107,13 @@ command line. For backwards compatibility with GHC versions prior to 8.0, all these warnings can still be controlled with ``-f(no-)warn-*`` instead of ``-W(no-)*``. +.. ghc-flag:: -Wunrecognised-warning-flags + + Enables warnings when the compiler encounters a ``-W...`` flag that is not + recognised. + + This warning is on by default. + .. ghc-flag:: -Wtyped-holes Determines whether the compiler reports typed holes warnings. Has no diff --git a/testsuite/tests/plugins/frontend01.hs b/testsuite/tests/driver/T11429a.hs similarity index 68% copy from testsuite/tests/plugins/frontend01.hs copy to testsuite/tests/driver/T11429a.hs index db01456..c81fb82 100644 --- a/testsuite/tests/plugins/frontend01.hs +++ b/testsuite/tests/driver/T11429a.hs @@ -1 +1,2 @@ +main :: IO () main = putStrLn "hello world" diff --git a/testsuite/tests/driver/T11429a.stderr b/testsuite/tests/driver/T11429a.stderr new file mode 100644 index 0000000..c52b89e --- /dev/null +++ b/testsuite/tests/driver/T11429a.stderr @@ -0,0 +1,2 @@ + +on the commandline: warning: unrecognised warning flag: -Wfoobar diff --git a/testsuite/tests/plugins/frontend01.hs b/testsuite/tests/driver/T11429b.hs similarity index 68% copy from testsuite/tests/plugins/frontend01.hs copy to testsuite/tests/driver/T11429b.hs index db01456..c81fb82 100644 --- a/testsuite/tests/plugins/frontend01.hs +++ b/testsuite/tests/driver/T11429b.hs @@ -1 +1,2 @@ +main :: IO () main = putStrLn "hello world" diff --git a/testsuite/tests/plugins/frontend01.hs b/testsuite/tests/driver/T11429c.hs similarity index 68% copy from testsuite/tests/plugins/frontend01.hs copy to testsuite/tests/driver/T11429c.hs index db01456..c81fb82 100644 --- a/testsuite/tests/plugins/frontend01.hs +++ b/testsuite/tests/driver/T11429c.hs @@ -1 +1,2 @@ +main :: IO () main = putStrLn "hello world" diff --git a/testsuite/tests/driver/T11429c.stderr b/testsuite/tests/driver/T11429c.stderr new file mode 100644 index 0000000..19e269b --- /dev/null +++ b/testsuite/tests/driver/T11429c.stderr @@ -0,0 +1,5 @@ + +: error: +Failing due to -Werror. + +on the commandline: warning: unrecognised warning flag: -Wfoobar diff --git a/testsuite/tests/driver/all.T b/testsuite/tests/driver/all.T index 69d18d9..5a19366 100644 --- a/testsuite/tests/driver/all.T +++ b/testsuite/tests/driver/all.T @@ -467,3 +467,7 @@ test('T10970a', normal, compile_and_run, ['']) test('T4931', normal, compile_and_run, ['']) test('T11182', normal, compile_and_run, ['']) test('T11381', normal, compile_fail, ['']) +test('T11429a', normal, compile, ['-Wunrecognised-warning-flags -Wfoobar']) +test('T11429b', normal, compile, ['-Wno-unrecognised-warning-flags -Wfoobar']) +test('T11429c', normal, compile_fail, ['-Wunrecognised-warning-flags -Werror -Wfoobar']) + diff --git a/utils/mkUserGuidePart/Options/Warnings.hs b/utils/mkUserGuidePart/Options/Warnings.hs index 3c69de7..256d01f 100644 --- a/utils/mkUserGuidePart/Options/Warnings.hs +++ b/utils/mkUserGuidePart/Options/Warnings.hs @@ -36,6 +36,13 @@ warningsOptions = , flagType = DynamicFlag , flagReverse = "-Werror" } + , flag { flagName = "-Wunrecognised-warning-flags" + , flagDescription = + "throw a warning when an unreconised ``-W...`` flag is "++ + "encountered on the command line." + , flagType = DynamicFlag + , flagReverse = "-Wno-unrecognised-warning-flags" + } , flag { flagName = "-fdefer-type-errors" , flagDescription = "Turn type errors into warnings, :ref:`deferring the error until "++ From git at git.haskell.org Mon Jan 25 20:43:55 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Jan 2016 20:43:55 +0000 (UTC) Subject: [commit: ghc] master: Ensure that we don't produce code for pre-ARMv7 without barriers (9fe7d20) Message-ID: <20160125204355.1285B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/9fe7d20e2e5c60325ce04f476bc89fae06e43208/ghc >--------------------------------------------------------------- commit 9fe7d20e2e5c60325ce04f476bc89fae06e43208 Author: Ben Gamari Date: Mon Jan 25 21:19:04 2016 +0100 Ensure that we don't produce code for pre-ARMv7 without barriers We are unable to produce load/store barriers for pre-ARMv7 targets. Phab:D894 added dummy cases to SMP.h for these barriers to prevent the build from failing under the assumption that there are no SMP-capable devices of this vintage. However, #10433 points out that it is more correct to simply set NOSMP for such targets. Tested By: rwbarton Test Plan: Validate Reviewers: erikd, rwbarton, austin Reviewed By: rwbarton Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1704 GHC Trac Issues: #10433 >--------------------------------------------------------------- 9fe7d20e2e5c60325ce04f476bc89fae06e43208 aclocal.m4 | 2 ++ includes/stg/SMP.h | 17 +++-------------- mk/config.mk.in | 7 ++++++- mk/project.mk.in | 4 ++++ 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/aclocal.m4 b/aclocal.m4 index 933aee9..49c575e 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -451,6 +451,8 @@ AC_DEFUN([GET_ARM_ISA], [ARM_ABI="SOFTFP"] )] ) + + AC_SUBST(ARM_ISA) ]) diff --git a/includes/stg/SMP.h b/includes/stg/SMP.h index b0636d5..756f040 100644 --- a/includes/stg/SMP.h +++ b/includes/stg/SMP.h @@ -372,9 +372,7 @@ write_barrier(void) { #elif sparc_HOST_ARCH /* Sparc in TSO mode does not require store/store barriers. */ __asm__ __volatile__ ("" : : : "memory"); -#elif arm_HOST_ARCH && defined(arm_HOST_ARCH_PRE_ARMv7) - __asm__ __volatile__ ("" : : : "memory"); -#elif (arm_HOST_ARCH && !defined(arm_HOST_ARCH_PRE_ARMv7)) || aarch64_HOST_ARCH +#elif (arm_HOST_ARCH) || aarch64_HOST_ARCH __asm__ __volatile__ ("dmb st" : : : "memory"); #else #error memory barriers unimplemented on this architecture @@ -393,14 +391,7 @@ store_load_barrier(void) { __asm__ __volatile__ ("sync" : : : "memory"); #elif sparc_HOST_ARCH __asm__ __volatile__ ("membar #StoreLoad" : : : "memory"); -#elif arm_HOST_ARCH && defined(arm_HOST_ARCH_PRE_ARMv7) - // TODO FIXME: This case probably isn't totally correct - just because we - // use a pre-ARMv7 toolchain (e.g. to target an old Android device), doesn't - // mean the binary won't run on a newer ARMv7 system - in which case it - // needs a proper barrier. So we should rethink this - // - Reid - __asm__ __volatile__ ("" : : : "memory"); -#elif arm_HOST_ARCH && !defined(arm_HOST_ARCH_PRE_ARMv7) +#elif arm_HOST_ARCH __asm__ __volatile__ ("dmb" : : : "memory"); #elif aarch64_HOST_ARCH __asm__ __volatile__ ("dmb sy" : : : "memory"); @@ -422,9 +413,7 @@ load_load_barrier(void) { #elif sparc_HOST_ARCH /* Sparc in TSO mode does not require load/load barriers. */ __asm__ __volatile__ ("" : : : "memory"); -#elif arm_HOST_ARCH && defined(arm_HOST_ARCH_PRE_ARMv7) - __asm__ __volatile__ ("" : : : "memory"); -#elif arm_HOST_ARCH && !defined(arm_HOST_ARCH_PRE_ARMv7) +#elif arm_HOST_ARCH __asm__ __volatile__ ("dmb" : : : "memory"); #elif aarch64_HOST_ARCH __asm__ __volatile__ ("dmb sy" : : : "memory"); diff --git a/mk/config.mk.in b/mk/config.mk.in index 927e686..94ba5d7 100644 --- a/mk/config.mk.in +++ b/mk/config.mk.in @@ -184,7 +184,12 @@ HaveLibDL = @HaveLibDL@ # ArchSupportsSMP should be set iff there is support for that arch in # includes/stg/SMP.h -ArchSupportsSMP=$(strip $(patsubst $(TargetArch_CPP), YES, $(findstring $(TargetArch_CPP), i386 x86_64 sparc powerpc powerpc64 powerpc64le arm aarch64))) +ifeq "$(TargetArch_CPP)" "arm" +# We don't support load/store barriers pre-ARMv7. See #10433. +ArchSupportsSMP="$(if $(filter $(ARM_ISA),ARMv5 ARMv6),NO,YES)" +else +ArchSupportsSMP=$(strip $(patsubst $(TargetArch_CPP), YES, $(findstring $(TargetArch_CPP), i386 x86_64 sparc powerpc powerpc64 powerpc64le aarch64))) +endif GhcWithSMP := $(strip $(if $(filter YESNO, $(ArchSupportsSMP)$(GhcUnregisterised)),YES,NO)) diff --git a/mk/project.mk.in b/mk/project.mk.in index 9e45ae9..03bd744 100644 --- a/mk/project.mk.in +++ b/mk/project.mk.in @@ -158,3 +158,7 @@ CC_CLANG_BACKEND = @CC_CLANG_BACKEND@ # Is the stage0 compiler affected by Bug #9439? GHC_LLVM_AFFECTED_BY_9439 = @GHC_LLVM_AFFECTED_BY_9439@ + +ifeq "$(TargetArch_CPP)" "arm" +ARM_ISA=@ARM_ISA@ +endif From git at git.haskell.org Mon Jan 25 21:41:38 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Jan 2016 21:41:38 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Implement -Wunrecognised-warning-flag (bbd9356) Message-ID: <20160125214138.06D483A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/bbd935606422ca884a680afa806164d851fd5060/ghc >--------------------------------------------------------------- commit bbd935606422ca884a680afa806164d851fd5060 Author: Ben Gamari Date: Mon Jan 25 17:14:49 2016 +0100 Implement -Wunrecognised-warning-flag This allows the user to avoid warnings for warning flags that GHC doesn't recognise. See #11429 for details.. Test Plan: Validate with T11429[abc] tests Reviewers: austin, hvr Reviewed By: hvr Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1830 GHC Trac Issues: #11429 >--------------------------------------------------------------- bbd935606422ca884a680afa806164d851fd5060 compiler/main/DynFlags.hs | 22 ++++++++++++++++++---- docs/users_guide/using-warnings.rst | 8 ++++++++ .../{plugins/frontend01.hs => driver/T11429a.hs} | 1 + testsuite/tests/driver/T11429a.stderr | 2 ++ .../{plugins/frontend01.hs => driver/T11429b.hs} | 1 + .../{plugins/frontend01.hs => driver/T11429c.hs} | 1 + testsuite/tests/driver/T11429c.stderr | 5 +++++ testsuite/tests/driver/all.T | 4 ++++ utils/mkUserGuidePart/Options/Warnings.hs | 7 +++++++ 9 files changed, 47 insertions(+), 4 deletions(-) diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 7ce2a3d..3dce446 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -600,6 +600,7 @@ data WarningFlag = | Opt_WarnNonCanonicalMonadFailInstances -- since 8.0 | Opt_WarnNonCanonicalMonoidInstances -- since 8.0 | Opt_WarnMissingPatSynSigs -- since 8.0 + | Opt_WarnUnrecognisedWarningFlags -- since 8.0 deriving (Eq, Show, Enum) data Language = Haskell98 | Haskell2010 @@ -2749,7 +2750,8 @@ dynamic_flags = [ ++ map (mkFlag turnOff "XNo" unSetExtensionFlag) xFlags ++ map (mkFlag turnOn "X" setLanguage ) languageFlags ++ map (mkFlag turnOn "X" setSafeHaskell ) safeHaskellFlags - ++ [ defFlag "XGenerics" + ++ [ unrecognisedWarning + , defFlag "XGenerics" (NoArg (deprecate $ "it does nothing; look into -XDefaultSignatures " ++ "and -XDeriveGeneric for generic programming support.")) @@ -2758,6 +2760,16 @@ dynamic_flags = [ "it does nothing; look into -XDefaultSignatures and " ++ "-XDeriveGeneric for generic programming support.")) ] +-- | This is where we handle unrecognised warning flags. We only issue a warning +-- if -Wunrecognised-warning-flags is set. See Trac #11429 for context. +unrecognisedWarning :: Flag (CmdLineP DynFlags) +unrecognisedWarning = defFlag "W" (Prefix action) + where + action :: String -> EwM (CmdLineP DynFlags) () + action flag = do + f <- wopt Opt_WarnUnrecognisedWarningFlags <$> liftEwM getCmdLineState + when f $ addWarn $ "unrecognised warning flag: -W"++flag + -- See Note [Supporting CLI completion] package_flags :: [Flag (CmdLineP DynFlags)] package_flags = [ @@ -2970,7 +2982,8 @@ wWarningFlags = [ flagSpec "unused-top-binds" Opt_WarnUnusedTopBinds, flagSpec "warnings-deprecations" Opt_WarnWarningsDeprecations, flagSpec "wrong-do-bind" Opt_WarnWrongDoBind, - flagSpec "missing-pat-syn-sigs" Opt_WarnMissingPatSynSigs] + flagSpec "missing-pat-syn-sigs" Opt_WarnMissingPatSynSigs, + flagSpec "unrecognised-warning-flags" Opt_WarnUnrecognisedWarningFlags ] -- | These @-\@ flags can all be reversed with @-no-\@ negatableFlags :: [FlagSpec GeneralFlag] @@ -3469,7 +3482,7 @@ optLevelFlags -- see Note [Documenting optimisation flags] -- please remember to update the User's Guide. The relevant file is: -- -- * utils/mkUserGuidePart/ --- * docs/users_guide/using.rst +-- * docs/users_guide/using-warnings.rst -- | Warnings enabled unless specified otherwise standardWarnings :: [WarningFlag] @@ -3492,7 +3505,8 @@ standardWarnings -- see Note [Documenting warning flags] Opt_WarnInlineRuleShadowing, Opt_WarnAlternativeLayoutRuleTransitional, Opt_WarnUnsupportedLlvmVersion, - Opt_WarnTabs + Opt_WarnTabs, + Opt_WarnUnrecognisedWarningFlags ] -- | Things you get with -W diff --git a/docs/users_guide/using-warnings.rst b/docs/users_guide/using-warnings.rst index 4f9a741..10fc9df 100644 --- a/docs/users_guide/using-warnings.rst +++ b/docs/users_guide/using-warnings.rst @@ -31,6 +31,7 @@ generally likely to indicate bugs in your program. These are: * :ghc-flag:`-Winline-rule-shadowing` * :ghc-flag:`-Wunsupported-llvm-version` * :ghc-flag:`-Wtabs` + * :ghc-flag:`-Wunrecognised-warning-flags` The following flags are simple ways to select standard "packages" of warnings: @@ -106,6 +107,13 @@ command line. For backwards compatibility with GHC versions prior to 8.0, all these warnings can still be controlled with ``-f(no-)warn-*`` instead of ``-W(no-)*``. +.. ghc-flag:: -Wunrecognised-warning-flags + + Enables warnings when the compiler encounters a ``-W...`` flag that is not + recognised. + + This warning is on by default. + .. ghc-flag:: -Wtyped-holes Determines whether the compiler reports typed holes warnings. Has no diff --git a/testsuite/tests/plugins/frontend01.hs b/testsuite/tests/driver/T11429a.hs similarity index 68% copy from testsuite/tests/plugins/frontend01.hs copy to testsuite/tests/driver/T11429a.hs index db01456..c81fb82 100644 --- a/testsuite/tests/plugins/frontend01.hs +++ b/testsuite/tests/driver/T11429a.hs @@ -1 +1,2 @@ +main :: IO () main = putStrLn "hello world" diff --git a/testsuite/tests/driver/T11429a.stderr b/testsuite/tests/driver/T11429a.stderr new file mode 100644 index 0000000..c52b89e --- /dev/null +++ b/testsuite/tests/driver/T11429a.stderr @@ -0,0 +1,2 @@ + +on the commandline: warning: unrecognised warning flag: -Wfoobar diff --git a/testsuite/tests/plugins/frontend01.hs b/testsuite/tests/driver/T11429b.hs similarity index 68% copy from testsuite/tests/plugins/frontend01.hs copy to testsuite/tests/driver/T11429b.hs index db01456..c81fb82 100644 --- a/testsuite/tests/plugins/frontend01.hs +++ b/testsuite/tests/driver/T11429b.hs @@ -1 +1,2 @@ +main :: IO () main = putStrLn "hello world" diff --git a/testsuite/tests/plugins/frontend01.hs b/testsuite/tests/driver/T11429c.hs similarity index 68% copy from testsuite/tests/plugins/frontend01.hs copy to testsuite/tests/driver/T11429c.hs index db01456..c81fb82 100644 --- a/testsuite/tests/plugins/frontend01.hs +++ b/testsuite/tests/driver/T11429c.hs @@ -1 +1,2 @@ +main :: IO () main = putStrLn "hello world" diff --git a/testsuite/tests/driver/T11429c.stderr b/testsuite/tests/driver/T11429c.stderr new file mode 100644 index 0000000..19e269b --- /dev/null +++ b/testsuite/tests/driver/T11429c.stderr @@ -0,0 +1,5 @@ + +: error: +Failing due to -Werror. + +on the commandline: warning: unrecognised warning flag: -Wfoobar diff --git a/testsuite/tests/driver/all.T b/testsuite/tests/driver/all.T index 69d18d9..5a19366 100644 --- a/testsuite/tests/driver/all.T +++ b/testsuite/tests/driver/all.T @@ -467,3 +467,7 @@ test('T10970a', normal, compile_and_run, ['']) test('T4931', normal, compile_and_run, ['']) test('T11182', normal, compile_and_run, ['']) test('T11381', normal, compile_fail, ['']) +test('T11429a', normal, compile, ['-Wunrecognised-warning-flags -Wfoobar']) +test('T11429b', normal, compile, ['-Wno-unrecognised-warning-flags -Wfoobar']) +test('T11429c', normal, compile_fail, ['-Wunrecognised-warning-flags -Werror -Wfoobar']) + diff --git a/utils/mkUserGuidePart/Options/Warnings.hs b/utils/mkUserGuidePart/Options/Warnings.hs index 3c69de7..256d01f 100644 --- a/utils/mkUserGuidePart/Options/Warnings.hs +++ b/utils/mkUserGuidePart/Options/Warnings.hs @@ -36,6 +36,13 @@ warningsOptions = , flagType = DynamicFlag , flagReverse = "-Werror" } + , flag { flagName = "-Wunrecognised-warning-flags" + , flagDescription = + "throw a warning when an unreconised ``-W...`` flag is "++ + "encountered on the command line." + , flagType = DynamicFlag + , flagReverse = "-Wno-unrecognised-warning-flags" + } , flag { flagName = "-fdefer-type-errors" , flagDescription = "Turn type errors into warnings, :ref:`deferring the error until "++ From git at git.haskell.org Mon Jan 25 21:41:40 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Jan 2016 21:41:40 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Ensure that we don't produce code for pre-ARMv7 without barriers (761d423) Message-ID: <20160125214140.BAD3A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/761d423ec2723137c67942718b4d6d793716acff/ghc >--------------------------------------------------------------- commit 761d423ec2723137c67942718b4d6d793716acff Author: Ben Gamari Date: Mon Jan 25 21:19:04 2016 +0100 Ensure that we don't produce code for pre-ARMv7 without barriers We are unable to produce load/store barriers for pre-ARMv7 targets. Phab:D894 added dummy cases to SMP.h for these barriers to prevent the build from failing under the assumption that there are no SMP-capable devices of this vintage. However, #10433 points out that it is more correct to simply set NOSMP for such targets. Tested By: rwbarton Test Plan: Validate Reviewers: erikd, rwbarton, austin Reviewed By: rwbarton Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1704 GHC Trac Issues: #10433 >--------------------------------------------------------------- 761d423ec2723137c67942718b4d6d793716acff aclocal.m4 | 2 ++ includes/stg/SMP.h | 17 +++-------------- mk/config.mk.in | 7 ++++++- mk/project.mk.in | 4 ++++ 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/aclocal.m4 b/aclocal.m4 index 8e97726..cd680e5 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -451,6 +451,8 @@ AC_DEFUN([GET_ARM_ISA], [ARM_ABI="SOFTFP"] )] ) + + AC_SUBST(ARM_ISA) ]) diff --git a/includes/stg/SMP.h b/includes/stg/SMP.h index b0636d5..756f040 100644 --- a/includes/stg/SMP.h +++ b/includes/stg/SMP.h @@ -372,9 +372,7 @@ write_barrier(void) { #elif sparc_HOST_ARCH /* Sparc in TSO mode does not require store/store barriers. */ __asm__ __volatile__ ("" : : : "memory"); -#elif arm_HOST_ARCH && defined(arm_HOST_ARCH_PRE_ARMv7) - __asm__ __volatile__ ("" : : : "memory"); -#elif (arm_HOST_ARCH && !defined(arm_HOST_ARCH_PRE_ARMv7)) || aarch64_HOST_ARCH +#elif (arm_HOST_ARCH) || aarch64_HOST_ARCH __asm__ __volatile__ ("dmb st" : : : "memory"); #else #error memory barriers unimplemented on this architecture @@ -393,14 +391,7 @@ store_load_barrier(void) { __asm__ __volatile__ ("sync" : : : "memory"); #elif sparc_HOST_ARCH __asm__ __volatile__ ("membar #StoreLoad" : : : "memory"); -#elif arm_HOST_ARCH && defined(arm_HOST_ARCH_PRE_ARMv7) - // TODO FIXME: This case probably isn't totally correct - just because we - // use a pre-ARMv7 toolchain (e.g. to target an old Android device), doesn't - // mean the binary won't run on a newer ARMv7 system - in which case it - // needs a proper barrier. So we should rethink this - // - Reid - __asm__ __volatile__ ("" : : : "memory"); -#elif arm_HOST_ARCH && !defined(arm_HOST_ARCH_PRE_ARMv7) +#elif arm_HOST_ARCH __asm__ __volatile__ ("dmb" : : : "memory"); #elif aarch64_HOST_ARCH __asm__ __volatile__ ("dmb sy" : : : "memory"); @@ -422,9 +413,7 @@ load_load_barrier(void) { #elif sparc_HOST_ARCH /* Sparc in TSO mode does not require load/load barriers. */ __asm__ __volatile__ ("" : : : "memory"); -#elif arm_HOST_ARCH && defined(arm_HOST_ARCH_PRE_ARMv7) - __asm__ __volatile__ ("" : : : "memory"); -#elif arm_HOST_ARCH && !defined(arm_HOST_ARCH_PRE_ARMv7) +#elif arm_HOST_ARCH __asm__ __volatile__ ("dmb" : : : "memory"); #elif aarch64_HOST_ARCH __asm__ __volatile__ ("dmb sy" : : : "memory"); diff --git a/mk/config.mk.in b/mk/config.mk.in index a8581e3..d2c042d 100644 --- a/mk/config.mk.in +++ b/mk/config.mk.in @@ -184,7 +184,12 @@ HaveLibDL = @HaveLibDL@ # ArchSupportsSMP should be set iff there is support for that arch in # includes/stg/SMP.h -ArchSupportsSMP=$(strip $(patsubst $(TargetArch_CPP), YES, $(findstring $(TargetArch_CPP), i386 x86_64 sparc powerpc powerpc64 powerpc64le arm aarch64))) +ifeq "$(TargetArch_CPP)" "arm" +# We don't support load/store barriers pre-ARMv7. See #10433. +ArchSupportsSMP="$(if $(filter $(ARM_ISA),ARMv5 ARMv6),NO,YES)" +else +ArchSupportsSMP=$(strip $(patsubst $(TargetArch_CPP), YES, $(findstring $(TargetArch_CPP), i386 x86_64 sparc powerpc powerpc64 powerpc64le aarch64))) +endif GhcWithSMP := $(strip $(if $(filter YESNO, $(ArchSupportsSMP)$(GhcUnregisterised)),YES,NO)) diff --git a/mk/project.mk.in b/mk/project.mk.in index 9e45ae9..03bd744 100644 --- a/mk/project.mk.in +++ b/mk/project.mk.in @@ -158,3 +158,7 @@ CC_CLANG_BACKEND = @CC_CLANG_BACKEND@ # Is the stage0 compiler affected by Bug #9439? GHC_LLVM_AFFECTED_BY_9439 = @GHC_LLVM_AFFECTED_BY_9439@ + +ifeq "$(TargetArch_CPP)" "arm" +ARM_ISA=@ARM_ISA@ +endif From git at git.haskell.org Mon Jan 25 21:45:44 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 25 Jan 2016 21:45:44 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: rts: Disable tick timer unless really needed (26a9f13) Message-ID: <20160125214544.742B83A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/26a9f13ca4f602749f0f00388a145badbf7c27dd/ghc >--------------------------------------------------------------- commit 26a9f13ca4f602749f0f00388a145badbf7c27dd Author: Ben Gamari Date: Fri Jan 22 16:22:13 2016 +0100 rts: Disable tick timer unless really needed Trac #9105 notes significant CPU usage by an otherwise idle process when compiled with profiling. The reason for this is that we keep the tick timer active in the profiling RTS even if profiling wasn't requested at runtime. If the user requests any sort of profiling then we need to keep the timer active to ensure that samples are collected. Test Plan: Validate, check CPU usage, ensure profiling still works Reviewers: simonmar, austin Reviewed By: simonmar, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1822 GHC Trac Issues: #9105 (cherry picked from commit b01288d509b0f9e45f23ae48f2366f85f489089c) >--------------------------------------------------------------- 26a9f13ca4f602749f0f00388a145badbf7c27dd rts/Timer.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/rts/Timer.c b/rts/Timer.c index 99c09b0..bf7240b 100644 --- a/rts/Timer.c +++ b/rts/Timer.c @@ -72,10 +72,15 @@ handle_tick(int unused STG_UNUSED) #endif } else { recent_activity = ACTIVITY_DONE_GC; - // disable timer signals (see #1623, #5991) - // but only if we're not profiling + // disable timer signals (see #1623, #5991, #9105) + // but only if we're not profiling (e.g. passed -h or -p RTS + // flags). If we are profiling we need to keep the timer active + // so that samples continue to be collected. #ifndef PROFILING - stopTimer(); + if (!(RtsFlags.ProfFlags.doHeapProfile + || RtsFlags.CcFlags.doCostCentres)) { + stopTimer(); + } #endif } } else { From git at git.haskell.org Tue Jan 26 10:48:40 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 26 Jan 2016 10:48:40 +0000 (UTC) Subject: [commit: ghc] master: Add "ticks-exhausted" comment (47b3f58) Message-ID: <20160126104840.37E083A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/47b3f58889caa71bf096a149e58c2a9b94b75a7d/ghc >--------------------------------------------------------------- commit 47b3f58889caa71bf096a149e58c2a9b94b75a7d Author: Simon Peyton Jones Date: Tue Jan 26 09:24:33 2016 +0000 Add "ticks-exhausted" comment This code deliberately builds a subtle negative-occurrence-of-data-type example, described in the paper, so with -O it'll give "simplifier ticks exhausted". This patch just adds a comment to explain. >--------------------------------------------------------------- 47b3f58889caa71bf096a149e58c2a9b94b75a7d testsuite/tests/dependent/should_compile/dynamic-paper.hs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/testsuite/tests/dependent/should_compile/dynamic-paper.hs b/testsuite/tests/dependent/should_compile/dynamic-paper.hs index 4e89209..fd63871 100644 --- a/testsuite/tests/dependent/should_compile/dynamic-paper.hs +++ b/testsuite/tests/dependent/should_compile/dynamic-paper.hs @@ -1,6 +1,9 @@ {- This is the code extracted from "A reflection on types", by Simon PJ, Stephanie Weirich, Richard Eisenberg, and Dimitrios Vytiniotis, 2016. -} +-- NB: it includes a negative-recursive function (see delta1), and +-- so will give "simplifer ticks exhausted", at least with -O + {-# LANGUAGE RankNTypes, PolyKinds, TypeOperators, ScopedTypeVariables, GADTs, FlexibleInstances, UndecidableInstances, RebindableSyntax, @@ -239,6 +242,10 @@ tcMaybe = TyCon { tc_module = Module { mod_pkg = "base" rt = undefined delta1 :: Dynamic -> Dynamic +-- NB: this function behaves like a negative-recursive data type +-- and hence leads compiler into an infinite inlining loop, +-- and we get "simplifier ticks exhausted". +-- See Section 7 of the paper "A reflection on types" delta1 dn = case fromDynamic dn of Just f -> f dn Nothing -> dn From git at git.haskell.org Tue Jan 26 10:48:42 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 26 Jan 2016 10:48:42 +0000 (UTC) Subject: [commit: ghc] master: Less verbose output for the in-scope set (632f020) Message-ID: <20160126104842.E6B393A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/632f020b6ee6fa1ebf9942a11be9d3a6a0cd4c06/ghc >--------------------------------------------------------------- commit 632f020b6ee6fa1ebf9942a11be9d3a6a0cd4c06 Author: Simon Peyton Jones Date: Mon Jan 25 14:17:14 2016 +0000 Less verbose output for the in-scope set With -dppr-debug the output for the (ofen-large) InScope set was overwhelming. This makes it smaller. Only affects debugging. >--------------------------------------------------------------- 632f020b6ee6fa1ebf9942a11be9d3a6a0cd4c06 compiler/basicTypes/VarEnv.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/compiler/basicTypes/VarEnv.hs b/compiler/basicTypes/VarEnv.hs index 08eabee..10a7f14 100644 --- a/compiler/basicTypes/VarEnv.hs +++ b/compiler/basicTypes/VarEnv.hs @@ -99,7 +99,10 @@ data InScopeSet = InScope (VarEnv Var) {-# UNPACK #-} !Int -- INVARIANT: it's not zero; we use it as a multiplier in uniqAway instance Outputable InScopeSet where - ppr (InScope s _) = text "InScope" <+> ppr s + ppr (InScope s _) = text "InScope" + <+> braces (fsep (map (ppr . Var.varName) (varSetElems s))) + -- In-scope sets get big, and with -dppr-debug + -- the output is overwhelming emptyInScopeSet :: InScopeSet emptyInScopeSet = InScope emptyVarSet 1 From git at git.haskell.org Tue Jan 26 10:48:46 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 26 Jan 2016 10:48:46 +0000 (UTC) Subject: [commit: ghc] master: Fix two cloning-related bugs (016a0bd) Message-ID: <20160126104846.410633A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/016a0bd1ba129134dfa612db0d96e01644fa7b9f/ghc >--------------------------------------------------------------- commit 016a0bd1ba129134dfa612db0d96e01644fa7b9f Author: Simon Peyton Jones Date: Tue Jan 26 09:30:50 2016 +0000 Fix two cloning-related bugs Crikey! Not just one but two bugs in type variable cloning, both dating from the days before PolyKinds. Both were shown up by Trac #11330. 1. In SetLevels, when floating a case expression we must clone its binders, *and* do so in a telescope-aware way, because the constructor may bind a kind variable that appears in the kind of a type variable. Instead of doing this (wrongly) by steam, call CoreSubst.cloneBndrs. I added Notes and did other refactoring at the same time. 2. It turned out that CoreSubst.cloneBndrs calls TyCoRep.cloneTyVarBndr, and that too was bogus! It didn't substitute in the kind of the TyVar being cloned. There was even a comment to say "variables can't appear in kinds". Thta hasn't been true for a long time now. Easily fixed. Interestingly, I then found that test dependent/should_compile/KindEqualities was emitting a new inexhaustive-pattern-match warning. Sure enough it was valid! So the lack of cloning in cloneTyVarBndr really was causing an observable bug; just one that we had not observed. >--------------------------------------------------------------- 016a0bd1ba129134dfa612db0d96e01644fa7b9f compiler/simplCore/SetLevels.hs | 84 +++++++++++++--------- compiler/types/TyCoRep.hs | 21 +++--- .../dependent/should_compile/KindEqualities.stderr | 5 ++ 3 files changed, 69 insertions(+), 41 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 016a0bd1ba129134dfa612db0d96e01644fa7b9f From git at git.haskell.org Tue Jan 26 10:48:48 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 26 Jan 2016 10:48:48 +0000 (UTC) Subject: [commit: ghc] master: White space only (cf788a5) Message-ID: <20160126104848.F34293A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/cf788a53df3ada686ec516c2edffeb54b632065f/ghc >--------------------------------------------------------------- commit cf788a53df3ada686ec516c2edffeb54b632065f Author: Simon Peyton Jones Date: Tue Jan 26 09:00:57 2016 +0000 White space only >--------------------------------------------------------------- cf788a53df3ada686ec516c2edffeb54b632065f compiler/coreSyn/CoreSubst.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/coreSyn/CoreSubst.hs b/compiler/coreSyn/CoreSubst.hs index a3ab970..8d4529a 100644 --- a/compiler/coreSyn/CoreSubst.hs +++ b/compiler/coreSyn/CoreSubst.hs @@ -542,8 +542,8 @@ cloneBndrs subst us vs cloneBndr :: Subst -> Unique -> Var -> (Subst, Var) cloneBndr subst uniq v - | isTyVar v = cloneTyVarBndr subst v uniq - | otherwise = clone_id subst subst (v,uniq) -- Works for coercion variables too + | isTyVar v = cloneTyVarBndr subst v uniq + | otherwise = clone_id subst subst (v,uniq) -- Works for coercion variables too -- | Clone a mutually recursive group of 'Id's cloneRecIdBndrs :: Subst -> UniqSupply -> [Id] -> (Subst, [Id]) From git at git.haskell.org Tue Jan 26 10:48:51 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 26 Jan 2016 10:48:51 +0000 (UTC) Subject: [commit: ghc] master: Kill off zipTopTCvSubst in favour of zipOpenTCvSubst (1c6d70c) Message-ID: <20160126104851.C02893A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/1c6d70c2121fd1126fcc2458bdbcc856e19598c2/ghc >--------------------------------------------------------------- commit 1c6d70c2121fd1126fcc2458bdbcc856e19598c2 Author: Simon Peyton Jones Date: Tue Jan 26 09:37:06 2016 +0000 Kill off zipTopTCvSubst in favour of zipOpenTCvSubst As Bartosz has discovered, the invariants for substitutions were wrong, and in particular the "mkTop...Subst" and "zipTop..Subst" functions were building substitutions that didn't obey even the old invariants. This patch kills of the bogus zipTopTCvSubst in favour of the more robust zipOpenTCvSubst. I tripped over this because my upcoming patch (concerning SetLevels, Trac #11330) triggered an ASSERT failure in the substitution well-formedness assertion in TyCoRep. >--------------------------------------------------------------- 1c6d70c2121fd1126fcc2458bdbcc856e19598c2 compiler/deSugar/Check.hs | 2 +- compiler/iface/BuildTyCl.hs | 6 +++--- compiler/typecheck/TcDeriv.hs | 4 ++-- compiler/typecheck/TcPat.hs | 2 +- compiler/typecheck/TcType.hs | 4 ++-- compiler/types/TyCoRep.hs | 35 ++++++++++++++--------------------- compiler/types/Type.hs | 4 ++-- 7 files changed, 25 insertions(+), 32 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 1c6d70c2121fd1126fcc2458bdbcc856e19598c2 From git at git.haskell.org Tue Jan 26 11:42:49 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 26 Jan 2016 11:42:49 +0000 (UTC) Subject: [commit: ghc] master: Missed plural renaming in user's guide (34c9a4e) Message-ID: <20160126114249.7E0843A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/34c9a4e4290595adc2e59024f9bfdc914b0f6dd3/ghc >--------------------------------------------------------------- commit 34c9a4e4290595adc2e59024f9bfdc914b0f6dd3 Author: Herbert Valerio Riedel Date: Tue Jan 26 11:59:40 2016 +0100 Missed plural renaming in user's guide Follow-up to 132c20894d102558cc8f3aee5bc289425d0ddb24 [skip ci] >--------------------------------------------------------------- 34c9a4e4290595adc2e59024f9bfdc914b0f6dd3 docs/users_guide/8.0.1-notes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/users_guide/8.0.1-notes.rst b/docs/users_guide/8.0.1-notes.rst index 153a4d3..6239ea5 100644 --- a/docs/users_guide/8.0.1-notes.rst +++ b/docs/users_guide/8.0.1-notes.rst @@ -252,7 +252,7 @@ Compiler allows library authors eager to make their code future compatible to adapt to new features before they even generate warnings. -- Added the :ghc-flag:`-Wmissing-monadfail-instance` flag. When enabled, this +- Added the :ghc-flag:`-Wmissing-monadfail-instances` flag. When enabled, this will issue a warning if a failable pattern is used in a context that does not have a ``MonadFail`` constraint. This flag represents phase 1 of the `MonadFail Proposal (MFP) From git at git.haskell.org Tue Jan 26 11:42:52 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 26 Jan 2016 11:42:52 +0000 (UTC) Subject: [commit: ghc] master: Minor users-guide markup fixup [skip ci] (5f5dc86) Message-ID: <20160126114252.2DD393A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/5f5dc8626e59272f7055f57d9a651c9bbb3a6ee5/ghc >--------------------------------------------------------------- commit 5f5dc8626e59272f7055f57d9a651c9bbb3a6ee5 Author: Herbert Valerio Riedel Date: Tue Jan 26 12:00:58 2016 +0100 Minor users-guide markup fixup [skip ci] >--------------------------------------------------------------- 5f5dc8626e59272f7055f57d9a651c9bbb3a6ee5 docs/users_guide/using-warnings.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/users_guide/using-warnings.rst b/docs/users_guide/using-warnings.rst index 10fc9df..e4f8d2c 100644 --- a/docs/users_guide/using-warnings.rst +++ b/docs/users_guide/using-warnings.rst @@ -226,7 +226,7 @@ of ``-W(no-)*``. * If ``return`` is defined it must be canonical (i.e. ``return = pure``). * If ``(>>)`` is defined it must be canonical (i.e. ``(>>) = (*>)``). - Moreover, in 'Applicative' instance declarations: + Moreover, in ``Applicative`` instance declarations: * Warn if ``pure`` is defined backwards (i.e. ``pure = return``). * Warn if ``(*>)`` is defined backwards (i.e. ``(*>) = (>>)``). @@ -268,7 +268,7 @@ of ``-W(no-)*``. * If ``mappend`` is defined it must be canonical (i.e. ``mappend = (Data.Semigroup.<>)``). - Moreover, in 'Semigroup' instance declarations: + Moreover, in ``Semigroup`` instance declarations: * Warn if ``(<>)`` is defined backwards (i.e. ``(<>) = mappend``). From git at git.haskell.org Tue Jan 26 11:42:54 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 26 Jan 2016 11:42:54 +0000 (UTC) Subject: [commit: ghc] master: Update transformers submodule to 0.5.1.0 release (9b71695) Message-ID: <20160126114254.CE06E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/9b716950e1c9e99afe2840ef804e5b3343ef3653/ghc >--------------------------------------------------------------- commit 9b716950e1c9e99afe2840ef804e5b3343ef3653 Author: Herbert Valerio Riedel Date: Tue Jan 26 12:03:23 2016 +0100 Update transformers submodule to 0.5.1.0 release This shouldn't have any noticeable API changes for GHC >--------------------------------------------------------------- 9b716950e1c9e99afe2840ef804e5b3343ef3653 libraries/transformers | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/transformers b/libraries/transformers index 1a2bc4e..a2f7dd0 160000 --- a/libraries/transformers +++ b/libraries/transformers @@ -1 +1 @@ -Subproject commit 1a2bc4ecada9561911e9c2e8a98a3c6bf59b7bb1 +Subproject commit a2f7dd057a0ee0c6cb206609594d7a07d26a1861 From git at git.haskell.org Tue Jan 26 11:42:57 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 26 Jan 2016 11:42:57 +0000 (UTC) Subject: [commit: ghc] master: Update process submodule to 1.4.2.0 release (f1885df) Message-ID: <20160126114257.BDA013A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/f1885dfd7ee84fae478e2e8398d2eff14ee36b2c/ghc >--------------------------------------------------------------- commit f1885dfd7ee84fae478e2e8398d2eff14ee36b2c Author: Herbert Valerio Riedel Date: Tue Jan 26 12:41:23 2016 +0100 Update process submodule to 1.4.2.0 release Most notably, this pulls in a feature needed for #11100 (remote ghci) windows-support >--------------------------------------------------------------- f1885dfd7ee84fae478e2e8398d2eff14ee36b2c libraries/process | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/process b/libraries/process index 0edb978..296cbce 160000 --- a/libraries/process +++ b/libraries/process @@ -1 +1 @@ -Subproject commit 0edb97876c2f783b33f9a69089ca9d26a061e112 +Subproject commit 296cbce6294316d6534b4449fc7ab0f0d3f5775b From git at git.haskell.org Tue Jan 26 12:36:09 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 26 Jan 2016 12:36:09 +0000 (UTC) Subject: [commit: ghc] master: Fix three broken tests involving exceptions (3798b2a) Message-ID: <20160126123609.872423A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/3798b2aad8f62cb18e6147b54c57a9a4ad6c23f4/ghc >--------------------------------------------------------------- commit 3798b2aad8f62cb18e6147b54c57a9a4ad6c23f4 Author: Simon Peyton Jones Date: Tue Jan 26 12:36:21 2016 +0000 Fix three broken tests involving exceptions See comment:16 in Trac #10712. The tests were wrong, not GHC! >--------------------------------------------------------------- 3798b2aad8f62cb18e6147b54c57a9a4ad6c23f4 testsuite/tests/concurrent/should_run/T3279.hs | 2 +- testsuite/tests/concurrent/should_run/conc012.hs | 2 +- testsuite/tests/concurrent/should_run/conc014.hs | 10 ++++------ 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/testsuite/tests/concurrent/should_run/T3279.hs b/testsuite/tests/concurrent/should_run/T3279.hs index a90d38a..b721a61 100644 --- a/testsuite/tests/concurrent/should_run/T3279.hs +++ b/testsuite/tests/concurrent/should_run/T3279.hs @@ -7,7 +7,7 @@ import GHC.IO (unsafeUnmask) f :: Int f = (1 +) . unsafePerformIO $ do - error "foo" `catch` \(SomeException e) -> do + throwIO (ErrorCall "foo") `catch` \(SomeException e) -> do myThreadId >>= flip throwTo e -- point X unsafeUnmask $ return 1 diff --git a/testsuite/tests/concurrent/should_run/conc012.hs b/testsuite/tests/concurrent/should_run/conc012.hs index a2f139e..753fa89 100644 --- a/testsuite/tests/concurrent/should_run/conc012.hs +++ b/testsuite/tests/concurrent/should_run/conc012.hs @@ -15,7 +15,7 @@ stackoverflow n = n + stackoverflow n main = do let x = stackoverflow 1 result <- newEmptyMVar - forkIO $ Control.Exception.catch (x `seq` putMVar result Finished) $ + forkIO $ Control.Exception.catch (evaluate x >> putMVar result Finished) $ \e -> putMVar result (Died e) res <- takeMVar result case res of diff --git a/testsuite/tests/concurrent/should_run/conc014.hs b/testsuite/tests/concurrent/should_run/conc014.hs index 76cb3c2..7171674 100644 --- a/testsuite/tests/concurrent/should_run/conc014.hs +++ b/testsuite/tests/concurrent/should_run/conc014.hs @@ -8,13 +8,11 @@ main = do main_thread <- myThreadId m <- newEmptyMVar forkIO (do { takeMVar m; throwTo main_thread (ErrorCall "foo") }) - (do - error "wibble" - `Control.Exception.catch` + (do { throwIO (ErrorCall "wibble") + `Control.Exception.catch` (\e -> let _ = e::ErrorCall in - do putMVar m (); sum [1..10000] `seq` putStrLn "done.") - myDelay 500000 - ) + do putMVar m (); evaluate (sum [1..10000]); putStrLn "done.") + ; myDelay 500000 }) `Control.Exception.catch` \e -> putStrLn ("caught: " ++ show (e::SomeException)) From git at git.haskell.org Tue Jan 26 13:35:39 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 26 Jan 2016 13:35:39 +0000 (UTC) Subject: [commit: ghc] master: Pass InScopeSet to substTy in lintTyApp (01809bc) Message-ID: <20160126133539.ECA663A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/01809bcd4c9066244d705360f0d9a3a2176385f4/ghc >--------------------------------------------------------------- commit 01809bcd4c9066244d705360f0d9a3a2176385f4 Author: Bartosz Nitka Date: Thu Jan 21 11:30:07 2016 -0800 Pass InScopeSet to substTy in lintTyApp This is the fix proposed in #11371: ``` In other cases, we already have the in-scope set in hand. Example: in CoreLint.lintTyApp we find a call to substTyWith. But Lint carries an in-scope set, so it would be easy to pass it to substTyWith. ``` Test Plan: ./validate --slow (only pre-existing problems) Reviewers: simonpj, goldfire, austin, nomeata, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1820 GHC Trac Issues: #11371 >--------------------------------------------------------------- 01809bcd4c9066244d705360f0d9a3a2176385f4 compiler/coreSyn/CoreLint.hs | 9 ++++++++- compiler/types/TyCoRep.hs | 24 +++++++++++++++++------- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/compiler/coreSyn/CoreLint.hs b/compiler/coreSyn/CoreLint.hs index ccd3b8e..6546c3d 100644 --- a/compiler/coreSyn/CoreLint.hs +++ b/compiler/coreSyn/CoreLint.hs @@ -785,7 +785,11 @@ lintTyApp :: OutType -> OutType -> LintM OutType lintTyApp fun_ty arg_ty | Just (tv,body_ty) <- splitForAllTy_maybe fun_ty = do { lintTyKind tv arg_ty - ; return (substTyWith [tv] [arg_ty] body_ty) } + ; in_scope <- getInScope + -- substTy needs the set of tyvars in scope to avoid generating + -- uniques that are already in scope. + -- See Note [The subsititution invariant] in TyCoRep + ; return (substTyWithInScope in_scope [tv] [arg_ty] body_ty) } | otherwise = failWithL (mkTyAppMsg fun_ty arg_ty) @@ -1685,6 +1689,9 @@ updateTCvSubst subst' m getTCvSubst :: LintM TCvSubst getTCvSubst = LintM (\ env errs -> (Just (le_subst env), errs)) +getInScope :: LintM InScopeSet +getInScope = LintM (\ env errs -> (Just (getTCvInScope $ le_subst env), errs)) + applySubstTy :: InType -> LintM OutType applySubstTy ty = do { subst <- getTCvSubst; return (substTy subst ty) } diff --git a/compiler/types/TyCoRep.hs b/compiler/types/TyCoRep.hs index 9779e83..2f034d0 100644 --- a/compiler/types/TyCoRep.hs +++ b/compiler/types/TyCoRep.hs @@ -90,7 +90,7 @@ module TyCoRep ( substTyWith, substTyWithCoVars, substTysWith, substTysWithCoVars, substCoWith, substTy, substTyAddInScope, substTyUnchecked, - substTyWithBinders, + substTyWithBinders, substTyWithInScope, substTys, substTheta, lookupTyVar, substTyVarBndr, substCo, substCos, substCoVar, substCoVars, lookupCoVar, @@ -1416,7 +1416,7 @@ data TCvSubst -- See Note [Apply Once] -- and Note [Extending the TvSubstEnv] -- and Note [Substituting types and coercions] - -- and Note [Generating the in-scope set for a substitution] + -- and Note [The subsititution invariant] -- | A substitution of 'Type's for 'TyVar's -- and 'Kind's for 'KindVar's @@ -1489,7 +1489,7 @@ constructor) and the CvSubstEnv should *never* map a TyVar. Furthermore, the range of the TvSubstEnv should *never* include a type headed with CoercionTy. -Note [Generating the in-scope set for a substitution] +Note [The subsititution invariant] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ When calling substTy subst ty it should be the case that the in-scope set in the substitution is a superset of both: @@ -1788,6 +1788,16 @@ substTyWith :: [TyVar] -> [Type] -> Type -> Type substTyWith tvs tys = ASSERT( length tvs == length tys ) substTyUnchecked (zipOpenTCvSubst tvs tys) +-- | Substitute tyvars within a type using a known 'InScopeSet'. +-- Pre-condition: the 'in_scope' set should satisfy Note [The substitution +-- invariant]; specifically it should include the free vars of 'tys', +-- and of 'ty' minus the domain of the subst. +substTyWithInScope :: InScopeSet -> [TyVar] -> [Type] -> Type -> Type +substTyWithInScope in_scope tvs tys ty = + ASSERT( length tvs == length tys ) + substTy (mkTCvSubst in_scope (tenv, emptyCvSubstEnv)) ty + where tenv = zipTyEnv tvs tys + -- | Coercion substitution making use of an 'TCvSubst' that -- is assumed to be open, see 'zipOpenTCvSubst' substCoWith :: [TyVar] -> [Type] -> Coercion -> Coercion @@ -1819,7 +1829,7 @@ substTyWithBinders bndrs tys = ASSERT( length bndrs == length tys ) -- | Substitute within a 'Type' after adding the free variables of the type -- to the in-scope set. This is useful for the case when the free variables -- aren't already in the in-scope set or easily available. --- See also Note [Generating the in-scope set for a substitution]. +-- See also Note [The subsititution invariant]. substTyAddInScope :: TCvSubst -> Type -> Type substTyAddInScope subst ty = substTy (extendTCvInScopeSet subst $ tyCoVarsOfType ty) ty @@ -1827,7 +1837,7 @@ substTyAddInScope subst ty = -- | When calling `substTy` it should be the case that the in-scope set in -- the substitution is a superset of the free vars of the range of the -- substitution. --- See also Note [Generating the in-scope set for a substitution]. +-- See also Note [The subsititution invariant]. isValidTCvSubst :: TCvSubst -> Bool isValidTCvSubst (TCvSubst in_scope tenv cenv) = (tenvFVs `varSetInScope` in_scope) && @@ -1838,7 +1848,7 @@ isValidTCvSubst (TCvSubst in_scope tenv cenv) = -- | Substitute within a 'Type' -- The substitution has to satisfy the invariants described in --- Note [Generating the in-scope set for a substitution]. +-- Note [The subsititution invariant]. substTy :: -- CallStack wasn't present in GHC 7.10.1, disable callstacks in stage 1 @@ -1867,7 +1877,7 @@ substTy subst@(TCvSubst in_scope tenv cenv) ty -- | Substitute within a 'Type' disabling the sanity checks. -- The problems that the sanity checks in substTy catch are described in --- Note [Generating the in-scope set for a substitution]. +-- Note [The subsititution invariant]. -- The goal of #11371 is to migrate all the calls of substTyUnchecked to -- substTy and remove this function. Please don't use in new code. substTyUnchecked :: TCvSubst -> Type -> Type From git at git.haskell.org Tue Jan 26 17:24:04 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 26 Jan 2016 17:24:04 +0000 (UTC) Subject: [commit: ghc] master: Nicer error on +RTS -hc without -rtsopts or -prof (e24a9b5) Message-ID: <20160126172404.0361B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e24a9b5de00bc2669a52a1f9905bd40e7be0d857/ghc >--------------------------------------------------------------- commit e24a9b5de00bc2669a52a1f9905bd40e7be0d857 Author: Thomas Miedema Date: Mon Jan 25 20:07:31 2016 +0100 Nicer error on +RTS -hc without -rtsopts or -prof Before: * without -rtsopts: Most RTS options are disabled. Link with -rtsopts to enable them. * with -rtsopts: invalid heap profile option: -hc After: * the flag -hc requires the program to be built with -prof Copy `Note [OPTION_SAFE vs OPTION_UNSAFE]` from commit 8c7ad0bd. Reviewed by: bgamari Differential Revision: https://phabricator.haskell.org/D1845 >--------------------------------------------------------------- e24a9b5de00bc2669a52a1f9905bd40e7be0d857 rts/RtsFlags.c | 46 ++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 42 insertions(+), 4 deletions(-) diff --git a/rts/RtsFlags.c b/rts/RtsFlags.c index 56f4420..46d1409 100644 --- a/rts/RtsFlags.c +++ b/rts/RtsFlags.c @@ -650,6 +650,7 @@ static void procRtsOpts (int rts_argc0, at the start each iteration and checked at the end. */ rtsBool option_checked = rtsFalse; +// See Note [OPTION_SAFE vs OPTION_UNSAFE]. #define OPTION_SAFE option_checked = rtsTrue; #define OPTION_UNSAFE checkUnsafe(rtsOptsEnabled); option_checked = rtsTrue; @@ -854,7 +855,6 @@ error = rtsTrue; THREADED_BUILD_ONLY( int nNodes; int proc = (int)getNumberOfProcessors(); - OPTION_SAFE; nNodes = strtol(rts_argv[arg]+5, (char **) NULL, 10); if (nNodes > proc) { nNodes = proc; } @@ -1011,15 +1011,15 @@ error = rtsTrue; ) break; case 'h': /* serial heap profile */ #if !defined(PROFILING) - OPTION_UNSAFE; switch (rts_argv[arg][2]) { case '\0': case 'T': + OPTION_UNSAFE; RtsFlags.ProfFlags.doHeapProfile = HEAP_BY_CLOSURE_TYPE; break; default: - errorBelch("invalid heap profile option: %s",rts_argv[arg]); - error = rtsTrue; + OPTION_SAFE; + PROFILING_BUILD_ONLY(); } #else OPTION_SAFE; @@ -1971,3 +1971,41 @@ void freeRtsArgs(void) freeProgArgv(); freeRtsArgv(); } + + +/* +Note [OPTION_SAFE vs OPTION_UNSAFE] + +Ticket #3910 originally pointed out that the RTS options are a potential +security problem. For example the -t -s or -S flags can be used to +overwrite files. This would be bad in the context of CGI scripts or +setuid binaries. So we introduced a system where +RTS processing is more +or less disabled unless you pass the -rtsopts flag at link time. + +This scheme is safe enough but it also really annoyes users. They have +to use -rtsopts in many circumstances: with -threaded to use -N, with +-eventlog to use -l, with -prof to use any of the profiling flags. Many +users just set -rtsopts globally or in project .cabal files. Apart from +annoying users it reduces security because it means that deployed +binaries will have all RTS options enabled rather than just profiling +ones. + +So now, we relax the set of RTS options that are available in the +default -rtsopts=some case. For "deployment" ways like vanilla and +-threaded we remain quite conservative. Only --info -? --help are +allowed for vanilla. For -threaded, -N and -N are allowed with a +check that x <= num cpus. + +For "developer" ways like -debug, -eventlog, -prof, we allow all the +options that are special to that way. Some of these allow writing files, +but the file written is not directly under the control of the attacker. +For the setuid case (where the attacker would have control over binary +name, current dir, local symlinks etc) we check if the process is +running setuid/setgid and refuse all RTS option processing. Users would +need to use -rtsopts=all in this case. + +We are making the assumption that developers will not deploy binaries +built in the -debug, -eventlog, -prof ways. And even if they do, the +damage should be limited to DOS, information disclosure and writing +files like .eventlog, not arbitrary files. +*/ From git at git.haskell.org Tue Jan 26 17:24:06 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 26 Jan 2016 17:24:06 +0000 (UTC) Subject: [commit: ghc] master: Fix segmentation fault when .prof file not writeable (6d2bdfd) Message-ID: <20160126172406.E4AC03A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/6d2bdfd8d40b926d7a11d003213220022a63d9f5/ghc >--------------------------------------------------------------- commit 6d2bdfd8d40b926d7a11d003213220022a63d9f5 Author: Thomas Miedema Date: Tue Jan 26 01:11:49 2016 +0100 Fix segmentation fault when .prof file not writeable There are two ways to do retainer profiling. Quoting from the user's guide: 1. `+RTS -hr` "Breaks down the graph by retainer set" 2. `+RTS -hr -h`, where `-h` is one of normal heap profiling break-down options (e.g. `-hc`), and `-hr means "Restrict the profile to closures with retainer sets containing cost-centre stacks with one of the specified cost centres at the top." Retainer profiling writes to a .hp file, like the other heap profiling options, but also to a .prof file. Therefore, when the .prof file is not writeable for whatever reason, retainer profiling should be turned off completely. This worked ok when running the program with `+RTS -hr` (option 1), but a segfault would occur when using `+RTS -hr -h`, with `x!=r` (option 2). This commit fixes that. Reviewed by: bgamari Differential Revision: https://phabricator.haskell.org/D1849 GHC Trac Issues: #11489 >--------------------------------------------------------------- 6d2bdfd8d40b926d7a11d003213220022a63d9f5 rts/ProfHeap.c | 2 +- rts/ProfHeap.h | 5 +++++ rts/Profiling.c | 13 +++++-------- testsuite/tests/profiling/should_run/Makefile | 10 ++++++++++ .../{driver/T10219.hspp => profiling/should_run/T11489.hs} | 0 testsuite/tests/profiling/should_run/T11489.stderr | 1 + testsuite/tests/profiling/should_run/all.T | 5 +++++ testsuite/tests/rts/all.T | 3 +-- 8 files changed, 28 insertions(+), 11 deletions(-) diff --git a/rts/ProfHeap.c b/rts/ProfHeap.c index 416f5ac..187116f 100644 --- a/rts/ProfHeap.c +++ b/rts/ProfHeap.c @@ -161,7 +161,7 @@ doingLDVProfiling( void ) || RtsFlags.ProfFlags.bioSelector != NULL); } -STATIC_INLINE rtsBool +rtsBool doingRetainerProfiling( void ) { return (RtsFlags.ProfFlags.doHeapProfile == HEAP_BY_RETAINER diff --git a/rts/ProfHeap.h b/rts/ProfHeap.h index e29a9f6..279eef2 100644 --- a/rts/ProfHeap.h +++ b/rts/ProfHeap.h @@ -16,6 +16,11 @@ nat initHeapProfiling (void); void endHeapProfiling (void); rtsBool strMatchesSelector (const char* str, const char* sel); +#ifdef PROFILING +// doingRetainerProfiling: `-hr` or `-hr -h` +rtsBool doingRetainerProfiling(void); +#endif + #include "EndPrivate.h" #endif /* PROFHEAP_H */ diff --git a/rts/Profiling.c b/rts/Profiling.c index 2c2981a..c67b081 100644 --- a/rts/Profiling.c +++ b/rts/Profiling.c @@ -254,9 +254,7 @@ initProfilingLogFile(void) } #endif - if (RtsFlags.CcFlags.doCostCentres == 0 && - RtsFlags.ProfFlags.doHeapProfile != HEAP_BY_RETAINER && - RtsFlags.ProfFlags.retainerSelector == NULL) + if (RtsFlags.CcFlags.doCostCentres == 0 && !doingRetainerProfiling()) { /* No need for the .prof file */ prof_filename = NULL; @@ -272,11 +270,11 @@ initProfilingLogFile(void) if ((prof_file = fopen(prof_filename, "w")) == NULL) { debugBelch("Can't open profiling report file %s\n", prof_filename); RtsFlags.CcFlags.doCostCentres = 0; - // The following line was added by Sung; retainer/LDV profiling may need - // two output files, i.e., .prof/hp. - if (RtsFlags.ProfFlags.doHeapProfile == HEAP_BY_RETAINER) + // Retainer profiling (`-hr` or `-hr -h`) writes to + // both .hp as .prof. + if (doingRetainerProfiling()) { RtsFlags.ProfFlags.doHeapProfile = 0; - return; + } } } @@ -290,7 +288,6 @@ initProfilingLogFile(void) debugBelch("Can't open profiling report file %s\n", hp_filename); RtsFlags.ProfFlags.doHeapProfile = 0; - return; } } } diff --git a/testsuite/tests/profiling/should_run/Makefile b/testsuite/tests/profiling/should_run/Makefile index 577fc34..e46dd97 100644 --- a/testsuite/tests/profiling/should_run/Makefile +++ b/testsuite/tests/profiling/should_run/Makefile @@ -23,3 +23,13 @@ scc001: $(call scc001Rule,-O0) $(call scc001Rule,-O) +.PHONY: T11489 +T11489: + $(RM) T11489 + touch T11489.prof + chmod -w T11489.prof + "$(TEST_HC)" -v0 -prof T11489.hs + # Should print some message about not being to open the .prof file, + # then continue to run and exit normally. + # Caused a segmentation fault in GHC <= 7.10.3 + ./T11489 +RTS -hr{} -hc diff --git a/testsuite/tests/driver/T10219.hspp b/testsuite/tests/profiling/should_run/T11489.hs similarity index 100% copy from testsuite/tests/driver/T10219.hspp copy to testsuite/tests/profiling/should_run/T11489.hs diff --git a/testsuite/tests/profiling/should_run/T11489.stderr b/testsuite/tests/profiling/should_run/T11489.stderr new file mode 100644 index 0000000..4f19dd9 --- /dev/null +++ b/testsuite/tests/profiling/should_run/T11489.stderr @@ -0,0 +1 @@ +Can't open profiling report file T11489.prof diff --git a/testsuite/tests/profiling/should_run/all.T b/testsuite/tests/profiling/should_run/all.T index 7804d46..ca37fe5 100644 --- a/testsuite/tests/profiling/should_run/all.T +++ b/testsuite/tests/profiling/should_run/all.T @@ -134,3 +134,8 @@ test('T5363', test('profinline001', [ req_profiling, extra_ways(['prof']), only_ways(prof_ways) ], compile_and_run, ['']) + +test('T11489', [ + req_profiling, + extra_clean(['T11489.prof', 'T11489.hp']), + ], run_command, ['$MAKE -s --no-print-directory T11489']) diff --git a/testsuite/tests/rts/all.T b/testsuite/tests/rts/all.T index c88bd62..951acbe 100644 --- a/testsuite/tests/rts/all.T +++ b/testsuite/tests/rts/all.T @@ -55,8 +55,7 @@ test('divbyzero', test('outofmem', when(opsys('darwin'), skip), run_command, ['$MAKE -s --no-print-directory outofmem']) -test('outofmem2', extra_run_opts('+RTS -M5m -RTS'), - run_command, ['$MAKE -s --no-print-directory outofmem2']) +test('outofmem2', normal, run_command, ['$MAKE -s --no-print-directory outofmem2']) test('T2047', [ignore_output, extra_run_opts('+RTS -c -RTS')], compile_and_run, ['-package containers']) From git at git.haskell.org Tue Jan 26 17:37:38 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 26 Jan 2016 17:37:38 +0000 (UTC) Subject: [commit: ghc] master: Split off -Wunused-type-variables from -Wunused-matches (6817703) Message-ID: <20160126173738.E034D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/6817703b31840620cca8596ca62ed70633934972/ghc >--------------------------------------------------------------- commit 6817703b31840620cca8596ca62ed70633934972 Author: RyanGlScott Date: Tue Jan 26 12:33:19 2016 -0500 Split off -Wunused-type-variables from -Wunused-matches Summary: Previously, `-Wunused-matches` would fire whenever it detected unused type variables in a type family or data family instance. This can be annoying for users who wish to use type variable names as documentation, as being `-Wall`-compliant would mean that they'd have to prefix many of their type variable names with underscores, making the documentation harder to read. To avoid this, a new warning `-Wunused-type-variables` was created that only encompasses unused variables in family instances. `-Wunused-matches` reverts back to its role of only warning on unused term-level pattern names. Unlike `-Wunused-matches`, `-Wunused-type-variables` is not implied by `-Wall`. Fixes #11451. Test Plan: ./validate Reviewers: goldfire, ekmett, austin, hvr, simonpj, bgamari Reviewed By: simonpj, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1825 GHC Trac Issues: #11451 >--------------------------------------------------------------- 6817703b31840620cca8596ca62ed70633934972 compiler/hsSyn/PlaceHolder.hs | 12 +++--- compiler/main/DynFlags.hs | 5 +++ compiler/rename/RnEnv.hs | 10 +++-- compiler/rename/RnSource.hs | 6 +-- compiler/rename/RnTypes.hs | 2 +- docs/users_guide/8.0.1-notes.rst | 18 +++++++-- docs/users_guide/glasgow_exts.rst | 28 ++++++++----- docs/users_guide/using-warnings.rst | 46 ++++++++++++++++++++-- libraries/base/Data/Either.hs | 2 +- libraries/base/Data/Type/Bool.hs | 12 +++--- libraries/base/Data/Type/Equality.hs | 16 ++++---- libraries/base/GHC/Generics.hs | 28 ++++++------- libraries/base/GHC/TypeLits.hs | 8 ++-- .../tests/determinism/should_compile/determ004.hs | 6 +-- testsuite/tests/indexed-types/should_compile/all.T | 4 +- .../tests/simplCore/should_compile/T10689a.hs | 4 +- utils/mkUserGuidePart/Options/Warnings.hs | 12 ++++++ 17 files changed, 149 insertions(+), 70 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 6817703b31840620cca8596ca62ed70633934972 From git at git.haskell.org Tue Jan 26 19:28:25 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 26 Jan 2016 19:28:25 +0000 (UTC) Subject: [commit: ghc] master: Construct in_scope set in mkTopTCvSubst (144ddb4) Message-ID: <20160126192825.2C1D83A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/144ddb414a8a4f40df1ad9ab27fcdf38f30db4d3/ghc >--------------------------------------------------------------- commit 144ddb414a8a4f40df1ad9ab27fcdf38f30db4d3 Author: Bartosz Nitka Date: Tue Jan 26 11:26:06 2016 -0800 Construct in_scope set in mkTopTCvSubst The pre-condition on `mkTopTCvSubst` turned out to be wrong and not satisfied by any of the callers. I've fixed it, so that it constructs the in_scope set from the range of the substitution. `mkTopTCvSubst` was also unnecessarily general it is never called with `CoVars`, so I changed the type signature and added an assertion. Test Plan: ./validate --slow Reviewers: goldfire, simonpj, bgamari, austin Reviewed By: simonpj Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1801 GHC Trac Issues: #11371 >--------------------------------------------------------------- 144ddb414a8a4f40df1ad9ab27fcdf38f30db4d3 compiler/iface/BuildTyCl.hs | 2 +- compiler/main/InteractiveEval.hs | 4 ++-- compiler/typecheck/TcFlatten.hs | 2 +- compiler/typecheck/TcMType.hs | 2 +- compiler/typecheck/TcSplice.hs | 6 +++--- compiler/types/FamInstEnv.hs | 2 +- compiler/types/TyCoRep.hs | 15 +++++++++------ compiler/types/Type.hs | 6 +++++- 8 files changed, 23 insertions(+), 16 deletions(-) diff --git a/compiler/iface/BuildTyCl.hs b/compiler/iface/BuildTyCl.hs index d13d38e..1b4017a 100644 --- a/compiler/iface/BuildTyCl.hs +++ b/compiler/iface/BuildTyCl.hs @@ -184,7 +184,7 @@ buildPatSyn src_name declared_infix matcher@(matcher_id,_) builder -- compatible with the pattern synonym ASSERT2((and [ univ_tvs `equalLength` univ_tvs1 , ex_tvs `equalLength` ex_tvs1 - , pat_ty `eqType` substTyUnchecked subst pat_ty1 + , pat_ty `eqType` substTy subst pat_ty1 , prov_theta `eqTypes` substTys subst prov_theta1 , req_theta `eqTypes` substTys subst req_theta1 , arg_tys `eqTypes` substTys subst arg_tys1 diff --git a/compiler/main/InteractiveEval.hs b/compiler/main/InteractiveEval.hs index b7c2178..f0df270 100644 --- a/compiler/main/InteractiveEval.hs +++ b/compiler/main/InteractiveEval.hs @@ -543,13 +543,13 @@ bindLocalsAtBreakpoint hsc_env apStack_fhv (Just BreakInfo{..}) = do let tv_subst = newTyVars us free_tvs filtered_ids = [ id | (id, Just _hv) <- zip ids mb_hValues ] (_,tidy_tys) = tidyOpenTypes emptyTidyEnv $ - map (substTyUnchecked tv_subst . idType) filtered_ids + map (substTy tv_subst . idType) filtered_ids new_ids <- zipWith3M mkNewId occs tidy_tys filtered_ids result_name <- newInteractiveBinder hsc_env (mkVarOccFS result_fs) span let result_id = Id.mkVanillaGlobal result_name - (substTyUnchecked tv_subst result_ty) + (substTy tv_subst result_ty) result_ok = isPointer result_id final_ids | result_ok = result_id : new_ids diff --git a/compiler/typecheck/TcFlatten.hs b/compiler/typecheck/TcFlatten.hs index 612f8a6..f87a302 100644 --- a/compiler/typecheck/TcFlatten.hs +++ b/compiler/typecheck/TcFlatten.hs @@ -956,7 +956,7 @@ flatten_one (TyConApp tc tys) -- Expand type synonyms that mention type families -- on the RHS; see Note [Flattening synonyms] | Just (tenv, rhs, tys') <- expandSynTyCon_maybe tc tys - , let expanded_ty = mkAppTys (substTyUnchecked (mkTopTCvSubst tenv) rhs) tys' + , let expanded_ty = mkAppTys (substTy (mkTopTCvSubst tenv) rhs) tys' = do { mode <- getMode ; let used_tcs = tyConsOfType rhs ; case mode of diff --git a/compiler/typecheck/TcMType.hs b/compiler/typecheck/TcMType.hs index bb31005..a160d4e 100644 --- a/compiler/typecheck/TcMType.hs +++ b/compiler/typecheck/TcMType.hs @@ -307,7 +307,7 @@ tcSuperSkolTyVars :: [TyVar] -> (TCvSubst, [TcTyVar]) -- Moreover, make them "super skolems"; see comments with superSkolemTv -- see Note [Kind substitution when instantiating] -- Precondition: tyvars should be ordered by scoping -tcSuperSkolTyVars = mapAccumL tcSuperSkolTyVar (mkTopTCvSubst []) +tcSuperSkolTyVars = mapAccumL tcSuperSkolTyVar emptyTCvSubst tcSuperSkolTyVar :: TCvSubst -> TyVar -> (TCvSubst, TcTyVar) tcSuperSkolTyVar subst tv diff --git a/compiler/typecheck/TcSplice.hs b/compiler/typecheck/TcSplice.hs index fe13226..ac7e1b7 100644 --- a/compiler/typecheck/TcSplice.hs +++ b/compiler/typecheck/TcSplice.hs @@ -99,7 +99,7 @@ import GHC.Serialized import ErrUtils import Util import Unique -import VarSet ( isEmptyVarSet, filterVarSet ) +import VarSet ( isEmptyVarSet, filterVarSet, mkVarSet, elemVarSet ) import Data.List ( find ) import Data.Maybe import FastString @@ -1395,8 +1395,8 @@ reifyDataCon isGadtDataCon tys dc name = reifyName dc -- Universal tvs present in eq_spec need to be filtered out, as -- they will not appear anywhere in the type. - subst = mkTopTCvSubst (map eqSpecPair g_eq_spec) - g_unsbst_univ_tvs = filter (`notElemTCvSubst` subst) g_univ_tvs + eq_spec_tvs = mkVarSet (map eqSpecTyVar g_eq_spec) + g_unsbst_univ_tvs = filterOut (`elemVarSet` eq_spec_tvs) g_univ_tvs ; r_arg_tys <- reifyTypes (if isGadtDataCon then g_arg_tys else arg_tys) diff --git a/compiler/types/FamInstEnv.hs b/compiler/types/FamInstEnv.hs index 1167ac2..4b4cc5d 100644 --- a/compiler/types/FamInstEnv.hs +++ b/compiler/types/FamInstEnv.hs @@ -1237,7 +1237,7 @@ normalise_tc_app tc tys ; case expandSynTyCon_maybe tc ntys of { Just (tenv, rhs, ntys') -> do { (co2, ninst_rhs) - <- normalise_type (substTyUnchecked (mkTopTCvSubst tenv) rhs) + <- normalise_type (substTy (mkTopTCvSubst tenv) rhs) ; return $ if isReflCo co2 then (args_co, mkTyConApp tc ntys) diff --git a/compiler/types/TyCoRep.hs b/compiler/types/TyCoRep.hs index 2f034d0..a247725 100644 --- a/compiler/types/TyCoRep.hs +++ b/compiler/types/TyCoRep.hs @@ -1686,12 +1686,15 @@ zipOpenTCvSubstBinders bndrs tys is = mkInScopeSet (tyCoVarsOfTypes tys) tenv = mkVarEnv [ (tv, ty) | (Named tv _, ty) <- zip bndrs tys ] --- | Called when doing top-level substitutions. Here we expect that the --- free vars of the range of the substitution will be empty. -mkTopTCvSubst :: [(TyCoVar, Type)] -> TCvSubst -mkTopTCvSubst prs = TCvSubst emptyInScopeSet tenv cenv - where (tenv, cenv) = foldl extend (emptyTvSubstEnv, emptyCvSubstEnv) prs - extend envs (v, ty) = extendSubstEnvs envs v ty +-- | Called when doing top-level substitutions. No CoVars, please! +mkTopTCvSubst :: [(TyVar, Type)] -> TCvSubst +mkTopTCvSubst prs = + ASSERT2( onlyTyVarsAndNoCoercionTy, text "prs" <+> ppr prs ) + mkOpenTCvSubst tenv emptyCvSubstEnv + where tenv = mkVarEnv prs + onlyTyVarsAndNoCoercionTy = + and [ isTyVar tv && not (isCoercionTy ty) + | (tv, ty) <- prs ] zipTyEnv :: [TyVar] -> [Type] -> TvSubstEnv zipTyEnv tyvars tys diff --git a/compiler/types/Type.hs b/compiler/types/Type.hs index 8b426f1..c6d51f3 100644 --- a/compiler/types/Type.hs +++ b/compiler/types/Type.hs @@ -294,7 +294,11 @@ coreView :: Type -> Maybe Type -- By being non-recursive and inlined, this case analysis gets efficiently -- joined onto the case analysis that the caller is already doing coreView (TyConApp tc tys) | Just (tenv, rhs, tys') <- expandSynTyCon_maybe tc tys - = Just (mkAppTys (substTyUnchecked (mkTopTCvSubst tenv) rhs) tys') + = Just (mkAppTys (substTy (mkTopTCvSubst tenv) rhs) tys') + -- The free vars of 'rhs' should all be bound by 'tenv', so it's + -- ok to use 'substTy' here. + -- See also Note [Generating the in-scope set for a substitution] + -- in TyCoRep. -- Its important to use mkAppTys, rather than (foldl AppTy), -- because the function part might well return a -- partially-applied type constructor; indeed, usually will! From git at git.haskell.org Tue Jan 26 19:38:24 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 26 Jan 2016 19:38:24 +0000 (UTC) Subject: [commit: ghc] wip/exp-types: Fix some substitution InScopeSets (919597d) Message-ID: <20160126193824.64D1A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/exp-types Link : http://ghc.haskell.org/trac/ghc/changeset/919597def355708e6fa88d4d43f55e7fd693cec3/ghc >--------------------------------------------------------------- commit 919597def355708e6fa88d4d43f55e7fd693cec3 Author: Richard Eisenberg Date: Mon Jan 25 22:00:47 2016 -0500 Fix some substitution InScopeSets >--------------------------------------------------------------- 919597def355708e6fa88d4d43f55e7fd693cec3 compiler/typecheck/TcHsType.hs | 2 +- compiler/typecheck/TcMType.hs | 2 +- compiler/typecheck/TcType.hs | 1 + compiler/types/TyCoRep.hs | 4 ++++ compiler/types/Type.hs | 4 ++-- 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/compiler/typecheck/TcHsType.hs b/compiler/typecheck/TcHsType.hs index 1b6d5cf..c752dba 100644 --- a/compiler/typecheck/TcHsType.hs +++ b/compiler/typecheck/TcHsType.hs @@ -847,7 +847,7 @@ tcInstBinderX :: Maybe (VarEnv Kind) tcInstBinderX mb_kind_info subst binder | Just tv <- binderVar_maybe binder = case lookup_tv tv of - Just ki -> return (extendTCvSubst subst tv ki, ki) + Just ki -> return (extendTCvSubstAndInScope subst tv ki, ki) Nothing -> do { (subst', tv') <- newMetaTyVarX subst tv ; return (subst', mkTyVarTy tv') } diff --git a/compiler/typecheck/TcMType.hs b/compiler/typecheck/TcMType.hs index a160d4e..b7fe68c 100644 --- a/compiler/typecheck/TcMType.hs +++ b/compiler/typecheck/TcMType.hs @@ -693,7 +693,7 @@ newMetaTyVarX subst tyvar -- See Note [Name of an instantiated type variable] kind = substTyUnchecked subst (tyVarKind tyvar) new_tv = mkTcTyVar name kind details - ; return (extendTCvSubst (extendTCvInScope subst new_tv) tyvar + ; return (extendTCvSubstAndInScope subst tyvar (mkTyVarTy new_tv) , new_tv) } diff --git a/compiler/typecheck/TcType.hs b/compiler/typecheck/TcType.hs index 4f74468..3534b46 100644 --- a/compiler/typecheck/TcType.hs +++ b/compiler/typecheck/TcType.hs @@ -145,6 +145,7 @@ module TcType ( mkOpenTCvSubst, zipOpenTCvSubst, mkTopTCvSubst, notElemTCvSubst, unionTCvSubst, getTvSubstEnv, setTvSubstEnv, getTCvInScope, extendTCvInScope, + extendTCvInScopeList, extendTCvInScopeSet, extendTCvSubstAndInScope, Type.lookupTyVar, Type.extendTCvSubst, Type.substTyVarBndr, extendTCvSubstList, isInScope, mkTCvSubst, zipTyEnv, zipCoEnv, Type.substTy, substTys, substTyWith, substTyWithCoVars, diff --git a/compiler/types/TyCoRep.hs b/compiler/types/TyCoRep.hs index a247725..7ad9dc2 100644 --- a/compiler/types/TyCoRep.hs +++ b/compiler/types/TyCoRep.hs @@ -1864,7 +1864,11 @@ substTy subst@(TCvSubst in_scope tenv cenv) ty | otherwise = ASSERT2( isValidTCvSubst subst, text "in_scope" <+> ppr in_scope $$ text "tenv" <+> ppr tenv $$ + text "tenvFVs" + <+> ppr (tyCoVarsOfTypes $ varEnvElts tenv) $$ text "cenv" <+> ppr cenv $$ + text "cenvFVs" + <+> ppr (tyCoVarsOfCos $ varEnvElts cenv) $$ text "ty" <+> ppr ty ) ASSERT2( typeFVsInScope, text "in_scope" <+> ppr in_scope $$ diff --git a/compiler/types/Type.hs b/compiler/types/Type.hs index c6d51f3..63ee21b 100644 --- a/compiler/types/Type.hs +++ b/compiler/types/Type.hs @@ -154,8 +154,8 @@ module Type ( notElemTCvSubst, getTvSubstEnv, setTvSubstEnv, zapTCvSubst, getTCvInScope, - extendTCvInScope, extendTCvInScopeList, - extendTCvSubst, extendTCvSubstList, + extendTCvInScope, extendTCvInScopeList, extendTCvInScopeSet, + extendTCvSubst, extendTCvSubstList, extendTCvSubstAndInScope, isInScope, composeTCvSubstEnv, composeTCvSubst, zipTyEnv, zipCoEnv, isEmptyTCvSubst, unionTCvSubst, From git at git.haskell.org Tue Jan 26 19:38:28 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 26 Jan 2016 19:38:28 +0000 (UTC) Subject: [commit: ghc] wip/exp-types: Refactor the typechecker to use ExpTypes. (716d3fa) Message-ID: <20160126193828.D40913A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/exp-types Link : http://ghc.haskell.org/trac/ghc/changeset/716d3fa9fb29f040f30fd329d49c9cc6ca839ae9/ghc >--------------------------------------------------------------- commit 716d3fa9fb29f040f30fd329d49c9cc6ca839ae9 Author: Richard Eisenberg Date: Wed Jan 13 23:29:17 2016 -0500 Refactor the typechecker to use ExpTypes. The idea here is described in [wiki:Typechecker]. Briefly, this refactor keeps solid track of "synthesis" mode vs "checking" in GHC's bidirectional type-checking algorithm. When in synthesis mode, the expected type is just an IORef to write to. In addition, this patch does a significant reworking of RebindableSyntax, allowing much more freedom in the types of the rebindable operators. For example, we can now have `negate :: Int -> Bool` and `(>>=) :: m a -> (forall x. a x -> m b) -> m b`. The magic is in tcSyntaxOp. This addresses tickets #11397, #11452, and #11458. Tests: typecheck/should_compile/{RebindHR,RebindNegate,T11397,T11458} th/T11452 >--------------------------------------------------------------- 716d3fa9fb29f040f30fd329d49c9cc6ca839ae9 compiler/deSugar/Check.hs | 160 +++---- compiler/deSugar/Coverage.hs | 32 +- compiler/deSugar/DsArrows.hs | 13 +- compiler/deSugar/DsExpr.hs | 61 +-- compiler/deSugar/DsExpr.hs-boot | 3 +- compiler/deSugar/DsGRHSs.hs | 2 +- compiler/deSugar/DsListComp.hs | 59 ++- compiler/deSugar/DsMeta.hs | 10 +- compiler/deSugar/DsUtils.hs | 10 +- compiler/deSugar/Match.hs | 32 +- compiler/deSugar/MatchLit.hs | 52 +-- compiler/deSugar/PmExpr.hs | 5 +- compiler/ghci/RtClosureInspect.hs | 4 - compiler/hsSyn/Convert.hs | 2 +- compiler/hsSyn/HsExpr.hs | 74 +++- compiler/hsSyn/HsExpr.hs-boot | 5 +- compiler/hsSyn/HsLit.hs | 6 +- compiler/hsSyn/HsPat.hs | 16 +- compiler/hsSyn/HsUtils.hs | 74 ++-- compiler/hsSyn/PlaceHolder.hs | 23 +- compiler/parser/Parser.y | 2 +- compiler/parser/RdrHsSyn.hs | 4 +- compiler/rename/RnEnv.hs | 8 +- compiler/rename/RnExpr.hs | 103 +++-- compiler/rename/RnPat.hs | 11 +- compiler/typecheck/Inst.hs | 55 ++- compiler/typecheck/TcArrows.hs | 45 +- compiler/typecheck/TcBinds.hs | 18 +- compiler/typecheck/TcErrors.hs | 112 +++-- compiler/typecheck/TcEvidence.hs | 38 +- compiler/typecheck/TcExpr.hs | 472 ++++++++++++++------- compiler/typecheck/TcExpr.hs-boot | 24 +- compiler/typecheck/TcGenDeriv.hs | 32 +- compiler/typecheck/TcHsSyn.hs | 303 ++++++++----- compiler/typecheck/TcHsType.hs | 11 +- compiler/typecheck/TcInstDcls.hs | 3 +- compiler/typecheck/TcMType.hs | 242 +++++++---- compiler/typecheck/TcMatches.hs | 436 ++++++++++--------- compiler/typecheck/TcMatches.hs-boot | 4 +- compiler/typecheck/TcPat.hs | 248 +++++++---- compiler/typecheck/TcPatSyn.hs | 26 +- compiler/typecheck/TcRnDriver.hs | 17 +- compiler/typecheck/TcRnMonad.hs | 4 +- compiler/typecheck/TcRnTypes.hs | 28 +- compiler/typecheck/TcRules.hs | 3 +- compiler/typecheck/TcSplice.hs | 41 +- compiler/typecheck/TcSplice.hs-boot | 8 +- compiler/typecheck/TcType.hs | 111 +++-- compiler/typecheck/TcUnify.hs | 449 +++++++++++++------- compiler/typecheck/TcValidity.hs | 2 +- compiler/utils/MonadUtils.hs | 7 +- libraries/process | 2 +- libraries/transformers | 2 +- testsuite/tests/ado/ado004.stderr | 30 +- .../tests/annotations/should_fail/annfail10.stderr | 12 +- testsuite/tests/determinism/typecheck/A.hs | 2 +- testsuite/tests/gadt/gadt-escape1.stderr | 16 +- testsuite/tests/gadt/gadt13.stderr | 10 +- testsuite/tests/gadt/gadt7.stderr | 20 +- .../tests/ghci.debugger/scripts/break003.stderr | 2 +- .../tests/ghci.debugger/scripts/break003.stdout | 8 +- .../tests/ghci.debugger/scripts/break005.stdout | 4 +- .../tests/ghci.debugger/scripts/break006.stderr | 12 +- .../tests/ghci.debugger/scripts/break006.stdout | 10 +- .../tests/ghci.debugger/scripts/break012.stdout | 8 +- .../tests/ghci.debugger/scripts/hist001.stdout | 28 +- .../tests/ghci.debugger/scripts/print022.stdout | 4 +- testsuite/tests/ghci/scripts/T2182ghci.stderr | 30 +- testsuite/tests/ghci/scripts/T8959.script | 8 +- testsuite/tests/ghci/scripts/T8959.stderr | 48 +-- testsuite/tests/ghci/scripts/T8959.stdout | 11 +- .../tests/indexed-types/should_compile/T3484.hs | 4 +- .../tests/indexed-types/should_compile/T4120.hs | 4 +- .../tests/indexed-types/should_compile/T4494.hs | 3 +- .../tests/indexed-types/should_compile/T9090.hs | 2 +- .../tests/indexed-types/should_compile/T9316.hs | 2 +- .../tests/indexed-types/should_fail/T3330a.hs | 3 +- .../tests/indexed-types/should_fail/T5934.stderr | 11 +- .../tests/indexed-types/should_fail/T7788.stderr | 7 +- .../tests/indexed-types/should_fail/T8518.stderr | 33 +- testsuite/tests/module/mod71.stderr | 6 +- .../should_fail/overloadedlistsfail03.hs | 2 +- .../should_fail/overloadedlistsfail03.stderr | 13 +- .../should_fail/overloadedlistsfail05.hs | 2 +- .../should_fail/overloadedlistsfail05.stderr | 15 +- .../tests/parser/should_compile/read014.stderr | 8 +- testsuite/tests/parser/should_fail/T7848.stderr | 42 +- .../partial-sigs/should_compile/T10438.stderr | 16 +- .../partial-sigs/should_compile/T11192.stderr | 12 +- testsuite/tests/polykinds/T7438.stderr | 16 +- testsuite/tests/rebindable/rebindable6.hs | 5 +- testsuite/tests/rebindable/rebindable6.stderr | 24 +- .../tests/rename/should_compile/T3103/GHC/Num.hs | 9 + .../tests/rename/should_compile/T3103/GHC/Word.hs | 2 +- testsuite/tests/th/T11452.hs | 6 + testsuite/tests/th/T11452.stderr | 15 + testsuite/tests/th/T2222.stderr | 2 +- testsuite/tests/th/all.T | 1 + .../tests/typecheck/should_compile/RebindHR.hs | 26 ++ .../tests/typecheck/should_compile/RebindNegate.hs | 9 + testsuite/tests/typecheck/should_compile/T11397.hs | 69 +++ testsuite/tests/typecheck/should_compile/T11458.hs | 5 + testsuite/tests/typecheck/should_compile/T2683.hs | 2 +- testsuite/tests/typecheck/should_compile/T7888.hs | 4 + testsuite/tests/typecheck/should_compile/all.T | 4 + .../tests/typecheck/should_compile/tc141.stderr | 6 +- testsuite/tests/typecheck/should_compile/tc158.hs | 2 +- testsuite/tests/typecheck/should_compile/twins.hs | 2 +- .../tests/typecheck/should_fail/FDsFromGivens2.hs | 1 + .../typecheck/should_fail/FDsFromGivens2.stderr | 26 +- .../tests/typecheck/should_fail/T10619.stderr | 4 +- testsuite/tests/typecheck/should_fail/T3613.stderr | 4 +- testsuite/tests/typecheck/should_fail/T5570.stderr | 3 +- testsuite/tests/typecheck/should_fail/T7453.stderr | 50 +-- testsuite/tests/typecheck/should_fail/T7734.stderr | 12 +- testsuite/tests/typecheck/should_fail/T8603.stderr | 8 +- testsuite/tests/typecheck/should_fail/T9109.stderr | 11 +- .../tests/typecheck/should_fail/tcfail014.stderr | 6 +- .../tests/typecheck/should_fail/tcfail016.stderr | 25 +- .../tests/typecheck/should_fail/tcfail032.stderr | 6 +- .../tests/typecheck/should_fail/tcfail099.stderr | 6 +- .../tests/typecheck/should_fail/tcfail104.stderr | 14 +- .../tests/typecheck/should_fail/tcfail140.stderr | 7 +- .../tests/typecheck/should_fail/tcfail159.stderr | 9 +- .../tests/typecheck/should_fail/tcfail181.stderr | 2 +- 125 files changed, 2650 insertions(+), 1715 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 716d3fa9fb29f040f30fd329d49c9cc6ca839ae9 From git at git.haskell.org Tue Jan 26 19:38:31 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 26 Jan 2016 19:38:31 +0000 (UTC) Subject: [commit: ghc] wip/exp-types's head updated: Refactor the typechecker to use ExpTypes. (716d3fa) Message-ID: <20160126193831.3273C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Branch 'wip/exp-types' now includes: 8e9a870 Remove -Wredundant-superclasses from standard warnings 1be8491 mkUserGuidePart: Better flag cross-referencing 6f96109 user-guide: Reformat warning lists b5e52bf user-guide: Fix typos ec87788 Don't add ticks around type applications (#11329) 923d215 user-guide: Document -L RTS flag 89bdac7 Add test for #11473 8b5ea7c User's guide: fix singular/plural typo in flagnames 98d6a29 Docs: delete section on Hierarchical Modules edc68b2 Remove `replaceDynFlags` from `ContainsDynFlags` 2c6fe5b Add -fwarn-redundant-constrains to test for #9708 fd6dd41 Implement `-Wnoncanonical-monadfail-instances` warning ff21795 Special-case implicit params in superclass expansion 746764c Refactor validity checking for type/data instances 42c6263 Avoid recursive use of immSuperClasses f7e0e5f Improve tracing in checkValidInstance 3c060f3 Fix exprIsHNF (Trac #11248) 5c82333 Show error message for unknown symbol on Elf_Rel platforms edb30fd Comments only: more alternate names for ARM registers [skip ci] bc1e085 HscTypes: Fix typo in comment 132c208 Rename -Wmissing-monadfail-instance to plural-form 6e2658f Better document behavior of -Wmissed-specialisations 128b678 user-guide: Note order-dependence of flags f0f63b3 Implement -Wunrecognised-warning-flag 9fe7d20 Ensure that we don't produce code for pre-ARMv7 without barriers 632f020 Less verbose output for the in-scope set cf788a5 White space only 47b3f58 Add "ticks-exhausted" comment 1c6d70c Kill off zipTopTCvSubst in favour of zipOpenTCvSubst 016a0bd Fix two cloning-related bugs 34c9a4e Missed plural renaming in user's guide 5f5dc86 Minor users-guide markup fixup [skip ci] 9b71695 Update transformers submodule to 0.5.1.0 release f1885df Update process submodule to 1.4.2.0 release 3798b2a Fix three broken tests involving exceptions 01809bc Pass InScopeSet to substTy in lintTyApp e24a9b5 Nicer error on +RTS -hc without -rtsopts or -prof 6d2bdfd Fix segmentation fault when .prof file not writeable 6817703 Split off -Wunused-type-variables from -Wunused-matches 144ddb4 Construct in_scope set in mkTopTCvSubst 919597d Fix some substitution InScopeSets 716d3fa Refactor the typechecker to use ExpTypes. From git at git.haskell.org Tue Jan 26 20:09:16 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 26 Jan 2016 20:09:16 +0000 (UTC) Subject: [commit: ghc] wip/exp-types: Refactor the typechecker to use ExpTypes. (1fa8452) Message-ID: <20160126200916.CD20A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/exp-types Link : http://ghc.haskell.org/trac/ghc/changeset/1fa8452ba809c24b614c28f7703aad9b0a6118df/ghc >--------------------------------------------------------------- commit 1fa8452ba809c24b614c28f7703aad9b0a6118df Author: Richard Eisenberg Date: Wed Jan 13 23:29:17 2016 -0500 Refactor the typechecker to use ExpTypes. The idea here is described in [wiki:Typechecker]. Briefly, this refactor keeps solid track of "synthesis" mode vs "checking" in GHC's bidirectional type-checking algorithm. When in synthesis mode, the expected type is just an IORef to write to. In addition, this patch does a significant reworking of RebindableSyntax, allowing much more freedom in the types of the rebindable operators. For example, we can now have `negate :: Int -> Bool` and `(>>=) :: m a -> (forall x. a x -> m b) -> m b`. The magic is in tcSyntaxOp. This addresses tickets #11397, #11452, and #11458. Tests: typecheck/should_compile/{RebindHR,RebindNegate,T11397,T11458} th/T11452 >--------------------------------------------------------------- 1fa8452ba809c24b614c28f7703aad9b0a6118df compiler/deSugar/Check.hs | 160 +++---- compiler/deSugar/Coverage.hs | 32 +- compiler/deSugar/DsArrows.hs | 13 +- compiler/deSugar/DsExpr.hs | 61 +-- compiler/deSugar/DsExpr.hs-boot | 3 +- compiler/deSugar/DsGRHSs.hs | 2 +- compiler/deSugar/DsListComp.hs | 59 ++- compiler/deSugar/DsMeta.hs | 10 +- compiler/deSugar/DsUtils.hs | 10 +- compiler/deSugar/Match.hs | 32 +- compiler/deSugar/MatchLit.hs | 52 +-- compiler/deSugar/PmExpr.hs | 5 +- compiler/ghci/RtClosureInspect.hs | 4 - compiler/hsSyn/Convert.hs | 2 +- compiler/hsSyn/HsExpr.hs | 74 +++- compiler/hsSyn/HsExpr.hs-boot | 5 +- compiler/hsSyn/HsLit.hs | 6 +- compiler/hsSyn/HsPat.hs | 16 +- compiler/hsSyn/HsUtils.hs | 74 ++-- compiler/hsSyn/PlaceHolder.hs | 23 +- compiler/parser/Parser.y | 2 +- compiler/parser/RdrHsSyn.hs | 4 +- compiler/rename/RnEnv.hs | 8 +- compiler/rename/RnExpr.hs | 101 +++-- compiler/rename/RnPat.hs | 11 +- compiler/typecheck/Inst.hs | 55 ++- compiler/typecheck/TcArrows.hs | 45 +- compiler/typecheck/TcBinds.hs | 18 +- compiler/typecheck/TcErrors.hs | 112 +++-- compiler/typecheck/TcEvidence.hs | 38 +- compiler/typecheck/TcExpr.hs | 472 ++++++++++++++------- compiler/typecheck/TcExpr.hs-boot | 24 +- compiler/typecheck/TcGenDeriv.hs | 32 +- compiler/typecheck/TcHsSyn.hs | 303 ++++++++----- compiler/typecheck/TcHsType.hs | 11 +- compiler/typecheck/TcInstDcls.hs | 3 +- compiler/typecheck/TcMType.hs | 242 +++++++---- compiler/typecheck/TcMatches.hs | 436 ++++++++++--------- compiler/typecheck/TcMatches.hs-boot | 4 +- compiler/typecheck/TcPat.hs | 248 +++++++---- compiler/typecheck/TcPatSyn.hs | 26 +- compiler/typecheck/TcRnDriver.hs | 17 +- compiler/typecheck/TcRnMonad.hs | 4 +- compiler/typecheck/TcRnTypes.hs | 28 +- compiler/typecheck/TcRules.hs | 3 +- compiler/typecheck/TcSplice.hs | 41 +- compiler/typecheck/TcSplice.hs-boot | 8 +- compiler/typecheck/TcType.hs | 111 +++-- compiler/typecheck/TcUnify.hs | 449 +++++++++++++------- compiler/typecheck/TcValidity.hs | 2 +- compiler/utils/MonadUtils.hs | 7 +- libraries/process | 2 +- libraries/transformers | 2 +- testsuite/tests/ado/ado004.stderr | 30 +- .../tests/annotations/should_fail/annfail10.stderr | 12 +- testsuite/tests/determinism/typecheck/A.hs | 2 +- testsuite/tests/gadt/gadt-escape1.stderr | 16 +- testsuite/tests/gadt/gadt13.stderr | 10 +- testsuite/tests/gadt/gadt7.stderr | 20 +- .../tests/ghci.debugger/scripts/break003.stderr | 2 +- .../tests/ghci.debugger/scripts/break003.stdout | 8 +- .../tests/ghci.debugger/scripts/break005.stdout | 4 +- .../tests/ghci.debugger/scripts/break006.stderr | 12 +- .../tests/ghci.debugger/scripts/break006.stdout | 10 +- .../tests/ghci.debugger/scripts/break012.stdout | 8 +- .../tests/ghci.debugger/scripts/hist001.stdout | 28 +- .../tests/ghci.debugger/scripts/print022.stdout | 4 +- testsuite/tests/ghci/scripts/T2182ghci.stderr | 30 +- testsuite/tests/ghci/scripts/T8959.script | 8 +- testsuite/tests/ghci/scripts/T8959.stderr | 48 +-- testsuite/tests/ghci/scripts/T8959.stdout | 11 +- .../tests/indexed-types/should_compile/T3484.hs | 4 +- .../tests/indexed-types/should_compile/T4120.hs | 4 +- .../tests/indexed-types/should_compile/T4494.hs | 3 +- .../tests/indexed-types/should_compile/T9090.hs | 2 +- .../tests/indexed-types/should_compile/T9316.hs | 2 +- .../tests/indexed-types/should_fail/T3330a.hs | 3 +- .../tests/indexed-types/should_fail/T5934.stderr | 11 +- .../tests/indexed-types/should_fail/T7788.stderr | 7 +- .../tests/indexed-types/should_fail/T8518.stderr | 33 +- testsuite/tests/module/mod71.stderr | 6 +- .../should_fail/overloadedlistsfail03.hs | 2 +- .../should_fail/overloadedlistsfail03.stderr | 13 +- .../should_fail/overloadedlistsfail05.hs | 2 +- .../should_fail/overloadedlistsfail05.stderr | 15 +- .../tests/parser/should_compile/read014.stderr | 8 +- testsuite/tests/parser/should_fail/T7848.stderr | 42 +- .../partial-sigs/should_compile/T10438.stderr | 16 +- .../partial-sigs/should_compile/T11192.stderr | 12 +- testsuite/tests/polykinds/T7438.stderr | 16 +- testsuite/tests/rebindable/rebindable6.hs | 5 +- testsuite/tests/rebindable/rebindable6.stderr | 24 +- .../tests/rename/should_compile/T3103/GHC/Num.hs | 9 + .../tests/rename/should_compile/T3103/GHC/Word.hs | 2 +- testsuite/tests/th/T11452.hs | 6 + testsuite/tests/th/T11452.stderr | 15 + testsuite/tests/th/T2222.stderr | 2 +- testsuite/tests/th/all.T | 1 + .../tests/typecheck/should_compile/RebindHR.hs | 26 ++ .../tests/typecheck/should_compile/RebindNegate.hs | 9 + testsuite/tests/typecheck/should_compile/T11397.hs | 69 +++ testsuite/tests/typecheck/should_compile/T11458.hs | 5 + testsuite/tests/typecheck/should_compile/T2683.hs | 2 +- testsuite/tests/typecheck/should_compile/T7888.hs | 4 + testsuite/tests/typecheck/should_compile/all.T | 4 + .../tests/typecheck/should_compile/tc141.stderr | 6 +- testsuite/tests/typecheck/should_compile/tc158.hs | 2 +- testsuite/tests/typecheck/should_compile/twins.hs | 2 +- .../tests/typecheck/should_fail/FDsFromGivens2.hs | 1 + .../typecheck/should_fail/FDsFromGivens2.stderr | 26 +- .../tests/typecheck/should_fail/T10619.stderr | 4 +- testsuite/tests/typecheck/should_fail/T3613.stderr | 4 +- testsuite/tests/typecheck/should_fail/T5570.stderr | 3 +- testsuite/tests/typecheck/should_fail/T7453.stderr | 50 +-- testsuite/tests/typecheck/should_fail/T7734.stderr | 12 +- testsuite/tests/typecheck/should_fail/T8603.stderr | 8 +- testsuite/tests/typecheck/should_fail/T9109.stderr | 11 +- .../tests/typecheck/should_fail/tcfail014.stderr | 6 +- .../tests/typecheck/should_fail/tcfail016.stderr | 25 +- .../tests/typecheck/should_fail/tcfail032.stderr | 6 +- .../tests/typecheck/should_fail/tcfail099.stderr | 6 +- .../tests/typecheck/should_fail/tcfail104.stderr | 14 +- .../tests/typecheck/should_fail/tcfail140.stderr | 7 +- .../tests/typecheck/should_fail/tcfail159.stderr | 9 +- .../tests/typecheck/should_fail/tcfail181.stderr | 2 +- 125 files changed, 2649 insertions(+), 1714 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 1fa8452ba809c24b614c28f7703aad9b0a6118df From git at git.haskell.org Wed Jan 27 00:56:01 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Jan 2016 00:56:01 +0000 (UTC) Subject: [commit: ghc] master: Build profiling libraries on `validate --slow` (#11496) (e2bdf03) Message-ID: <20160127005601.991ED3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e2bdf03a63b09feabee76e2efd33eb56739324ac/ghc >--------------------------------------------------------------- commit e2bdf03a63b09feabee76e2efd33eb56739324ac Author: Thomas Miedema Date: Wed Jan 27 00:08:53 2016 +0100 Build profiling libraries on `validate --slow` (#11496) >--------------------------------------------------------------- e2bdf03a63b09feabee76e2efd33eb56739324ac mk/flavours/validate.mk | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mk/flavours/validate.mk b/mk/flavours/validate.mk index 0bb7b92..94892d4 100644 --- a/mk/flavours/validate.mk +++ b/mk/flavours/validate.mk @@ -17,8 +17,12 @@ ifeq "$(ValidateSpeed)" "SLOW" GhcStage2HcOpts += -DDEBUG endif +ifeq "$(ValidateSpeed)" "SLOW" +BUILD_PROF_LIBS = YES +endif + ifneq "$(ValidateSpeed)" "FAST" -BUILD_EXTRA_PKGS=YES +BUILD_EXTRA_PKGS = YES endif WERROR = -Werror From git at git.haskell.org Wed Jan 27 00:56:04 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Jan 2016 00:56:04 +0000 (UTC) Subject: [commit: ghc] master: Testsuite: fixup req_profiling tests (#11496) (eeb67c9) Message-ID: <20160127005604.69BB83A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/eeb67c9b833d95fa69932c34a3175054dacb83e2/ghc >--------------------------------------------------------------- commit eeb67c9b833d95fa69932c34a3175054dacb83e2 Author: Thomas Miedema Date: Tue Jan 26 13:07:38 2016 +0100 Testsuite: fixup req_profiling tests (#11496) * T2552 (#10037) is failng for all threaded opt_ways, not for WAY=prof. * TH_spliceE5_prof (#11495) is failing when ghc_dynamic * Rename ghci_dynamic to ghc_dynamic. It's the same thing. >--------------------------------------------------------------- eeb67c9b833d95fa69932c34a3175054dacb83e2 testsuite/driver/testlib.py | 2 +- testsuite/tests/ghc-e/should_run/all.T | 2 +- testsuite/tests/ghci/linking/all.T | 4 ++-- testsuite/tests/profiling/should_run/all.T | 2 +- testsuite/tests/profiling/should_run/callstack002.stderr | 4 ++-- testsuite/tests/profiling/should_run/callstack002.stdout | 2 +- testsuite/tests/th/Makefile | 2 +- testsuite/tests/th/all.T | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py index 2ac9018..97a5a0d 100644 --- a/testsuite/driver/testlib.py +++ b/testsuite/driver/testlib.py @@ -336,7 +336,7 @@ def unless(b, f): def doing_ghci(): return 'ghci' in config.run_ways -def ghci_dynamic( ): +def ghc_dynamic(): return config.ghc_dynamic def fast(): diff --git a/testsuite/tests/ghc-e/should_run/all.T b/testsuite/tests/ghc-e/should_run/all.T index ae28653..a10fb0d 100644 --- a/testsuite/tests/ghc-e/should_run/all.T +++ b/testsuite/tests/ghc-e/should_run/all.T @@ -7,7 +7,7 @@ test('ghc-e005', req_interp, run_command, ['$MAKE --no-print-directory -s ghc-e0 test('ghc-e006', req_interp, run_command, ['$MAKE --no-print-directory -s ghc-e006']) test('T2228', - [req_interp, when(ghci_dynamic(), expect_broken(7298))], + [req_interp, when(ghc_dynamic(), expect_broken(7298))], run_command, ['$MAKE --no-print-directory -s T2228']) test('T2636', req_interp, run_command, ['$MAKE --no-print-directory -s T2636']) diff --git a/testsuite/tests/ghci/linking/all.T b/testsuite/tests/ghci/linking/all.T index 7404de3..369ef28 100644 --- a/testsuite/tests/ghci/linking/all.T +++ b/testsuite/tests/ghci/linking/all.T @@ -1,5 +1,5 @@ test('ghcilink001', - [when(ghci_dynamic(), expect_fail), # dynamic ghci can't load '.a's + [when(ghc_dynamic(), expect_fail), # dynamic ghci can't load '.a's unless(doing_ghci, skip), extra_clean(['dir001/*','dir001'])], run_command, @@ -43,7 +43,7 @@ test('ghcilink006', test('T3333', [extra_clean(['T3333.o']), unless(doing_ghci, skip), - unless(opsys('linux') or opsys('darwin') or ghci_dynamic(), expect_broken(3333))], + unless(opsys('linux') or opsys('darwin') or ghc_dynamic(), expect_broken(3333))], run_command, ['$MAKE -s --no-print-directory T3333']) diff --git a/testsuite/tests/profiling/should_run/all.T b/testsuite/tests/profiling/should_run/all.T index ca37fe5..52bd62c 100644 --- a/testsuite/tests/profiling/should_run/all.T +++ b/testsuite/tests/profiling/should_run/all.T @@ -72,7 +72,7 @@ test('T680', test('T2552', [ req_profiling, extra_ways(['prof']), only_ways(prof_ways), - expect_broken_for(10037,['prof'])], + expect_broken_for(10037, opt_ways)], compile_and_run, ['']) diff --git a/testsuite/tests/profiling/should_run/callstack002.stderr b/testsuite/tests/profiling/should_run/callstack002.stderr index b4bb0d5..e1f249a 100644 --- a/testsuite/tests/profiling/should_run/callstack002.stderr +++ b/testsuite/tests/profiling/should_run/callstack002.stderr @@ -1,5 +1,5 @@ f: 42 -Stack trace: +CallStack (from -prof): Main.f (callstack002.hs:10:7-43) Main.map.go (callstack002.hs:15:21-23) Main.map.go (callstack002.hs:15:21-34) @@ -7,7 +7,7 @@ Stack trace: Main.main.xs (callstack002.hs:18:12-24) Main.CAF () f: 43 -Stack trace: +CallStack (from -prof): Main.f (callstack002.hs:10:7-43) Main.map.go (callstack002.hs:15:21-23) Main.map.go (callstack002.hs:15:21-34) diff --git a/testsuite/tests/profiling/should_run/callstack002.stdout b/testsuite/tests/profiling/should_run/callstack002.stdout index 480090d..8116c2c 100644 --- a/testsuite/tests/profiling/should_run/callstack002.stdout +++ b/testsuite/tests/profiling/should_run/callstack002.stdout @@ -1,5 +1,5 @@ [84,86] -Stack trace: +CallStack (from -prof): Main.f (callstack002.hs:10:38-42) Main.f (callstack002.hs:10:7-43) Main.map.go (callstack002.hs:15:21-23) diff --git a/testsuite/tests/th/Makefile b/testsuite/tests/th/Makefile index 4fb508f..5e47e8c 100644 --- a/testsuite/tests/th/Makefile +++ b/testsuite/tests/th/Makefile @@ -16,7 +16,7 @@ HC_OPTS = -XTemplateHaskell -package template-haskell TH_spliceE5_prof:: $(RM) TH_spliceE5_prof*.o TH_spliceE5_prof*.hi TH_spliceE5_prof*.dyn_o TH_spliceE5_prof*.dyn_hi TH_spliceE5_prof - '$(TEST_HC)' $(TEST_HC_OPTS) $(HC_OPTS) $(ghcThWayFlags) --make -v0 TH_spliceE5_prof.hs -c + '$(TEST_HC)' $(TEST_HC_OPTS) $(HC_OPTS) $(ghcThWayFlags) --make -no-link -v0 TH_spliceE5_prof.hs # Using `-osuf .p.o` should work. Note the dot before the `p` (#9760), and # the dot between the `p` and the `o` (#5554). '$(TEST_HC)' $(TEST_HC_OPTS) $(HC_OPTS) --make -v0 TH_spliceE5_prof.hs -prof -auto-all -osuf .p.o -o $@ diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index 8b38e3f..db6ee4e 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -45,7 +45,7 @@ test('TH_NestedSplices', # normal way first, which is why the work is done by a Makefile rule. test('TH_spliceE5_prof', [req_profiling, - omit_ways(['ghci']), + when(ghc_dynamic(), expect_broken(11495)), extra_clean(['TH_spliceE5_prof_Lib.p.o', 'TH_spliceE5_prof_Lib.hi', 'TH_spliceE5_prof_Lib.dyn_o', 'TH_spliceE5_prof_Lib.dyn_hi', 'TH_spliceE5_prof.dyn_o', 'TH_spliceE5_prof.dyn_hi', From git at git.haskell.org Wed Jan 27 04:32:24 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Jan 2016 04:32:24 +0000 (UTC) Subject: [commit: ghc] wip/exp-types: Refactor the typechecker to use ExpTypes. (f338ce6) Message-ID: <20160127043224.9816F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/exp-types Link : http://ghc.haskell.org/trac/ghc/changeset/f338ce60cde1b9e63747cc240f635fe7bf50059a/ghc >--------------------------------------------------------------- commit f338ce60cde1b9e63747cc240f635fe7bf50059a Author: Richard Eisenberg Date: Wed Jan 13 23:29:17 2016 -0500 Refactor the typechecker to use ExpTypes. The idea here is described in [wiki:Typechecker]. Briefly, this refactor keeps solid track of "synthesis" mode vs "checking" in GHC's bidirectional type-checking algorithm. When in synthesis mode, the expected type is just an IORef to write to. In addition, this patch does a significant reworking of RebindableSyntax, allowing much more freedom in the types of the rebindable operators. For example, we can now have `negate :: Int -> Bool` and `(>>=) :: m a -> (forall x. a x -> m b) -> m b`. The magic is in tcSyntaxOp. This addresses tickets #11397, #11452, and #11458. Tests: typecheck/should_compile/{RebindHR,RebindNegate,T11397,T11458} th/T11452 >--------------------------------------------------------------- f338ce60cde1b9e63747cc240f635fe7bf50059a compiler/deSugar/Check.hs | 160 +++---- compiler/deSugar/Coverage.hs | 32 +- compiler/deSugar/DsArrows.hs | 13 +- compiler/deSugar/DsExpr.hs | 61 +-- compiler/deSugar/DsExpr.hs-boot | 3 +- compiler/deSugar/DsGRHSs.hs | 2 +- compiler/deSugar/DsListComp.hs | 59 ++- compiler/deSugar/DsMeta.hs | 10 +- compiler/deSugar/DsUtils.hs | 10 +- compiler/deSugar/Match.hs | 32 +- compiler/deSugar/MatchLit.hs | 52 +-- compiler/deSugar/PmExpr.hs | 5 +- compiler/ghci/RtClosureInspect.hs | 4 - compiler/hsSyn/Convert.hs | 2 +- compiler/hsSyn/HsExpr.hs | 74 +++- compiler/hsSyn/HsExpr.hs-boot | 5 +- compiler/hsSyn/HsLit.hs | 6 +- compiler/hsSyn/HsPat.hs | 16 +- compiler/hsSyn/HsUtils.hs | 80 ++-- compiler/hsSyn/PlaceHolder.hs | 14 +- compiler/parser/Parser.y | 2 +- compiler/parser/RdrHsSyn.hs | 4 +- compiler/rename/RnEnv.hs | 8 +- compiler/rename/RnExpr.hs | 101 +++-- compiler/rename/RnPat.hs | 11 +- compiler/typecheck/Inst.hs | 55 ++- compiler/typecheck/TcArrows.hs | 45 +- compiler/typecheck/TcBinds.hs | 18 +- compiler/typecheck/TcErrors.hs | 112 +++-- compiler/typecheck/TcEvidence.hs | 38 +- compiler/typecheck/TcExpr.hs | 472 ++++++++++++++------- compiler/typecheck/TcExpr.hs-boot | 24 +- compiler/typecheck/TcGenDeriv.hs | 32 +- compiler/typecheck/TcHsSyn.hs | 303 ++++++++----- compiler/typecheck/TcHsType.hs | 11 +- compiler/typecheck/TcInstDcls.hs | 3 +- compiler/typecheck/TcMType.hs | 242 +++++++---- compiler/typecheck/TcMatches.hs | 436 ++++++++++--------- compiler/typecheck/TcMatches.hs-boot | 4 +- compiler/typecheck/TcPat.hs | 248 +++++++---- compiler/typecheck/TcPatSyn.hs | 26 +- compiler/typecheck/TcRnDriver.hs | 17 +- compiler/typecheck/TcRnMonad.hs | 4 +- compiler/typecheck/TcRnTypes.hs | 28 +- compiler/typecheck/TcRules.hs | 3 +- compiler/typecheck/TcSplice.hs | 42 +- compiler/typecheck/TcSplice.hs-boot | 8 +- compiler/typecheck/TcType.hs | 111 +++-- compiler/typecheck/TcUnify.hs | 449 +++++++++++++------- compiler/typecheck/TcValidity.hs | 2 +- compiler/utils/MonadUtils.hs | 7 +- libraries/process | 2 +- libraries/transformers | 2 +- testsuite/tests/ado/ado004.stderr | 30 +- .../tests/annotations/should_fail/annfail10.stderr | 12 +- testsuite/tests/deSugar/should_run/dsrun017.hs | 0 testsuite/tests/determinism/typecheck/A.hs | 2 +- testsuite/tests/gadt/gadt-escape1.stderr | 16 +- testsuite/tests/gadt/gadt13.stderr | 10 +- testsuite/tests/gadt/gadt7.stderr | 20 +- .../ghc-api/annotations-literals/parsed.stdout | 8 +- .../tests/ghci.debugger/scripts/break003.stderr | 2 +- .../tests/ghci.debugger/scripts/break003.stdout | 8 +- .../tests/ghci.debugger/scripts/break005.stdout | 4 +- .../tests/ghci.debugger/scripts/break006.stderr | 12 +- .../tests/ghci.debugger/scripts/break006.stdout | 10 +- .../tests/ghci.debugger/scripts/break012.stdout | 8 +- .../tests/ghci.debugger/scripts/hist001.stdout | 28 +- .../tests/ghci.debugger/scripts/print022.stdout | 4 +- testsuite/tests/ghci/scripts/T2182ghci.stderr | 30 +- testsuite/tests/ghci/scripts/T8959.script | 8 +- testsuite/tests/ghci/scripts/T8959.stderr | 48 +-- testsuite/tests/ghci/scripts/T8959.stdout | 11 +- .../tests/indexed-types/should_compile/T3484.hs | 4 +- .../tests/indexed-types/should_compile/T4120.hs | 4 +- .../tests/indexed-types/should_compile/T4494.hs | 3 +- .../tests/indexed-types/should_compile/T9090.hs | 2 +- .../tests/indexed-types/should_compile/T9316.hs | 2 +- .../tests/indexed-types/should_fail/T3330a.hs | 3 +- .../tests/indexed-types/should_fail/T5934.stderr | 11 +- .../tests/indexed-types/should_fail/T7788.stderr | 7 +- .../tests/indexed-types/should_fail/T8518.stderr | 33 +- testsuite/tests/module/mod71.stderr | 6 +- .../should_fail/overloadedlistsfail03.hs | 2 +- .../should_fail/overloadedlistsfail03.stderr | 13 +- .../should_fail/overloadedlistsfail05.hs | 2 +- .../should_fail/overloadedlistsfail05.stderr | 15 +- .../tests/parser/should_compile/read014.stderr | 8 +- testsuite/tests/parser/should_fail/T7848.stderr | 42 +- .../partial-sigs/should_compile/T10438.stderr | 16 +- .../partial-sigs/should_compile/T11192.stderr | 12 +- testsuite/tests/perf/compiler/all.T | 3 +- testsuite/tests/polykinds/T7438.stderr | 16 +- testsuite/tests/rebindable/rebindable6.hs | 5 +- testsuite/tests/rebindable/rebindable6.stderr | 24 +- .../tests/rename/should_compile/T3103/GHC/Num.hs | 9 + .../tests/rename/should_compile/T3103/GHC/Word.hs | 2 +- testsuite/tests/th/T11452.hs | 6 + testsuite/tests/th/T11452.stderr | 15 + testsuite/tests/th/T2222.stderr | 2 +- testsuite/tests/th/all.T | 1 + .../tests/typecheck/should_compile/RebindHR.hs | 26 ++ .../tests/typecheck/should_compile/RebindNegate.hs | 9 + testsuite/tests/typecheck/should_compile/T11397.hs | 69 +++ testsuite/tests/typecheck/should_compile/T11458.hs | 5 + testsuite/tests/typecheck/should_compile/T2683.hs | 2 +- testsuite/tests/typecheck/should_compile/T7888.hs | 4 + testsuite/tests/typecheck/should_compile/all.T | 4 + .../tests/typecheck/should_compile/tc141.stderr | 6 +- testsuite/tests/typecheck/should_compile/tc158.hs | 2 +- testsuite/tests/typecheck/should_compile/twins.hs | 2 +- .../tests/typecheck/should_fail/FDsFromGivens2.hs | 1 + .../typecheck/should_fail/FDsFromGivens2.stderr | 26 +- .../tests/typecheck/should_fail/T10619.stderr | 4 +- testsuite/tests/typecheck/should_fail/T3613.stderr | 4 +- testsuite/tests/typecheck/should_fail/T5570.stderr | 3 +- testsuite/tests/typecheck/should_fail/T7453.stderr | 50 +-- testsuite/tests/typecheck/should_fail/T7734.stderr | 12 +- testsuite/tests/typecheck/should_fail/T8603.stderr | 8 +- testsuite/tests/typecheck/should_fail/T9109.stderr | 11 +- .../tests/typecheck/should_fail/VtaFail.stderr | 2 +- .../tests/typecheck/should_fail/tcfail014.stderr | 6 +- .../tests/typecheck/should_fail/tcfail016.stderr | 25 +- .../tests/typecheck/should_fail/tcfail032.stderr | 6 +- .../tests/typecheck/should_fail/tcfail099.stderr | 6 +- .../tests/typecheck/should_fail/tcfail104.stderr | 14 +- .../tests/typecheck/should_fail/tcfail140.stderr | 7 +- .../tests/typecheck/should_fail/tcfail159.stderr | 9 +- .../tests/typecheck/should_fail/tcfail181.stderr | 2 +- utils/ghctags/Main.hs | 4 +- 130 files changed, 2662 insertions(+), 1716 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc f338ce60cde1b9e63747cc240f635fe7bf50059a From git at git.haskell.org Wed Jan 27 09:51:54 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Jan 2016 09:51:54 +0000 (UTC) Subject: [commit: ghc] master: Enable RemoteGHCi on Windows (44a5d51) Message-ID: <20160127095154.EAD773A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/44a5d51a4892b85c7eba09dcb90ca02245637812/ghc >--------------------------------------------------------------- commit 44a5d51a4892b85c7eba09dcb90ca02245637812 Author: Tamar Christina Date: Wed Jan 27 10:20:11 2016 +0100 Enable RemoteGHCi on Windows Makes the needed changes to make RemoteGHCi work on Windows. The approach passes OS Handles areound instead of the Posix Fd as on Linux. The reason is that I could not find any real documentation about the behaviour of Windows w.r.t inheritance and Posix FDs. The implementation with Fd did not seem to be able to find the Fd in the child process. Instead I'm using the much better documented approach of passing inheriting handles. This requires a small modification to the `process` library. https://github.com/haskell/process/pull/52 Test Plan: ./validate On Windows x86_64 Reviewers: thomie, erikd, bgamari, simonmar, austin, hvr Reviewed By: simonmar Subscribers: #ghc_windows_task_force Differential Revision: https://phabricator.haskell.org/D1836 GHC Trac Issues: #11100 >--------------------------------------------------------------- 44a5d51a4892b85c7eba09dcb90ca02245637812 .gitignore | 1 + compiler/ghci/GHCi.hs | 61 +++++++++++++++++++++++++++---------------- compiler/main/DynFlags.hs | 7 ----- ghc.mk | 2 -- iserv/{ => cbits}/iservmain.c | 0 iserv/iserv-bin.cabal | 8 ++++-- iserv/src/GHCi/Utils.hsc | 25 ++++++++++++++++++ iserv/{ => src}/Main.hs | 10 +++---- mk/warnings.mk | 5 ++++ 9 files changed, 81 insertions(+), 38 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 44a5d51a4892b85c7eba09dcb90ca02245637812 From git at git.haskell.org Wed Jan 27 09:55:03 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Jan 2016 09:55:03 +0000 (UTC) Subject: [commit: ghc] master: Fix a typo in the note name in comments (45fd83b) Message-ID: <20160127095503.0839C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/45fd83bb5ed3a66320eb873039b65566f53ed36a/ghc >--------------------------------------------------------------- commit 45fd83bb5ed3a66320eb873039b65566f53ed36a Author: Bartosz Nitka Date: Wed Jan 27 01:55:52 2016 -0800 Fix a typo in the note name in comments This is `subsititution` to `substitution`, plus one instance of the note that I missed. Test Plan: docufix Reviewers: simonpj, bgamari, austin, goldfire Reviewed By: simonpj, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1856 GHC Trac Issues: #11371 >--------------------------------------------------------------- 45fd83bb5ed3a66320eb873039b65566f53ed36a compiler/coreSyn/CoreLint.hs | 2 +- compiler/types/TyCoRep.hs | 12 ++++++------ compiler/types/Type.hs | 3 +-- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/compiler/coreSyn/CoreLint.hs b/compiler/coreSyn/CoreLint.hs index 6546c3d..9c61b39 100644 --- a/compiler/coreSyn/CoreLint.hs +++ b/compiler/coreSyn/CoreLint.hs @@ -788,7 +788,7 @@ lintTyApp fun_ty arg_ty ; in_scope <- getInScope -- substTy needs the set of tyvars in scope to avoid generating -- uniques that are already in scope. - -- See Note [The subsititution invariant] in TyCoRep + -- See Note [The substitution invariant] in TyCoRep ; return (substTyWithInScope in_scope [tv] [arg_ty] body_ty) } | otherwise diff --git a/compiler/types/TyCoRep.hs b/compiler/types/TyCoRep.hs index a247725..08d3b79 100644 --- a/compiler/types/TyCoRep.hs +++ b/compiler/types/TyCoRep.hs @@ -1416,7 +1416,7 @@ data TCvSubst -- See Note [Apply Once] -- and Note [Extending the TvSubstEnv] -- and Note [Substituting types and coercions] - -- and Note [The subsititution invariant] + -- and Note [The substitution invariant] -- | A substitution of 'Type's for 'TyVar's -- and 'Kind's for 'KindVar's @@ -1489,7 +1489,7 @@ constructor) and the CvSubstEnv should *never* map a TyVar. Furthermore, the range of the TvSubstEnv should *never* include a type headed with CoercionTy. -Note [The subsititution invariant] +Note [The substitution invariant] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ When calling substTy subst ty it should be the case that the in-scope set in the substitution is a superset of both: @@ -1832,7 +1832,7 @@ substTyWithBinders bndrs tys = ASSERT( length bndrs == length tys ) -- | Substitute within a 'Type' after adding the free variables of the type -- to the in-scope set. This is useful for the case when the free variables -- aren't already in the in-scope set or easily available. --- See also Note [The subsititution invariant]. +-- See also Note [The substitution invariant]. substTyAddInScope :: TCvSubst -> Type -> Type substTyAddInScope subst ty = substTy (extendTCvInScopeSet subst $ tyCoVarsOfType ty) ty @@ -1840,7 +1840,7 @@ substTyAddInScope subst ty = -- | When calling `substTy` it should be the case that the in-scope set in -- the substitution is a superset of the free vars of the range of the -- substitution. --- See also Note [The subsititution invariant]. +-- See also Note [The substitution invariant]. isValidTCvSubst :: TCvSubst -> Bool isValidTCvSubst (TCvSubst in_scope tenv cenv) = (tenvFVs `varSetInScope` in_scope) && @@ -1851,7 +1851,7 @@ isValidTCvSubst (TCvSubst in_scope tenv cenv) = -- | Substitute within a 'Type' -- The substitution has to satisfy the invariants described in --- Note [The subsititution invariant]. +-- Note [The substitution invariant]. substTy :: -- CallStack wasn't present in GHC 7.10.1, disable callstacks in stage 1 @@ -1880,7 +1880,7 @@ substTy subst@(TCvSubst in_scope tenv cenv) ty -- | Substitute within a 'Type' disabling the sanity checks. -- The problems that the sanity checks in substTy catch are described in --- Note [The subsititution invariant]. +-- Note [The substitution invariant]. -- The goal of #11371 is to migrate all the calls of substTyUnchecked to -- substTy and remove this function. Please don't use in new code. substTyUnchecked :: TCvSubst -> Type -> Type diff --git a/compiler/types/Type.hs b/compiler/types/Type.hs index c6d51f3..0b51f5d 100644 --- a/compiler/types/Type.hs +++ b/compiler/types/Type.hs @@ -297,8 +297,7 @@ coreView (TyConApp tc tys) | Just (tenv, rhs, tys') <- expandSynTyCon_maybe tc t = Just (mkAppTys (substTy (mkTopTCvSubst tenv) rhs) tys') -- The free vars of 'rhs' should all be bound by 'tenv', so it's -- ok to use 'substTy' here. - -- See also Note [Generating the in-scope set for a substitution] - -- in TyCoRep. + -- See also Note [The substitution invariant] in TyCoRep. -- Its important to use mkAppTys, rather than (foldl AppTy), -- because the function part might well return a -- partially-applied type constructor; indeed, usually will! From git at git.haskell.org Wed Jan 27 10:10:56 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Jan 2016 10:10:56 +0000 (UTC) Subject: [commit: ghc] master: Typos in comments (448ea97) Message-ID: <20160127101056.3DC653A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/448ea978318a9f8c9bb611803aa01f934b111fe9/ghc >--------------------------------------------------------------- commit 448ea978318a9f8c9bb611803aa01f934b111fe9 Author: Gabor Greif Date: Wed Jan 27 11:11:04 2016 +0100 Typos in comments >--------------------------------------------------------------- 448ea978318a9f8c9bb611803aa01f934b111fe9 compiler/llvmGen/LlvmCodeGen/CodeGen.hs | 2 +- compiler/typecheck/TcSMonad.hs | 2 +- compiler/vectorise/Vectorise.hs | 2 +- docs/backpack/algorithm.tex | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/llvmGen/LlvmCodeGen/CodeGen.hs b/compiler/llvmGen/LlvmCodeGen/CodeGen.hs index a4aa62a..4bc6248 100644 --- a/compiler/llvmGen/LlvmCodeGen/CodeGen.hs +++ b/compiler/llvmGen/LlvmCodeGen/CodeGen.hs @@ -1667,7 +1667,7 @@ genLit _ CmmHighStackMark -- and avoids having to deal with Phi node insertion. This is also -- the approach recommended by LLVM developers. -- --- On the other hand, this is unecessarily verbose if the register in +-- On the other hand, this is unnecessarily verbose if the register in -- question is never written. Therefore we skip it where we can to -- save a few lines in the output and hopefully speed compilation up a -- bit. diff --git a/compiler/typecheck/TcSMonad.hs b/compiler/typecheck/TcSMonad.hs index 3616bb7..2cf7d79 100644 --- a/compiler/typecheck/TcSMonad.hs +++ b/compiler/typecheck/TcSMonad.hs @@ -932,7 +932,7 @@ For example, if we have and we wish to compute S(W/R, T a b), the correct answer is T a Bool, NOT T Int Bool. The reason is that T's first parameter has a nominal role, and thus rewriting a to Int in T a b is wrong. Indeed, this non-congruence of -subsitution means that the proof in Note [The inert equalities] may need +substitution means that the proof in Note [The inert equalities] may need to be revisited, but we don't think that the end conclusion is wrong. Note [Examples of how the inert_model helps completeness] diff --git a/compiler/vectorise/Vectorise.hs b/compiler/vectorise/Vectorise.hs index fa59f08..77561ff 100644 --- a/compiler/vectorise/Vectorise.hs +++ b/compiler/vectorise/Vectorise.hs @@ -130,7 +130,7 @@ vectModule guts@(ModGuts { mg_tcs = tycons -- -- The original binding @foo@ is rewritten to call the vectorised version present in the closure. -- --- Vectorisation may be surpressed by annotating a binding with a 'NOVECTORISE' pragma. If this +-- Vectorisation may be suppressed by annotating a binding with a 'NOVECTORISE' pragma. If this -- pragma is used in a group of mutually recursive bindings, either all or no binding must have -- the pragma. If only some bindings are annotated, a fatal error is being raised. (In the case of -- scalar bindings, we only omit vectorisation if all bindings in a group are scalar.) diff --git a/docs/backpack/algorithm.tex b/docs/backpack/algorithm.tex index 1c7192c..c98781c 100644 --- a/docs/backpack/algorithm.tex +++ b/docs/backpack/algorithm.tex @@ -671,7 +671,7 @@ we have to type-check the \I{ModIface} with the following adjustments: with a unit key that is a $\verb|hole|$, substitute with the recorded \I{Name} in the requirements of the shape. Otherwise, look up the (unique) \I{ModIface} for the \I{Module}, - and subsitute with the corresponding \I{Name} in the \I{mi\_exports}. + and substitute with the corresponding \I{Name} in the \I{mi\_exports}. \end{enumerate} \paragraph{Signatures} For signatures, we have a \I{Module} of the form From git at git.haskell.org Wed Jan 27 10:30:55 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Jan 2016 10:30:55 +0000 (UTC) Subject: [commit: ghc] master: Use stage1 build variables when building the RTS (0d92d9c) Message-ID: <20160127103055.7E4A63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/0d92d9cb6d65fd00f9910c3f6f85bc6c68f5543b/ghc >--------------------------------------------------------------- commit 0d92d9cb6d65fd00f9910c3f6f85bc6c68f5543b Author: Reid Barton Date: Wed Jan 27 11:05:50 2016 +0100 Use stage1 build variables when building the RTS The fourth argument of distdir-way-opts was missing. So, for example, SRC_HC_OPTS_STAGE1 was not used when building the RTS. Test Plan: validate --slow Reviewers: austin, bgamari, thomie Reviewed By: thomie Differential Revision: https://phabricator.haskell.org/D1857 >--------------------------------------------------------------- 0d92d9cb6d65fd00f9910c3f6f85bc6c68f5543b rts/ghc.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rts/ghc.mk b/rts/ghc.mk index 71da10d..85fab78 100644 --- a/rts/ghc.mk +++ b/rts/ghc.mk @@ -160,7 +160,7 @@ ifneq "$$(findstring thr, $1)" "" rts_$1_EXTRA_C_SRCS = rts/dist/build/sm/Evac_thr.c rts/dist/build/sm/Scav_thr.c endif -$(call distdir-way-opts,rts,dist,$1) +$(call distdir-way-opts,rts,dist,$1,1) # 1 because the rts is built with stage1 $(call c-suffix-rules,rts,dist,$1,YES) $(call cmm-suffix-rules,rts,dist,$1) From git at git.haskell.org Wed Jan 27 10:30:58 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Jan 2016 10:30:58 +0000 (UTC) Subject: [commit: ghc] master: rts/Timer: Actually fix #9105 (1c6130d) Message-ID: <20160127103058.294093A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/1c6130d91420dc835c281bc9b13d603b7aa49b59/ghc >--------------------------------------------------------------- commit 1c6130d91420dc835c281bc9b13d603b7aa49b59 Author: Ben Gamari Date: Wed Jan 27 11:05:23 2016 +0100 rts/Timer: Actually fix #9105 jberthold astutely pointed out that the previous fix (D1822) could not have possibly fixed the issue as the patch would only have had any effect if !PROFILING. Test Plan: Check for reduced CPU usage when compiled with `-prof` but without `+RTS -p` Reviewers: simonmar, austin, jberthold Reviewed By: simonmar, jberthold Subscribers: simonmar, thomie Differential Revision: https://phabricator.haskell.org/D1844 GHC Trac Issues: #9105 >--------------------------------------------------------------- 1c6130d91420dc835c281bc9b13d603b7aa49b59 rts/Timer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rts/Timer.c b/rts/Timer.c index bf7240b..9136c60 100644 --- a/rts/Timer.c +++ b/rts/Timer.c @@ -76,11 +76,13 @@ handle_tick(int unused STG_UNUSED) // but only if we're not profiling (e.g. passed -h or -p RTS // flags). If we are profiling we need to keep the timer active // so that samples continue to be collected. -#ifndef PROFILING +#ifdef PROFILING if (!(RtsFlags.ProfFlags.doHeapProfile || RtsFlags.CcFlags.doCostCentres)) { stopTimer(); } +#else + stopTimer(); #endif } } else { From git at git.haskell.org Wed Jan 27 10:31:00 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Jan 2016 10:31:00 +0000 (UTC) Subject: [commit: ghc] master: ghci: fix trac issue #11481 (1f6d142) Message-ID: <20160127103100.D68533A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/1f6d1422f9fe875e1d150b423c4864b42d96b8db/ghc >--------------------------------------------------------------- commit 1f6d1422f9fe875e1d150b423c4864b42d96b8db Author: Benjamin Bykowski Date: Wed Jan 27 11:05:13 2016 +0100 ghci: fix trac issue #11481 Test Plan: validate Reviewers: thomie, austin, bgamari Reviewed By: bgamari Differential Revision: https://phabricator.haskell.org/D1833 GHC Trac Issues: #11481 >--------------------------------------------------------------- 1f6d1422f9fe875e1d150b423c4864b42d96b8db compiler/main/DynFlags.hs | 2 +- ghc/GHCi/UI.hs | 13 +++---- testsuite/tests/ghci/scripts/Defer03.hs | 5 ++- testsuite/tests/ghci/scripts/T8353.stderr | 60 +++++++++++++++++++++++-------- 4 files changed, 55 insertions(+), 25 deletions(-) diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 0e9d420..83de48c 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -28,7 +28,7 @@ module DynFlags ( ProfAuto(..), glasgowExtsFlags, dopt, dopt_set, dopt_unset, - gopt, gopt_set, gopt_unset, + gopt, gopt_set, gopt_unset, setGeneralFlag', unSetGeneralFlag', wopt, wopt_set, wopt_unset, xopt, xopt_set, xopt_unset, lang_set, diff --git a/ghc/GHCi/UI.hs b/ghc/GHCi/UI.hs index fc03b5f..2528503 100644 --- a/ghc/GHCi/UI.hs +++ b/ghc/GHCi/UI.hs @@ -1460,17 +1460,14 @@ checkModule m = do -- :load, :add, :reload -- | Sets '-fdefer-type-errors' if 'defer' is true, executes 'load' and unsets --- '-fdefer-type-errors' again if it has not been set before +-- '-fdefer-type-errors' again if it has not been set before. deferredLoad :: Bool -> InputT GHCi SuccessFlag -> InputT GHCi () deferredLoad defer load = do - flags <- getDynFlags - deferredBefore <- return (gopt Opt_DeferTypeErrors flags) - when (defer) $ Monad.void $ - GHC.setProgramDynFlags $ gopt_set flags Opt_DeferTypeErrors + originalFlags <- getDynFlags + when defer $ Monad.void $ + GHC.setProgramDynFlags $ setGeneralFlag' Opt_DeferTypeErrors originalFlags Monad.void $ load - flags <- getDynFlags - when (not deferredBefore) $ Monad.void $ - GHC.setProgramDynFlags $ gopt_unset flags Opt_DeferTypeErrors + Monad.void $ GHC.setProgramDynFlags $ originalFlags loadModule :: [(FilePath, Maybe Phase)] -> InputT GHCi SuccessFlag loadModule fs = timeIt (const Nothing) (loadModule' fs) diff --git a/testsuite/tests/ghci/scripts/Defer03.hs b/testsuite/tests/ghci/scripts/Defer03.hs index b91a7ac..b0f65fb 100755 --- a/testsuite/tests/ghci/scripts/Defer03.hs +++ b/testsuite/tests/ghci/scripts/Defer03.hs @@ -3,5 +3,8 @@ module Main where a :: Int a = 'p' +f :: Int +f = _ + main :: IO () -main = print "No errors!" +main = print f diff --git a/testsuite/tests/ghci/scripts/T8353.stderr b/testsuite/tests/ghci/scripts/T8353.stderr index 7303142..8914820 100644 --- a/testsuite/tests/ghci/scripts/T8353.stderr +++ b/testsuite/tests/ghci/scripts/T8353.stderr @@ -1,25 +1,55 @@ Defer03.hs:4:5: warning: - Couldn't match expected type ?Int? with actual type ?Char? - In the expression: 'p' - In an equation for ?a?: a = 'p' + ? Couldn't match expected type ?Int? with actual type ?Char? + ? In the expression: 'p' + In an equation for ?a?: a = 'p' + +Defer03.hs:7:5: warning: + ? Found hole: _ :: Int + ? In the expression: _ + In an equation for ?f?: f = _ + ? Relevant bindings include f :: Int (bound at Defer03.hs:7:1) Defer03.hs:4:5: error: - Couldn't match expected type ?Int? with actual type ?Char? - In the expression: 'p' - In an equation for ?a?: a = 'p' + ? Couldn't match expected type ?Int? with actual type ?Char? + ? In the expression: 'p' + In an equation for ?a?: a = 'p' + +Defer03.hs:7:5: error: + ? Found hole: _ :: Int + ? In the expression: _ + In an equation for ?f?: f = _ + ? Relevant bindings include f :: Int (bound at Defer03.hs:7:1) Defer03.hs:4:5: warning: - Couldn't match expected type ?Int? with actual type ?Char? - In the expression: 'p' - In an equation for ?a?: a = 'p' + ? Couldn't match expected type ?Int? with actual type ?Char? + ? In the expression: 'p' + In an equation for ?a?: a = 'p' + +Defer03.hs:7:5: warning: + ? Found hole: _ :: Int + ? In the expression: _ + In an equation for ?f?: f = _ + ? Relevant bindings include f :: Int (bound at Defer03.hs:7:1) Defer03.hs:4:5: error: - Couldn't match expected type ?Int? with actual type ?Char? - In the expression: 'p' - In an equation for ?a?: a = 'p' + ? Couldn't match expected type ?Int? with actual type ?Char? + ? In the expression: 'p' + In an equation for ?a?: a = 'p' + +Defer03.hs:7:5: error: + ? Found hole: _ :: Int + ? In the expression: _ + In an equation for ?f?: f = _ + ? Relevant bindings include f :: Int (bound at Defer03.hs:7:1) Defer03.hs:4:5: warning: - Couldn't match expected type ?Int? with actual type ?Char? - In the expression: 'p' - In an equation for ?a?: a = 'p' + ? Couldn't match expected type ?Int? with actual type ?Char? + ? In the expression: 'p' + In an equation for ?a?: a = 'p' + +Defer03.hs:7:5: warning: + ? Found hole: _ :: Int + ? In the expression: _ + In an equation for ?f?: f = _ + ? Relevant bindings include f :: Int (bound at Defer03.hs:7:1) From git at git.haskell.org Wed Jan 27 10:31:03 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Jan 2016 10:31:03 +0000 (UTC) Subject: [commit: ghc] master: Test for undef bugs in the LLVM backend when validating (d50609e) Message-ID: <20160127103103.8EDA63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d50609e8f7a9c3a19d9d75c6133e742c9b584732/ghc >--------------------------------------------------------------- commit d50609e8f7a9c3a19d9d75c6133e742c9b584732 Author: Reid Barton Date: Wed Jan 27 11:05:59 2016 +0100 Test for undef bugs in the LLVM backend when validating In an attempt to catch bugs involving using undef values, replace undef literals by values likely to cause crashes or test failures. We do this only when validating since it is a deoptimization. This depends on D1857 to catch such bugs in the RTS (such as #11487). Test Plan: Did a build with ``` BuildFlavour = quick-llvm SRC_HC_OPTS_STAGE1 = -fllvm-fill-undef-with-garbage ``` The build crashed when running ghc-stage2, as expected. Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1858 >--------------------------------------------------------------- d50609e8f7a9c3a19d9d75c6133e742c9b584732 compiler/llvmGen/Llvm/Types.hs | 26 +++++++++++++++++++++++++- compiler/main/DynFlags.hs | 2 ++ mk/flavours/validate.mk | 1 + 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/compiler/llvmGen/Llvm/Types.hs b/compiler/llvmGen/Llvm/Types.hs index d533b4a..5c2ce5e 100644 --- a/compiler/llvmGen/Llvm/Types.hs +++ b/compiler/llvmGen/Llvm/Types.hs @@ -217,7 +217,31 @@ ppLit f@(LMFloatLit _ _) = sdocWithDynFlags (\dflags -> error $ "Can't print this float literal!" ++ showSDoc dflags (ppr f)) ppLit (LMVectorLit ls ) = char '<' <+> ppCommaJoin ls <+> char '>' ppLit (LMNullLit _ ) = text "null" -ppLit (LMUndefLit _ ) = text "undef" +-- Trac 11487 was an issue where we passed undef for some arguments +-- that were actually live. By chance the registers holding those +-- arguments usually happened to have the right values anyways, but +-- that was not guaranteed. To find such bugs reliably, we set the +-- flag below when validating, which replaces undef literals (at +-- common types) with values that are likely to cause a crash or test +-- failure. +ppLit (LMUndefLit t ) = sdocWithDynFlags f + where f dflags + | gopt Opt_LlvmFillUndefWithGarbage dflags, + Just lit <- garbageLit t = ppLit lit + | otherwise = text "undef" + +garbageLit :: LlvmType -> Maybe LlvmLit +garbageLit t@(LMInt w) = Just (LMIntLit (0xbbbbbbbbbbbbbbb0 `mod` (2^w)) t) + -- Use a value that looks like an untagged pointer, so we are more + -- likely to try to enter it +garbageLit t + | isFloat t = Just (LMFloatLit 12345678.9 t) +garbageLit t@(LMPointer _) = Just (LMNullLit t) + -- Using null isn't totally ideal, since some functions may check for null. + -- But producing another value is inconvenient since it needs a cast, + -- and the knowledge for how to format casts is in PpLlvm. +garbageLit _ = Nothing + -- More cases could be added, but this should do for now. -- | Return the 'LlvmType' of the 'LlvmVar' getVarType :: LlvmVar -> LlvmType diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 83de48c..b86d1a7 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -422,6 +422,7 @@ data GeneralFlag | Opt_PedanticBottoms -- Be picky about how we treat bottom | Opt_LlvmTBAA -- Use LLVM TBAA infastructure for improving AA (hidden flag) | Opt_LlvmPassVectorsInRegisters -- Pass SIMD vectors in registers (requires a patched LLVM) (hidden flag) + | Opt_LlvmFillUndefWithGarbage -- Testing for undef bugs (hidden flag) | Opt_IrrefutableTuples | Opt_CmmSink | Opt_CmmElimCommonBlocks @@ -3055,6 +3056,7 @@ fFlags = [ flagSpec "liberate-case" Opt_LiberateCase, flagHiddenSpec "llvm-pass-vectors-in-regs" Opt_LlvmPassVectorsInRegisters, flagHiddenSpec "llvm-tbaa" Opt_LlvmTBAA, + flagHiddenSpec "llvm-fill-undef-with-garbage" Opt_LlvmFillUndefWithGarbage, flagSpec "loopification" Opt_Loopification, flagSpec "omit-interface-pragmas" Opt_OmitInterfacePragmas, flagSpec "omit-yields" Opt_OmitYields, diff --git a/mk/flavours/validate.mk b/mk/flavours/validate.mk index 94892d4..1a636fa 100644 --- a/mk/flavours/validate.mk +++ b/mk/flavours/validate.mk @@ -1,4 +1,5 @@ SRC_HC_OPTS = -O0 -H64m +SRC_HC_OPTS_STAGE1 = -fllvm-fill-undef-with-garbage # See Trac 11487 GhcStage1HcOpts = -O GhcStage2HcOpts = -O -dcore-lint GhcLibHcOpts = -O -dcore-lint From git at git.haskell.org Wed Jan 27 10:31:06 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Jan 2016 10:31:06 +0000 (UTC) Subject: [commit: ghc] master: Restore original alignment for info tables (0dc7b36) Message-ID: <20160127103106.3F16E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/0dc7b36c3c261b3eccf8460581fcd3d71f6e6ff6/ghc >--------------------------------------------------------------- commit 0dc7b36c3c261b3eccf8460581fcd3d71f6e6ff6 Author: Simon Brenner Date: Wed Jan 27 11:05:35 2016 +0100 Restore original alignment for info tables This was broken in 4a32bf925b8aba7885d9c745769fe84a10979a53, meaning that info tables and subsequent code are no longer guaranteed to have the recommended alignment. Split up the section header and section alignment printers, and print an appropriate alignment directive before each info table. Fixes Trac #11486 Reviewers: austin, bgamari, rwbarton Reviewed By: bgamari, rwbarton Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1847 GHC Trac Issues: #11486 >--------------------------------------------------------------- 0dc7b36c3c261b3eccf8460581fcd3d71f6e6ff6 compiler/nativeGen/PPC/Ppr.hs | 12 +++++++++--- compiler/nativeGen/SPARC/Ppr.hs | 7 ++++++- compiler/nativeGen/X86/Ppr.hs | 9 +++++++++ 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/compiler/nativeGen/PPC/Ppr.hs b/compiler/nativeGen/PPC/Ppr.hs index 8d89a19..08c02f0 100644 --- a/compiler/nativeGen/PPC/Ppr.hs +++ b/compiler/nativeGen/PPC/Ppr.hs @@ -112,7 +112,7 @@ pprBasicBlock info_env (BasicBlock blockid instrs) maybe_infotable = case mapLookup blockid info_env of Nothing -> empty Just (Statics info_lbl info) -> - pprSectionAlign (Section Text info_lbl) $$ + pprAlignForSection Text $$ vcat (map pprData info) $$ pprLabel info_lbl @@ -305,9 +305,16 @@ pprAddr (AddrRegImm r1 imm) = hcat [ pprImm imm, char '(', pprReg r1, char ')' ] pprSectionAlign :: Section -> SDoc pprSectionAlign sec@(Section seg _) = sdocWithPlatform $ \platform -> + pprSectionHeader platform sec $$ + pprAlignForSection seg + +-- | Print appropriate alignment for the given section type. +pprAlignForSection :: SectionType -> SDoc +pprAlignForSection seg = + sdocWithPlatform $ \platform -> let osDarwin = platformOS platform == OSDarwin ppc64 = not $ target32Bit platform - align = ptext $ case seg of + in ptext $ case seg of Text -> sLit ".align 2" Data | ppc64 -> sLit ".align 3" @@ -328,7 +335,6 @@ pprSectionAlign sec@(Section seg _) = | osDarwin -> sLit ".align 4" | otherwise -> sLit ".align 4" OtherSection _ -> panic "PprMach.pprSectionAlign: unknown section" - in pprSectionHeader platform sec $$ align pprDataItem :: CmmLit -> SDoc pprDataItem lit diff --git a/compiler/nativeGen/SPARC/Ppr.hs b/compiler/nativeGen/SPARC/Ppr.hs index 8c7871e..eb41f23 100644 --- a/compiler/nativeGen/SPARC/Ppr.hs +++ b/compiler/nativeGen/SPARC/Ppr.hs @@ -96,7 +96,7 @@ pprBasicBlock info_env (BasicBlock blockid instrs) maybe_infotable = case mapLookup blockid info_env of Nothing -> empty Just (Statics info_lbl info) -> - pprSectionAlign (Section Text info_lbl) $$ + pprAlignForSection Text $$ vcat (map pprData info) $$ pprLabel info_lbl @@ -326,6 +326,11 @@ pprSectionAlign :: Section -> SDoc pprSectionAlign sec@(Section seg _) = sdocWithPlatform $ \platform -> pprSectionHeader platform sec $$ + pprAlignForSection seg + +-- | Print appropriate alignment for the given section type. +pprAlignForSection :: SectionType -> SDoc +pprAlignForSection seg = ptext (case seg of Text -> sLit ".align 4" Data -> sLit ".align 8" diff --git a/compiler/nativeGen/X86/Ppr.hs b/compiler/nativeGen/X86/Ppr.hs index f2fc884..7809ae1 100644 --- a/compiler/nativeGen/X86/Ppr.hs +++ b/compiler/nativeGen/X86/Ppr.hs @@ -109,6 +109,7 @@ pprBasicBlock info_env (BasicBlock blockid instrs) maybe_infotable = case mapLookup blockid info_env of Nothing -> empty Just (Statics info_lbl info) -> + pprAlignForSection Text $$ infoTableLoc $$ vcat (map pprData info) $$ pprLabel info_lbl @@ -386,8 +387,15 @@ pprSectionAlign (Section (OtherSection _) _) = pprSectionAlign sec@(Section seg _) = sdocWithPlatform $ \platform -> pprSectionHeader platform sec $$ + pprAlignForSection seg + +-- | Print appropriate alignment for the given section type. +pprAlignForSection :: SectionType -> SDoc +pprAlignForSection seg = + sdocWithPlatform $ \platform -> text ".align " <> case platformOS platform of + -- Darwin: alignments are given as shifts. OSDarwin | target32Bit platform -> case seg of @@ -397,6 +405,7 @@ pprSectionAlign sec@(Section seg _) = case seg of ReadOnlyData16 -> int 4 _ -> int 3 + -- Other: alignments are given as bytes. _ | target32Bit platform -> case seg of From git at git.haskell.org Wed Jan 27 12:05:03 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Jan 2016 12:05:03 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: White space only (835b3ba) Message-ID: <20160127120503.8211B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/835b3ba613a4d0e6a2b281e62d269dc05c639817/ghc >--------------------------------------------------------------- commit 835b3ba613a4d0e6a2b281e62d269dc05c639817 Author: Simon Peyton Jones Date: Tue Jan 26 09:00:57 2016 +0000 White space only (cherry picked from commit cf788a53df3ada686ec516c2edffeb54b632065f) >--------------------------------------------------------------- 835b3ba613a4d0e6a2b281e62d269dc05c639817 compiler/coreSyn/CoreSubst.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/coreSyn/CoreSubst.hs b/compiler/coreSyn/CoreSubst.hs index a3ab970..8d4529a 100644 --- a/compiler/coreSyn/CoreSubst.hs +++ b/compiler/coreSyn/CoreSubst.hs @@ -542,8 +542,8 @@ cloneBndrs subst us vs cloneBndr :: Subst -> Unique -> Var -> (Subst, Var) cloneBndr subst uniq v - | isTyVar v = cloneTyVarBndr subst v uniq - | otherwise = clone_id subst subst (v,uniq) -- Works for coercion variables too + | isTyVar v = cloneTyVarBndr subst v uniq + | otherwise = clone_id subst subst (v,uniq) -- Works for coercion variables too -- | Clone a mutually recursive group of 'Id's cloneRecIdBndrs :: Subst -> UniqSupply -> [Id] -> (Subst, [Id]) From git at git.haskell.org Wed Jan 27 12:05:06 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Jan 2016 12:05:06 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Add "ticks-exhausted" comment (e035680) Message-ID: <20160127120506.3C62D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/e03568010a4b2155d1afe67534e2d97fe560317b/ghc >--------------------------------------------------------------- commit e03568010a4b2155d1afe67534e2d97fe560317b Author: Simon Peyton Jones Date: Tue Jan 26 09:24:33 2016 +0000 Add "ticks-exhausted" comment This code deliberately builds a subtle negative-occurrence-of-data-type example, described in the paper, so with -O it'll give "simplifier ticks exhausted". This patch just adds a comment to explain. (cherry picked from commit 47b3f58889caa71bf096a149e58c2a9b94b75a7d) >--------------------------------------------------------------- e03568010a4b2155d1afe67534e2d97fe560317b testsuite/tests/dependent/should_compile/dynamic-paper.hs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/testsuite/tests/dependent/should_compile/dynamic-paper.hs b/testsuite/tests/dependent/should_compile/dynamic-paper.hs index 4e89209..fd63871 100644 --- a/testsuite/tests/dependent/should_compile/dynamic-paper.hs +++ b/testsuite/tests/dependent/should_compile/dynamic-paper.hs @@ -1,6 +1,9 @@ {- This is the code extracted from "A reflection on types", by Simon PJ, Stephanie Weirich, Richard Eisenberg, and Dimitrios Vytiniotis, 2016. -} +-- NB: it includes a negative-recursive function (see delta1), and +-- so will give "simplifer ticks exhausted", at least with -O + {-# LANGUAGE RankNTypes, PolyKinds, TypeOperators, ScopedTypeVariables, GADTs, FlexibleInstances, UndecidableInstances, RebindableSyntax, @@ -239,6 +242,10 @@ tcMaybe = TyCon { tc_module = Module { mod_pkg = "base" rt = undefined delta1 :: Dynamic -> Dynamic +-- NB: this function behaves like a negative-recursive data type +-- and hence leads compiler into an infinite inlining loop, +-- and we get "simplifier ticks exhausted". +-- See Section 7 of the paper "A reflection on types" delta1 dn = case fromDynamic dn of Just f -> f dn Nothing -> dn From git at git.haskell.org Wed Jan 27 12:05:09 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Jan 2016 12:05:09 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Kill off zipTopTCvSubst in favour of zipOpenTCvSubst (f47feda) Message-ID: <20160127120509.0D2863A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/f47feda9c1a5298fbcf40a5aba87750d19e14157/ghc >--------------------------------------------------------------- commit f47feda9c1a5298fbcf40a5aba87750d19e14157 Author: Simon Peyton Jones Date: Tue Jan 26 09:37:06 2016 +0000 Kill off zipTopTCvSubst in favour of zipOpenTCvSubst As Bartosz has discovered, the invariants for substitutions were wrong, and in particular the "mkTop...Subst" and "zipTop..Subst" functions were building substitutions that didn't obey even the old invariants. This patch kills of the bogus zipTopTCvSubst in favour of the more robust zipOpenTCvSubst. I tripped over this because my upcoming patch (concerning SetLevels, Trac #11330) triggered an ASSERT failure in the substitution well-formedness assertion in TyCoRep. (cherry picked from commit 1c6d70c2121fd1126fcc2458bdbcc856e19598c2) >--------------------------------------------------------------- f47feda9c1a5298fbcf40a5aba87750d19e14157 compiler/deSugar/Check.hs | 2 +- compiler/iface/BuildTyCl.hs | 6 +++--- compiler/typecheck/TcDeriv.hs | 4 ++-- compiler/typecheck/TcPat.hs | 2 +- compiler/typecheck/TcType.hs | 4 ++-- compiler/types/TyCoRep.hs | 35 ++++++++++++++--------------------- compiler/types/Type.hs | 4 ++-- 7 files changed, 25 insertions(+), 32 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc f47feda9c1a5298fbcf40a5aba87750d19e14157 From git at git.haskell.org Wed Jan 27 12:05:12 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Jan 2016 12:05:12 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Fix two cloning-related bugs (c4e94cd) Message-ID: <20160127120512.861983A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/c4e94cd3f1742cc5e2b8391d151fef2fc9f8fdbe/ghc >--------------------------------------------------------------- commit c4e94cd3f1742cc5e2b8391d151fef2fc9f8fdbe Author: Simon Peyton Jones Date: Tue Jan 26 09:30:50 2016 +0000 Fix two cloning-related bugs Crikey! Not just one but two bugs in type variable cloning, both dating from the days before PolyKinds. Both were shown up by Trac #11330. 1. In SetLevels, when floating a case expression we must clone its binders, *and* do so in a telescope-aware way, because the constructor may bind a kind variable that appears in the kind of a type variable. Instead of doing this (wrongly) by steam, call CoreSubst.cloneBndrs. I added Notes and did other refactoring at the same time. 2. It turned out that CoreSubst.cloneBndrs calls TyCoRep.cloneTyVarBndr, and that too was bogus! It didn't substitute in the kind of the TyVar being cloned. There was even a comment to say "variables can't appear in kinds". Thta hasn't been true for a long time now. Easily fixed. Interestingly, I then found that test dependent/should_compile/KindEqualities was emitting a new inexhaustive-pattern-match warning. Sure enough it was valid! So the lack of cloning in cloneTyVarBndr really was causing an observable bug; just one that we had not observed. (cherry picked from commit 016a0bd1ba129134dfa612db0d96e01644fa7b9f) >--------------------------------------------------------------- c4e94cd3f1742cc5e2b8391d151fef2fc9f8fdbe compiler/simplCore/SetLevels.hs | 84 +++++++++++++--------- compiler/types/TyCoRep.hs | 21 +++--- .../dependent/should_compile/KindEqualities.stderr | 5 ++ 3 files changed, 69 insertions(+), 41 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc c4e94cd3f1742cc5e2b8391d151fef2fc9f8fdbe From git at git.haskell.org Wed Jan 27 12:05:15 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Jan 2016 12:05:15 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Missed plural renaming in user's guide (6d797c7) Message-ID: <20160127120515.319763A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/6d797c77d919f4f77e0ee2f01e0012be709fe2a7/ghc >--------------------------------------------------------------- commit 6d797c77d919f4f77e0ee2f01e0012be709fe2a7 Author: Herbert Valerio Riedel Date: Tue Jan 26 11:59:40 2016 +0100 Missed plural renaming in user's guide Follow-up to 132c20894d102558cc8f3aee5bc289425d0ddb24 [skip ci] (cherry picked from commit 34c9a4e4290595adc2e59024f9bfdc914b0f6dd3) >--------------------------------------------------------------- 6d797c77d919f4f77e0ee2f01e0012be709fe2a7 docs/users_guide/8.0.1-notes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/users_guide/8.0.1-notes.rst b/docs/users_guide/8.0.1-notes.rst index 918ede7..0acad37 100644 --- a/docs/users_guide/8.0.1-notes.rst +++ b/docs/users_guide/8.0.1-notes.rst @@ -252,7 +252,7 @@ Compiler allows library authors eager to make their code future compatible to adapt to new features before they even generate warnings. -- Added the :ghc-flag:`-Wmissing-monadfail-instance` flag. When enabled, this +- Added the :ghc-flag:`-Wmissing-monadfail-instances` flag. When enabled, this will issue a warning if a failable pattern is used in a context that does not have a ``MonadFail`` constraint. This flag represents phase 1 of the `MonadFail Proposal (MFP) From git at git.haskell.org Wed Jan 27 12:05:17 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Jan 2016 12:05:17 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Minor users-guide markup fixup [skip ci] (06bfee3) Message-ID: <20160127120517.E18223A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/06bfee33336d54aa823b38e10244c21bf2a49b13/ghc >--------------------------------------------------------------- commit 06bfee33336d54aa823b38e10244c21bf2a49b13 Author: Herbert Valerio Riedel Date: Tue Jan 26 12:00:58 2016 +0100 Minor users-guide markup fixup [skip ci] (cherry picked from commit 5f5dc8626e59272f7055f57d9a651c9bbb3a6ee5) >--------------------------------------------------------------- 06bfee33336d54aa823b38e10244c21bf2a49b13 docs/users_guide/using-warnings.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/users_guide/using-warnings.rst b/docs/users_guide/using-warnings.rst index 10fc9df..e4f8d2c 100644 --- a/docs/users_guide/using-warnings.rst +++ b/docs/users_guide/using-warnings.rst @@ -226,7 +226,7 @@ of ``-W(no-)*``. * If ``return`` is defined it must be canonical (i.e. ``return = pure``). * If ``(>>)`` is defined it must be canonical (i.e. ``(>>) = (*>)``). - Moreover, in 'Applicative' instance declarations: + Moreover, in ``Applicative`` instance declarations: * Warn if ``pure`` is defined backwards (i.e. ``pure = return``). * Warn if ``(*>)`` is defined backwards (i.e. ``(*>) = (>>)``). @@ -268,7 +268,7 @@ of ``-W(no-)*``. * If ``mappend`` is defined it must be canonical (i.e. ``mappend = (Data.Semigroup.<>)``). - Moreover, in 'Semigroup' instance declarations: + Moreover, in ``Semigroup`` instance declarations: * Warn if ``(<>)`` is defined backwards (i.e. ``(<>) = mappend``). From git at git.haskell.org Wed Jan 27 12:05:20 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Jan 2016 12:05:20 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Update transformers submodule to 0.5.1.0 release (251ec58) Message-ID: <20160127120520.9FE923A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/251ec5861c06729d40a7ad28f8dd170eb29d6ee0/ghc >--------------------------------------------------------------- commit 251ec5861c06729d40a7ad28f8dd170eb29d6ee0 Author: Herbert Valerio Riedel Date: Tue Jan 26 12:03:23 2016 +0100 Update transformers submodule to 0.5.1.0 release This shouldn't have any noticeable API changes for GHC (cherry picked from commit 9b716950e1c9e99afe2840ef804e5b3343ef3653) >--------------------------------------------------------------- 251ec5861c06729d40a7ad28f8dd170eb29d6ee0 libraries/transformers | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/transformers b/libraries/transformers index 1a2bc4e..a2f7dd0 160000 --- a/libraries/transformers +++ b/libraries/transformers @@ -1 +1 @@ -Subproject commit 1a2bc4ecada9561911e9c2e8a98a3c6bf59b7bb1 +Subproject commit a2f7dd057a0ee0c6cb206609594d7a07d26a1861 From git at git.haskell.org Wed Jan 27 12:05:23 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Jan 2016 12:05:23 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Update process submodule to 1.4.2.0 release (f37e98e) Message-ID: <20160127120523.6C2363A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/f37e98eccb002678d52ff405d1196b05de5545dd/ghc >--------------------------------------------------------------- commit f37e98eccb002678d52ff405d1196b05de5545dd Author: Herbert Valerio Riedel Date: Tue Jan 26 12:41:23 2016 +0100 Update process submodule to 1.4.2.0 release Most notably, this pulls in a feature needed for #11100 (remote ghci) windows-support (cherry picked from commit f1885dfd7ee84fae478e2e8398d2eff14ee36b2c) >--------------------------------------------------------------- f37e98eccb002678d52ff405d1196b05de5545dd libraries/process | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/process b/libraries/process index 0edb978..296cbce 160000 --- a/libraries/process +++ b/libraries/process @@ -1 +1 @@ -Subproject commit 0edb97876c2f783b33f9a69089ca9d26a061e112 +Subproject commit 296cbce6294316d6534b4449fc7ab0f0d3f5775b From git at git.haskell.org Wed Jan 27 12:05:26 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Jan 2016 12:05:26 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Fix three broken tests involving exceptions (940aa47) Message-ID: <20160127120526.2944B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/940aa477db84b373290d2d8e177a811cacbaa6f5/ghc >--------------------------------------------------------------- commit 940aa477db84b373290d2d8e177a811cacbaa6f5 Author: Simon Peyton Jones Date: Tue Jan 26 12:36:21 2016 +0000 Fix three broken tests involving exceptions See comment:16 in Trac #10712. The tests were wrong, not GHC! (cherry picked from commit 3798b2aad8f62cb18e6147b54c57a9a4ad6c23f4) >--------------------------------------------------------------- 940aa477db84b373290d2d8e177a811cacbaa6f5 testsuite/tests/concurrent/should_run/T3279.hs | 2 +- testsuite/tests/concurrent/should_run/conc012.hs | 2 +- testsuite/tests/concurrent/should_run/conc014.hs | 10 ++++------ 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/testsuite/tests/concurrent/should_run/T3279.hs b/testsuite/tests/concurrent/should_run/T3279.hs index a90d38a..b721a61 100644 --- a/testsuite/tests/concurrent/should_run/T3279.hs +++ b/testsuite/tests/concurrent/should_run/T3279.hs @@ -7,7 +7,7 @@ import GHC.IO (unsafeUnmask) f :: Int f = (1 +) . unsafePerformIO $ do - error "foo" `catch` \(SomeException e) -> do + throwIO (ErrorCall "foo") `catch` \(SomeException e) -> do myThreadId >>= flip throwTo e -- point X unsafeUnmask $ return 1 diff --git a/testsuite/tests/concurrent/should_run/conc012.hs b/testsuite/tests/concurrent/should_run/conc012.hs index a2f139e..753fa89 100644 --- a/testsuite/tests/concurrent/should_run/conc012.hs +++ b/testsuite/tests/concurrent/should_run/conc012.hs @@ -15,7 +15,7 @@ stackoverflow n = n + stackoverflow n main = do let x = stackoverflow 1 result <- newEmptyMVar - forkIO $ Control.Exception.catch (x `seq` putMVar result Finished) $ + forkIO $ Control.Exception.catch (evaluate x >> putMVar result Finished) $ \e -> putMVar result (Died e) res <- takeMVar result case res of diff --git a/testsuite/tests/concurrent/should_run/conc014.hs b/testsuite/tests/concurrent/should_run/conc014.hs index 76cb3c2..7171674 100644 --- a/testsuite/tests/concurrent/should_run/conc014.hs +++ b/testsuite/tests/concurrent/should_run/conc014.hs @@ -8,13 +8,11 @@ main = do main_thread <- myThreadId m <- newEmptyMVar forkIO (do { takeMVar m; throwTo main_thread (ErrorCall "foo") }) - (do - error "wibble" - `Control.Exception.catch` + (do { throwIO (ErrorCall "wibble") + `Control.Exception.catch` (\e -> let _ = e::ErrorCall in - do putMVar m (); sum [1..10000] `seq` putStrLn "done.") - myDelay 500000 - ) + do putMVar m (); evaluate (sum [1..10000]); putStrLn "done.") + ; myDelay 500000 }) `Control.Exception.catch` \e -> putStrLn ("caught: " ++ show (e::SomeException)) From git at git.haskell.org Wed Jan 27 12:05:28 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Jan 2016 12:05:28 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Pass InScopeSet to substTy in lintTyApp (1524945) Message-ID: <20160127120528.E47393A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/1524945eee9e7540be7df482d2d62bdbaebd2872/ghc >--------------------------------------------------------------- commit 1524945eee9e7540be7df482d2d62bdbaebd2872 Author: Bartosz Nitka Date: Thu Jan 21 11:30:07 2016 -0800 Pass InScopeSet to substTy in lintTyApp This is the fix proposed in #11371: ``` In other cases, we already have the in-scope set in hand. Example: in CoreLint.lintTyApp we find a call to substTyWith. But Lint carries an in-scope set, so it would be easy to pass it to substTyWith. ``` Test Plan: ./validate --slow (only pre-existing problems) Reviewers: simonpj, goldfire, austin, nomeata, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1820 GHC Trac Issues: #11371 (cherry picked from commit 01809bcd4c9066244d705360f0d9a3a2176385f4) >--------------------------------------------------------------- 1524945eee9e7540be7df482d2d62bdbaebd2872 compiler/coreSyn/CoreLint.hs | 9 ++++++++- compiler/types/TyCoRep.hs | 24 +++++++++++++++++------- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/compiler/coreSyn/CoreLint.hs b/compiler/coreSyn/CoreLint.hs index 50ae0bd..5702f93 100644 --- a/compiler/coreSyn/CoreLint.hs +++ b/compiler/coreSyn/CoreLint.hs @@ -785,7 +785,11 @@ lintTyApp :: OutType -> OutType -> LintM OutType lintTyApp fun_ty arg_ty | Just (tv,body_ty) <- splitForAllTy_maybe fun_ty = do { lintTyKind tv arg_ty - ; return (substTyWith [tv] [arg_ty] body_ty) } + ; in_scope <- getInScope + -- substTy needs the set of tyvars in scope to avoid generating + -- uniques that are already in scope. + -- See Note [The subsititution invariant] in TyCoRep + ; return (substTyWithInScope in_scope [tv] [arg_ty] body_ty) } | otherwise = failWithL (mkTyAppMsg fun_ty arg_ty) @@ -1686,6 +1690,9 @@ updateTCvSubst subst' m getTCvSubst :: LintM TCvSubst getTCvSubst = LintM (\ env errs -> (Just (le_subst env), errs)) +getInScope :: LintM InScopeSet +getInScope = LintM (\ env errs -> (Just (getTCvInScope $ le_subst env), errs)) + applySubstTy :: InType -> LintM OutType applySubstTy ty = do { subst <- getTCvSubst; return (substTy subst ty) } diff --git a/compiler/types/TyCoRep.hs b/compiler/types/TyCoRep.hs index 599f9b8..ce3290a 100644 --- a/compiler/types/TyCoRep.hs +++ b/compiler/types/TyCoRep.hs @@ -90,7 +90,7 @@ module TyCoRep ( substTyWith, substTyWithCoVars, substTysWith, substTysWithCoVars, substCoWith, substTy, substTyAddInScope, substTyUnchecked, - substTyWithBinders, + substTyWithBinders, substTyWithInScope, substTys, substTheta, lookupTyVar, substTyVarBndr, substCo, substCos, substCoVar, substCoVars, lookupCoVar, @@ -1388,7 +1388,7 @@ data TCvSubst -- See Note [Apply Once] -- and Note [Extending the TvSubstEnv] -- and Note [Substituting types and coercions] - -- and Note [Generating the in-scope set for a substitution] + -- and Note [The subsititution invariant] -- | A substitution of 'Type's for 'TyVar's -- and 'Kind's for 'KindVar's @@ -1461,7 +1461,7 @@ constructor) and the CvSubstEnv should *never* map a TyVar. Furthermore, the range of the TvSubstEnv should *never* include a type headed with CoercionTy. -Note [Generating the in-scope set for a substitution] +Note [The subsititution invariant] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ When calling substTy subst ty it should be the case that the in-scope set in the substitution is a superset of both: @@ -1760,6 +1760,16 @@ substTyWith :: [TyVar] -> [Type] -> Type -> Type substTyWith tvs tys = ASSERT( length tvs == length tys ) substTyUnchecked (zipOpenTCvSubst tvs tys) +-- | Substitute tyvars within a type using a known 'InScopeSet'. +-- Pre-condition: the 'in_scope' set should satisfy Note [The substitution +-- invariant]; specifically it should include the free vars of 'tys', +-- and of 'ty' minus the domain of the subst. +substTyWithInScope :: InScopeSet -> [TyVar] -> [Type] -> Type -> Type +substTyWithInScope in_scope tvs tys ty = + ASSERT( length tvs == length tys ) + substTy (mkTCvSubst in_scope (tenv, emptyCvSubstEnv)) ty + where tenv = zipTyEnv tvs tys + -- | Coercion substitution making use of an 'TCvSubst' that -- is assumed to be open, see 'zipOpenTCvSubst' substCoWith :: [TyVar] -> [Type] -> Coercion -> Coercion @@ -1791,7 +1801,7 @@ substTyWithBinders bndrs tys = ASSERT( length bndrs == length tys ) -- | Substitute within a 'Type' after adding the free variables of the type -- to the in-scope set. This is useful for the case when the free variables -- aren't already in the in-scope set or easily available. --- See also Note [Generating the in-scope set for a substitution]. +-- See also Note [The subsititution invariant]. substTyAddInScope :: TCvSubst -> Type -> Type substTyAddInScope subst ty = substTy (extendTCvInScopeSet subst $ tyCoVarsOfType ty) ty @@ -1799,7 +1809,7 @@ substTyAddInScope subst ty = -- | When calling `substTy` it should be the case that the in-scope set in -- the substitution is a superset of the free vars of the range of the -- substitution. --- See also Note [Generating the in-scope set for a substitution]. +-- See also Note [The subsititution invariant]. isValidTCvSubst :: TCvSubst -> Bool isValidTCvSubst (TCvSubst in_scope tenv cenv) = (tenvFVs `varSetInScope` in_scope) && @@ -1810,7 +1820,7 @@ isValidTCvSubst (TCvSubst in_scope tenv cenv) = -- | Substitute within a 'Type' -- The substitution has to satisfy the invariants described in --- Note [Generating the in-scope set for a substitution]. +-- Note [The subsititution invariant]. substTy :: -- CallStack wasn't present in GHC 7.10.1, disable callstacks in stage 1 @@ -1839,7 +1849,7 @@ substTy subst@(TCvSubst in_scope tenv cenv) ty -- | Substitute within a 'Type' disabling the sanity checks. -- The problems that the sanity checks in substTy catch are described in --- Note [Generating the in-scope set for a substitution]. +-- Note [The subsititution invariant]. -- The goal of #11371 is to migrate all the calls of substTyUnchecked to -- substTy and remove this function. Please don't use in new code. substTyUnchecked :: TCvSubst -> Type -> Type From git at git.haskell.org Wed Jan 27 12:05:31 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Jan 2016 12:05:31 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Nicer error on +RTS -hc without -rtsopts or -prof (fb6e876) Message-ID: <20160127120531.974943A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/fb6e8768fe818a3d45bc857f9dccc7d783b2f9e5/ghc >--------------------------------------------------------------- commit fb6e8768fe818a3d45bc857f9dccc7d783b2f9e5 Author: Thomas Miedema Date: Mon Jan 25 20:07:31 2016 +0100 Nicer error on +RTS -hc without -rtsopts or -prof Before: * without -rtsopts: Most RTS options are disabled. Link with -rtsopts to enable them. * with -rtsopts: invalid heap profile option: -hc After: * the flag -hc requires the program to be built with -prof Copy `Note [OPTION_SAFE vs OPTION_UNSAFE]` from commit 8c7ad0bd. Reviewed by: bgamari Differential Revision: https://phabricator.haskell.org/D1845 (cherry picked from commit e24a9b5de00bc2669a52a1f9905bd40e7be0d857) >--------------------------------------------------------------- fb6e8768fe818a3d45bc857f9dccc7d783b2f9e5 rts/RtsFlags.c | 46 ++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 42 insertions(+), 4 deletions(-) diff --git a/rts/RtsFlags.c b/rts/RtsFlags.c index 56f4420..46d1409 100644 --- a/rts/RtsFlags.c +++ b/rts/RtsFlags.c @@ -650,6 +650,7 @@ static void procRtsOpts (int rts_argc0, at the start each iteration and checked at the end. */ rtsBool option_checked = rtsFalse; +// See Note [OPTION_SAFE vs OPTION_UNSAFE]. #define OPTION_SAFE option_checked = rtsTrue; #define OPTION_UNSAFE checkUnsafe(rtsOptsEnabled); option_checked = rtsTrue; @@ -854,7 +855,6 @@ error = rtsTrue; THREADED_BUILD_ONLY( int nNodes; int proc = (int)getNumberOfProcessors(); - OPTION_SAFE; nNodes = strtol(rts_argv[arg]+5, (char **) NULL, 10); if (nNodes > proc) { nNodes = proc; } @@ -1011,15 +1011,15 @@ error = rtsTrue; ) break; case 'h': /* serial heap profile */ #if !defined(PROFILING) - OPTION_UNSAFE; switch (rts_argv[arg][2]) { case '\0': case 'T': + OPTION_UNSAFE; RtsFlags.ProfFlags.doHeapProfile = HEAP_BY_CLOSURE_TYPE; break; default: - errorBelch("invalid heap profile option: %s",rts_argv[arg]); - error = rtsTrue; + OPTION_SAFE; + PROFILING_BUILD_ONLY(); } #else OPTION_SAFE; @@ -1971,3 +1971,41 @@ void freeRtsArgs(void) freeProgArgv(); freeRtsArgv(); } + + +/* +Note [OPTION_SAFE vs OPTION_UNSAFE] + +Ticket #3910 originally pointed out that the RTS options are a potential +security problem. For example the -t -s or -S flags can be used to +overwrite files. This would be bad in the context of CGI scripts or +setuid binaries. So we introduced a system where +RTS processing is more +or less disabled unless you pass the -rtsopts flag at link time. + +This scheme is safe enough but it also really annoyes users. They have +to use -rtsopts in many circumstances: with -threaded to use -N, with +-eventlog to use -l, with -prof to use any of the profiling flags. Many +users just set -rtsopts globally or in project .cabal files. Apart from +annoying users it reduces security because it means that deployed +binaries will have all RTS options enabled rather than just profiling +ones. + +So now, we relax the set of RTS options that are available in the +default -rtsopts=some case. For "deployment" ways like vanilla and +-threaded we remain quite conservative. Only --info -? --help are +allowed for vanilla. For -threaded, -N and -N are allowed with a +check that x <= num cpus. + +For "developer" ways like -debug, -eventlog, -prof, we allow all the +options that are special to that way. Some of these allow writing files, +but the file written is not directly under the control of the attacker. +For the setuid case (where the attacker would have control over binary +name, current dir, local symlinks etc) we check if the process is +running setuid/setgid and refuse all RTS option processing. Users would +need to use -rtsopts=all in this case. + +We are making the assumption that developers will not deploy binaries +built in the -debug, -eventlog, -prof ways. And even if they do, the +damage should be limited to DOS, information disclosure and writing +files like .eventlog, not arbitrary files. +*/ From git at git.haskell.org Wed Jan 27 12:05:34 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Jan 2016 12:05:34 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Fix segmentation fault when .prof file not writeable (8efe964) Message-ID: <20160127120534.8A26B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/8efe964a0f31af30c5b860b7491f4f278884493b/ghc >--------------------------------------------------------------- commit 8efe964a0f31af30c5b860b7491f4f278884493b Author: Thomas Miedema Date: Tue Jan 26 01:11:49 2016 +0100 Fix segmentation fault when .prof file not writeable There are two ways to do retainer profiling. Quoting from the user's guide: 1. `+RTS -hr` "Breaks down the graph by retainer set" 2. `+RTS -hr -h`, where `-h` is one of normal heap profiling break-down options (e.g. `-hc`), and `-hr means "Restrict the profile to closures with retainer sets containing cost-centre stacks with one of the specified cost centres at the top." Retainer profiling writes to a .hp file, like the other heap profiling options, but also to a .prof file. Therefore, when the .prof file is not writeable for whatever reason, retainer profiling should be turned off completely. This worked ok when running the program with `+RTS -hr` (option 1), but a segfault would occur when using `+RTS -hr -h`, with `x!=r` (option 2). This commit fixes that. Reviewed by: bgamari Differential Revision: https://phabricator.haskell.org/D1849 GHC Trac Issues: #11489 (cherry picked from commit 6d2bdfd8d40b926d7a11d003213220022a63d9f5) >--------------------------------------------------------------- 8efe964a0f31af30c5b860b7491f4f278884493b rts/ProfHeap.c | 2 +- rts/ProfHeap.h | 5 +++++ rts/Profiling.c | 13 +++++-------- testsuite/tests/profiling/should_run/Makefile | 10 ++++++++++ .../{driver/T10219.hspp => profiling/should_run/T11489.hs} | 0 testsuite/tests/profiling/should_run/T11489.stderr | 1 + testsuite/tests/profiling/should_run/all.T | 5 +++++ testsuite/tests/rts/all.T | 3 +-- 8 files changed, 28 insertions(+), 11 deletions(-) diff --git a/rts/ProfHeap.c b/rts/ProfHeap.c index e7f6417..23b1f9a 100644 --- a/rts/ProfHeap.c +++ b/rts/ProfHeap.c @@ -161,7 +161,7 @@ doingLDVProfiling( void ) || RtsFlags.ProfFlags.bioSelector != NULL); } -STATIC_INLINE rtsBool +rtsBool doingRetainerProfiling( void ) { return (RtsFlags.ProfFlags.doHeapProfile == HEAP_BY_RETAINER diff --git a/rts/ProfHeap.h b/rts/ProfHeap.h index e29a9f6..279eef2 100644 --- a/rts/ProfHeap.h +++ b/rts/ProfHeap.h @@ -16,6 +16,11 @@ nat initHeapProfiling (void); void endHeapProfiling (void); rtsBool strMatchesSelector (const char* str, const char* sel); +#ifdef PROFILING +// doingRetainerProfiling: `-hr` or `-hr -h` +rtsBool doingRetainerProfiling(void); +#endif + #include "EndPrivate.h" #endif /* PROFHEAP_H */ diff --git a/rts/Profiling.c b/rts/Profiling.c index 2c2981a..c67b081 100644 --- a/rts/Profiling.c +++ b/rts/Profiling.c @@ -254,9 +254,7 @@ initProfilingLogFile(void) } #endif - if (RtsFlags.CcFlags.doCostCentres == 0 && - RtsFlags.ProfFlags.doHeapProfile != HEAP_BY_RETAINER && - RtsFlags.ProfFlags.retainerSelector == NULL) + if (RtsFlags.CcFlags.doCostCentres == 0 && !doingRetainerProfiling()) { /* No need for the .prof file */ prof_filename = NULL; @@ -272,11 +270,11 @@ initProfilingLogFile(void) if ((prof_file = fopen(prof_filename, "w")) == NULL) { debugBelch("Can't open profiling report file %s\n", prof_filename); RtsFlags.CcFlags.doCostCentres = 0; - // The following line was added by Sung; retainer/LDV profiling may need - // two output files, i.e., .prof/hp. - if (RtsFlags.ProfFlags.doHeapProfile == HEAP_BY_RETAINER) + // Retainer profiling (`-hr` or `-hr -h`) writes to + // both .hp as .prof. + if (doingRetainerProfiling()) { RtsFlags.ProfFlags.doHeapProfile = 0; - return; + } } } @@ -290,7 +288,6 @@ initProfilingLogFile(void) debugBelch("Can't open profiling report file %s\n", hp_filename); RtsFlags.ProfFlags.doHeapProfile = 0; - return; } } } diff --git a/testsuite/tests/profiling/should_run/Makefile b/testsuite/tests/profiling/should_run/Makefile index 577fc34..e46dd97 100644 --- a/testsuite/tests/profiling/should_run/Makefile +++ b/testsuite/tests/profiling/should_run/Makefile @@ -23,3 +23,13 @@ scc001: $(call scc001Rule,-O0) $(call scc001Rule,-O) +.PHONY: T11489 +T11489: + $(RM) T11489 + touch T11489.prof + chmod -w T11489.prof + "$(TEST_HC)" -v0 -prof T11489.hs + # Should print some message about not being to open the .prof file, + # then continue to run and exit normally. + # Caused a segmentation fault in GHC <= 7.10.3 + ./T11489 +RTS -hr{} -hc diff --git a/testsuite/tests/driver/T10219.hspp b/testsuite/tests/profiling/should_run/T11489.hs similarity index 100% copy from testsuite/tests/driver/T10219.hspp copy to testsuite/tests/profiling/should_run/T11489.hs diff --git a/testsuite/tests/profiling/should_run/T11489.stderr b/testsuite/tests/profiling/should_run/T11489.stderr new file mode 100644 index 0000000..4f19dd9 --- /dev/null +++ b/testsuite/tests/profiling/should_run/T11489.stderr @@ -0,0 +1 @@ +Can't open profiling report file T11489.prof diff --git a/testsuite/tests/profiling/should_run/all.T b/testsuite/tests/profiling/should_run/all.T index 7804d46..ca37fe5 100644 --- a/testsuite/tests/profiling/should_run/all.T +++ b/testsuite/tests/profiling/should_run/all.T @@ -134,3 +134,8 @@ test('T5363', test('profinline001', [ req_profiling, extra_ways(['prof']), only_ways(prof_ways) ], compile_and_run, ['']) + +test('T11489', [ + req_profiling, + extra_clean(['T11489.prof', 'T11489.hp']), + ], run_command, ['$MAKE -s --no-print-directory T11489']) diff --git a/testsuite/tests/rts/all.T b/testsuite/tests/rts/all.T index c88bd62..951acbe 100644 --- a/testsuite/tests/rts/all.T +++ b/testsuite/tests/rts/all.T @@ -55,8 +55,7 @@ test('divbyzero', test('outofmem', when(opsys('darwin'), skip), run_command, ['$MAKE -s --no-print-directory outofmem']) -test('outofmem2', extra_run_opts('+RTS -M5m -RTS'), - run_command, ['$MAKE -s --no-print-directory outofmem2']) +test('outofmem2', normal, run_command, ['$MAKE -s --no-print-directory outofmem2']) test('T2047', [ignore_output, extra_run_opts('+RTS -c -RTS')], compile_and_run, ['-package containers']) From git at git.haskell.org Wed Jan 27 12:05:37 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Jan 2016 12:05:37 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Split off -Wunused-type-variables from -Wunused-matches (2d3f277) Message-ID: <20160127120537.5CEA33A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/2d3f277817b3a173a5651fc8d10601851485302f/ghc >--------------------------------------------------------------- commit 2d3f277817b3a173a5651fc8d10601851485302f Author: RyanGlScott Date: Tue Jan 26 12:33:19 2016 -0500 Split off -Wunused-type-variables from -Wunused-matches Summary: Previously, `-Wunused-matches` would fire whenever it detected unused type variables in a type family or data family instance. This can be annoying for users who wish to use type variable names as documentation, as being `-Wall`-compliant would mean that they'd have to prefix many of their type variable names with underscores, making the documentation harder to read. To avoid this, a new warning `-Wunused-type-variables` was created that only encompasses unused variables in family instances. `-Wunused-matches` reverts back to its role of only warning on unused term-level pattern names. Unlike `-Wunused-matches`, `-Wunused-type-variables` is not implied by `-Wall`. Fixes #11451. Test Plan: ./validate Reviewers: goldfire, ekmett, austin, hvr, simonpj, bgamari Reviewed By: simonpj, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1825 GHC Trac Issues: #11451 (cherry picked from commit 6817703b31840620cca8596ca62ed70633934972) >--------------------------------------------------------------- 2d3f277817b3a173a5651fc8d10601851485302f compiler/hsSyn/PlaceHolder.hs | 12 +++--- compiler/main/DynFlags.hs | 5 +++ compiler/rename/RnEnv.hs | 10 +++-- compiler/rename/RnSource.hs | 6 +-- compiler/rename/RnTypes.hs | 2 +- docs/users_guide/8.0.1-notes.rst | 18 +++++++-- docs/users_guide/glasgow_exts.rst | 28 ++++++++----- docs/users_guide/using-warnings.rst | 46 ++++++++++++++++++++-- libraries/base/Data/Either.hs | 2 +- libraries/base/Data/Type/Bool.hs | 12 +++--- libraries/base/Data/Type/Equality.hs | 16 ++++---- libraries/base/GHC/Generics.hs | 28 ++++++------- libraries/base/GHC/TypeLits.hs | 8 ++-- .../tests/determinism/should_compile/determ004.hs | 6 +-- testsuite/tests/indexed-types/should_compile/all.T | 4 +- .../tests/simplCore/should_compile/T10689a.hs | 4 +- utils/mkUserGuidePart/Options/Warnings.hs | 12 ++++++ 17 files changed, 149 insertions(+), 70 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 2d3f277817b3a173a5651fc8d10601851485302f From git at git.haskell.org Wed Jan 27 12:05:40 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Jan 2016 12:05:40 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Construct in_scope set in mkTopTCvSubst (c325baf) Message-ID: <20160127120540.24D1A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/c325bafe0525a7bf65656bacba85ef2a5c6f88d2/ghc >--------------------------------------------------------------- commit c325bafe0525a7bf65656bacba85ef2a5c6f88d2 Author: Bartosz Nitka Date: Tue Jan 26 11:26:06 2016 -0800 Construct in_scope set in mkTopTCvSubst The pre-condition on `mkTopTCvSubst` turned out to be wrong and not satisfied by any of the callers. I've fixed it, so that it constructs the in_scope set from the range of the substitution. `mkTopTCvSubst` was also unnecessarily general it is never called with `CoVars`, so I changed the type signature and added an assertion. Test Plan: ./validate --slow Reviewers: goldfire, simonpj, bgamari, austin Reviewed By: simonpj Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1801 GHC Trac Issues: #11371 (cherry picked from commit 144ddb414a8a4f40df1ad9ab27fcdf38f30db4d3) >--------------------------------------------------------------- c325bafe0525a7bf65656bacba85ef2a5c6f88d2 compiler/iface/BuildTyCl.hs | 2 +- compiler/main/InteractiveEval.hs | 4 ++-- compiler/typecheck/TcFlatten.hs | 2 +- compiler/typecheck/TcMType.hs | 2 +- compiler/typecheck/TcSplice.hs | 6 +++--- compiler/types/FamInstEnv.hs | 2 +- compiler/types/TyCoRep.hs | 15 +++++++++------ compiler/types/Type.hs | 6 +++++- 8 files changed, 23 insertions(+), 16 deletions(-) diff --git a/compiler/iface/BuildTyCl.hs b/compiler/iface/BuildTyCl.hs index d13d38e..1b4017a 100644 --- a/compiler/iface/BuildTyCl.hs +++ b/compiler/iface/BuildTyCl.hs @@ -184,7 +184,7 @@ buildPatSyn src_name declared_infix matcher@(matcher_id,_) builder -- compatible with the pattern synonym ASSERT2((and [ univ_tvs `equalLength` univ_tvs1 , ex_tvs `equalLength` ex_tvs1 - , pat_ty `eqType` substTyUnchecked subst pat_ty1 + , pat_ty `eqType` substTy subst pat_ty1 , prov_theta `eqTypes` substTys subst prov_theta1 , req_theta `eqTypes` substTys subst req_theta1 , arg_tys `eqTypes` substTys subst arg_tys1 diff --git a/compiler/main/InteractiveEval.hs b/compiler/main/InteractiveEval.hs index b7ed44f..6e3f77b 100644 --- a/compiler/main/InteractiveEval.hs +++ b/compiler/main/InteractiveEval.hs @@ -533,13 +533,13 @@ bindLocalsAtBreakpoint hsc_env apStack_fhv (Just BreakInfo{..}) = do let tv_subst = newTyVars us free_tvs filtered_ids = [ id | (id, Just _hv) <- zip ids mb_hValues ] (_,tidy_tys) = tidyOpenTypes emptyTidyEnv $ - map (substTyUnchecked tv_subst . idType) filtered_ids + map (substTy tv_subst . idType) filtered_ids new_ids <- zipWith3M mkNewId occs tidy_tys filtered_ids result_name <- newInteractiveBinder hsc_env (mkVarOccFS result_fs) span let result_id = Id.mkVanillaGlobal result_name - (substTyUnchecked tv_subst result_ty) + (substTy tv_subst result_ty) result_ok = isPointer result_id final_ids | result_ok = result_id : new_ids diff --git a/compiler/typecheck/TcFlatten.hs b/compiler/typecheck/TcFlatten.hs index ee92f06..1a0e280 100644 --- a/compiler/typecheck/TcFlatten.hs +++ b/compiler/typecheck/TcFlatten.hs @@ -960,7 +960,7 @@ flatten_one (TyConApp tc tys) -- Expand type synonyms that mention type families -- on the RHS; see Note [Flattening synonyms] | Just (tenv, rhs, tys') <- expandSynTyCon_maybe tc tys - , let expanded_ty = mkAppTys (substTyUnchecked (mkTopTCvSubst tenv) rhs) tys' + , let expanded_ty = mkAppTys (substTy (mkTopTCvSubst tenv) rhs) tys' = do { mode <- getMode ; let used_tcs = tyConsOfType rhs ; case mode of diff --git a/compiler/typecheck/TcMType.hs b/compiler/typecheck/TcMType.hs index f9f057f..f772da5 100644 --- a/compiler/typecheck/TcMType.hs +++ b/compiler/typecheck/TcMType.hs @@ -307,7 +307,7 @@ tcSuperSkolTyVars :: [TyVar] -> (TCvSubst, [TcTyVar]) -- Moreover, make them "super skolems"; see comments with superSkolemTv -- see Note [Kind substitution when instantiating] -- Precondition: tyvars should be ordered by scoping -tcSuperSkolTyVars = mapAccumL tcSuperSkolTyVar (mkTopTCvSubst []) +tcSuperSkolTyVars = mapAccumL tcSuperSkolTyVar emptyTCvSubst tcSuperSkolTyVar :: TCvSubst -> TyVar -> (TCvSubst, TcTyVar) tcSuperSkolTyVar subst tv diff --git a/compiler/typecheck/TcSplice.hs b/compiler/typecheck/TcSplice.hs index 7c7ebe5..59c5b43 100644 --- a/compiler/typecheck/TcSplice.hs +++ b/compiler/typecheck/TcSplice.hs @@ -99,7 +99,7 @@ import GHC.Serialized import ErrUtils import Util import Unique -import VarSet ( isEmptyVarSet, filterVarSet ) +import VarSet ( isEmptyVarSet, filterVarSet, mkVarSet, elemVarSet ) import Data.List ( find ) import Data.Maybe import FastString @@ -1394,8 +1394,8 @@ reifyDataCon isGadtDataCon tys dc name = reifyName dc -- Universal tvs present in eq_spec need to be filtered out, as -- they will not appear anywhere in the type. - subst = mkTopTCvSubst (map eqSpecPair g_eq_spec) - g_unsbst_univ_tvs = filter (`notElemTCvSubst` subst) g_univ_tvs + eq_spec_tvs = mkVarSet (map eqSpecTyVar g_eq_spec) + g_unsbst_univ_tvs = filterOut (`elemVarSet` eq_spec_tvs) g_univ_tvs ; r_arg_tys <- reifyTypes (if isGadtDataCon then g_arg_tys else arg_tys) diff --git a/compiler/types/FamInstEnv.hs b/compiler/types/FamInstEnv.hs index f26b113..6ed3547 100644 --- a/compiler/types/FamInstEnv.hs +++ b/compiler/types/FamInstEnv.hs @@ -1237,7 +1237,7 @@ normalise_tc_app tc tys ; case expandSynTyCon_maybe tc ntys of { Just (tenv, rhs, ntys') -> do { (co2, ninst_rhs) - <- normalise_type (substTyUnchecked (mkTopTCvSubst tenv) rhs) + <- normalise_type (substTy (mkTopTCvSubst tenv) rhs) ; return $ if isReflCo co2 then (args_co, mkTyConApp tc ntys) diff --git a/compiler/types/TyCoRep.hs b/compiler/types/TyCoRep.hs index ce3290a..b80ee06 100644 --- a/compiler/types/TyCoRep.hs +++ b/compiler/types/TyCoRep.hs @@ -1658,12 +1658,15 @@ zipOpenTCvSubstBinders bndrs tys is = mkInScopeSet (tyCoVarsOfTypes tys) tenv = mkVarEnv [ (tv, ty) | (Named tv _, ty) <- zip bndrs tys ] --- | Called when doing top-level substitutions. Here we expect that the --- free vars of the range of the substitution will be empty. -mkTopTCvSubst :: [(TyCoVar, Type)] -> TCvSubst -mkTopTCvSubst prs = TCvSubst emptyInScopeSet tenv cenv - where (tenv, cenv) = foldl extend (emptyTvSubstEnv, emptyCvSubstEnv) prs - extend envs (v, ty) = extendSubstEnvs envs v ty +-- | Called when doing top-level substitutions. No CoVars, please! +mkTopTCvSubst :: [(TyVar, Type)] -> TCvSubst +mkTopTCvSubst prs = + ASSERT2( onlyTyVarsAndNoCoercionTy, text "prs" <+> ppr prs ) + mkOpenTCvSubst tenv emptyCvSubstEnv + where tenv = mkVarEnv prs + onlyTyVarsAndNoCoercionTy = + and [ isTyVar tv && not (isCoercionTy ty) + | (tv, ty) <- prs ] zipTyEnv :: [TyVar] -> [Type] -> TvSubstEnv zipTyEnv tyvars tys diff --git a/compiler/types/Type.hs b/compiler/types/Type.hs index 5e3a1f3..0d25045 100644 --- a/compiler/types/Type.hs +++ b/compiler/types/Type.hs @@ -300,7 +300,11 @@ coreView :: Type -> Maybe Type -- By being non-recursive and inlined, this case analysis gets efficiently -- joined onto the case analysis that the caller is already doing coreView (TyConApp tc tys) | Just (tenv, rhs, tys') <- expandSynTyCon_maybe tc tys - = Just (mkAppTys (substTyUnchecked (mkTopTCvSubst tenv) rhs) tys') + = Just (mkAppTys (substTy (mkTopTCvSubst tenv) rhs) tys') + -- The free vars of 'rhs' should all be bound by 'tenv', so it's + -- ok to use 'substTy' here. + -- See also Note [Generating the in-scope set for a substitution] + -- in TyCoRep. -- Its important to use mkAppTys, rather than (foldl AppTy), -- because the function part might well return a -- partially-applied type constructor; indeed, usually will! From git at git.haskell.org Wed Jan 27 12:05:42 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Jan 2016 12:05:42 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Testsuite: fixup req_profiling tests (#11496) (f5ccb52) Message-ID: <20160127120542.CFCE73A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/f5ccb528dfd078e34cd0041f9a0ee56884677351/ghc >--------------------------------------------------------------- commit f5ccb528dfd078e34cd0041f9a0ee56884677351 Author: Thomas Miedema Date: Tue Jan 26 13:07:38 2016 +0100 Testsuite: fixup req_profiling tests (#11496) * T2552 (#10037) is failng for all threaded opt_ways, not for WAY=prof. * TH_spliceE5_prof (#11495) is failing when ghc_dynamic * Rename ghci_dynamic to ghc_dynamic. It's the same thing. (cherry picked from commit eeb67c9b833d95fa69932c34a3175054dacb83e2) >--------------------------------------------------------------- f5ccb528dfd078e34cd0041f9a0ee56884677351 testsuite/driver/testlib.py | 2 +- testsuite/tests/ghc-e/should_run/all.T | 2 +- testsuite/tests/ghci/linking/all.T | 4 ++-- testsuite/tests/profiling/should_run/all.T | 2 +- testsuite/tests/profiling/should_run/callstack002.stderr | 4 ++-- testsuite/tests/profiling/should_run/callstack002.stdout | 2 +- testsuite/tests/th/Makefile | 2 +- testsuite/tests/th/all.T | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py index 2ac9018..97a5a0d 100644 --- a/testsuite/driver/testlib.py +++ b/testsuite/driver/testlib.py @@ -336,7 +336,7 @@ def unless(b, f): def doing_ghci(): return 'ghci' in config.run_ways -def ghci_dynamic( ): +def ghc_dynamic(): return config.ghc_dynamic def fast(): diff --git a/testsuite/tests/ghc-e/should_run/all.T b/testsuite/tests/ghc-e/should_run/all.T index ae28653..a10fb0d 100644 --- a/testsuite/tests/ghc-e/should_run/all.T +++ b/testsuite/tests/ghc-e/should_run/all.T @@ -7,7 +7,7 @@ test('ghc-e005', req_interp, run_command, ['$MAKE --no-print-directory -s ghc-e0 test('ghc-e006', req_interp, run_command, ['$MAKE --no-print-directory -s ghc-e006']) test('T2228', - [req_interp, when(ghci_dynamic(), expect_broken(7298))], + [req_interp, when(ghc_dynamic(), expect_broken(7298))], run_command, ['$MAKE --no-print-directory -s T2228']) test('T2636', req_interp, run_command, ['$MAKE --no-print-directory -s T2636']) diff --git a/testsuite/tests/ghci/linking/all.T b/testsuite/tests/ghci/linking/all.T index 7404de3..369ef28 100644 --- a/testsuite/tests/ghci/linking/all.T +++ b/testsuite/tests/ghci/linking/all.T @@ -1,5 +1,5 @@ test('ghcilink001', - [when(ghci_dynamic(), expect_fail), # dynamic ghci can't load '.a's + [when(ghc_dynamic(), expect_fail), # dynamic ghci can't load '.a's unless(doing_ghci, skip), extra_clean(['dir001/*','dir001'])], run_command, @@ -43,7 +43,7 @@ test('ghcilink006', test('T3333', [extra_clean(['T3333.o']), unless(doing_ghci, skip), - unless(opsys('linux') or opsys('darwin') or ghci_dynamic(), expect_broken(3333))], + unless(opsys('linux') or opsys('darwin') or ghc_dynamic(), expect_broken(3333))], run_command, ['$MAKE -s --no-print-directory T3333']) diff --git a/testsuite/tests/profiling/should_run/all.T b/testsuite/tests/profiling/should_run/all.T index ca37fe5..52bd62c 100644 --- a/testsuite/tests/profiling/should_run/all.T +++ b/testsuite/tests/profiling/should_run/all.T @@ -72,7 +72,7 @@ test('T680', test('T2552', [ req_profiling, extra_ways(['prof']), only_ways(prof_ways), - expect_broken_for(10037,['prof'])], + expect_broken_for(10037, opt_ways)], compile_and_run, ['']) diff --git a/testsuite/tests/profiling/should_run/callstack002.stderr b/testsuite/tests/profiling/should_run/callstack002.stderr index b4bb0d5..e1f249a 100644 --- a/testsuite/tests/profiling/should_run/callstack002.stderr +++ b/testsuite/tests/profiling/should_run/callstack002.stderr @@ -1,5 +1,5 @@ f: 42 -Stack trace: +CallStack (from -prof): Main.f (callstack002.hs:10:7-43) Main.map.go (callstack002.hs:15:21-23) Main.map.go (callstack002.hs:15:21-34) @@ -7,7 +7,7 @@ Stack trace: Main.main.xs (callstack002.hs:18:12-24) Main.CAF () f: 43 -Stack trace: +CallStack (from -prof): Main.f (callstack002.hs:10:7-43) Main.map.go (callstack002.hs:15:21-23) Main.map.go (callstack002.hs:15:21-34) diff --git a/testsuite/tests/profiling/should_run/callstack002.stdout b/testsuite/tests/profiling/should_run/callstack002.stdout index 480090d..8116c2c 100644 --- a/testsuite/tests/profiling/should_run/callstack002.stdout +++ b/testsuite/tests/profiling/should_run/callstack002.stdout @@ -1,5 +1,5 @@ [84,86] -Stack trace: +CallStack (from -prof): Main.f (callstack002.hs:10:38-42) Main.f (callstack002.hs:10:7-43) Main.map.go (callstack002.hs:15:21-23) diff --git a/testsuite/tests/th/Makefile b/testsuite/tests/th/Makefile index 4fb508f..5e47e8c 100644 --- a/testsuite/tests/th/Makefile +++ b/testsuite/tests/th/Makefile @@ -16,7 +16,7 @@ HC_OPTS = -XTemplateHaskell -package template-haskell TH_spliceE5_prof:: $(RM) TH_spliceE5_prof*.o TH_spliceE5_prof*.hi TH_spliceE5_prof*.dyn_o TH_spliceE5_prof*.dyn_hi TH_spliceE5_prof - '$(TEST_HC)' $(TEST_HC_OPTS) $(HC_OPTS) $(ghcThWayFlags) --make -v0 TH_spliceE5_prof.hs -c + '$(TEST_HC)' $(TEST_HC_OPTS) $(HC_OPTS) $(ghcThWayFlags) --make -no-link -v0 TH_spliceE5_prof.hs # Using `-osuf .p.o` should work. Note the dot before the `p` (#9760), and # the dot between the `p` and the `o` (#5554). '$(TEST_HC)' $(TEST_HC_OPTS) $(HC_OPTS) --make -v0 TH_spliceE5_prof.hs -prof -auto-all -osuf .p.o -o $@ diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index 88b6a12..82fabb3 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -45,7 +45,7 @@ test('TH_NestedSplices', # normal way first, which is why the work is done by a Makefile rule. test('TH_spliceE5_prof', [req_profiling, - omit_ways(['ghci']), + when(ghc_dynamic(), expect_broken(11495)), extra_clean(['TH_spliceE5_prof_Lib.p.o', 'TH_spliceE5_prof_Lib.hi', 'TH_spliceE5_prof_Lib.dyn_o', 'TH_spliceE5_prof_Lib.dyn_hi', 'TH_spliceE5_prof.dyn_o', 'TH_spliceE5_prof.dyn_hi', From git at git.haskell.org Wed Jan 27 12:05:45 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Jan 2016 12:05:45 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Build profiling libraries on `validate --slow` (#11496) (7c6215b) Message-ID: <20160127120545.8048B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/7c6215bc7d25e47d2753c46980bd8e4600d11cc6/ghc >--------------------------------------------------------------- commit 7c6215bc7d25e47d2753c46980bd8e4600d11cc6 Author: Thomas Miedema Date: Wed Jan 27 00:08:53 2016 +0100 Build profiling libraries on `validate --slow` (#11496) (cherry picked from commit e2bdf03a63b09feabee76e2efd33eb56739324ac) >--------------------------------------------------------------- 7c6215bc7d25e47d2753c46980bd8e4600d11cc6 mk/flavours/validate.mk | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mk/flavours/validate.mk b/mk/flavours/validate.mk index 0bb7b92..94892d4 100644 --- a/mk/flavours/validate.mk +++ b/mk/flavours/validate.mk @@ -17,8 +17,12 @@ ifeq "$(ValidateSpeed)" "SLOW" GhcStage2HcOpts += -DDEBUG endif +ifeq "$(ValidateSpeed)" "SLOW" +BUILD_PROF_LIBS = YES +endif + ifneq "$(ValidateSpeed)" "FAST" -BUILD_EXTRA_PKGS=YES +BUILD_EXTRA_PKGS = YES endif WERROR = -Werror From git at git.haskell.org Wed Jan 27 12:05:48 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Jan 2016 12:05:48 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Fix a typo in the note name in comments (4f383ee) Message-ID: <20160127120548.53A9C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/4f383ee0b75cbf982ff86ba2a38b1d3ebbb417f6/ghc >--------------------------------------------------------------- commit 4f383ee0b75cbf982ff86ba2a38b1d3ebbb417f6 Author: Bartosz Nitka Date: Wed Jan 27 01:55:52 2016 -0800 Fix a typo in the note name in comments This is `subsititution` to `substitution`, plus one instance of the note that I missed. Test Plan: docufix Reviewers: simonpj, bgamari, austin, goldfire Reviewed By: simonpj, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1856 GHC Trac Issues: #11371 (cherry picked from commit 45fd83bb5ed3a66320eb873039b65566f53ed36a) >--------------------------------------------------------------- 4f383ee0b75cbf982ff86ba2a38b1d3ebbb417f6 compiler/coreSyn/CoreLint.hs | 2 +- compiler/types/TyCoRep.hs | 12 ++++++------ compiler/types/Type.hs | 3 +-- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/compiler/coreSyn/CoreLint.hs b/compiler/coreSyn/CoreLint.hs index 5702f93..43dbdaa 100644 --- a/compiler/coreSyn/CoreLint.hs +++ b/compiler/coreSyn/CoreLint.hs @@ -788,7 +788,7 @@ lintTyApp fun_ty arg_ty ; in_scope <- getInScope -- substTy needs the set of tyvars in scope to avoid generating -- uniques that are already in scope. - -- See Note [The subsititution invariant] in TyCoRep + -- See Note [The substitution invariant] in TyCoRep ; return (substTyWithInScope in_scope [tv] [arg_ty] body_ty) } | otherwise diff --git a/compiler/types/TyCoRep.hs b/compiler/types/TyCoRep.hs index b80ee06..fb30b52 100644 --- a/compiler/types/TyCoRep.hs +++ b/compiler/types/TyCoRep.hs @@ -1388,7 +1388,7 @@ data TCvSubst -- See Note [Apply Once] -- and Note [Extending the TvSubstEnv] -- and Note [Substituting types and coercions] - -- and Note [The subsititution invariant] + -- and Note [The substitution invariant] -- | A substitution of 'Type's for 'TyVar's -- and 'Kind's for 'KindVar's @@ -1461,7 +1461,7 @@ constructor) and the CvSubstEnv should *never* map a TyVar. Furthermore, the range of the TvSubstEnv should *never* include a type headed with CoercionTy. -Note [The subsititution invariant] +Note [The substitution invariant] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ When calling substTy subst ty it should be the case that the in-scope set in the substitution is a superset of both: @@ -1804,7 +1804,7 @@ substTyWithBinders bndrs tys = ASSERT( length bndrs == length tys ) -- | Substitute within a 'Type' after adding the free variables of the type -- to the in-scope set. This is useful for the case when the free variables -- aren't already in the in-scope set or easily available. --- See also Note [The subsititution invariant]. +-- See also Note [The substitution invariant]. substTyAddInScope :: TCvSubst -> Type -> Type substTyAddInScope subst ty = substTy (extendTCvInScopeSet subst $ tyCoVarsOfType ty) ty @@ -1812,7 +1812,7 @@ substTyAddInScope subst ty = -- | When calling `substTy` it should be the case that the in-scope set in -- the substitution is a superset of the free vars of the range of the -- substitution. --- See also Note [The subsititution invariant]. +-- See also Note [The substitution invariant]. isValidTCvSubst :: TCvSubst -> Bool isValidTCvSubst (TCvSubst in_scope tenv cenv) = (tenvFVs `varSetInScope` in_scope) && @@ -1823,7 +1823,7 @@ isValidTCvSubst (TCvSubst in_scope tenv cenv) = -- | Substitute within a 'Type' -- The substitution has to satisfy the invariants described in --- Note [The subsititution invariant]. +-- Note [The substitution invariant]. substTy :: -- CallStack wasn't present in GHC 7.10.1, disable callstacks in stage 1 @@ -1852,7 +1852,7 @@ substTy subst@(TCvSubst in_scope tenv cenv) ty -- | Substitute within a 'Type' disabling the sanity checks. -- The problems that the sanity checks in substTy catch are described in --- Note [The subsititution invariant]. +-- Note [The substitution invariant]. -- The goal of #11371 is to migrate all the calls of substTyUnchecked to -- substTy and remove this function. Please don't use in new code. substTyUnchecked :: TCvSubst -> Type -> Type diff --git a/compiler/types/Type.hs b/compiler/types/Type.hs index 0d25045..be5b375 100644 --- a/compiler/types/Type.hs +++ b/compiler/types/Type.hs @@ -303,8 +303,7 @@ coreView (TyConApp tc tys) | Just (tenv, rhs, tys') <- expandSynTyCon_maybe tc t = Just (mkAppTys (substTy (mkTopTCvSubst tenv) rhs) tys') -- The free vars of 'rhs' should all be bound by 'tenv', so it's -- ok to use 'substTy' here. - -- See also Note [Generating the in-scope set for a substitution] - -- in TyCoRep. + -- See also Note [The substitution invariant] in TyCoRep. -- Its important to use mkAppTys, rather than (foldl AppTy), -- because the function part might well return a -- partially-applied type constructor; indeed, usually will! From git at git.haskell.org Wed Jan 27 12:05:51 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Jan 2016 12:05:51 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Typos in comments (4459a61) Message-ID: <20160127120551.036C43A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/4459a61353e844b959d7707493ccd612bd2b30b7/ghc >--------------------------------------------------------------- commit 4459a61353e844b959d7707493ccd612bd2b30b7 Author: Gabor Greif Date: Wed Jan 27 11:11:04 2016 +0100 Typos in comments (cherry picked from commit 448ea978318a9f8c9bb611803aa01f934b111fe9) >--------------------------------------------------------------- 4459a61353e844b959d7707493ccd612bd2b30b7 compiler/llvmGen/LlvmCodeGen/CodeGen.hs | 2 +- compiler/typecheck/TcSMonad.hs | 2 +- compiler/vectorise/Vectorise.hs | 2 +- docs/backpack/algorithm.tex | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/llvmGen/LlvmCodeGen/CodeGen.hs b/compiler/llvmGen/LlvmCodeGen/CodeGen.hs index 0aec7ad..61c059d 100644 --- a/compiler/llvmGen/LlvmCodeGen/CodeGen.hs +++ b/compiler/llvmGen/LlvmCodeGen/CodeGen.hs @@ -1671,7 +1671,7 @@ genLit _ CmmHighStackMark -- and avoids having to deal with Phi node insertion. This is also -- the approach recommended by LLVM developers. -- --- On the other hand, this is unecessarily verbose if the register in +-- On the other hand, this is unnecessarily verbose if the register in -- question is never written. Therefore we skip it where we can to -- save a few lines in the output and hopefully speed compilation up a -- bit. diff --git a/compiler/typecheck/TcSMonad.hs b/compiler/typecheck/TcSMonad.hs index 9a5bb53..ddacdd9 100644 --- a/compiler/typecheck/TcSMonad.hs +++ b/compiler/typecheck/TcSMonad.hs @@ -932,7 +932,7 @@ For example, if we have and we wish to compute S(W/R, T a b), the correct answer is T a Bool, NOT T Int Bool. The reason is that T's first parameter has a nominal role, and thus rewriting a to Int in T a b is wrong. Indeed, this non-congruence of -subsitution means that the proof in Note [The inert equalities] may need +substitution means that the proof in Note [The inert equalities] may need to be revisited, but we don't think that the end conclusion is wrong. Note [Examples of how the inert_model helps completeness] diff --git a/compiler/vectorise/Vectorise.hs b/compiler/vectorise/Vectorise.hs index fa59f08..77561ff 100644 --- a/compiler/vectorise/Vectorise.hs +++ b/compiler/vectorise/Vectorise.hs @@ -130,7 +130,7 @@ vectModule guts@(ModGuts { mg_tcs = tycons -- -- The original binding @foo@ is rewritten to call the vectorised version present in the closure. -- --- Vectorisation may be surpressed by annotating a binding with a 'NOVECTORISE' pragma. If this +-- Vectorisation may be suppressed by annotating a binding with a 'NOVECTORISE' pragma. If this -- pragma is used in a group of mutually recursive bindings, either all or no binding must have -- the pragma. If only some bindings are annotated, a fatal error is being raised. (In the case of -- scalar bindings, we only omit vectorisation if all bindings in a group are scalar.) diff --git a/docs/backpack/algorithm.tex b/docs/backpack/algorithm.tex index 1c7192c..c98781c 100644 --- a/docs/backpack/algorithm.tex +++ b/docs/backpack/algorithm.tex @@ -671,7 +671,7 @@ we have to type-check the \I{ModIface} with the following adjustments: with a unit key that is a $\verb|hole|$, substitute with the recorded \I{Name} in the requirements of the shape. Otherwise, look up the (unique) \I{ModIface} for the \I{Module}, - and subsitute with the corresponding \I{Name} in the \I{mi\_exports}. + and substitute with the corresponding \I{Name} in the \I{mi\_exports}. \end{enumerate} \paragraph{Signatures} For signatures, we have a \I{Module} of the form From git at git.haskell.org Wed Jan 27 12:05:54 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Jan 2016 12:05:54 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Enable RemoteGHCi on Windows (0e90d3b) Message-ID: <20160127120554.806193A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/0e90d3bded49f42d25527cd4a67f2b1ef9cf5ff3/ghc >--------------------------------------------------------------- commit 0e90d3bded49f42d25527cd4a67f2b1ef9cf5ff3 Author: Tamar Christina Date: Wed Jan 27 10:20:11 2016 +0100 Enable RemoteGHCi on Windows Makes the needed changes to make RemoteGHCi work on Windows. The approach passes OS Handles areound instead of the Posix Fd as on Linux. The reason is that I could not find any real documentation about the behaviour of Windows w.r.t inheritance and Posix FDs. The implementation with Fd did not seem to be able to find the Fd in the child process. Instead I'm using the much better documented approach of passing inheriting handles. This requires a small modification to the `process` library. https://github.com/haskell/process/pull/52 Test Plan: ./validate On Windows x86_64 Reviewers: thomie, erikd, bgamari, simonmar, austin, hvr Reviewed By: simonmar Subscribers: #ghc_windows_task_force Differential Revision: https://phabricator.haskell.org/D1836 GHC Trac Issues: #11100 (cherry picked from commit 44a5d51a4892b85c7eba09dcb90ca02245637812) >--------------------------------------------------------------- 0e90d3bded49f42d25527cd4a67f2b1ef9cf5ff3 .gitignore | 1 + compiler/ghci/GHCi.hs | 61 +++++++++++++++++++++++++++---------------- compiler/main/DynFlags.hs | 7 ----- ghc.mk | 2 -- iserv/{ => cbits}/iservmain.c | 0 iserv/iserv-bin.cabal | 8 ++++-- iserv/src/GHCi/Utils.hsc | 25 ++++++++++++++++++ iserv/{ => src}/Main.hs | 10 +++---- mk/warnings.mk | 5 ++++ 9 files changed, 81 insertions(+), 38 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 0e90d3bded49f42d25527cd4a67f2b1ef9cf5ff3 From git at git.haskell.org Wed Jan 27 12:05:57 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Jan 2016 12:05:57 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: ghci: fix trac issue #11481 (e17a1d5) Message-ID: <20160127120557.42FB33A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/e17a1d5700801db97d10e4bbdd8b31080bba47dc/ghc >--------------------------------------------------------------- commit e17a1d5700801db97d10e4bbdd8b31080bba47dc Author: Benjamin Bykowski Date: Wed Jan 27 11:05:13 2016 +0100 ghci: fix trac issue #11481 Test Plan: validate Reviewers: thomie, austin, bgamari Reviewed By: bgamari Differential Revision: https://phabricator.haskell.org/D1833 GHC Trac Issues: #11481 (cherry picked from commit 1f6d1422f9fe875e1d150b423c4864b42d96b8db) >--------------------------------------------------------------- e17a1d5700801db97d10e4bbdd8b31080bba47dc compiler/main/DynFlags.hs | 2 +- ghc/GHCi/UI.hs | 13 +++---- testsuite/tests/ghci/scripts/Defer03.hs | 5 ++- testsuite/tests/ghci/scripts/T8353.stderr | 60 +++++++++++++++++++++++-------- 4 files changed, 55 insertions(+), 25 deletions(-) diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 46dce1b..3850026 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -28,7 +28,7 @@ module DynFlags ( ProfAuto(..), glasgowExtsFlags, dopt, dopt_set, dopt_unset, - gopt, gopt_set, gopt_unset, + gopt, gopt_set, gopt_unset, setGeneralFlag', unSetGeneralFlag', wopt, wopt_set, wopt_unset, xopt, xopt_set, xopt_unset, lang_set, diff --git a/ghc/GHCi/UI.hs b/ghc/GHCi/UI.hs index fc03b5f..2528503 100644 --- a/ghc/GHCi/UI.hs +++ b/ghc/GHCi/UI.hs @@ -1460,17 +1460,14 @@ checkModule m = do -- :load, :add, :reload -- | Sets '-fdefer-type-errors' if 'defer' is true, executes 'load' and unsets --- '-fdefer-type-errors' again if it has not been set before +-- '-fdefer-type-errors' again if it has not been set before. deferredLoad :: Bool -> InputT GHCi SuccessFlag -> InputT GHCi () deferredLoad defer load = do - flags <- getDynFlags - deferredBefore <- return (gopt Opt_DeferTypeErrors flags) - when (defer) $ Monad.void $ - GHC.setProgramDynFlags $ gopt_set flags Opt_DeferTypeErrors + originalFlags <- getDynFlags + when defer $ Monad.void $ + GHC.setProgramDynFlags $ setGeneralFlag' Opt_DeferTypeErrors originalFlags Monad.void $ load - flags <- getDynFlags - when (not deferredBefore) $ Monad.void $ - GHC.setProgramDynFlags $ gopt_unset flags Opt_DeferTypeErrors + Monad.void $ GHC.setProgramDynFlags $ originalFlags loadModule :: [(FilePath, Maybe Phase)] -> InputT GHCi SuccessFlag loadModule fs = timeIt (const Nothing) (loadModule' fs) diff --git a/testsuite/tests/ghci/scripts/Defer03.hs b/testsuite/tests/ghci/scripts/Defer03.hs index b91a7ac..b0f65fb 100755 --- a/testsuite/tests/ghci/scripts/Defer03.hs +++ b/testsuite/tests/ghci/scripts/Defer03.hs @@ -3,5 +3,8 @@ module Main where a :: Int a = 'p' +f :: Int +f = _ + main :: IO () -main = print "No errors!" +main = print f diff --git a/testsuite/tests/ghci/scripts/T8353.stderr b/testsuite/tests/ghci/scripts/T8353.stderr index 7303142..8914820 100644 --- a/testsuite/tests/ghci/scripts/T8353.stderr +++ b/testsuite/tests/ghci/scripts/T8353.stderr @@ -1,25 +1,55 @@ Defer03.hs:4:5: warning: - Couldn't match expected type ?Int? with actual type ?Char? - In the expression: 'p' - In an equation for ?a?: a = 'p' + ? Couldn't match expected type ?Int? with actual type ?Char? + ? In the expression: 'p' + In an equation for ?a?: a = 'p' + +Defer03.hs:7:5: warning: + ? Found hole: _ :: Int + ? In the expression: _ + In an equation for ?f?: f = _ + ? Relevant bindings include f :: Int (bound at Defer03.hs:7:1) Defer03.hs:4:5: error: - Couldn't match expected type ?Int? with actual type ?Char? - In the expression: 'p' - In an equation for ?a?: a = 'p' + ? Couldn't match expected type ?Int? with actual type ?Char? + ? In the expression: 'p' + In an equation for ?a?: a = 'p' + +Defer03.hs:7:5: error: + ? Found hole: _ :: Int + ? In the expression: _ + In an equation for ?f?: f = _ + ? Relevant bindings include f :: Int (bound at Defer03.hs:7:1) Defer03.hs:4:5: warning: - Couldn't match expected type ?Int? with actual type ?Char? - In the expression: 'p' - In an equation for ?a?: a = 'p' + ? Couldn't match expected type ?Int? with actual type ?Char? + ? In the expression: 'p' + In an equation for ?a?: a = 'p' + +Defer03.hs:7:5: warning: + ? Found hole: _ :: Int + ? In the expression: _ + In an equation for ?f?: f = _ + ? Relevant bindings include f :: Int (bound at Defer03.hs:7:1) Defer03.hs:4:5: error: - Couldn't match expected type ?Int? with actual type ?Char? - In the expression: 'p' - In an equation for ?a?: a = 'p' + ? Couldn't match expected type ?Int? with actual type ?Char? + ? In the expression: 'p' + In an equation for ?a?: a = 'p' + +Defer03.hs:7:5: error: + ? Found hole: _ :: Int + ? In the expression: _ + In an equation for ?f?: f = _ + ? Relevant bindings include f :: Int (bound at Defer03.hs:7:1) Defer03.hs:4:5: warning: - Couldn't match expected type ?Int? with actual type ?Char? - In the expression: 'p' - In an equation for ?a?: a = 'p' + ? Couldn't match expected type ?Int? with actual type ?Char? + ? In the expression: 'p' + In an equation for ?a?: a = 'p' + +Defer03.hs:7:5: warning: + ? Found hole: _ :: Int + ? In the expression: _ + In an equation for ?f?: f = _ + ? Relevant bindings include f :: Int (bound at Defer03.hs:7:1) From git at git.haskell.org Wed Jan 27 12:05:59 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Jan 2016 12:05:59 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: Restore original alignment for info tables (7a70f98) Message-ID: <20160127120559.F29893A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/7a70f980d39533f30e1a6504b7821e63a4d6f41e/ghc >--------------------------------------------------------------- commit 7a70f980d39533f30e1a6504b7821e63a4d6f41e Author: Simon Brenner Date: Wed Jan 27 11:05:35 2016 +0100 Restore original alignment for info tables This was broken in 4a32bf925b8aba7885d9c745769fe84a10979a53, meaning that info tables and subsequent code are no longer guaranteed to have the recommended alignment. Split up the section header and section alignment printers, and print an appropriate alignment directive before each info table. Fixes Trac #11486 Reviewers: austin, bgamari, rwbarton Reviewed By: bgamari, rwbarton Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1847 GHC Trac Issues: #11486 (cherry picked from commit 0dc7b36c3c261b3eccf8460581fcd3d71f6e6ff6) >--------------------------------------------------------------- 7a70f980d39533f30e1a6504b7821e63a4d6f41e compiler/nativeGen/PPC/Ppr.hs | 12 +++++++++--- compiler/nativeGen/SPARC/Ppr.hs | 7 ++++++- compiler/nativeGen/X86/Ppr.hs | 9 +++++++++ 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/compiler/nativeGen/PPC/Ppr.hs b/compiler/nativeGen/PPC/Ppr.hs index 8d89a19..08c02f0 100644 --- a/compiler/nativeGen/PPC/Ppr.hs +++ b/compiler/nativeGen/PPC/Ppr.hs @@ -112,7 +112,7 @@ pprBasicBlock info_env (BasicBlock blockid instrs) maybe_infotable = case mapLookup blockid info_env of Nothing -> empty Just (Statics info_lbl info) -> - pprSectionAlign (Section Text info_lbl) $$ + pprAlignForSection Text $$ vcat (map pprData info) $$ pprLabel info_lbl @@ -305,9 +305,16 @@ pprAddr (AddrRegImm r1 imm) = hcat [ pprImm imm, char '(', pprReg r1, char ')' ] pprSectionAlign :: Section -> SDoc pprSectionAlign sec@(Section seg _) = sdocWithPlatform $ \platform -> + pprSectionHeader platform sec $$ + pprAlignForSection seg + +-- | Print appropriate alignment for the given section type. +pprAlignForSection :: SectionType -> SDoc +pprAlignForSection seg = + sdocWithPlatform $ \platform -> let osDarwin = platformOS platform == OSDarwin ppc64 = not $ target32Bit platform - align = ptext $ case seg of + in ptext $ case seg of Text -> sLit ".align 2" Data | ppc64 -> sLit ".align 3" @@ -328,7 +335,6 @@ pprSectionAlign sec@(Section seg _) = | osDarwin -> sLit ".align 4" | otherwise -> sLit ".align 4" OtherSection _ -> panic "PprMach.pprSectionAlign: unknown section" - in pprSectionHeader platform sec $$ align pprDataItem :: CmmLit -> SDoc pprDataItem lit diff --git a/compiler/nativeGen/SPARC/Ppr.hs b/compiler/nativeGen/SPARC/Ppr.hs index 8c7871e..eb41f23 100644 --- a/compiler/nativeGen/SPARC/Ppr.hs +++ b/compiler/nativeGen/SPARC/Ppr.hs @@ -96,7 +96,7 @@ pprBasicBlock info_env (BasicBlock blockid instrs) maybe_infotable = case mapLookup blockid info_env of Nothing -> empty Just (Statics info_lbl info) -> - pprSectionAlign (Section Text info_lbl) $$ + pprAlignForSection Text $$ vcat (map pprData info) $$ pprLabel info_lbl @@ -326,6 +326,11 @@ pprSectionAlign :: Section -> SDoc pprSectionAlign sec@(Section seg _) = sdocWithPlatform $ \platform -> pprSectionHeader platform sec $$ + pprAlignForSection seg + +-- | Print appropriate alignment for the given section type. +pprAlignForSection :: SectionType -> SDoc +pprAlignForSection seg = ptext (case seg of Text -> sLit ".align 4" Data -> sLit ".align 8" diff --git a/compiler/nativeGen/X86/Ppr.hs b/compiler/nativeGen/X86/Ppr.hs index f2fc884..7809ae1 100644 --- a/compiler/nativeGen/X86/Ppr.hs +++ b/compiler/nativeGen/X86/Ppr.hs @@ -109,6 +109,7 @@ pprBasicBlock info_env (BasicBlock blockid instrs) maybe_infotable = case mapLookup blockid info_env of Nothing -> empty Just (Statics info_lbl info) -> + pprAlignForSection Text $$ infoTableLoc $$ vcat (map pprData info) $$ pprLabel info_lbl @@ -386,8 +387,15 @@ pprSectionAlign (Section (OtherSection _) _) = pprSectionAlign sec@(Section seg _) = sdocWithPlatform $ \platform -> pprSectionHeader platform sec $$ + pprAlignForSection seg + +-- | Print appropriate alignment for the given section type. +pprAlignForSection :: SectionType -> SDoc +pprAlignForSection seg = + sdocWithPlatform $ \platform -> text ".align " <> case platformOS platform of + -- Darwin: alignments are given as shifts. OSDarwin | target32Bit platform -> case seg of @@ -397,6 +405,7 @@ pprSectionAlign sec@(Section seg _) = case seg of ReadOnlyData16 -> int 4 _ -> int 3 + -- Other: alignments are given as bytes. _ | target32Bit platform -> case seg of From git at git.haskell.org Wed Jan 27 12:06:02 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Jan 2016 12:06:02 +0000 (UTC) Subject: [commit: ghc] ghc-8.0: rts/Timer: Actually fix #9105 (7d123cc) Message-ID: <20160127120602.CCC993A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-8.0 Link : http://ghc.haskell.org/trac/ghc/changeset/7d123cc87ba69d96f4e32921549201537abe118b/ghc >--------------------------------------------------------------- commit 7d123cc87ba69d96f4e32921549201537abe118b Author: Ben Gamari Date: Wed Jan 27 11:05:23 2016 +0100 rts/Timer: Actually fix #9105 jberthold astutely pointed out that the previous fix (D1822) could not have possibly fixed the issue as the patch would only have had any effect if !PROFILING. Test Plan: Check for reduced CPU usage when compiled with `-prof` but without `+RTS -p` Reviewers: simonmar, austin, jberthold Reviewed By: simonmar, jberthold Subscribers: simonmar, thomie Differential Revision: https://phabricator.haskell.org/D1844 GHC Trac Issues: #9105 (cherry picked from commit 1c6130d91420dc835c281bc9b13d603b7aa49b59) >--------------------------------------------------------------- 7d123cc87ba69d96f4e32921549201537abe118b rts/Timer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rts/Timer.c b/rts/Timer.c index bf7240b..9136c60 100644 --- a/rts/Timer.c +++ b/rts/Timer.c @@ -76,11 +76,13 @@ handle_tick(int unused STG_UNUSED) // but only if we're not profiling (e.g. passed -h or -p RTS // flags). If we are profiling we need to keep the timer active // so that samples continue to be collected. -#ifndef PROFILING +#ifdef PROFILING if (!(RtsFlags.ProfFlags.doHeapProfile || RtsFlags.CcFlags.doCostCentres)) { stopTimer(); } +#else + stopTimer(); #endif } } else { From git at git.haskell.org Wed Jan 27 12:55:28 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Jan 2016 12:55:28 +0000 (UTC) Subject: [commit: ghc] master: Document -fllvm-fill-undef-with-garbage (45c6fbc) Message-ID: <20160127125528.7FA083A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/45c6fbc5284f83e1253ff9f3b49fe54a76c20ba7/ghc >--------------------------------------------------------------- commit 45c6fbc5284f83e1253ff9f3b49fe54a76c20ba7 Author: Ben Gamari Date: Wed Jan 27 12:24:48 2016 +0100 Document -fllvm-fill-undef-with-garbage >--------------------------------------------------------------- 45c6fbc5284f83e1253ff9f3b49fe54a76c20ba7 docs/users_guide/debugging.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/users_guide/debugging.rst b/docs/users_guide/debugging.rst index 80c9f8d..a7bbbb5 100644 --- a/docs/users_guide/debugging.rst +++ b/docs/users_guide/debugging.rst @@ -333,6 +333,12 @@ Checking for consistency Ditto for C-- level. +.. ghc-flag:: -fllvm-fill-undef-with-garbage + + Instructs the LLVM code generator to fill dead STG registers with garbage + instead of ``undef`` in calls. This makes it easier to catch subtle + code generator and runtime system bugs (e.g. see :ghc-ticket:`11487`). + .. _checking-determinism: Checking for determinism From git at git.haskell.org Wed Jan 27 12:55:31 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Jan 2016 12:55:31 +0000 (UTC) Subject: [commit: ghc] master: s/unLifted/unlifted for consistency (4faa1a6) Message-ID: <20160127125531.591BE3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/4faa1a63d0496fd511d2d139622dbf7ef2ce4655/ghc >--------------------------------------------------------------- commit 4faa1a63d0496fd511d2d139622dbf7ef2ce4655 Author: ?mer Sinan A?acan Date: Wed Jan 27 13:15:15 2016 +0100 s/unLifted/unlifted for consistency This was causing trouble as we had to remember when to use "unLifted" and when to use "unlifted". "unlifted" is used instead of "unLifted" as it's a single word. Reviewers: austin, hvr, goldfire, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1852 >--------------------------------------------------------------- 4faa1a63d0496fd511d2d139622dbf7ef2ce4655 compiler/basicTypes/Demand.hs | 4 ++-- compiler/codeGen/StgCmmClosure.hs | 10 +++++----- compiler/codeGen/StgCmmExpr.hs | 2 +- compiler/codeGen/StgCmmTicky.hs | 2 +- compiler/coreSyn/CoreLint.hs | 14 +++++++------- compiler/coreSyn/CorePrep.hs | 4 ++-- compiler/coreSyn/CoreSubst.hs | 2 +- compiler/coreSyn/CoreUnfold.hs | 4 ++-- compiler/coreSyn/CoreUtils.hs | 4 ++-- compiler/deSugar/Coverage.hs | 2 +- compiler/deSugar/DsCCall.hs | 2 +- compiler/deSugar/DsExpr.hs | 8 ++++---- compiler/deSugar/DsForeign.hs | 2 +- compiler/ghci/ByteCodeGen.hs | 6 +++--- compiler/simplCore/FloatIn.hs | 6 +++--- compiler/simplCore/SetLevels.hs | 8 ++++---- compiler/simplCore/SimplEnv.hs | 2 +- compiler/simplCore/Simplify.hs | 10 +++++----- compiler/specialise/Specialise.hs | 2 +- compiler/stgSyn/CoreToStg.hs | 4 ++-- compiler/stgSyn/StgLint.hs | 8 ++++---- compiler/stranal/WwLib.hs | 6 +++--- compiler/typecheck/TcBinds.hs | 2 +- compiler/typecheck/TcDeriv.hs | 4 ++-- compiler/typecheck/TcGenDeriv.hs | 12 ++++++------ compiler/typecheck/TcGenGenerics.hs | 2 +- compiler/typecheck/TcPat.hs | 2 +- compiler/typecheck/TcPatSyn.hs | 2 +- compiler/typecheck/TcRnDriver.hs | 2 +- compiler/typecheck/TcSplice.hs | 2 +- compiler/typecheck/TcType.hs | 10 +++++----- compiler/typecheck/TcValidity.hs | 4 ++-- compiler/types/TyCon.hs | 16 ++++++++-------- compiler/types/Type.hs | 18 +++++++++--------- compiler/vectorise/Vectorise/Type/Classify.hs | 2 +- 35 files changed, 95 insertions(+), 95 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 4faa1a63d0496fd511d2d139622dbf7ef2ce4655 From git at git.haskell.org Wed Jan 27 14:33:16 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Jan 2016 14:33:16 +0000 (UTC) Subject: [commit: ghc] master: Fix some substitution InScopeSets (2899aa5) Message-ID: <20160127143316.7404A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/2899aa580d633103fc551e36c977720b94f5b41c/ghc >--------------------------------------------------------------- commit 2899aa580d633103fc551e36c977720b94f5b41c Author: Richard Eisenberg Date: Mon Jan 25 22:00:47 2016 -0500 Fix some substitution InScopeSets This is relevant to #11371. >--------------------------------------------------------------- 2899aa580d633103fc551e36c977720b94f5b41c compiler/typecheck/TcHsType.hs | 2 +- compiler/typecheck/TcMType.hs | 2 +- compiler/typecheck/TcType.hs | 1 + compiler/types/TyCoRep.hs | 4 ++++ compiler/types/Type.hs | 4 ++-- 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/compiler/typecheck/TcHsType.hs b/compiler/typecheck/TcHsType.hs index 1b6d5cf..c752dba 100644 --- a/compiler/typecheck/TcHsType.hs +++ b/compiler/typecheck/TcHsType.hs @@ -847,7 +847,7 @@ tcInstBinderX :: Maybe (VarEnv Kind) tcInstBinderX mb_kind_info subst binder | Just tv <- binderVar_maybe binder = case lookup_tv tv of - Just ki -> return (extendTCvSubst subst tv ki, ki) + Just ki -> return (extendTCvSubstAndInScope subst tv ki, ki) Nothing -> do { (subst', tv') <- newMetaTyVarX subst tv ; return (subst', mkTyVarTy tv') } diff --git a/compiler/typecheck/TcMType.hs b/compiler/typecheck/TcMType.hs index a160d4e..b7fe68c 100644 --- a/compiler/typecheck/TcMType.hs +++ b/compiler/typecheck/TcMType.hs @@ -693,7 +693,7 @@ newMetaTyVarX subst tyvar -- See Note [Name of an instantiated type variable] kind = substTyUnchecked subst (tyVarKind tyvar) new_tv = mkTcTyVar name kind details - ; return (extendTCvSubst (extendTCvInScope subst new_tv) tyvar + ; return (extendTCvSubstAndInScope subst tyvar (mkTyVarTy new_tv) , new_tv) } diff --git a/compiler/typecheck/TcType.hs b/compiler/typecheck/TcType.hs index a3e449d..796c042 100644 --- a/compiler/typecheck/TcType.hs +++ b/compiler/typecheck/TcType.hs @@ -145,6 +145,7 @@ module TcType ( mkOpenTCvSubst, zipOpenTCvSubst, mkTopTCvSubst, notElemTCvSubst, unionTCvSubst, getTvSubstEnv, setTvSubstEnv, getTCvInScope, extendTCvInScope, + extendTCvInScopeList, extendTCvInScopeSet, extendTCvSubstAndInScope, Type.lookupTyVar, Type.extendTCvSubst, Type.substTyVarBndr, extendTCvSubstList, isInScope, mkTCvSubst, zipTyEnv, zipCoEnv, Type.substTy, substTys, substTyWith, substTyWithCoVars, diff --git a/compiler/types/TyCoRep.hs b/compiler/types/TyCoRep.hs index 08d3b79..dcffbe0 100644 --- a/compiler/types/TyCoRep.hs +++ b/compiler/types/TyCoRep.hs @@ -1864,7 +1864,11 @@ substTy subst@(TCvSubst in_scope tenv cenv) ty | otherwise = ASSERT2( isValidTCvSubst subst, text "in_scope" <+> ppr in_scope $$ text "tenv" <+> ppr tenv $$ + text "tenvFVs" + <+> ppr (tyCoVarsOfTypes $ varEnvElts tenv) $$ text "cenv" <+> ppr cenv $$ + text "cenvFVs" + <+> ppr (tyCoVarsOfCos $ varEnvElts cenv) $$ text "ty" <+> ppr ty ) ASSERT2( typeFVsInScope, text "in_scope" <+> ppr in_scope $$ diff --git a/compiler/types/Type.hs b/compiler/types/Type.hs index 81e5773..3992a71 100644 --- a/compiler/types/Type.hs +++ b/compiler/types/Type.hs @@ -154,8 +154,8 @@ module Type ( notElemTCvSubst, getTvSubstEnv, setTvSubstEnv, zapTCvSubst, getTCvInScope, - extendTCvInScope, extendTCvInScopeList, - extendTCvSubst, extendTCvSubstList, + extendTCvInScope, extendTCvInScopeList, extendTCvInScopeSet, + extendTCvSubst, extendTCvSubstList, extendTCvSubstAndInScope, isInScope, composeTCvSubstEnv, composeTCvSubst, zipTyEnv, zipCoEnv, isEmptyTCvSubst, unionTCvSubst, From git at git.haskell.org Wed Jan 27 14:33:20 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Jan 2016 14:33:20 +0000 (UTC) Subject: [commit: ghc] master: Refactor the typechecker to use ExpTypes. (00cbbab) Message-ID: <20160127143320.C91E23A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/00cbbab3362578df44851442408a8b91a2a769fa/ghc >--------------------------------------------------------------- commit 00cbbab3362578df44851442408a8b91a2a769fa Author: Richard Eisenberg Date: Wed Jan 13 23:29:17 2016 -0500 Refactor the typechecker to use ExpTypes. The idea here is described in [wiki:Typechecker]. Briefly, this refactor keeps solid track of "synthesis" mode vs "checking" in GHC's bidirectional type-checking algorithm. When in synthesis mode, the expected type is just an IORef to write to. In addition, this patch does a significant reworking of RebindableSyntax, allowing much more freedom in the types of the rebindable operators. For example, we can now have `negate :: Int -> Bool` and `(>>=) :: m a -> (forall x. a x -> m b) -> m b`. The magic is in tcSyntaxOp. This addresses tickets #11397, #11452, and #11458. Tests: typecheck/should_compile/{RebindHR,RebindNegate,T11397,T11458} th/T11452 >--------------------------------------------------------------- 00cbbab3362578df44851442408a8b91a2a769fa compiler/deSugar/Check.hs | 160 +++---- compiler/deSugar/Coverage.hs | 32 +- compiler/deSugar/DsArrows.hs | 13 +- compiler/deSugar/DsExpr.hs | 61 +-- compiler/deSugar/DsExpr.hs-boot | 3 +- compiler/deSugar/DsGRHSs.hs | 2 +- compiler/deSugar/DsListComp.hs | 59 ++- compiler/deSugar/DsMeta.hs | 10 +- compiler/deSugar/DsUtils.hs | 10 +- compiler/deSugar/Match.hs | 32 +- compiler/deSugar/MatchLit.hs | 52 +-- compiler/deSugar/PmExpr.hs | 5 +- compiler/ghci/RtClosureInspect.hs | 4 - compiler/hsSyn/Convert.hs | 2 +- compiler/hsSyn/HsExpr.hs | 74 +++- compiler/hsSyn/HsExpr.hs-boot | 5 +- compiler/hsSyn/HsLit.hs | 6 +- compiler/hsSyn/HsPat.hs | 16 +- compiler/hsSyn/HsUtils.hs | 80 ++-- compiler/hsSyn/PlaceHolder.hs | 14 +- compiler/parser/Parser.y | 2 +- compiler/parser/RdrHsSyn.hs | 4 +- compiler/rename/RnEnv.hs | 8 +- compiler/rename/RnExpr.hs | 101 +++-- compiler/rename/RnPat.hs | 11 +- compiler/typecheck/Inst.hs | 55 ++- compiler/typecheck/TcArrows.hs | 45 +- compiler/typecheck/TcBinds.hs | 18 +- compiler/typecheck/TcErrors.hs | 112 +++-- compiler/typecheck/TcEvidence.hs | 38 +- compiler/typecheck/TcExpr.hs | 472 ++++++++++++++------- compiler/typecheck/TcExpr.hs-boot | 24 +- compiler/typecheck/TcGenDeriv.hs | 32 +- compiler/typecheck/TcHsSyn.hs | 303 ++++++++----- compiler/typecheck/TcHsType.hs | 11 +- compiler/typecheck/TcInstDcls.hs | 3 +- compiler/typecheck/TcMType.hs | 242 +++++++---- compiler/typecheck/TcMatches.hs | 436 ++++++++++--------- compiler/typecheck/TcMatches.hs-boot | 4 +- compiler/typecheck/TcPat.hs | 248 +++++++---- compiler/typecheck/TcPatSyn.hs | 26 +- compiler/typecheck/TcRnDriver.hs | 17 +- compiler/typecheck/TcRnMonad.hs | 4 +- compiler/typecheck/TcRnTypes.hs | 28 +- compiler/typecheck/TcRules.hs | 3 +- compiler/typecheck/TcSplice.hs | 42 +- compiler/typecheck/TcSplice.hs-boot | 8 +- compiler/typecheck/TcType.hs | 111 +++-- compiler/typecheck/TcUnify.hs | 449 +++++++++++++------- compiler/typecheck/TcValidity.hs | 2 +- compiler/utils/MonadUtils.hs | 7 +- testsuite/tests/ado/ado004.stderr | 30 +- .../tests/annotations/should_fail/annfail10.stderr | 12 +- testsuite/tests/deSugar/should_run/dsrun017.hs | 0 testsuite/tests/determinism/typecheck/A.hs | 2 +- testsuite/tests/gadt/gadt-escape1.stderr | 16 +- testsuite/tests/gadt/gadt13.stderr | 10 +- testsuite/tests/gadt/gadt7.stderr | 20 +- .../ghc-api/annotations-literals/parsed.stdout | 8 +- .../tests/ghci.debugger/scripts/break003.stderr | 2 +- .../tests/ghci.debugger/scripts/break003.stdout | 8 +- .../tests/ghci.debugger/scripts/break005.stdout | 4 +- .../tests/ghci.debugger/scripts/break006.stderr | 12 +- .../tests/ghci.debugger/scripts/break006.stdout | 10 +- .../tests/ghci.debugger/scripts/break012.stdout | 8 +- .../tests/ghci.debugger/scripts/hist001.stdout | 28 +- .../tests/ghci.debugger/scripts/print022.stdout | 4 +- testsuite/tests/ghci/scripts/T2182ghci.stderr | 30 +- testsuite/tests/ghci/scripts/T8959.script | 8 +- testsuite/tests/ghci/scripts/T8959.stderr | 48 +-- testsuite/tests/ghci/scripts/T8959.stdout | 11 +- .../tests/indexed-types/should_compile/T3484.hs | 4 +- .../tests/indexed-types/should_compile/T4120.hs | 4 +- .../tests/indexed-types/should_compile/T4494.hs | 3 +- .../tests/indexed-types/should_compile/T9090.hs | 2 +- .../tests/indexed-types/should_compile/T9316.hs | 2 +- .../tests/indexed-types/should_fail/T3330a.hs | 3 +- .../tests/indexed-types/should_fail/T5934.stderr | 11 +- .../tests/indexed-types/should_fail/T7788.stderr | 7 +- .../tests/indexed-types/should_fail/T8518.stderr | 33 +- testsuite/tests/module/mod71.stderr | 6 +- .../should_fail/overloadedlistsfail03.hs | 2 +- .../should_fail/overloadedlistsfail03.stderr | 13 +- .../should_fail/overloadedlistsfail05.hs | 2 +- .../should_fail/overloadedlistsfail05.stderr | 15 +- .../tests/parser/should_compile/read014.stderr | 8 +- testsuite/tests/parser/should_fail/T7848.stderr | 42 +- .../partial-sigs/should_compile/T10438.stderr | 16 +- .../partial-sigs/should_compile/T11192.stderr | 12 +- testsuite/tests/perf/compiler/all.T | 3 +- testsuite/tests/polykinds/T7438.stderr | 16 +- testsuite/tests/rebindable/rebindable6.hs | 5 +- testsuite/tests/rebindable/rebindable6.stderr | 24 +- .../tests/rename/should_compile/T3103/GHC/Num.hs | 9 + .../tests/rename/should_compile/T3103/GHC/Word.hs | 2 +- testsuite/tests/th/T11452.hs | 6 + testsuite/tests/th/T11452.stderr | 15 + testsuite/tests/th/T2222.stderr | 2 +- testsuite/tests/th/all.T | 1 + .../tests/typecheck/should_compile/RebindHR.hs | 26 ++ .../tests/typecheck/should_compile/RebindNegate.hs | 9 + testsuite/tests/typecheck/should_compile/T11397.hs | 69 +++ testsuite/tests/typecheck/should_compile/T11458.hs | 5 + testsuite/tests/typecheck/should_compile/T2683.hs | 2 +- testsuite/tests/typecheck/should_compile/T7888.hs | 4 + testsuite/tests/typecheck/should_compile/all.T | 4 + .../tests/typecheck/should_compile/tc141.stderr | 6 +- testsuite/tests/typecheck/should_compile/tc158.hs | 2 +- testsuite/tests/typecheck/should_compile/twins.hs | 2 +- .../tests/typecheck/should_fail/FDsFromGivens2.hs | 1 + .../typecheck/should_fail/FDsFromGivens2.stderr | 26 +- .../tests/typecheck/should_fail/T10619.stderr | 4 +- testsuite/tests/typecheck/should_fail/T3613.stderr | 4 +- testsuite/tests/typecheck/should_fail/T5570.stderr | 3 +- testsuite/tests/typecheck/should_fail/T7453.stderr | 50 +-- testsuite/tests/typecheck/should_fail/T7734.stderr | 12 +- testsuite/tests/typecheck/should_fail/T8603.stderr | 8 +- testsuite/tests/typecheck/should_fail/T9109.stderr | 11 +- .../tests/typecheck/should_fail/VtaFail.stderr | 2 +- .../tests/typecheck/should_fail/tcfail014.stderr | 6 +- .../tests/typecheck/should_fail/tcfail016.stderr | 25 +- .../tests/typecheck/should_fail/tcfail032.stderr | 6 +- .../tests/typecheck/should_fail/tcfail099.stderr | 6 +- .../tests/typecheck/should_fail/tcfail104.stderr | 14 +- .../tests/typecheck/should_fail/tcfail140.stderr | 7 +- .../tests/typecheck/should_fail/tcfail159.stderr | 9 +- .../tests/typecheck/should_fail/tcfail181.stderr | 2 +- utils/ghctags/Main.hs | 4 +- 128 files changed, 2660 insertions(+), 1714 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 00cbbab3362578df44851442408a8b91a2a769fa From git at git.haskell.org Wed Jan 27 15:16:10 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Jan 2016 15:16:10 +0000 (UTC) Subject: [commit: ghc] master: Rename "open" subst functions (5dcae88) Message-ID: <20160127151610.A97F63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/5dcae88bd0df440abe78c3d793d21aca6236fc25/ghc >--------------------------------------------------------------- commit 5dcae88bd0df440abe78c3d793d21aca6236fc25 Author: Bartosz Nitka Date: Tue Jan 26 11:59:37 2016 -0800 Rename "open" subst functions This is the renaming that @simonpj requested: ``` ? zipOpenTCvSubst -> zipTvSubst (It only deals with tyvars) ? zipOpenTCvSubstCoVars -> zipCvSubst (it only deals with covars) ? zipOpenTCvSubstBinders -> zipTyBinderSubst (it only deals with TyBinders, not covars) ``` plus the `mk` variant. Test Plan: ./validate Reviewers: simonpj, goldfire, austin, bgamari Subscribers: thomie, simonpj Differential Revision: https://phabricator.haskell.org/D1853 GHC Trac Issues: #11371 >--------------------------------------------------------------- 5dcae88bd0df440abe78c3d793d21aca6236fc25 compiler/basicTypes/DataCon.hs | 2 +- compiler/basicTypes/MkId.hs | 4 +-- compiler/coreSyn/CoreUtils.hs | 2 +- compiler/deSugar/Check.hs | 2 +- compiler/deSugar/DsExpr.hs | 2 +- compiler/iface/BuildTyCl.hs | 6 ++-- compiler/iface/TcIface.hs | 2 +- compiler/main/InteractiveEval.hs | 6 ++-- compiler/typecheck/TcDeriv.hs | 8 ++--- compiler/typecheck/TcFlatten.hs | 2 +- compiler/typecheck/TcInstDcls.hs | 2 +- compiler/typecheck/TcPat.hs | 4 +-- compiler/typecheck/TcTyDecls.hs | 2 +- compiler/typecheck/TcType.hs | 6 ++-- compiler/types/FamInstEnv.hs | 2 +- compiler/types/OptCoercion.hs | 4 +-- compiler/types/TyCoRep.hs | 70 ++++++++++++++++++---------------------- compiler/types/Type.hs | 10 +++--- 18 files changed, 64 insertions(+), 72 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 5dcae88bd0df440abe78c3d793d21aca6236fc25 From git at git.haskell.org Wed Jan 27 15:19:52 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Jan 2016 15:19:52 +0000 (UTC) Subject: [commit: ghc] master: Fix cost-centre-stack bug when creating new PAP (#5654) (85daac5) Message-ID: <20160127151952.84B7F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/85daac593c498f581d46f44982ee5dcf1001f611/ghc >--------------------------------------------------------------- commit 85daac593c498f581d46f44982ee5dcf1001f611 Author: Simon Marlow Date: Thu Jan 21 09:45:52 2016 +0000 Fix cost-centre-stack bug when creating new PAP (#5654) See comment in `AutoApply.h`. This partly fixes #5654. New test added, and renamed the old test to match the ticket number. >--------------------------------------------------------------- 85daac593c498f581d46f44982ee5dcf1001f611 rts/AutoApply.h | 12 +++++++++ testsuite/tests/profiling/should_run/T5654.hs | 14 +++++++++++ .../{scc004.prof.sample => T5654.prof.sample} | 0 .../profiling/should_run/T5654b-O0.prof.sample | 29 ++++++++++++++++++++++ .../profiling/should_run/T5654b-O1.prof.sample | 28 +++++++++++++++++++++ testsuite/tests/profiling/should_run/T5654b.hs | 22 ++++++++++++++++ testsuite/tests/profiling/should_run/all.T | 12 ++++++++- testsuite/tests/profiling/should_run/scc004.hs | 10 -------- 8 files changed, 116 insertions(+), 11 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 85daac593c498f581d46f44982ee5dcf1001f611 From git at git.haskell.org Wed Jan 27 15:19:55 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Jan 2016 15:19:55 +0000 (UTC) Subject: [commit: ghc] master: Remote GHCi: create cost centre stacks in batches (a496f82) Message-ID: <20160127151955.3FF4E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a496f82d5684f3025a60877600e82f0b29736e85/ghc >--------------------------------------------------------------- commit a496f82d5684f3025a60877600e82f0b29736e85 Author: Simon Marlow Date: Thu Jan 21 09:46:13 2016 +0000 Remote GHCi: create cost centre stacks in batches Towards optimising the binary serialisation that -fexternal-interpreter does, this saves quite a bit of time when using -fexternal-interpreter with -prof. >--------------------------------------------------------------- a496f82d5684f3025a60877600e82f0b29736e85 compiler/deSugar/Coverage.hs | 22 +++++++--------------- compiler/ghci/GHCi.hs | 11 +++++------ libraries/ghci/GHCi/Message.hs | 16 +++++++--------- libraries/ghci/GHCi/Run.hs | 19 +++++++++++-------- 4 files changed, 30 insertions(+), 38 deletions(-) diff --git a/compiler/deSugar/Coverage.hs b/compiler/deSugar/Coverage.hs index 9b7c873..56eb96d 100644 --- a/compiler/deSugar/Coverage.hs +++ b/compiler/deSugar/Coverage.hs @@ -158,26 +158,18 @@ mkCCSArray :: HscEnv -> Module -> Int -> [MixEntry_] -> IO (Array BreakIndex (RemotePtr GHC.Stack.CCS.CostCentre)) mkCCSArray hsc_env modul count entries = do - if interpreterProfiled (hsc_dflags hsc_env) + if interpreterProfiled dflags then do - let module_bs = fastStringToByteString (moduleNameFS (moduleName modul)) - c_module <- GHCi.mallocData hsc_env (module_bs `B.snoc` 0) - -- NB. null-terminate the string - costcentres <- - mapM (mkCostCentre hsc_env (castRemotePtr c_module)) entries + let module_str = moduleNameString (moduleName modul) + costcentres <- GHCi.mkCostCentres hsc_env module_str (map mk_one entries) return (listArray (0,count-1) costcentres) else do return (listArray (0,-1) []) where - mkCostCentre - :: HscEnv - -> RemotePtr CChar - -> MixEntry_ - -> IO (RemotePtr GHC.Stack.CCS.CostCentre) - mkCostCentre hsc_env at HscEnv{..} c_module (srcspan, decl_path, _, _) = do - let name = concat (intersperse "." decl_path) - src = showSDoc hsc_dflags (ppr srcspan) - GHCi.mkCostCentre hsc_env c_module name src + dflags = hsc_dflags hsc_env + mk_one (srcspan, decl_path, _, _) = (name, src) + where name = concat (intersperse "." decl_path) + src = showSDoc dflags (ppr srcspan) #endif diff --git a/compiler/ghci/GHCi.hs b/compiler/ghci/GHCi.hs index 08285a8..c54090c 100644 --- a/compiler/ghci/GHCi.hs +++ b/compiler/ghci/GHCi.hs @@ -13,7 +13,7 @@ module GHCi , evalString , evalStringToIOString , mallocData - , mkCostCentre + , mkCostCentres , costCentreStackInfo , newBreakArray , enableBreakpoint @@ -65,7 +65,6 @@ import Data.Binary import Data.ByteString (ByteString) import Data.IORef import Foreign -import Foreign.C import GHC.Stack.CCS (CostCentre,CostCentreStack) import System.Exit import Data.Maybe @@ -253,10 +252,10 @@ evalStringToIOString hsc_env fhv str = do mallocData :: HscEnv -> ByteString -> IO (RemotePtr ()) mallocData hsc_env bs = iservCmd hsc_env (MallocData bs) -mkCostCentre - :: HscEnv -> RemotePtr CChar -> String -> String -> IO (RemotePtr CostCentre) -mkCostCentre hsc_env c_module name src = - iservCmd hsc_env (MkCostCentre c_module name src) +mkCostCentres + :: HscEnv -> String -> [(String,String)] -> IO [RemotePtr CostCentre] +mkCostCentres hsc_env mod ccs = + iservCmd hsc_env (MkCostCentres mod ccs) costCentreStackInfo :: HscEnv -> RemotePtr CostCentreStack -> IO [String] diff --git a/libraries/ghci/GHCi/Message.hs b/libraries/ghci/GHCi/Message.hs index a22767a..bdb1a9f 100644 --- a/libraries/ghci/GHCi/Message.hs +++ b/libraries/ghci/GHCi/Message.hs @@ -32,7 +32,6 @@ import qualified Data.ByteString.Lazy as LB import Data.Dynamic import Data.IORef import Data.Map (Map) -import Foreign.C import GHC.Generics import GHC.Stack.CCS import qualified Language.Haskell.TH as TH @@ -122,12 +121,11 @@ data Message a where :: HValueRef {- IO a -} -> Message (EvalResult ()) - -- | Create a CostCentre - MkCostCentre - :: RemotePtr CChar -- module, RemotePtr so it can be shared - -> String -- name - -> String -- SrcSpan - -> Message (RemotePtr CostCentre) + -- | Create a set of CostCentres with the same module name + MkCostCentres + :: String -- module, RemotePtr so it can be shared + -> [(String,String)] -- (name, SrcSpan) + -> Message [RemotePtr CostCentre] -- | Show a 'CostCentreStack' as a @[String]@ CostCentreStackInfo @@ -334,7 +332,7 @@ getMessage = do 21 -> Msg <$> (EvalString <$> get) 22 -> Msg <$> (EvalStringToString <$> get <*> get) 23 -> Msg <$> (EvalIO <$> get) - 24 -> Msg <$> (MkCostCentre <$> get <*> get <*> get) + 24 -> Msg <$> (MkCostCentres <$> get <*> get) 25 -> Msg <$> (CostCentreStackInfo <$> get) 26 -> Msg <$> (NewBreakArray <$> get) 27 -> Msg <$> (EnableBreakpoint <$> get <*> get <*> get) @@ -389,7 +387,7 @@ putMessage m = case m of EvalString val -> putWord8 21 >> put val EvalStringToString str val -> putWord8 22 >> put str >> put val EvalIO val -> putWord8 23 >> put val - MkCostCentre mod name src -> putWord8 24 >> put mod >> put name >> put src + MkCostCentres mod ccs -> putWord8 24 >> put mod >> put ccs CostCentreStackInfo ptr -> putWord8 25 >> put ptr NewBreakArray sz -> putWord8 26 >> put sz EnableBreakpoint arr ix b -> putWord8 27 >> put arr >> put ix >> put b diff --git a/libraries/ghci/GHCi/Run.hs b/libraries/ghci/GHCi/Run.hs index 5951d9b..780ff3e 100644 --- a/libraries/ghci/GHCi/Run.hs +++ b/libraries/ghci/GHCi/Run.hs @@ -59,8 +59,7 @@ run m = case m of EvalString r -> evalString r EvalStringToString r s -> evalStringToString r s EvalIO r -> evalIO r - MkCostCentre mod name src -> - toRemotePtr <$> mkCostCentre (fromRemotePtr mod) name src + MkCostCentres mod ccs -> mkCostCentres mod ccs CostCentreStackInfo ptr -> ccsToStrings (fromRemotePtr ptr) NewBreakArray sz -> mkRemoteRef =<< newBreakArray sz EnableBreakpoint ref ix b -> do @@ -324,17 +323,21 @@ mkString bs = B.unsafeUseAsCStringLen bs $ \(cstr,len) -> do copyBytes ptr cstr len return (castRemotePtr (toRemotePtr ptr)) -mkCostCentre :: Ptr CChar -> String -> String -> IO (Ptr CostCentre) +mkCostCentres :: String -> [(String,String)] -> IO [RemotePtr CostCentre] #if defined(PROFILING) -mkCostCentre c_module decl_path srcspan = do - c_name <- newCString decl_path - c_srcspan <- newCString srcspan - c_mkCostCentre c_name c_module c_srcspan +mkCostCentres mod ccs = do + c_module <- newCString mod + mapM (mk_one c_module) ccs + where + mk_one c_module (decl_path,srcspan) = do + c_name <- newCString decl_path + c_srcspan <- newCString srcspan + toRemotePtr <$> c_mkCostCentre c_name c_module c_srcspan foreign import ccall unsafe "mkCostCentre" c_mkCostCentre :: Ptr CChar -> Ptr CChar -> Ptr CChar -> IO (Ptr CostCentre) #else -mkCostCentre _ _ _ = return nullPtr +mkCostCentres _ _ = return [] #endif getIdValFromApStack :: HValue -> Int -> IO (Maybe HValue) From git at git.haskell.org Wed Jan 27 15:19:57 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Jan 2016 15:19:57 +0000 (UTC) Subject: [commit: ghc] master: Update profiling test output (71b1183) Message-ID: <20160127151957.E1ABC3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/71b1183df946543b6c0a50ff2320e2a04b934540/ghc >--------------------------------------------------------------- commit 71b1183df946543b6c0a50ff2320e2a04b934540 Author: Simon Marlow Date: Wed Jan 27 08:20:01 2016 +0000 Update profiling test output There were a couple of broken profiling tests. >--------------------------------------------------------------- 71b1183df946543b6c0a50ff2320e2a04b934540 .../tests/profiling/should_run/T2552.prof.sample | 51 +++++++++++----------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/testsuite/tests/profiling/should_run/T2552.prof.sample b/testsuite/tests/profiling/should_run/T2552.prof.sample index ea6b5ec..3eea44a 100644 --- a/testsuite/tests/profiling/should_run/T2552.prof.sample +++ b/testsuite/tests/profiling/should_run/T2552.prof.sample @@ -1,36 +1,37 @@ - Thu Apr 2 20:30 2015 Time and Allocation Profiling Report (Final) + Wed Jan 27 08:12 2016 Time and Allocation Profiling Report (Final) T2552 +RTS -hc -p -RTS - total time = 0.09 secs (92 ticks @ 1000 us, 1 processor) - total alloc = 123,466,304 bytes (excludes profiling overheads) + total time = 0.01 secs (5 ticks @ 1000 us, 1 processor) + total alloc = 123,466,024 bytes (excludes profiling overheads) COST CENTRE MODULE %time %alloc -fib1.fib1'.nfib Main 34.8 33.3 -fib2'.nfib Main 34.8 33.3 -fib3'.nfib Main 30.4 33.3 +fib1.fib1'.nfib Main 80.0 33.3 +MAIN MAIN 20.0 0.0 +fib2'.nfib Main 0.0 33.3 +fib3'.nfib Main 0.0 33.3 individual inherited COST CENTRE MODULE no. entries %time %alloc %time %alloc -MAIN MAIN 98 0 0.0 0.0 100.0 100.0 - main Main 197 0 0.0 0.0 0.0 0.0 - CAF Main 195 0 0.0 0.0 100.0 100.0 - main Main 196 1 0.0 0.0 100.0 100.0 - fib3 Main 205 1 0.0 0.0 30.4 33.3 - fib3' Main 206 1 0.0 0.0 30.4 33.3 - fib3'.nfib Main 207 1028457 30.4 33.3 30.4 33.3 - fib2 Main 202 1 0.0 0.0 34.8 33.3 - fib2' Main 203 1 0.0 0.0 34.8 33.3 - fib2'.nfib Main 204 1028457 34.8 33.3 34.8 33.3 - fib1 Main 198 1 0.0 0.0 34.8 33.3 - fib1.fib1' Main 199 1 0.0 0.0 34.8 33.3 - nfib' Main 200 1 0.0 0.0 34.8 33.3 - fib1.fib1'.nfib Main 201 1028457 34.8 33.3 34.8 33.3 - CAF GHC.Conc.Signal 177 0 0.0 0.0 0.0 0.0 - CAF GHC.IO.Encoding 161 0 0.0 0.0 0.0 0.0 - CAF GHC.IO.Encoding.Iconv 159 0 0.0 0.0 0.0 0.0 - CAF GHC.IO.Handle.FD 150 0 0.0 0.0 0.0 0.0 - CAF GHC.IO.Handle.Text 148 0 0.0 0.0 0.0 0.0 +MAIN MAIN 105 0 20.0 0.0 100.0 100.0 + main Main 211 0 0.0 0.0 0.0 0.0 + CAF Main 209 0 0.0 0.0 80.0 100.0 + main Main 210 1 0.0 0.0 80.0 100.0 + fib3' Main 220 1 0.0 0.0 0.0 33.3 + fib3'.nfib Main 221 1028457 0.0 33.3 0.0 33.3 + fib3 Main 219 1 0.0 0.0 0.0 0.0 + fib2 Main 216 1 0.0 0.0 0.0 33.3 + fib2' Main 217 1 0.0 0.0 0.0 33.3 + fib2'.nfib Main 218 1028457 0.0 33.3 0.0 33.3 + fib1 Main 212 1 0.0 0.0 80.0 33.3 + fib1.fib1' Main 213 1 0.0 0.0 80.0 33.3 + nfib' Main 214 1 0.0 0.0 80.0 33.3 + fib1.fib1'.nfib Main 215 1028457 80.0 33.3 80.0 33.3 + CAF GHC.Conc.Signal 203 0 0.0 0.0 0.0 0.0 + CAF GHC.IO.Encoding 193 0 0.0 0.0 0.0 0.0 + CAF GHC.IO.Encoding.Iconv 191 0 0.0 0.0 0.0 0.0 + CAF GHC.IO.Handle.FD 183 0 0.0 0.0 0.0 0.0 + CAF GHC.IO.Handle.Text 181 0 0.0 0.0 0.0 0.0 From git at git.haskell.org Wed Jan 27 16:57:36 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 27 Jan 2016 16:57:36 +0000 (UTC) Subject: [commit: ghc] master: fix validate breakage (0d5ddad) Message-ID: <20160127165736.826033A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/0d5ddad900257a1a31658e5d9fc4be6648462588/ghc >--------------------------------------------------------------- commit 0d5ddad900257a1a31658e5d9fc4be6648462588 Author: Simon Marlow Date: Wed Jan 27 08:57:44 2016 -0800 fix validate breakage (Travis said it was OK!) >--------------------------------------------------------------- 0d5ddad900257a1a31658e5d9fc4be6648462588 compiler/deSugar/Coverage.hs | 2 -- 1 file changed, 2 deletions(-) diff --git a/compiler/deSugar/Coverage.hs b/compiler/deSugar/Coverage.hs index 56eb96d..ef21f5c 100644 --- a/compiler/deSugar/Coverage.hs +++ b/compiler/deSugar/Coverage.hs @@ -13,8 +13,6 @@ import GHCi.RemoteTypes import Data.Array import ByteCodeTypes import GHC.Stack.CCS -import Foreign.C -import qualified Data.ByteString as B #endif import Type import HsSyn From git at git.haskell.org Thu Jan 28 11:47:43 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 28 Jan 2016 11:47:43 +0000 (UTC) Subject: [commit: ghc] master: Use the in_scope set in lint_app (63700a1) Message-ID: <20160128114743.E4EF53A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/63700a193557ed63a1da18a6a059cb7ec5596796/ghc >--------------------------------------------------------------- commit 63700a193557ed63a1da18a6a059cb7ec5596796 Author: Bartosz Nitka Date: Wed Jan 27 11:59:02 2016 -0800 Use the in_scope set in lint_app This makes the call to `substTy` satisfy the invariant from Note [The substitution invariant] in TyCoRep. Test Plan: ./validate --slow Reviewers: goldfire, austin, bgamari, simonpj Reviewed By: simonpj Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1861 GHC Trac Issues: #11371 >--------------------------------------------------------------- 63700a193557ed63a1da18a6a059cb7ec5596796 compiler/coreSyn/CoreLint.hs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/compiler/coreSyn/CoreLint.hs b/compiler/coreSyn/CoreLint.hs index f0f2764..26e7257 100644 --- a/compiler/coreSyn/CoreLint.hs +++ b/compiler/coreSyn/CoreLint.hs @@ -1136,25 +1136,28 @@ lint_app :: SDoc -> LintedKind -> [(LintedType,LintedKind)] -> LintM Kind -- If you edit this function, you may need to update the GHC formalism -- See Note [GHC Formalism] lint_app doc kfn kas - = foldlM go_app kfn kas + = do { in_scope <- getInScope + -- We need the in_scope set to satisfy the invariant in + -- Note [The substitution invariant] in TyCoRep + ; foldlM (go_app in_scope) kfn kas } where fail_msg = vcat [ hang (text "Kind application error in") 2 doc , nest 2 (text "Function kind =" <+> ppr kfn) , nest 2 (text "Arg kinds =" <+> ppr kas) ] - go_app kfn ka + go_app in_scope kfn ka | Just kfn' <- coreView kfn - = go_app kfn' ka + = go_app in_scope kfn' ka - go_app (ForAllTy (Anon kfa) kfb) (_,ka) + go_app _ (ForAllTy (Anon kfa) kfb) (_,ka) = do { unless (ka `eqType` kfa) (addErrL fail_msg) ; return kfb } - go_app (ForAllTy (Named kv _vis) kfn) (ta,ka) + go_app in_scope (ForAllTy (Named kv _vis) kfn) (ta,ka) = do { unless (ka `eqType` tyVarKind kv) (addErrL fail_msg) - ; return (substTyWith [kv] [ta] kfn) } + ; return (substTyWithInScope in_scope [kv] [ta] kfn) } - go_app _ _ = failWithL fail_msg + go_app _ _ _ = failWithL fail_msg {- ********************************************************************* * * From git at git.haskell.org Thu Jan 28 14:56:04 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 28 Jan 2016 14:56:04 +0000 (UTC) Subject: [commit: ghc] wip/gadtpm: Overhaul the Overhauled Pattern Match Checker (30a4631) Message-ID: <20160128145604.70E463A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/gadtpm Link : http://ghc.haskell.org/trac/ghc/changeset/30a4631a4796bdf8a9b7da9dd1d24360ed763f7a/ghc >--------------------------------------------------------------- commit 30a4631a4796bdf8a9b7da9dd1d24360ed763f7a Author: George Karachalias Date: Thu Jan 28 14:39:39 2016 +0100 Overhaul the Overhauled Pattern Match Checker * Changed the representation of Value Set Abstractions. Instead of using a prefix tree, we now use a list of Value Vector Abstractions. The set of constraints Delta for every Value Vector Abstraction is the oracle state so that we solve everything only once. * Instead of doing everything lazily, we prune at once (and in general everything is much stricter). Hence, an example written with pattern guards is checked in almost the same time as the equivalent with pattern matching. * Do not store the covered and the divergent sets at all. Since what we only need is a yes/no (does this clause cover anything? Does it force any thunk?) We just keep a boolean for each. * Removed flags `-Wtoo-many-guards` and `-ffull-guard-reasoning`. Replaced with `fmax-pmcheck-iterations=n`. Still debatable what should the default `n` be. * When a guard is for sure not going to contribute anything, we treat it as such: The oracle is not called and cases `CGuard`, `UGuard` and `DGuard` from the paper are not happening at all (the generation of a fresh variable, the unfolding of the pattern list etc.). his combined with the above seems to be enough to drop the memory increase for test T783 down to 18.7%. * Added testcases T11195, T11303b (data families) and T11374 The patch addresses: #11195, #11276, #11303, #11374, #11162 >--------------------------------------------------------------- 30a4631a4796bdf8a9b7da9dd1d24360ed763f7a compiler/deSugar/Check.hs | 1139 ++++++++------------ compiler/deSugar/DsMonad.hs | 36 +- compiler/deSugar/Match.hs | 13 +- compiler/deSugar/TmOracle.hs | 18 +- compiler/ghci/RtClosureInspect.hs | 3 - compiler/main/DynFlags.hs | 12 +- compiler/nativeGen/Dwarf/Constants.hs | 4 - compiler/typecheck/TcRnTypes.hs | 3 +- compiler/types/OptCoercion.hs | 4 +- docs/users_guide/8.0.1-notes.rst | 9 - docs/users_guide/bugs.rst | 10 - docs/users_guide/using-warnings.rst | 34 - libraries/base/Foreign/C/Error.hs | 1 - testsuite/tests/pmcheck/should_compile/T11195.hs | 189 ++++ testsuite/tests/pmcheck/should_compile/T11303b.hs | 25 + testsuite/tests/pmcheck/should_compile/T11374.hs | 59 + .../tests/pmcheck/should_compile/T2204.stderr | 6 +- .../tests/pmcheck/should_compile/T9951b.stderr | 6 +- testsuite/tests/pmcheck/should_compile/all.T | 3 + .../tests/pmcheck/should_compile/pmc001.stderr | 12 +- .../tests/pmcheck/should_compile/pmc007.stderr | 12 +- utils/mkUserGuidePart/Options/Warnings.hs | 13 - 22 files changed, 801 insertions(+), 810 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 30a4631a4796bdf8a9b7da9dd1d24360ed763f7a From git at git.haskell.org Thu Jan 28 14:56:07 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 28 Jan 2016 14:56:07 +0000 (UTC) Subject: [commit: ghc] wip/gadtpm: Mainly some top-level comments (3b6f7c8) Message-ID: <20160128145607.2F70E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/gadtpm Link : http://ghc.haskell.org/trac/ghc/changeset/3b6f7c868d9e38b84c03b88931d58a037c0d82b2/ghc >--------------------------------------------------------------- commit 3b6f7c868d9e38b84c03b88931d58a037c0d82b2 Author: George Karachalias Date: Thu Jan 28 15:48:10 2016 +0100 Mainly some top-level comments >--------------------------------------------------------------- 3b6f7c868d9e38b84c03b88931d58a037c0d82b2 compiler/deSugar/Check.hs | 66 ++++++++++++++++++++++++++++++++++++--------- compiler/deSugar/DsMonad.hs | 5 +++- 2 files changed, 58 insertions(+), 13 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 3b6f7c868d9e38b84c03b88931d58a037c0d82b2 From git at git.haskell.org Thu Jan 28 14:56:09 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 28 Jan 2016 14:56:09 +0000 (UTC) Subject: [commit: ghc] wip/gadtpm's head updated: Mainly some top-level comments (3b6f7c8) Message-ID: <20160128145609.ABF173A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Branch 'wip/gadtpm' now includes: 4c4a0a5 Fix docstring GHC.IO.Handle.FD.openFileBLocking 4c11db6 sphinx-build: fix python stack overflow (Trac #10950) b617e9f Improve comments in CmmSwitch 85e147e Always run test T9407 36b174d Add expected stderr for #11466 test case adb721b Make a constraint synonym for repeated BinaryStringRep and use it. 835a2a2 Default non-canonical CallStack constraints 2df4221 Add tests for #11465 and the kind invariant 9048c3d Don't print "Loaded GHCi configuration" message in ghc -e (#11478) 65881c0 Mark some ghci tests as req_interp 6e5f828 Fix a formatting error in the user's guide 4d51bfc Do not count void arguments when considering a function for loopification. b01288d rts: Disable tick timer unless really needed 4e04043 Add test for Trac #11056 f42db15 Remove unused IND_PERM 06c2547 Small doc fix 7cd37c5 Give a more verbose error message when desugaring a HsTypeOut 8e9a870 Remove -Wredundant-superclasses from standard warnings 1be8491 mkUserGuidePart: Better flag cross-referencing 6f96109 user-guide: Reformat warning lists b5e52bf user-guide: Fix typos ec87788 Don't add ticks around type applications (#11329) 923d215 user-guide: Document -L RTS flag 89bdac7 Add test for #11473 8b5ea7c User's guide: fix singular/plural typo in flagnames 98d6a29 Docs: delete section on Hierarchical Modules edc68b2 Remove `replaceDynFlags` from `ContainsDynFlags` 2c6fe5b Add -fwarn-redundant-constrains to test for #9708 fd6dd41 Implement `-Wnoncanonical-monadfail-instances` warning ff21795 Special-case implicit params in superclass expansion 746764c Refactor validity checking for type/data instances 42c6263 Avoid recursive use of immSuperClasses f7e0e5f Improve tracing in checkValidInstance 3c060f3 Fix exprIsHNF (Trac #11248) 5c82333 Show error message for unknown symbol on Elf_Rel platforms edb30fd Comments only: more alternate names for ARM registers [skip ci] bc1e085 HscTypes: Fix typo in comment 132c208 Rename -Wmissing-monadfail-instance to plural-form 6e2658f Better document behavior of -Wmissed-specialisations 128b678 user-guide: Note order-dependence of flags f0f63b3 Implement -Wunrecognised-warning-flag 9fe7d20 Ensure that we don't produce code for pre-ARMv7 without barriers 632f020 Less verbose output for the in-scope set cf788a5 White space only 47b3f58 Add "ticks-exhausted" comment 1c6d70c Kill off zipTopTCvSubst in favour of zipOpenTCvSubst 016a0bd Fix two cloning-related bugs 34c9a4e Missed plural renaming in user's guide 5f5dc86 Minor users-guide markup fixup [skip ci] 9b71695 Update transformers submodule to 0.5.1.0 release f1885df Update process submodule to 1.4.2.0 release 3798b2a Fix three broken tests involving exceptions 01809bc Pass InScopeSet to substTy in lintTyApp e24a9b5 Nicer error on +RTS -hc without -rtsopts or -prof 6d2bdfd Fix segmentation fault when .prof file not writeable 6817703 Split off -Wunused-type-variables from -Wunused-matches 144ddb4 Construct in_scope set in mkTopTCvSubst eeb67c9 Testsuite: fixup req_profiling tests (#11496) e2bdf03 Build profiling libraries on `validate --slow` (#11496) 44a5d51 Enable RemoteGHCi on Windows 45fd83b Fix a typo in the note name in comments 448ea97 Typos in comments 1f6d142 ghci: fix trac issue #11481 1c6130d rts/Timer: Actually fix #9105 0dc7b36 Restore original alignment for info tables 0d92d9c Use stage1 build variables when building the RTS d50609e Test for undef bugs in the LLVM backend when validating 45c6fbc Document -fllvm-fill-undef-with-garbage 4faa1a6 s/unLifted/unlifted for consistency 2899aa5 Fix some substitution InScopeSets 00cbbab Refactor the typechecker to use ExpTypes. 5dcae88 Rename "open" subst functions 85daac5 Fix cost-centre-stack bug when creating new PAP (#5654) a496f82 Remote GHCi: create cost centre stacks in batches 71b1183 Update profiling test output 0d5ddad fix validate breakage 30a4631 Overhaul the Overhauled Pattern Match Checker 3b6f7c8 Mainly some top-level comments From git at git.haskell.org Thu Jan 28 18:10:06 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 28 Jan 2016 18:10:06 +0000 (UTC) Subject: [commit: ghc] branch 'wip/rwbarton-align4' created Message-ID: <20160128181006.3C4FD3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/rwbarton-align4 Referencing: d03a0ae909fb99da60ba345019632386e87525b0 From git at git.haskell.org Thu Jan 28 18:10:08 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 28 Jan 2016 18:10:08 +0000 (UTC) Subject: [commit: ghc] wip/rwbarton-align4: Try aligning info tables to 4 bytes (d03a0ae) Message-ID: <20160128181008.F21853A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/rwbarton-align4 Link : http://ghc.haskell.org/trac/ghc/changeset/d03a0ae909fb99da60ba345019632386e87525b0/ghc >--------------------------------------------------------------- commit d03a0ae909fb99da60ba345019632386e87525b0 Author: Reid Barton Date: Thu Jan 28 13:10:42 2016 -0500 Try aligning info tables to 4 bytes >--------------------------------------------------------------- d03a0ae909fb99da60ba345019632386e87525b0 compiler/nativeGen/X86/Ppr.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/nativeGen/X86/Ppr.hs b/compiler/nativeGen/X86/Ppr.hs index 7809ae1..301c44b 100644 --- a/compiler/nativeGen/X86/Ppr.hs +++ b/compiler/nativeGen/X86/Ppr.hs @@ -109,7 +109,7 @@ pprBasicBlock info_env (BasicBlock blockid instrs) maybe_infotable = case mapLookup blockid info_env of Nothing -> empty Just (Statics info_lbl info) -> - pprAlignForSection Text $$ + text ".align 4" $$ infoTableLoc $$ vcat (map pprData info) $$ pprLabel info_lbl From git at git.haskell.org Fri Jan 29 04:27:24 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 29 Jan 2016 04:27:24 +0000 (UTC) Subject: [commit: ghc] master: Fixup test for #10728 (1b72534) Message-ID: <20160129042724.C41B83A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/1b72534b99ea17012746ef97b4892a7c9c3450dd/ghc >--------------------------------------------------------------- commit 1b72534b99ea17012746ef97b4892a7c9c3450dd Author: Thomas Miedema Date: Fri Jan 29 05:19:46 2016 +0100 Fixup test for #10728 It was failing for WAY=ghci. >--------------------------------------------------------------- 1b72534b99ea17012746ef97b4892a7c9c3450dd testsuite/tests/rts/T10728.hs | 16 ++++++---------- testsuite/tests/rts/all.T | 4 ++-- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/testsuite/tests/rts/T10728.hs b/testsuite/tests/rts/T10728.hs index ff005fa..a7c3d79 100644 --- a/testsuite/tests/rts/T10728.hs +++ b/testsuite/tests/rts/T10728.hs @@ -4,13 +4,13 @@ module Main where import GHC.Conc (getNumProcessors, getNumCapabilities) import GHC.Environment -import Data.Char +import Data.List main :: IO () main = do -- We're parsing args passed in to make sure things are proper between the -- cli and the program. - n <- getN + n <- getN <$> getFullArgs c <- getNumCapabilities p <- getNumProcessors @@ -30,11 +30,7 @@ check n c p check _n _c _p = "maxN Error" -- Parsing ``-maxN`` from Args to be sure of it. -getN :: IO Int -getN = getFullArgs >>= return . go - where - go :: [String] -> Int - go as = case reads ( - dropWhile (not . isDigit) . (!! 2) $ as ) :: [(Int, String)] of - [x] -> fst x - _ -> 0 +getN :: [String] -> Int +getN args = case filter (isPrefixOf "-maxN") (reverse args) of + (maxN:_) -> read (drop 5 maxN) + _ -> error "Please pass `-maxN` on command-line" diff --git a/testsuite/tests/rts/all.T b/testsuite/tests/rts/all.T index 951acbe..5aa296a 100644 --- a/testsuite/tests/rts/all.T +++ b/testsuite/tests/rts/all.T @@ -333,5 +333,5 @@ test('T10590', [ignore_output, when(opsys('mingw32'),skip)], compile_and_run, [' test('T10904', [ omit_ways(['ghci']), extra_run_opts('20000') ], compile_and_run, ['T10904lib.c']) -test('T10728', [extra_run_opts('+RTS -maxN3 -RTS'), req_smp], - compile_and_run, ['-threaded']) +test('T10728', [extra_run_opts('+RTS -maxN3 -RTS'), only_ways(['threaded2'])], + compile_and_run, ['']) From git at git.haskell.org Fri Jan 29 04:27:27 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 29 Jan 2016 04:27:27 +0000 (UTC) Subject: [commit: ghc] master: Mark dynamic-paper as expect_fail_for optasm and optllvm (#11330) (61e4d6b) Message-ID: <20160129042727.7A8143A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/61e4d6b10e06e820d976137b223b1f4f6dbed2a6/ghc >--------------------------------------------------------------- commit 61e4d6b10e06e820d976137b223b1f4f6dbed2a6 Author: Thomas Miedema Date: Fri Jan 29 04:05:15 2016 +0100 Mark dynamic-paper as expect_fail_for optasm and optllvm (#11330) It passes with `-O -fhpc` though, strange... (I didn't read the paper) >--------------------------------------------------------------- 61e4d6b10e06e820d976137b223b1f4f6dbed2a6 testsuite/tests/dependent/should_compile/all.T | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/testsuite/tests/dependent/should_compile/all.T b/testsuite/tests/dependent/should_compile/all.T index 4509072..571a9fb 100644 --- a/testsuite/tests/dependent/should_compile/all.T +++ b/testsuite/tests/dependent/should_compile/all.T @@ -10,7 +10,10 @@ test('RaeBlogPost', normal, compile, ['']) test('mkGADTVars', normal, compile, ['']) test('TypeLevelVec',normal,compile, ['']) test('T9632', normal, compile, ['']) -test('dynamic-paper', normal, compile, ['']) +# Simon says in #11330: The "simplifier ticks exhausted" error is expected; +# see Section 7 of the paper: +# http://research.microsoft.com/en-us/um/people/simonpj/papers/haskell-dynamic/ +test('dynamic-paper', expect_fail_for(['optasm', 'optllvm']), compile, ['']) test('T11311', normal, compile, ['']) test('T11405', normal, compile, ['']) From git at git.haskell.org Fri Jan 29 04:33:32 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 29 Jan 2016 04:33:32 +0000 (UTC) Subject: [commit: ghc] master: Fix the Windows build (d3b7db0) Message-ID: <20160129043332.4397A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d3b7db04620d92ff993a14a9ad6ebf9d74c74cd2/ghc >--------------------------------------------------------------- commit d3b7db04620d92ff993a14a9ad6ebf9d74c74cd2 Author: Thomas Miedema Date: Fri Jan 29 05:32:38 2016 +0100 Fix the Windows build >--------------------------------------------------------------- d3b7db04620d92ff993a14a9ad6ebf9d74c74cd2 compiler/ghci/GHCi.hs | 1 + rts/ProfHeap.c | 2 +- rts/Profiling.c | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/compiler/ghci/GHCi.hs b/compiler/ghci/GHCi.hs index c54090c..2e2cd35 100644 --- a/compiler/ghci/GHCi.hs +++ b/compiler/ghci/GHCi.hs @@ -70,6 +70,7 @@ import System.Exit import Data.Maybe import GHC.IO.Handle.Types (Handle) #ifdef mingw32_HOST_OS +import Foreign.C import GHC.IO.Handle.FD (fdToHandle) #else import System.Posix as Posix diff --git a/rts/ProfHeap.c b/rts/ProfHeap.c index 187116f..a7ea3eb 100644 --- a/rts/ProfHeap.c +++ b/rts/ProfHeap.c @@ -515,7 +515,7 @@ fprint_ccs(FILE *fp, CostCentreStack *ccs, nat max_length) return; } - fprintf(fp, "(%ld)", ccs->ccsID); + fprintf(fp, "(%" FMT_Int ")", ccs->ccsID); p = buf; buf_end = buf + max_length + 1; diff --git a/rts/Profiling.c b/rts/Profiling.c index c67b081..4f2606c 100644 --- a/rts/Profiling.c +++ b/rts/Profiling.c @@ -951,7 +951,7 @@ logCCS(CostCentreStack *ccs, nat indent, max_module_len - strlen_utf8(cc->module), ""); fprintf(prof_file, - " %*ld %11" FMT_Word64 " %5.1f %5.1f %5.1f %5.1f", + " %*" FMT_Int "%11" FMT_Word64 " %5.1f %5.1f %5.1f %5.1f", max_id_len, ccs->ccsID, ccs->scc_count, total_prof_ticks == 0 ? 0.0 : ((double)ccs->time_ticks / (double)total_prof_ticks * 100.0), total_alloc == 0 ? 0.0 : ((double)ccs->mem_alloc / (double)total_alloc * 100.0), From git at git.haskell.org Fri Jan 29 04:46:21 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 29 Jan 2016 04:46:21 +0000 (UTC) Subject: [commit: ghc] master: Add closing parenthesis in comment for eqString (#11507) (0dd663b) Message-ID: <20160129044621.27EA83A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/0dd663ba9111d78be116480e2f75bc272f3adc90/ghc >--------------------------------------------------------------- commit 0dd663ba9111d78be116480e2f75bc272f3adc90 Author: Thomas Miedema Date: Fri Jan 29 05:46:08 2016 +0100 Add closing parenthesis in comment for eqString (#11507) Spotted by czipperz >--------------------------------------------------------------- 0dd663ba9111d78be116480e2f75bc272f3adc90 libraries/base/GHC/Base.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/base/GHC/Base.hs b/libraries/base/GHC/Base.hs index 1f989c4..89c9f63 100644 --- a/libraries/base/GHC/Base.hs +++ b/libraries/base/GHC/Base.hs @@ -965,7 +965,7 @@ eqString _ _ = False {-# RULES "eqString" (==) = eqString #-} -- eqString also has a BuiltInRule in PrelRules.lhs: --- eqString (unpackCString# (Lit s1)) (unpackCString# (Lit s2) = s1==s2 +-- eqString (unpackCString# (Lit s1)) (unpackCString# (Lit s2)) = s1==s2 ---------------------------------------------- From git at git.haskell.org Fri Jan 29 13:02:35 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 29 Jan 2016 13:02:35 +0000 (UTC) Subject: [commit: ghc] wip/gadtpm: Store a Name instead of an Id in PmExprVar (4a192a7) Message-ID: <20160129130235.688863A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/gadtpm Link : http://ghc.haskell.org/trac/ghc/changeset/4a192a7a1e0c4f7c7214b906f66ee805e5755d4d/ghc >--------------------------------------------------------------- commit 4a192a7a1e0c4f7c7214b906f66ee805e5755d4d Author: George Karachalias Date: Fri Jan 29 14:01:51 2016 +0100 Store a Name instead of an Id in PmExprVar Nice advice from Richard. >--------------------------------------------------------------- 4a192a7a1e0c4f7c7214b906f66ee805e5755d4d compiler/deSugar/Check.hs | 22 +++++++++++----------- compiler/deSugar/PmExpr.hs | 25 +++++++++++++------------ compiler/deSugar/TmOracle.hs | 16 +++++++++------- 3 files changed, 33 insertions(+), 30 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 4a192a7a1e0c4f7c7214b906f66ee805e5755d4d From git at git.haskell.org Fri Jan 29 13:49:25 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 29 Jan 2016 13:49:25 +0000 (UTC) Subject: [commit: ghc] master: Add release note about flexible RebindableSyntax (bc83c73) Message-ID: <20160129134925.32E4A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/bc83c733e58939e1ff0d5eea9dca359615203ea4/ghc >--------------------------------------------------------------- commit bc83c733e58939e1ff0d5eea9dca359615203ea4 Author: Richard Eisenberg Date: Wed Jan 27 10:55:17 2016 -0500 Add release note about flexible RebindableSyntax >--------------------------------------------------------------- bc83c733e58939e1ff0d5eea9dca359615203ea4 docs/users_guide/8.0.1-notes.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/users_guide/8.0.1-notes.rst b/docs/users_guide/8.0.1-notes.rst index b31223e..41e6c2b 100644 --- a/docs/users_guide/8.0.1-notes.rst +++ b/docs/users_guide/8.0.1-notes.rst @@ -54,6 +54,8 @@ The highlights, since the 7.10 branch, are: - A rewritten (and greatly improved) pattern exhaustiveness checker +- More flexible rebindable syntax + - GHC can run the interpreter in a separate process (see :ref:`external-interpreter`), and the interpreter can now run profiled code. @@ -137,6 +139,12 @@ Language - The :ghc-flag:`-XDeriveAnyClass` extension now fills in associated type family default instances when deriving a class that contains them. +- The :ghc-flag:`-XRebindableSyntax` feature is now much more flexible, imposing + fewer restrictions on the types of the rebindable syntax elements. For example, + your ``negate`` function may now return a different type than it accepts. + Rebindable syntax also supports higher-rank types fully, allowing types + like ``(>>=) :: m a -> (forall x. a x -> m b) -> m b``. + - Users can now define record pattern synonyms. This allows pattern synonyms to behave more like normal data constructors. For example, :: From git at git.haskell.org Fri Jan 29 16:18:23 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 29 Jan 2016 16:18:23 +0000 (UTC) Subject: [commit: ghc] wip/gadtpm: Simon says: Do not export dsPmWarn (cc0533c) Message-ID: <20160129161823.2ABAE3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/gadtpm Link : http://ghc.haskell.org/trac/ghc/changeset/cc0533c5a50b1c66ce39662c95e371d335023c5c/ghc >--------------------------------------------------------------- commit cc0533c5a50b1c66ce39662c95e371d335023c5c Author: George Karachalias Date: Fri Jan 29 17:18:36 2016 +0100 Simon says: Do not export dsPmWarn >--------------------------------------------------------------- cc0533c5a50b1c66ce39662c95e371d335023c5c compiler/deSugar/Check.hs | 60 +++++++++++++++++++++++++---------------------- compiler/deSugar/Match.hs | 5 ++-- 2 files changed, 34 insertions(+), 31 deletions(-) diff --git a/compiler/deSugar/Check.hs b/compiler/deSugar/Check.hs index 786a04b..0ae5a31 100644 --- a/compiler/deSugar/Check.hs +++ b/compiler/deSugar/Check.hs @@ -7,8 +7,8 @@ Pattern Matching Coverage Checking. {-# LANGUAGE CPP, GADTs, DataKinds, KindSignatures #-} module Check ( - -- Actual check and pretty printing - checkSingle, checkMatches, dsPmWarn, isAnyPmCheckEnabled, + -- Checking and printing + checkSingle, checkMatches, isAnyPmCheckEnabled, -- See Note [Type and Term Equality Propagation] genCaseTmCs1, genCaseTmCs2 @@ -142,12 +142,12 @@ type PmResult = ([[LPat Id]], Uncovered, [[LPat Id]]) -} -- | Check a single pattern binding (let) -checkSingle :: Id -> Pat Id -> DsM (Maybe PmResult) -checkSingle var p = do +checkSingle :: DynFlags -> DsMatchContext -> Id -> Pat Id -> DsM () +checkSingle dflags ctxt var p = do mb_pm_res <- tryM (checkSingle' var p) - return $ case mb_pm_res of - Left _ -> Nothing - Right res -> Just res + case mb_pm_res of + Left _ -> warnPmIters dflags ctxt + Right res -> dsPmWarn dflags ctxt res -- | Check a single pattern binding (let) checkSingle' :: Id -> Pat Id -> DsM PmResult @@ -163,12 +163,14 @@ checkSingle' var p = do (False, True ) -> ([], us, m) -- inaccessible rhs where m = [[noLoc p]] -checkMatches :: [Id] -> [LMatch Id (LHsExpr Id)] -> DsM (Maybe PmResult) -checkMatches vars matches = do +-- | Check a matchgroup (case, functions, etc.) +checkMatches :: DynFlags -> DsMatchContext + -> [Id] -> [LMatch Id (LHsExpr Id)] -> DsM () +checkMatches dflags ctxt vars matches = do mb_pm_res <- tryM (checkMatches' vars matches) - return $ case mb_pm_res of - Left _ -> Nothing - Right res -> Just res + case mb_pm_res of + Left _ -> warnPmIters dflags ctxt + Right res -> dsPmWarn dflags ctxt res -- | Check a matchgroup (case, functions, etc.) checkMatches' :: [Id] -> [LMatch Id (LHsExpr Id)] -> DsM PmResult @@ -1215,20 +1217,18 @@ wrapUpTmState :: TmState -> ([ComplexEq], PmVarEnv) wrapUpTmState (residual, (_, subst)) = (residual, flattenPmVarEnv subst) -- | Issue all the warnings (coverage, exhaustiveness, inaccessibility) -dsPmWarn :: DynFlags -> DsMatchContext -> DsM (Maybe PmResult) -> DsM () -dsPmWarn dflags ctx@(DsMatchContext kind loc) mPmResult +dsPmWarn :: DynFlags -> DsMatchContext -> PmResult -> DsM () +dsPmWarn dflags ctx@(DsMatchContext kind loc) pm_result = when (flag_i || flag_u) $ do - mb_pm_res <- mPmResult - case mb_pm_res of - Just (redundant, uncovered, inaccessible) -> do - let exists_r = flag_i && notNull redundant - exists_i = flag_i && notNull inaccessible - exists_u = flag_u && notNull uncovered - when exists_r $ putSrcSpanDs loc (warnDs (pprEqns redundant rmsg)) - when exists_i $ putSrcSpanDs loc (warnDs (pprEqns inaccessible imsg)) - when exists_u $ putSrcSpanDs loc (warnDs (pprEqnsU uncovered)) - Nothing -> warnPmIters ctx + let exists_r = flag_i && notNull redundant + exists_i = flag_i && notNull inaccessible + exists_u = flag_u && notNull uncovered + when exists_r $ putSrcSpanDs loc (warnDs (pprEqns redundant rmsg)) + when exists_i $ putSrcSpanDs loc (warnDs (pprEqns inaccessible imsg)) + when exists_u $ putSrcSpanDs loc (warnDs (pprEqnsU uncovered)) where + (redundant, uncovered, inaccessible) = pm_result + flag_i = wopt Opt_WarnOverlappingPatterns dflags flag_u = exhaustive dflags kind @@ -1248,10 +1248,11 @@ dsPmWarn dflags ctx@(DsMatchContext kind loc) mPmResult -- | Issue a warning when the predefined number of iterations is exceeded -- for the pattern match checker -warnPmIters :: DsMatchContext -> PmM () -warnPmIters (DsMatchContext kind loc) = do - iters <- maxPmCheckIterations <$> getDynFlags - putSrcSpanDs loc (warnDs (msg iters)) +warnPmIters :: DynFlags -> DsMatchContext -> PmM () +warnPmIters dflags (DsMatchContext kind loc) + = when (flag_i || flag_u) $ do + iters <- maxPmCheckIterations <$> getDynFlags + putSrcSpanDs loc (warnDs (msg iters)) where ctxt = pprMatchContext kind msg is = fsep [ text "Pattern match checker exceeded" @@ -1259,6 +1260,9 @@ warnPmIters (DsMatchContext kind loc) = do , text "(Use fmax-pmcheck-iterations=n" , text "to set the maximun number of iterations to n)" ] + flag_i = wopt Opt_WarnOverlappingPatterns dflags + flag_u = exhaustive dflags kind + dots :: [a] -> SDoc dots qs | qs `lengthExceeds` maximum_output = text "..." | otherwise = empty diff --git a/compiler/deSugar/Match.hs b/compiler/deSugar/Match.hs index bee454f..be089e6 100644 --- a/compiler/deSugar/Match.hs +++ b/compiler/deSugar/Match.hs @@ -696,8 +696,7 @@ matchWrapper ctxt mb_scr (MG { mg_alts = L _ matches -- See Note [Type and Term Equality Propagation] addTmCsDs (genCaseTmCs1 mb_scr new_vars) $ - dsPmWarn dflags (DsMatchContext ctxt locn) $ - checkMatches new_vars matches + checkMatches dflags (DsMatchContext ctxt locn) new_vars matches ; result_expr <- handleWarnings $ matchEquations ctxt new_vars eqns_info rhs_ty @@ -766,7 +765,7 @@ matchSinglePat (Var var) ctx pat ty match_result ; locn <- getSrcSpanDs ; let pat' = getMaybeStrictPat dflags pat -- pattern match check warnings - ; dsPmWarn dflags (DsMatchContext ctx locn) (checkSingle var pat') + ; checkSingle dflags (DsMatchContext ctx locn) var pat' ; match [var] ty [EqnInfo { eqn_pats = [pat'], eqn_rhs = match_result }] } From git at git.haskell.org Sat Jan 30 16:40:13 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 30 Jan 2016 16:40:13 +0000 (UTC) Subject: [commit: ghc] master: Add asserts to other substitution functions (bb956eb) Message-ID: <20160130164013.DE7DC3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/bb956eb8d8774613c1e311655f1359a91a84765b/ghc >--------------------------------------------------------------- commit bb956eb8d8774613c1e311655f1359a91a84765b Author: Bartosz Nitka Date: Wed Jan 27 08:37:30 2016 -0800 Add asserts to other substitution functions This adds asserts to `substTys`, `substCo` and `substCos` in the same spirit as already existing asserts on `substTy`, protecting every possible entry point to `subst_ty` and `subst_co`. I've replaced the violators with unchecked versions. Test Plan: ./validate --slow Reviewers: simonpj, goldfire, austin, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1862 GHC Trac Issues: #11371 >--------------------------------------------------------------- bb956eb8d8774613c1e311655f1359a91a84765b compiler/basicTypes/MkId.hs | 2 +- compiler/coreSyn/CoreLint.hs | 2 +- compiler/coreSyn/CoreUtils.hs | 2 +- compiler/deSugar/DsExpr.hs | 2 +- compiler/typecheck/FunDeps.hs | 2 +- compiler/typecheck/Inst.hs | 10 +- compiler/typecheck/TcExpr.hs | 6 +- compiler/typecheck/TcSMonad.hs | 2 +- compiler/typecheck/TcType.hs | 5 +- compiler/types/Coercion.hs | 6 +- compiler/types/OptCoercion.hs | 2 +- compiler/types/TyCoRep.hs | 232 +++++++++++++++++++++++++++++++++-------- compiler/types/Type.hs | 19 ++-- 13 files changed, 222 insertions(+), 70 deletions(-) Diff suppressed because of size. To see it, use: git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc bb956eb8d8774613c1e311655f1359a91a84765b From git at git.haskell.org Sat Jan 30 20:10:53 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 30 Jan 2016 20:10:53 +0000 (UTC) Subject: [commit: ghc] master: Define CTYPE for more Posix types (6c7760b) Message-ID: <20160130201053.6209B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/6c7760b26133a0490f613895a37ff67045249fc8/ghc >--------------------------------------------------------------- commit 6c7760b26133a0490f613895a37ff67045249fc8 Author: Herbert Valerio Riedel Date: Sat Jan 30 18:50:17 2016 +0100 Define CTYPE for more Posix types See also b9f636b3aa962154c1b1515a3acecfbe9071b308 for explaination, as `unix` is slowly migrating to make more use of CApiFFI we need more accurately annotated CTYPES. >--------------------------------------------------------------- 6c7760b26133a0490f613895a37ff67045249fc8 libraries/base/System/Posix/Internals.hs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/libraries/base/System/Posix/Internals.hs b/libraries/base/System/Posix/Internals.hs index 1074a2c..ceac5ff 100644 --- a/libraries/base/System/Posix/Internals.hs +++ b/libraries/base/System/Posix/Internals.hs @@ -62,18 +62,18 @@ puts s = withCAStringLen (s ++ "\n") $ \(p, len) -> do -- --------------------------------------------------------------------------- -- Types -type CFLock = () +data {-# CTYPE "struct flock" #-} CFLock data {-# CTYPE "struct group" #-} CGroup -type CLconv = () -type CPasswd = () -type CSigaction = () +data {-# CTYPE "struct lconv" #-} CLconv +data {-# CTYPE "struct passwd" #-} CPasswd +data {-# CTYPE "struct sigaction" #-} CSigaction data {-# CTYPE "sigset_t" #-} CSigset -type CStat = () -type CTermios = () -type CTm = () -type CTms = () -type CUtimbuf = () -type CUtsname = () +data {-# CTYPE "struct stat" #-} CStat +data {-# CTYPE "struct termios" #-} CTermios +data {-# CTYPE "struct tm" #-} CTm +data {-# CTYPE "struct tms" #-} CTms +data {-# CTYPE "struct utimbuf" #-} CUtimbuf +data {-# CTYPE "struct utsname" #-} CUtsname type FD = CInt From git at git.haskell.org Sat Jan 30 23:54:52 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 30 Jan 2016 23:54:52 +0000 (UTC) Subject: [commit: ghc] master: Update unix submodule to latest snapshot (2fbf370) Message-ID: <20160130235452.E65903A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/2fbf370b953634716d3c0ad7020c29f06fdd68f4/ghc >--------------------------------------------------------------- commit 2fbf370b953634716d3c0ad7020c29f06fdd68f4 Author: Herbert Valerio Riedel Date: Sun Jan 31 00:53:11 2016 +0100 Update unix submodule to latest snapshot This is a follow-up to 6c7760b26133a0490f613895a37ff67045249fc8 which should have been accompanied by a submodule update... >--------------------------------------------------------------- 2fbf370b953634716d3c0ad7020c29f06fdd68f4 libraries/unix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/unix b/libraries/unix index 4f3b5d8..91b8238 160000 --- a/libraries/unix +++ b/libraries/unix @@ -1 +1 @@ -Subproject commit 4f3b5d8b87eef07d8df62a8d7240830bb81a8a6b +Subproject commit 91b82383873b46385d239f2b059f353b11f07e0f From git at git.haskell.org Sun Jan 31 15:01:31 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 31 Jan 2016 15:01:31 +0000 (UTC) Subject: [commit: ghc] master: Put docs in /usr/share/doc/ghc- (b61f5f7) Message-ID: <20160131150131.3341F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/b61f5f734d08fe9cdca3ac06560fc15e97aa77ab/ghc >--------------------------------------------------------------- commit b61f5f734d08fe9cdca3ac06560fc15e97aa77ab Author: Thomas Miedema Date: Fri Jan 29 20:30:47 2016 +0100 Put docs in /usr/share/doc/ghc- `make install` puts libraries in a direcory containing the version number. Do the same for the docs, such that multiple installs can live side-by-side. Delete unused ghcdocdir. Test Plan: ``` ./boot ./configure make show! VALUE=docdir ``` Reviewed by: bgamari Differential Revision: https://phabricator.haskell.org/D1868 GHC Trac Issues: #11354 >--------------------------------------------------------------- b61f5f734d08fe9cdca3ac06560fc15e97aa77ab mk/install.mk.in | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/mk/install.mk.in b/mk/install.mk.in index e404397..aa3afea 100644 --- a/mk/install.mk.in +++ b/mk/install.mk.in @@ -40,7 +40,7 @@ # # NOTE: The default e.g. ${docdir} above means that autoconf substitutes the # string "${docdir}", not the value of docdir! This is crucial for the GNU -# coding standards. +# coding standards. See Trac #1924. define set_default # $1 = variable to set @@ -52,9 +52,6 @@ $1 = $2 endif endef -# This gets used in the default docdir when autoconf >= 2.60 is used -PACKAGE_TARNAME = @PACKAGE_TARNAME@ - prefix = @prefix@ datarootdir = @datarootdir@ @@ -67,8 +64,10 @@ libdir = @libdir@ includedir = @includedir@ mandir = @mandir@ +# Note that `./configure --docdir=/foo/bar` should work. docdir = @docdir@ -$(eval $(call set_default,docdir,$${datarootdir}/doc/ghc)) +PACKAGE_TARNAME = ghc-${ProjectVersion} +$(eval $(call set_default,docdir,$${datarootdir}/doc/$${PACKAGE_TARNAME})) htmldir = @htmldir@ dvidir = @dvidir@ @@ -94,14 +93,12 @@ pdfdir = $(docdir) psdir = $(docdir) ghclibdir = $(libdir) -ghcdocdir = $(datarootdir)/doc else # Unix: override libdir and datadir to put ghc-specific stuff in # a subdirectory with the version number included. ghclibdir = $(libdir)/$(CrossCompilePrefix)ghc-$(ProjectVersion) -ghcdocdir = $(datarootdir)/doc/ghc endif ghclibexecdir = $(ghclibdir) From git at git.haskell.org Sun Jan 31 18:36:04 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 31 Jan 2016 18:36:04 +0000 (UTC) Subject: [commit: ghc] master: Properly track live registers when saving the CCCS. (6544f8d) Message-ID: <20160131183604.AB87A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/6544f8de1ed575378f14b82a2eaa06cab58b2d65/ghc >--------------------------------------------------------------- commit 6544f8de1ed575378f14b82a2eaa06cab58b2d65 Author: Geoffrey Mainland Date: Thu Jan 28 09:58:37 2016 -0500 Properly track live registers when saving the CCCS. Summary: When saving the CCCS, we now correctly track the set of live registers and pass them to the jump_SAVE_CCCS macro. This is now a variadic macro, but variadic macros are supported by GCC since 3.0 and by all versions of clang, so this should not be a problem. Test Plan: ./validate with the following build options: ``` BuildFlavour = quick-llvm SRC_HC_OPTS_STAGE1 = -fllvm-fill-undef-with-garbage ``` Reviewers: bgamari, simonmar, austin, rwbarton, simonpj Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1864 GHC Trac Issues: #11487 >--------------------------------------------------------------- 6544f8de1ed575378f14b82a2eaa06cab58b2d65 rts/AutoApply.h | 6 +++--- utils/genapply/Main.hs | 29 ++++++++++++++++++++++++++--- 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/rts/AutoApply.h b/rts/AutoApply.h index 7c8af93..4e441ca 100644 --- a/rts/AutoApply.h +++ b/rts/AutoApply.h @@ -90,13 +90,13 @@ // Jump to target, saving CCCS and restoring it on return #if defined(PROFILING) -#define jump_SAVE_CCCS(target) \ +#define jump_SAVE_CCCS(target,...) \ Sp(-1) = CCCS; \ Sp(-2) = stg_restore_cccs_info; \ Sp_adj(-2); \ - jump (target) [R1] + jump (target) [__VA_ARGS__] #else -#define jump_SAVE_CCCS(target) jump (target) [R1] +#define jump_SAVE_CCCS(target,...) jump (target) [__VA_ARGS__] #endif #endif /* APPLY_H */ diff --git a/utils/genapply/Main.hs b/utils/genapply/Main.hs index 58bee53..b8208ae 100644 --- a/utils/genapply/Main.hs +++ b/utils/genapply/Main.hs @@ -157,7 +157,28 @@ mkJump :: RegStatus -- Registerised status -> [ArgRep] -- Jump arguments -> Doc mkJump regstatus jump live args = - text "jump" <+> jump <+> brackets (hcat (punctuate comma (map text regs))) + text "jump" <+> jump <+> brackets (hcat (punctuate comma liveRegs)) + where + liveRegs = mkJumpLiveRegs regstatus live args + +-- Make a jump, saving CCCS and restoring it on return +mkJumpSaveCCCS :: RegStatus -- Registerised status + -> Doc -- Jump target + -> [Reg] -- Registers that are definitely live + -> [ArgRep] -- Jump arguments + -> Doc +mkJumpSaveCCCS regstatus jump live args = + text "jump_SAVE_CCCS" <> parens (hcat (punctuate comma (jump : liveRegs))) + where + liveRegs = mkJumpLiveRegs regstatus live args + +-- Calculate live registers for a jump +mkJumpLiveRegs :: RegStatus -- Registerised status + -> [Reg] -- Registers that are definitely live + -> [ArgRep] -- Jump arguments + -> [Doc] +mkJumpLiveRegs regstatus live args = + map text regs where (reg_locs, _, _) = assignRegs regstatus 0 args regs = (nub . sort) (live ++ map fst reg_locs) @@ -318,7 +339,8 @@ genMkPAP regstatus macro jump live ticker disamb else empty, if is_fun_case then mb_tag_node arity else empty, if overflow_regs - then text "jump_SAVE_CCCS" <> parens (text jump) <> semi + then mkJumpSaveCCCS + regstatus (text jump) live (take arity args) <> semi else mkJump regstatus (text jump) live (if no_load_regs then [] else args) <> semi ]) $$ text "}" @@ -740,7 +762,8 @@ genApply regstatus args = -- overwritten by an indirection, so we must enter the original -- info pointer we read, don't read it again, because it might -- not be enterable any more. - text "jump_SAVE_CCCS(%ENTRY_CODE(info));", + mkJumpSaveCCCS + regstatus (text "%ENTRY_CODE(info)") ["R1"] args <> semi, -- see Note [jump_SAVE_CCCS] text "" ]), From git at git.haskell.org Sun Jan 31 18:36:07 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 31 Jan 2016 18:36:07 +0000 (UTC) Subject: [commit: ghc] master: Add type signatures. (4d0e4fe) Message-ID: <20160131183607.5D1A43A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/4d0e4fe66892f6700c2bcd4ddcd1d1a837c38a56/ghc >--------------------------------------------------------------- commit 4d0e4fe66892f6700c2bcd4ddcd1d1a837c38a56 Author: Geoffrey Mainland Date: Thu Jan 28 09:58:28 2016 -0500 Add type signatures. >--------------------------------------------------------------- 4d0e4fe66892f6700c2bcd4ddcd1d1a837c38a56 utils/genapply/Main.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/utils/genapply/Main.hs b/utils/genapply/Main.hs index d01b025..50904ea 100644 --- a/utils/genapply/Main.hs +++ b/utils/genapply/Main.hs @@ -580,6 +580,7 @@ argRep V32 = text "V32_" argRep V64 = text "V64_" argRep _ = text "W_" +genApply :: RegStatus -> [ArgRep] -> Doc genApply regstatus args = let fun_ret_label = mkApplyRetName args @@ -776,6 +777,7 @@ genApply regstatus args = -- ----------------------------------------------------------------------------- -- Making a fast unknown application, args are in regs +genApplyFast :: RegStatus -> [ArgRep] -> Doc genApplyFast regstatus args = let fun_fast_label = mkApplyFastName args From git at git.haskell.org Sun Jan 31 18:36:10 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 31 Jan 2016 18:36:10 +0000 (UTC) Subject: [commit: ghc] master: Code formatting cleanup. (90f688e) Message-ID: <20160131183610.100FA3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/90f688e892427b1894b6aacb1f8de8d2e41ecb56/ghc >--------------------------------------------------------------- commit 90f688e892427b1894b6aacb1f8de8d2e41ecb56 Author: Geoffrey Mainland Date: Thu Jan 28 10:34:53 2016 -0500 Code formatting cleanup. >--------------------------------------------------------------- 90f688e892427b1894b6aacb1f8de8d2e41ecb56 utils/genapply/Main.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/utils/genapply/Main.hs b/utils/genapply/Main.hs index 50904ea..58bee53 100644 --- a/utils/genapply/Main.hs +++ b/utils/genapply/Main.hs @@ -157,10 +157,10 @@ mkJump :: RegStatus -- Registerised status -> [ArgRep] -- Jump arguments -> Doc mkJump regstatus jump live args = - text "jump " <> jump <+> brackets (hcat (punctuate comma (map text regs))) + text "jump" <+> jump <+> brackets (hcat (punctuate comma (map text regs))) where - (reg_locs, _, _) = assignRegs regstatus 0 args - regs = (nub . sort) (live ++ map fst reg_locs) + (reg_locs, _, _) = assignRegs regstatus 0 args + regs = (nub . sort) (live ++ map fst reg_locs) -- make a ptr/non-ptr bitmap from a list of argument types mkBitmap :: [ArgRep] -> Word32 From git at git.haskell.org Sun Jan 31 18:36:12 2016 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 31 Jan 2016 18:36:12 +0000 (UTC) Subject: [commit: ghc] master: Fix Trac issue #11487. (669cbef) Message-ID: <20160131183612.C3CCB3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/669cbef03c220de43b0f88f2b2238bf3c02ed64c/ghc >--------------------------------------------------------------- commit 669cbef03c220de43b0f88f2b2238bf3c02ed64c Merge: b61f5f7 6544f8d Author: Geoffrey Mainland Date: Sun Jan 31 13:35:41 2016 -0500 Fix Trac issue #11487. >--------------------------------------------------------------- 669cbef03c220de43b0f88f2b2238bf3c02ed64c rts/AutoApply.h | 6 +++--- utils/genapply/Main.hs | 35 ++++++++++++++++++++++++++++++----- 2 files changed, 33 insertions(+), 8 deletions(-)