From git at git.haskell.org Wed Jul 1 11:45:41 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 1 Jul 2015 11:45:41 +0000 (UTC) Subject: [commit: ghc] wip/impredicativity: Add lazy instantiation for type classes (d58e17d) Message-ID: <20150701114541.6DF283A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/impredicativity Link : http://ghc.haskell.org/trac/ghc/changeset/d58e17d2fbae2d424ae5af918fc43c1dafd4cce6/ghc >--------------------------------------------------------------- commit d58e17d2fbae2d424ae5af918fc43c1dafd4cce6 Author: Alejandro Serrano Date: Wed Jul 1 13:40:43 2015 +0200 Add lazy instantiation for type classes This commit implements the instantiation of type variables when they appear in both in an InstanceOf constraint and as an argument of a type class constraint that must be inspected to know whether an instance applies. For example, given Eq alpha and InstanceOf (forall b. [b]) alpha, the solver will now instantiate alpha to [beta], for a new beta variabe. The core of the changes are found in two places: - compiler/types/Unify.hs, where the matching procedure is enhanced to take some extra "lazy equations". These are equations of the form type variable ~ type which are available to be used if we do not know yet whether a match is successful over that type variable. At the end, the matching process returns which of the lazy equations were used, from which we can extract information to add the extra instantiations to the set of constraints. - compiler/typecheck/TcInteract.hs generates lazy equations from the InstanceOf constraints in the inert set, and passes them to the matching procedure. The rest of files had to be changed mostly to accomodate the new interface of the matching functions. >--------------------------------------------------------------- d58e17d2fbae2d424ae5af918fc43c1dafd4cce6 compiler/specialise/Rules.hs | 11 ++- compiler/typecheck/FamInst.hs | 8 +- compiler/typecheck/Inst.hs | 4 +- compiler/typecheck/TcBinds.hs | 13 ++- compiler/typecheck/TcErrors.hs | 10 +-- compiler/typecheck/TcInteract.hs | 89 ++++++++++++++------- compiler/typecheck/TcSMonad.hs | 44 ++++++---- compiler/typecheck/TcSimplify.hs | 8 +- compiler/typecheck/TcTyClsDecls.hs | 13 +-- compiler/typecheck/TcValidity.hs | 6 +- compiler/types/Coercion.hs | 10 ++- compiler/types/FamInstEnv.hs | 105 +++++++++++++----------- compiler/types/InstEnv.hs | 58 ++++++++------ compiler/types/Unify.hs | 111 ++++++++++++++++++-------- compiler/vectorise/Vectorise/Monad/InstEnv.hs | 4 +- compiler/vectorise/Vectorise/Utils/Base.hs | 2 +- 16 files changed, 308 insertions(+), 188 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 d58e17d2fbae2d424ae5af918fc43c1dafd4cce6 From git at git.haskell.org Wed Jul 1 12:30:10 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 1 Jul 2015 12:30:10 +0000 (UTC) Subject: [commit: ghc] wip/impredicativity: Small optimizations to desugaring of InstanceOf constraints (b425c3f) Message-ID: <20150701123010.66F473A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/impredicativity Link : http://ghc.haskell.org/trac/ghc/changeset/b425c3f0311e93abdfbbed03ff99e275ccc6e8f1/ghc >--------------------------------------------------------------- commit b425c3f0311e93abdfbbed03ff99e275ccc6e8f1 Author: Alejandro Serrano Date: Wed Jul 1 14:30:46 2015 +0200 Small optimizations to desugaring of InstanceOf constraints >--------------------------------------------------------------- b425c3f0311e93abdfbbed03ff99e275ccc6e8f1 compiler/deSugar/DsBinds.hs | 26 ++++++++++++++++++++++---- compiler/typecheck/TcBinds.hs | 3 --- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/compiler/deSugar/DsBinds.hs b/compiler/deSugar/DsBinds.hs index 9d4d875..0d55a83 100644 --- a/compiler/deSugar/DsBinds.hs +++ b/compiler/deSugar/DsBinds.hs @@ -37,6 +37,7 @@ import CoreUnfold import CoreFVs import UniqSupply import Digraph +import Pair import PrelNames import TysPrim ( mkProxyPrimTy ) @@ -801,6 +802,12 @@ dsHsWrapper (WpCast co) e = ASSERT(tcCoercionRole co == Representational) dsHsWrapper (WpEvLam ev) e = return $ Lam ev e dsHsWrapper (WpTyLam tv) e = return $ Lam tv e dsHsWrapper (WpEvApp tm) e = liftM (App e) (dsEvTerm tm) +dsHsWrapper (WpEvRevApp tm@(EvInstanceOf _ _)) e + = do { coreTm <- dsEvTerm tm + ; case splitFunTy_maybe (exprType coreTm) of + -- Do not generate instantiation if type remains the same + Just (ty1, ty2) | ty1 == ty2 -> return e + _ -> return (mkCoreApp coreTm e) } dsHsWrapper (WpEvRevApp tm) e = liftM (flip mkCoreApp e) (dsEvTerm tm) -------------------------------------- @@ -1154,21 +1161,32 @@ Maybe simpleOpt should be smarter. But it seems like a good plan to simply never generate the redundant box/unbox in the first place. -} +-- In order to get a smaller term to simplify, +-- we apply a direct simplification at this point, +-- removing all identity coercions and instantiations. dsEvInstanceOf :: Type -> EvInstanceOf -> DsM CoreExpr dsEvInstanceOf _ (EvInstanceOfVar v) = return (Var v) dsEvInstanceOf ty (EvInstanceOfEq co) = do { bndr <- newSysLocalDs ty - ; expr <- dsTcCoercion co (\c -> mkCast (Var bndr) (mkSubCo c)) + ; expr <- dsTcCoercion co $ \c -> + case coercionKind c of + Pair ty1 ty2 | ty1 == ty2 -> Var bndr + _ -> mkCast (Var bndr) (mkSubCo c) ; return (mkCoreLams [bndr] expr) } dsEvInstanceOf ty (EvInstanceOfInst qvars co qs) = do { bndr <- newSysLocalDs ty ; qs' <- mapM dsEvTerm qs ; let exprTy = mkCoreApps (Var bndr) (map Type qvars) exprEv = mkCoreApps exprTy qs' - ; return (mkCoreLams [bndr] (mkCoreApp (Var co) exprEv)) } + inner = case splitFunTy_maybe (exprType (Var co)) of + Just (ty1, ty2) | ty1 == ty2 -> exprEv + _ -> mkCoreApp (Var co) exprEv + ; return (mkCoreLams [bndr] inner) } dsEvInstanceOf ty (EvInstanceOfLet tyvars qvars qs rest) = do { bndr <- newSysLocalDs ty ; q_binds <- dsTcEvBinds qs - ; return (mkCoreLams (bndr : tyvars ++ qvars) $ - mkCoreLets q_binds (mkCoreApp (Var rest) (Var bndr))) } + ; let inner = case splitFunTy_maybe (exprType (Var rest)) of + Just (ty1, ty2) | ty1 == ty2 -> Var bndr + _ -> mkCoreApp (Var rest) (Var bndr) + ; return $ mkCoreLams (bndr : tyvars ++ qvars) (mkCoreLets q_binds inner) } diff --git a/compiler/typecheck/TcBinds.hs b/compiler/typecheck/TcBinds.hs index 40cf535..6fe2a25 100644 --- a/compiler/typecheck/TcBinds.hs +++ b/compiler/typecheck/TcBinds.hs @@ -428,9 +428,6 @@ tc_single top_lvl sig_fn prag_fn lbind thing_inside = do { (binds1, ids) <- tcPolyBinds top_lvl sig_fn prag_fn NonRecursive NonRecursive [lbind] - ; traceTc "tc_single/binds" (ppr binds1) - ; traceTc "tc_single/ids" (ppr ids) - ; traceTc "tc_single/ids_types" (ppr (map idType ids)) ; let uids = map (\x -> (x, choose_tc_id_flavour x)) ids ; thing <- tcExtendLetEnv top_lvl uids thing_inside ; return (binds1, thing) } From git at git.haskell.org Wed Jul 1 14:33:09 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 1 Jul 2015 14:33:09 +0000 (UTC) Subject: [commit: ghc] wip/gadtpm: Several changes towards correct guard reasoning (avoid EquationInfo) (f4cf68a) Message-ID: <20150701143309.C5A1D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/gadtpm Link : http://ghc.haskell.org/trac/ghc/changeset/f4cf68a3cceb7f00b2dbe7f769261c6774fa65fa/ghc >--------------------------------------------------------------- commit f4cf68a3cceb7f00b2dbe7f769261c6774fa65fa Author: George Karachalias Date: Wed Jul 1 14:45:34 2015 +0200 Several changes towards correct guard reasoning (avoid EquationInfo) * Splitted check into checkSingle (let) and checkMatches (matchgroups) * Made `initial_uncovered' monadic * Added `translateMatches' to replace `translateEqnInfo' * Process a list of guards: process_guards * Added utility functions: splitUniqSupply3, splitUniqSupply4 >--------------------------------------------------------------- f4cf68a3cceb7f00b2dbe7f769261c6774fa65fa compiler/deSugar/Check.hs | 139 ++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 128 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 f4cf68a3cceb7f00b2dbe7f769261c6774fa65fa From git at git.haskell.org Wed Jul 1 14:33:13 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 1 Jul 2015 14:33:13 +0000 (UTC) Subject: [commit: ghc] wip/gadtpm: Put the term oracle in a separate file (45f7b8d) Message-ID: <20150701143313.358093A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/gadtpm Link : http://ghc.haskell.org/trac/ghc/changeset/45f7b8d0030a8911883c39b150a024796cbc2284/ghc >--------------------------------------------------------------- commit 45f7b8d0030a8911883c39b150a024796cbc2284 Author: George Karachalias Date: Wed Jul 1 16:33:36 2015 +0200 Put the term oracle in a separate file >--------------------------------------------------------------- 45f7b8d0030a8911883c39b150a024796cbc2284 compiler/deSugar/Check.hs | 535 +------------------------------------------ compiler/deSugar/TmOracle.hs | 535 +++++++++++++++++++++++++++++++++++++++++++ compiler/ghc.cabal.in | 1 + 3 files changed, 539 insertions(+), 532 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 45f7b8d0030a8911883c39b150a024796cbc2284 From git at git.haskell.org Thu Jul 2 06:07:58 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 2 Jul 2015 06:07:58 +0000 (UTC) Subject: [commit: ghc] master: disable check for .init_array section on OpenBSD (bbf6078) Message-ID: <20150702060758.BA5883A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/bbf607865323f7d8dbd37dbfa2ae705fafb22417/ghc >--------------------------------------------------------------- commit bbf607865323f7d8dbd37dbfa2ae705fafb22417 Author: Karel Gardas Date: Wed Jul 1 00:02:52 2015 +0200 disable check for .init_array section on OpenBSD Summary: The patch disables check for .init_array section on OpenBSD. It is provided in OpenBSD ports tree and was done by Matthias Kilian. Reviewers: austin Subscribers: thomie, bgamari Differential Revision: https://phabricator.haskell.org/D1023 >--------------------------------------------------------------- bbf607865323f7d8dbd37dbfa2ae705fafb22417 rts/Linker.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rts/Linker.c b/rts/Linker.c index 2437e83..1b91e2f 100644 --- a/rts/Linker.c +++ b/rts/Linker.c @@ -5304,13 +5304,13 @@ static int getSectionKind_ELF( Elf_Shdr *hdr, int *is_bss ) /* .rodata-style section */ return SECTIONKIND_CODE_OR_RODATA; } - +#ifndef openbsd_HOST_OS if (hdr->sh_type == SHT_INIT_ARRAY && (hdr->sh_flags & SHF_ALLOC) && (hdr->sh_flags & SHF_WRITE)) { /* .init_array section */ return SECTIONKIND_INIT_ARRAY; } - +#endif /* not OpenBSD */ if (hdr->sh_type == SHT_NOBITS && (hdr->sh_flags & SHF_ALLOC) && (hdr->sh_flags & SHF_WRITE)) { /* .bss-style section */ From git at git.haskell.org Thu Jul 2 07:30:35 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 2 Jul 2015 07:30:35 +0000 (UTC) Subject: [commit: ghc] wip/impredicativity: Fix problems with type var flavour discrimination (fd3c060) Message-ID: <20150702073035.0901D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/impredicativity Link : http://ghc.haskell.org/trac/ghc/changeset/fd3c060b8a7c62e85b597360d38f76bd4389353f/ghc >--------------------------------------------------------------- commit fd3c060b8a7c62e85b597360d38f76bd4389353f Author: Alejandro Serrano Date: Thu Jul 2 09:31:10 2015 +0200 Fix problems with type var flavour discrimination >--------------------------------------------------------------- fd3c060b8a7c62e85b597360d38f76bd4389353f compiler/typecheck/TcBinds.hs | 17 ++++++++--------- compiler/typecheck/TcInteract.hs | 29 ++++++++++++++--------------- 2 files changed, 22 insertions(+), 24 deletions(-) diff --git a/compiler/typecheck/TcBinds.hs b/compiler/typecheck/TcBinds.hs index 6fe2a25..4c95286 100644 --- a/compiler/typecheck/TcBinds.hs +++ b/compiler/typecheck/TcBinds.hs @@ -311,7 +311,7 @@ tcValBinds top_lvl binds sigs thing_inside -- declared with complete type signatures -- Do not extend the TcIdBinderStack; instead -- we extend it on a per-rhs basis in tcExtendForRhs - ; tcExtendLetEnvIds top_lvl [( idName id, id, TcIdUnrestricted) | id <- poly_ids] $ do + ; tcExtendLetEnvIds top_lvl [(idName id, id, choose_tc_id_flavour id) | id <- poly_ids] $ do { (binds', (extra_binds', thing)) <- tcBindGroups top_lvl sig_fn prag_fn binds $ do { thing <- thing_inside -- See Note [Pattern synonym builders don't yield dependencies] @@ -387,7 +387,7 @@ tc_group top_lvl sig_fn prag_fn (Recursive, binds) thing_inside go :: [SCC (LHsBind Name)] -> TcM (LHsBinds TcId, thing) go (scc:sccs) = do { (binds1, ids1) <- tc_scc scc - ; let uids1 = map (\x -> (x, TcIdUnrestricted)) ids1 + ; let uids1 = map (\x -> (x, choose_tc_id_flavour x)) ids1 ; (binds2, thing) <- tcExtendLetEnv top_lvl uids1 $ go sccs ; return (binds1 `unionBags` binds2, thing) } @@ -431,12 +431,11 @@ tc_single top_lvl sig_fn prag_fn lbind thing_inside ; let uids = map (\x -> (x, choose_tc_id_flavour x)) ids ; thing <- tcExtendLetEnv top_lvl uids thing_inside ; return (binds1, thing) } - where - choose_tc_id_flavour v - | Just _ <- tcGetTyVar_maybe (idType v) - = TcIdMonomorphic - | otherwise - = TcIdUnrestricted + + +choose_tc_id_flavour v + | Just _ <- tcGetTyVar_maybe (idType v) = TcIdMonomorphic + | otherwise = TcIdUnrestricted -- | No signature or a partial signature noCompleteSig :: Maybe TcSigInfo -> Bool @@ -1304,7 +1303,7 @@ tcMonoBinds _ sig_fn no_gen binds -- Bring the monomorphic Ids, into scope for the RHSs ; let mono_info = getMonoBindInfo tc_binds - rhs_id_env = [(name, mono_id, TcIdMonomorphic) + rhs_id_env = [(name, mono_id, choose_tc_id_flavour mono_id) | (name, mb_sig, mono_id) <- mono_info , noCompleteSig mb_sig ] -- A monomorphic binding for each term variable that lacks diff --git a/compiler/typecheck/TcInteract.hs b/compiler/typecheck/TcInteract.hs index c4e7593..52a0d96 100644 --- a/compiler/typecheck/TcInteract.hs +++ b/compiler/typecheck/TcInteract.hs @@ -1735,24 +1735,23 @@ matchClassInst dflags _ clas tys loc ; (tys, theta) <- instDFunType dfun_id mb_inst_tys ; return $ GenInst theta (EvDFunApp dfun_id tys) so eqs } - inerts_to_lazy_eqs :: Cts -> TcS (LazyEqs [TcPredType]) - inerts_to_lazy_eqs = flatMapBagM $ \ct -> - case (ctEvidence ct, classifyPredType (ctPred ct)) of - (CtWanted { }, InstanceOfPred lhs rhs) - | Just _ <- getTyVar_maybe lhs - -- InstanceOf var sigma --> var ~ sigma - -> return $ unitBag (lhs, rhs, [mkTcEqPredRole Nominal lhs rhs]) - | Just _ <- getTyVar_maybe rhs - -- InstanceOf sigma var -> instantiate sigma - -> do { (_qvars, q, ty) <- splitInst lhs - ; return $ unitBag (rhs, ty, mkTcEqPredRole Nominal rhs ty : q) } - | otherwise - -> pprPanic "malformed irred InstanceOf" (ppr (ctPred ct)) - _ -> return noLazyEqs - extract_lazy_eqs :: LazyEqs [TcPredType] -> [TcPredType] extract_lazy_eqs leqs = concatMap (\(_,_,qs) -> qs) (bagToList leqs) +inerts_to_lazy_eqs :: Cts -> TcS (LazyEqs [TcPredType]) +inerts_to_lazy_eqs = flatMapBagM $ \ct -> + case (ctEvidence ct, classifyPredType (ctPred ct)) of + (CtWanted { }, InstanceOfPred lhs rhs) + | Just _ <- getTyVar_maybe lhs + -- InstanceOf var sigma --> var ~ sigma + -> return $ unitBag (lhs, rhs, [mkTcEqPredRole Nominal lhs rhs]) + | Just _ <- getTyVar_maybe rhs + -- InstanceOf sigma var -> instantiate sigma + -> do { (_qvars, q, ty) <- splitInst lhs + ; return $ unitBag (rhs, ty, mkTcEqPredRole Nominal ty rhs : q) } + | otherwise + -> pprPanic "malformed irred InstanceOf" (ppr (ctPred ct)) + _ -> return noLazyEqs {- Note [Instance and Given overlap] From git at git.haskell.org Thu Jul 2 07:43:24 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 2 Jul 2015 07:43:24 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Comments only (3f7494e) Message-ID: <20150702074324.F38513A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/3f7494ebf797eb9314424f56e2b9ad336cfa2e18/ghc >--------------------------------------------------------------- commit 3f7494ebf797eb9314424f56e2b9ad336cfa2e18 Author: Simon Peyton Jones Date: Thu Jul 2 08:43:58 2015 +0100 Comments only >--------------------------------------------------------------- 3f7494ebf797eb9314424f56e2b9ad336cfa2e18 compiler/basicTypes/FieldLabel.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compiler/basicTypes/FieldLabel.hs b/compiler/basicTypes/FieldLabel.hs index 34d07f4..cfcb05a 100644 --- a/compiler/basicTypes/FieldLabel.hs +++ b/compiler/basicTypes/FieldLabel.hs @@ -71,8 +71,9 @@ type FieldLabel = FieldLbl Name -- | Fields in an algebraic record type data FieldLbl a = FieldLabel { - flLabel :: FieldLabelString, -- ^ Label of the field - flIsOverloaded :: Bool, -- ^ Is this field overloaded? + flLabel :: FieldLabelString, -- ^ User-visible label of the field + flIsOverloaded :: Bool, -- ^ Was AllowDuplicateRecordFields on + -- in the defining module for this datatype? flSelector :: a -- ^ Record selector function } deriving (Functor, Foldable, Traversable) From git at git.haskell.org Thu Jul 2 08:27:20 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 2 Jul 2015 08:27:20 +0000 (UTC) Subject: [commit: ghc] master: ghc-pkg: use read/writeUTF8File from Cabal (9aa0e4b) Message-ID: <20150702082720.E5AA03A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/9aa0e4b23d074af44363236fb0f120f07c6e0067/ghc >--------------------------------------------------------------- commit 9aa0e4b23d074af44363236fb0f120f07c6e0067 Author: Thomas Miedema Date: Sat Jun 13 16:44:18 2015 +0200 ghc-pkg: use read/writeUTF8File from Cabal Use writeUTF8File and readUTF8File from Distribution.Simple.Utils, instead of our own buggy copies. Refactoring only. >--------------------------------------------------------------- 9aa0e4b23d074af44363236fb0f120f07c6e0067 utils/ghc-pkg/Main.hs | 58 +++------------------------------------------------ 1 file changed, 3 insertions(+), 55 deletions(-) diff --git a/utils/ghc-pkg/Main.hs b/utils/ghc-pkg/Main.hs index a83720b..6133017 100644 --- a/utils/ghc-pkg/Main.hs +++ b/utils/ghc-pkg/Main.hs @@ -22,7 +22,7 @@ import Distribution.ParseUtils import Distribution.Package hiding (installedPackageId) import Distribution.Text import Distribution.Version -import Distribution.Simple.Utils (fromUTF8, toUTF8) +import Distribution.Simple.Utils (fromUTF8, toUTF8, writeUTF8File, readUTF8File) import System.FilePath as FilePath import qualified System.FilePath.Posix as FilePath.Posix import System.Directory ( getAppUserDataDirectory, createDirectoryIfMissing, @@ -42,7 +42,7 @@ import Control.Applicative (Applicative(..)) #endif import Control.Monad import System.Directory ( doesDirectoryExist, getDirectoryContents, - doesFileExist, renameFile, removeFile, + doesFileExist, removeFile, getCurrentDirectory ) import System.Exit ( exitWith, ExitCode(..) ) import System.Environment ( getArgs, getProgName, getEnv ) @@ -1056,7 +1056,7 @@ changeDBDir verbosity cmds db = do do_cmd (AddPackage p) = do let file = location db display (installedPackageId p) <.> "conf" when (verbosity > Normal) $ infoLn ("writing " ++ file) - writeFileUtf8Atomic file (showInstalledPackageInfo p) + writeUTF8File file (showInstalledPackageInfo p) do_cmd (ModifyPackage p) = do_cmd (AddPackage p) @@ -1988,58 +1988,6 @@ catchIO = Exception.catch tryIO :: IO a -> IO (Either Exception.IOException a) tryIO = Exception.try -writeFileUtf8Atomic :: FilePath -> String -> IO () -writeFileUtf8Atomic targetFile content = - withFileAtomic targetFile $ \h -> do - hSetEncoding h utf8 - hPutStr h content - --- copied from Cabal's Distribution.Simple.Utils, except that we want --- to use text files here, rather than binary files. -withFileAtomic :: FilePath -> (Handle -> IO ()) -> IO () -withFileAtomic targetFile write_content = do - (newFile, newHandle) <- openNewFile targetDir template - do write_content newHandle - hClose newHandle -#if mingw32_HOST_OS || mingw32_TARGET_OS - renameFile newFile targetFile - -- If the targetFile exists then renameFile will fail - `catchIO` \err -> do - exists <- doesFileExist targetFile - if exists - then do removeFileSafe targetFile - -- Big fat hairy race condition - renameFile newFile targetFile - -- If the removeFile succeeds and the renameFile fails - -- then we've lost the atomic property. - else throwIOIO err -#else - renameFile newFile targetFile -#endif - `Exception.onException` do hClose newHandle - removeFileSafe newFile - where - template = targetName <.> "tmp" - targetDir | null targetDir_ = "." - | otherwise = targetDir_ - --TODO: remove this when takeDirectory/splitFileName is fixed - -- to always return a valid dir - (targetDir_,targetName) = splitFileName targetFile - -openNewFile :: FilePath -> String -> IO (FilePath, Handle) -openNewFile dir template = do - -- this was added to System.IO in 6.12.1 - -- we must use this version because the version below opens the file - -- in binary mode. - openTempFileWithDefaultPermissions dir template - -readUTF8File :: FilePath -> IO String -readUTF8File file = do - h <- openFile file ReadMode - -- fix the encoding to UTF-8 - hSetEncoding h utf8 - hGetContents h - -- removeFileSave doesn't throw an exceptions, if the file is already deleted removeFileSafe :: FilePath -> IO () removeFileSafe fn = From git at git.haskell.org Thu Jul 2 08:27:23 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 2 Jul 2015 08:27:23 +0000 (UTC) Subject: [commit: ghc] master: bin-package-db: copy paste writeFileAtomic from Cabal (bdd0b71) Message-ID: <20150702082723.A33CA3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/bdd0b719ea5f116b160bc37a09804d3eff14ecae/ghc >--------------------------------------------------------------- commit bdd0b719ea5f116b160bc37a09804d3eff14ecae Author: Thomas Miedema Date: Sat Jun 13 16:53:28 2015 +0200 bin-package-db: copy paste writeFileAtomic from Cabal renameFile on Windows calls `Win32.mOVEFILE_REPLACE_EXISTING` nowadays, which doesn't fail when the targetPath already exists. >--------------------------------------------------------------- bdd0b719ea5f116b160bc37a09804d3eff14ecae libraries/bin-package-db/GHC/PackageDb.hs | 31 ++++++++----------------------- 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/libraries/bin-package-db/GHC/PackageDb.hs b/libraries/bin-package-db/GHC/PackageDb.hs index 870abd4..672b7eb 100644 --- a/libraries/bin-package-db/GHC/PackageDb.hs +++ b/libraries/bin-package-db/GHC/PackageDb.hs @@ -283,32 +283,17 @@ decodeFromFile file decoder = `ioeSetErrorString` msg loc = "GHC.PackageDb.readPackageDb" +-- Copied from Cabal's Distribution.Simple.Utils. writeFileAtomic :: FilePath -> BS.Lazy.ByteString -> IO () writeFileAtomic targetPath content = do - let (targetDir, targetName) = splitFileName targetPath + let (targetDir, targetFile) = splitFileName targetPath Exception.bracketOnError - (openBinaryTempFileWithDefaultPermissions targetDir $ targetName <.> "tmp") - (\(tmpPath, hnd) -> hClose hnd >> removeFile tmpPath) - (\(tmpPath, hnd) -> do - BS.Lazy.hPut hnd content - hClose hnd -#if mingw32_HOST_OS || mingw32_TARGET_OS - renameFile tmpPath targetPath - -- If the targetPath exists then renameFile will fail - `catch` \err -> do - exists <- doesFileExist targetPath - if exists - then do removeFile targetPath - -- Big fat hairy race condition - renameFile tmpPath targetPath - -- If the removeFile succeeds and the renameFile fails - -- then we've lost the atomic property. - else throwIO (err :: IOException) -#else - renameFile tmpPath targetPath -#endif - ) - + (openBinaryTempFileWithDefaultPermissions targetDir $ targetFile <.> "tmp") + (\(tmpPath, handle) -> hClose handle >> removeFile tmpPath) + (\(tmpPath, handle) -> do + BS.Lazy.hPut handle content + hClose handle + renameFile tmpPath targetPath) instance (BinaryStringRep a, BinaryStringRep b, BinaryStringRep c, BinaryStringRep d, BinaryStringRep e) => From git at git.haskell.org Thu Jul 2 15:11:25 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 2 Jul 2015 15:11:25 +0000 (UTC) Subject: [commit: ghc] wip/gadtpm: Removed redundant stuff + comments (743b894) Message-ID: <20150702151125.A07483A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/gadtpm Link : http://ghc.haskell.org/trac/ghc/changeset/743b894a5c150b68d585cc9efa02a138bdba0e44/ghc >--------------------------------------------------------------- commit 743b894a5c150b68d585cc9efa02a138bdba0e44 Author: George Karachalias Date: Thu Jul 2 15:01:41 2015 +0200 Removed redundant stuff + comments >--------------------------------------------------------------- 743b894a5c150b68d585cc9efa02a138bdba0e44 compiler/deSugar/Check.hs | 131 ---------------------------------------------- 1 file changed, 131 deletions(-) diff --git a/compiler/deSugar/Check.hs b/compiler/deSugar/Check.hs index ac59974..33e8db2 100644 --- a/compiler/deSugar/Check.hs +++ b/compiler/deSugar/Check.hs @@ -35,7 +35,6 @@ import TcSimplify( tcCheckSatisfiability ) import TcType ( mkTcEqPred, toTcType, toTcTypeBag ) import Bag import ErrUtils -import TcMType (genInstSkolTyVarsX) import Data.List (find) import MonadUtils -- MonadIO import Var (EvVar) @@ -426,72 +425,6 @@ translateMatch (L _ (Match lpats _ grhss)) = do translateMatches :: [LMatch Id (LHsExpr Id)] -> UniqSM [(PatVec,[PatVec])] -- every vector with all its guards translateMatches = mapM translateMatch -- :: [Located (Match Id (LHsExpr Id))] -dsSrcVector :: [Pat Id] -> [GuardStmt Id] -> DsM PatVec -dsSrcVector pats guards = liftUs $ do - ps_vec <- concat <$> translatePatVec pats - gd_vec <- translateGuards guards - return (ps_vec ++ gd_vec) - --- | Instead of [EquationInfo] --- eqn_pats :: [Pat Id] --- eqn_rhs :: MatchResult --- Use the type: --- ([Pat Id], [GuardStmt Id]) --- --- It contains the same information about patters but also --- the Guard statements instead of the opaque to us MatchResult --- --- It is also suitable for all possible forms: case expressions, let-bindings, --- lambda bindings, do-expressions, etc. - --- This is not OK. we can have: --- --- p1 .. pn | g1 -> ... --- | g2 -> ... --- ... --- | gm -> ... - --- Which should be translated to this I think: --- --- p1 .. pn | g1 -> ... --- p1 .. pn | g2 -> ... --- ... --- p1 .. pn | gm -> ... - - --- check2 :: [Type] -> [([Pat Id], [GuardStmt Id])] -> DsM PmResult --- check2 tys pats_guards --- | null pats_guards = return ([],[],[]) -- If we have an empty match, do not reason at all --- | otherwise = do --- usupply <- getUniqueSupplyM --- (rs,is,us) <- check'2 pats_guards (initial_uncovered usupply tys) --- return (rs, is, valSetAbsToList us) --- --- check'2 :: [([Pat Id], [GuardStmt Id])] -> ValSetAbs -> DsM ([EquationInfo], [EquationInfo], ValSetAbs) --- check'2 [] missing = --- --- --- check' :: [EquationInfo] -> ValSetAbs -> DsM ([EquationInfo], [EquationInfo], ValSetAbs) --- check' [] missing = do --- missing' <- pruneValSetAbs missing --- return ([], [], missing') --- check' (eq:eqs) missing = do --- -- Translate and process current clause --- translated <- liftUs (translateEqnInfo eq) --- (c, d, us ) <- patVectProc translated missing --- (rs, is, us') <- check' eqs us --- return $ case (c,d) of --- (True, _) -> ( rs, is, us') --- (False, True) -> ( rs, eq:is, us') --- (False, False) -> (eq:rs, is, us') - - - - - - - - -- ----------------------------------------------------------------------- -- | Transform source guards (GuardStmt Id) to PmPats (Pattern) @@ -1228,70 +1161,6 @@ tyOracle evs Just sat -> return sat Nothing -> pprPanic "tyOracle" (vcat $ pprErrMsgBagWithLoc errs) } --- | Keep as a guide --- checkTyPmPat :: PmPat Id -> Type -> PmM (Bag EvVar) -- check a type and a set of constraints --- checkTyPmPat (PmGuardPat _) _ = panic "checkTyPmPat: PmGuardPat" --- checkTyPmPat (PmVarPat {}) _ = return emptyBag --- checkTyPmPat (PmLitPat {}) _ = return emptyBag --- checkTyPmPat (PmLitCon {}) _ = return emptyBag --- checkTyPmPat (PmConPat con args) res_ty = do --- let (univ_tvs, ex_tvs, eq_spec, thetas, arg_tys, dc_res_ty) = dataConFullSig con --- data_tc = dataConTyCon con -- The representation TyCon --- mb_tc_args = case splitTyConApp_maybe res_ty of --- Nothing -> Nothing --- Just (res_tc, res_tc_tys) --- | Just (fam_tc, fam_args, _) <- tyConFamInstSig_maybe data_tc --- , let fam_tc_tvs = tyConTyVars fam_tc --- -> ASSERT( res_tc == fam_tc ) --- case tcMatchTys (mkVarSet fam_tc_tvs) fam_args res_tc_tys of --- Just fam_subst -> Just (map (substTyVar fam_subst) fam_tc_tvs) --- Nothing -> Nothing --- | otherwise --- -> ASSERT( res_tc == data_tc ) Just res_tc_tys --- --- loc <- getSrcSpanDs --- (subst, res_eq) <- case mb_tc_args of --- Nothing -> -- The context type doesn't have a type constructor at the head. --- -- so generate an equality. But this doesn't really work if there --- -- are kind variables involved --- do (subst, _) <- genInstSkolTyVars loc univ_tvs --- res_eq <- newEqPmM (substTy subst dc_res_ty) res_ty --- return (subst, unitBag res_eq) --- Just tys -> return (zipTopTvSubst univ_tvs tys, emptyBag) --- --- (subst, _) <- genInstSkolTyVarsX loc subst ex_tvs --- arg_cs <- checkTyPmPatVec args (substTys subst arg_tys) --- theta_cs <- mapM (nameType "varcon") $ --- substTheta subst (eqSpecPreds eq_spec ++ thetas) --- --- return (listToBag theta_cs `unionBags` arg_cs `unionBags` res_eq) --- --- checkTyPmPatVec :: [PmPat Id] -> [Type] -> PmM (Bag EvVar) --- checkTyPmPatVec pats tys --- = do { cs <- zipWithM checkTyPmPat pats tys --- ; return (unionManyBags cs) } - -genInstSkolTyVars :: SrcSpan -> [TyVar] -> PmM (TvSubst, [TyVar]) --- Precondition: tyvars should be ordered (kind vars first) --- see Note [Kind substitution when instantiating] --- Get the location from the monad; this is a complete freshening operation -genInstSkolTyVars loc tvs = genInstSkolTyVarsX loc emptyTvSubst tvs - --- | Keep as a guide --- -- ----------------------------------------------------------------------- --- -- | Given a signature sig and an output vector, check whether the vector's type --- -- can match the signature --- wt :: [Type] -> OutVec -> PmM Bool --- wt sig (_, vec) --- | length sig == length vec = do --- cs <- checkTyPmPatVec vec sig --- env_cs <- getDictsDs --- tyOracle (cs `unionBags` env_cs) --- | otherwise = pprPanic "wt: length mismatch:" (ppr sig $$ ppr vec) - - - - {- %************************************************************************ %* * From git at git.haskell.org Thu Jul 2 19:57:49 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 2 Jul 2015 19:57:49 +0000 (UTC) Subject: [commit: ghc] master: Build system: rename bindist to bindist-list... (bdf7f13) Message-ID: <20150702195749.295183A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/bdf7f133d1d4bcc7ca3c0bbadda51ef542cccfb0/ghc >--------------------------------------------------------------- commit bdf7f133d1d4bcc7ca3c0bbadda51ef542cccfb0 Author: Thomas Miedema Date: Thu Jul 2 21:48:56 2015 +0200 Build system: rename bindist to bindist-list... ...to prevent accidental use of `make bindist`, when `make binary-dist` is called for. >--------------------------------------------------------------- bdf7f133d1d4bcc7ca3c0bbadda51ef542cccfb0 Makefile | 2 +- ghc.mk | 2 +- rules/bindist.mk | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index f0f864d..c08ccc5 100644 --- a/Makefile +++ b/Makefile @@ -119,7 +119,7 @@ ifeq "$(mingw32_TARGET_OS)" "1" $(MAKE) --no-print-directory -f ghc.mk windows-binary-dist-prep else rm -f bindist-list - $(MAKE) --no-print-directory -f ghc.mk bindist BINDIST=YES + $(MAKE) --no-print-directory -f ghc.mk bindist-list BINDIST=YES $(MAKE) --no-print-directory -f ghc.mk unix-binary-dist-prep endif diff --git a/ghc.mk b/ghc.mk index 1b50472..6c1d88d 100644 --- a/ghc.mk +++ b/ghc.mk @@ -946,7 +946,7 @@ ifneq "$(CLEANING)" "YES" # This rule seems to hold some files open on Windows which prevents # cleaning, perhaps due to the $(wildcard). -$(eval $(call bindist,.,\ +$(eval $(call bindist-list,.,\ LICENSE \ README \ INSTALL \ diff --git a/rules/bindist.mk b/rules/bindist.mk index 06f654d..49d8aa4 100644 --- a/rules/bindist.mk +++ b/rules/bindist.mk @@ -11,18 +11,18 @@ # ----------------------------------------------------------------------------- -# Add files to the bindist. Invoke like this: +# Add files to the bindist-list. Invoke like this: # -# $(eval $(call bindist,utils/genapply,ghc.mk)) +# $(eval $(call bindist-list,utils/genapply,ghc.mk)) -define bindist +define bindist-list # $1 = name # $2 = files -.PHONY: bindist_$1 -bindist: bindist_$1 +.PHONY: bindist-list_$1 +bindist-list: bindist-list_$1 -bindist_$1: +bindist-list_$1: $(foreach i,$2,\ $(call make-command,\ for f in $i; do echo $(BIN_DIST_NAME)/$$$$f >> bindist-list; done \ From git at git.haskell.org Fri Jul 3 10:11:16 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 3 Jul 2015 10:11:16 +0000 (UTC) Subject: [commit: ghc] wip/impredicativity: Fix bugs in expression optimization (06cfdcb) Message-ID: <20150703101116.CC62D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/impredicativity Link : http://ghc.haskell.org/trac/ghc/changeset/06cfdcb05ac03a090868b677192373ba6302943d/ghc >--------------------------------------------------------------- commit 06cfdcb05ac03a090868b677192373ba6302943d Author: Alejandro Serrano Date: Fri Jul 3 12:10:18 2015 +0200 Fix bugs in expression optimization We need to aggresively inline instatiation functions so that the simplifier has a better chance of working. In order to ensure that instantiation functions are inlined, a new field has been added to IdInfo. >--------------------------------------------------------------- 06cfdcb05ac03a090868b677192373ba6302943d compiler/basicTypes/Id.hs | 11 ++++++- compiler/basicTypes/IdInfo.hs | 13 ++++++-- compiler/coreSyn/CoreSubst.hs | 11 ++++++- compiler/deSugar/DsBinds.hs | 66 +++++++++++++++++++++------------------ compiler/specialise/Specialise.hs | 1 + compiler/typecheck/TcHsSyn.hs | 6 +++- 6 files changed, 72 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 06cfdcb05ac03a090868b677192373ba6302943d From git at git.haskell.org Fri Jul 3 12:17:53 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 3 Jul 2015 12:17:53 +0000 (UTC) Subject: [commit: ghc] wip/impredicativity: Fix problem with RULES desugaring (7807510) Message-ID: <20150703121753.B8D3D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/impredicativity Link : http://ghc.haskell.org/trac/ghc/changeset/7807510f906202de5e90e7cb1f81b4cedf215670/ghc >--------------------------------------------------------------- commit 7807510f906202de5e90e7cb1f81b4cedf215670 Author: Alejandro Serrano Date: Fri Jul 3 14:04:36 2015 +0200 Fix problem with RULES desugaring - Revert some changes in which isInstantiationFn is attached to IdInfo. It is now only used in those places where a coercion is applied, but not in the EvVar itself. - Change decomposeRuleLhs to drop less dictionaries that it was doing before. When working with instantiation constraints, some dictionaries of the form $dict_v = $dict_w are generated and need to be preserved. >--------------------------------------------------------------- 7807510f906202de5e90e7cb1f81b4cedf215670 compiler/coreSyn/CoreSubst.hs | 5 +---- compiler/deSugar/DsBinds.hs | 11 +++++++---- compiler/typecheck/TcHsSyn.hs | 6 +----- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/compiler/coreSyn/CoreSubst.hs b/compiler/coreSyn/CoreSubst.hs index 058336c..2d9c7e9 100644 --- a/compiler/coreSyn/CoreSubst.hs +++ b/compiler/coreSyn/CoreSubst.hs @@ -834,7 +834,7 @@ simpleOptExpr :: CoreExpr -> CoreExpr -- may change radically simpleOptExpr expr - = -- pprTrace "simpleOptExpr" (ppr init_subst $$ ppr expr) + = -- pprTrace "simpleOptExpr" (ppr init_subst $$ ppr expr) $ simpleOptExprWith init_subst expr where init_subst = mkEmptySubst (mkInScopeSet (exprFreeVars expr)) @@ -1027,9 +1027,6 @@ maybe_substitute subst b r , not (isUnLiftedType (idType b)) || exprOkForSpeculation r = Just (extendIdSubst subst b r) - | idIsInstantiationFn b - = Just (extendIdSubst subst b r) - | otherwise = Nothing where diff --git a/compiler/deSugar/DsBinds.hs b/compiler/deSugar/DsBinds.hs index 8c78fbb..818b516 100644 --- a/compiler/deSugar/DsBinds.hs +++ b/compiler/deSugar/DsBinds.hs @@ -629,6 +629,9 @@ decomposeRuleLhs orig_bndrs orig_lhs split_lets :: CoreExpr -> ([(DictId,CoreExpr)], CoreExpr) split_lets e + | Let (NonRec d (Var r)) _body <- e + , isDictId d, isDictId r + = ([], e) | Let (NonRec d r) body <- e , isDictId d , (bs, body') <- split_lets body @@ -1162,7 +1165,7 @@ to simply never generate the redundant box/unbox in the first place. dsEvInstanceOf :: Type -> EvInstanceOf -> CoreExpr -> DsM CoreExpr dsEvInstanceOf ty ev e = do { e' <- dsEvInstanceOf' ev e - ; return $ if False -- ty == exprType e' + ; return $ if ty == exprType e' then e -- No conversion needed else e' } @@ -1173,7 +1176,7 @@ dsEvInstanceOf' (EvInstanceOfVar v) e dsEvInstanceOf' (EvInstanceOfEq co) e = do { dsTcCoercion co $ \c -> case coercionKind c of - -- Pair ty1 ty2 | ty1 == ty2 -> e -- No conversion needed + Pair ty1 ty2 | ty1 == ty2 -> e -- No conversion needed _ -> mkCast e (mkSubCo c) } dsEvInstanceOf' (EvInstanceOfInst qvars co qs) e = do { qs' <- mapM dsEvTerm qs @@ -1181,13 +1184,13 @@ dsEvInstanceOf' (EvInstanceOfInst qvars co qs) e ; let exprTy = mkCoreApps e (map Type qvars) exprEv = mkCoreApps exprTy qs' ; return $ case splitFunTy_maybe (exprType (Var co')) of - -- Just (ty1, ty2) | ty1 == ty2 -> exprEv + Just (ty1, ty2) | ty1 == ty2 -> exprEv _ -> mkCoreApp (Var co') exprEv } dsEvInstanceOf' (EvInstanceOfLet tyvars qvars qs rest) e = do { q_binds <- dsTcEvBinds qs ; let rest' = setIdIsInstantiationFn rest True ; let inner = case splitFunTy_maybe (exprType (Var rest')) of - -- Just (ty1, ty2) | ty1 == ty2 -> e + Just (ty1, ty2) | ty1 == ty2 -> e _ -> mkCoreApp (Var rest') e ; return $ mkCoreLams (tyvars ++ qvars) (mkCoreLets q_binds inner) } diff --git a/compiler/typecheck/TcHsSyn.hs b/compiler/typecheck/TcHsSyn.hs index 80c07b5..8853607 100644 --- a/compiler/typecheck/TcHsSyn.hs +++ b/compiler/typecheck/TcHsSyn.hs @@ -273,14 +273,10 @@ zonkEvBndr :: ZonkEnv -> EvVar -> TcM EvVar -- Does not extend the ZonkEnv zonkEvBndr env var = do { let var_ty = varType var - -- Remember whether the variable was instantiation fn. - ; let var' = case classifyPredType (var_ty) of - InstanceOfPred {} -> setIdIsInstantiationFn var True - _ -> var ; ty <- {-# SCC "zonkEvBndr_zonkTcTypeToType" #-} zonkTcTypeToType env var_ty - ; return (setVarType var' ty) } + ; return (setVarType var ty) } zonkEvVarOcc :: ZonkEnv -> EvVar -> EvVar zonkEvVarOcc env v = zonkIdOcc env v From git at git.haskell.org Fri Jul 3 13:44:56 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 3 Jul 2015 13:44:56 +0000 (UTC) Subject: [commit: ghc] wip/impredicativity: Fix bug on generation of quantified vars in RULEs (212daac) Message-ID: <20150703134456.4F9E73A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/impredicativity Link : http://ghc.haskell.org/trac/ghc/changeset/212daacea7ad2e4fb54ea5ac25f6a2fe406b5ba8/ghc >--------------------------------------------------------------- commit 212daacea7ad2e4fb54ea5ac25f6a2fe406b5ba8 Author: Alejandro Serrano Date: Fri Jul 3 15:45:33 2015 +0200 Fix bug on generation of quantified vars in RULEs >--------------------------------------------------------------- 212daacea7ad2e4fb54ea5ac25f6a2fe406b5ba8 compiler/typecheck/TcRules.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/compiler/typecheck/TcRules.hs b/compiler/typecheck/TcRules.hs index 4335717..37bcb3a 100644 --- a/compiler/typecheck/TcRules.hs +++ b/compiler/typecheck/TcRules.hs @@ -310,7 +310,12 @@ simplifyRule name lhs_wanted rhs_wanted ; rhs_resid <- solveWanteds rhs_wanted ; return (insolubleWC lhs_inst_resid || insolubleWC rhs_resid, lhs_inst) } - ; zonked_lhs <- zonkSimples (wc_simple lhs_wanted `unionBags` lhs_extra) + ; zonked_simple <- zonkSimples (wc_simple lhs_wanted) + ; zonked_extra <- zonkSimples lhs_extra + -- Remove those extra constraints which were already in the initial set + ; let same_type x y = ctPred x == ctPred y + none_with_same_type x = not (anyBag (same_type x) zonked_simple) + zonked_lhs = zonked_simple `unionBags` filterBag none_with_same_type zonked_extra ; let (q_cts, non_q_cts) = partitionBag quantify_me zonked_lhs quantify_me -- Note [RULE quantification over equalities] | insoluble = quantify_insol From git at git.haskell.org Fri Jul 3 14:50:42 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 3 Jul 2015 14:50:42 +0000 (UTC) Subject: [commit: ghc] wip/gadtpm: more guards.. (26692cd) Message-ID: <20150703145042.17B813A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/gadtpm Link : http://ghc.haskell.org/trac/ghc/changeset/26692cde17ad5db2110a99dc7a44fca96555ec64/ghc >--------------------------------------------------------------- commit 26692cde17ad5db2110a99dc7a44fca96555ec64 Author: George Karachalias Date: Fri Jul 3 16:51:14 2015 +0200 more guards.. >--------------------------------------------------------------- 26692cde17ad5db2110a99dc7a44fca96555ec64 compiler/deSugar/Check.hs | 301 +++++++++++++++++++++++++++++++++++++++++----- compiler/deSugar/Match.hs | 31 ++++- 2 files changed, 301 insertions(+), 31 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 26692cde17ad5db2110a99dc7a44fca96555ec64 From git at git.haskell.org Fri Jul 3 17:29:39 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 3 Jul 2015 17:29:39 +0000 (UTC) Subject: [commit: ghc] master: Implement PowerPC 64-bit native code backend for Linux (d3c1dda) Message-ID: <20150703172939.2CDAB3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d3c1dda60d0ec07fc7f593bfd83ec9457dfa7984/ghc >--------------------------------------------------------------- commit d3c1dda60d0ec07fc7f593bfd83ec9457dfa7984 Author: Peter Trommler Date: Fri Jul 3 19:09:06 2015 +0200 Implement PowerPC 64-bit native code backend for Linux Extend the PowerPC 32-bit native code generator for "64-bit PowerPC ELF Application Binary Interface Supplement 1.9" by Ian Lance Taylor and "Power Architecture 64-Bit ELF V2 ABI Specification -- OpenPOWER ABI for Linux Supplement" by IBM. The latter ABI is mainly used on POWER7/7+ and POWER8 Linux systems running in little-endian mode. The code generator supports both static and dynamic linking. PowerPC 64-bit code for ELF ABI 1.9 and 2 is mostly position independent anyway, and thus so is all the code emitted by the code generator. In other words, -fPIC does not make a difference. rts/stg/SMP.h support is implemented. Following the spirit of the introductory comment in PPC/CodeGen.hs, the rest of the code is a straightforward extension of the 32-bit implementation. Limitations: * Code is generated only in the medium code model, which is also gcc's default * Local symbols are not accessed directly, which seems to also be the case for 32-bit * LLVM does not work, but this does not work on 32-bit either * Must use the system runtime linker in GHCi, because the GHC linker for "static" object files (rts/Linker.c) for PPC 64-bit is not implemented. The system runtime (dynamic) linker works. * The handling of the system stack (register 1) is not ELF- compliant so stack traces break. Instead of allocating a new stack frame, spill code should use the "official" spill area in the current stack frame and deallocation code should restore the back chain * DWARF support is missing Fixes #9863 Test Plan: validate (on powerpc, too) Reviewers: simonmar, trofi, erikd, austin Reviewed By: trofi Subscribers: bgamari, arnons1, kgardas, thomie Differential Revision: https://phabricator.haskell.org/D629 GHC Trac Issues: #9863 >--------------------------------------------------------------- d3c1dda60d0ec07fc7f593bfd83ec9457dfa7984 aclocal.m4 | 7 +- compiler/cmm/CLabel.hs | 16 +- compiler/codeGen/CodeGen/Platform.hs | 10 +- compiler/nativeGen/AsmCodeGen.hs | 24 +- compiler/nativeGen/PIC.hs | 83 ++- compiler/nativeGen/PPC/CodeGen.hs | 673 ++++++++++++++++----- compiler/nativeGen/PPC/Instr.hs | 92 ++- compiler/nativeGen/PPC/Ppr.hs | 163 ++++- compiler/nativeGen/PPC/Regs.hs | 21 +- compiler/nativeGen/RegAlloc/Graph/TrivColorable.hs | 8 +- compiler/nativeGen/RegAlloc/Linear/FreeRegs.hs | 2 +- compiler/nativeGen/RegAlloc/Linear/Main.hs | 2 +- compiler/nativeGen/TargetReg.hs | 10 +- compiler/utils/Platform.hs | 13 +- configure.ac | 2 +- includes/CodeGen.Platform.hs | 3 + includes/stg/HaskellMachRegs.h | 3 +- includes/stg/RtsMachRegs.h | 3 +- includes/stg/SMP.h | 28 +- mk/config.mk.in | 10 +- rts/StgCRun.c | 10 +- rts/StgCRunAsm.S | 114 ++++ rts/ghc.mk | 3 + testsuite/tests/rts/all.T | 6 + 24 files changed, 1044 insertions(+), 262 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 d3c1dda60d0ec07fc7f593bfd83ec9457dfa7984 From git at git.haskell.org Fri Jul 3 19:30:14 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 3 Jul 2015 19:30:14 +0000 (UTC) Subject: [commit: ghc] master: Use `+RTS -G1` for more stable residency measurements (#9675) (b5e1944) Message-ID: <20150703193014.720273A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/b5e1944e2b069a7df3444e57bae0b4ee15bde73c/ghc >--------------------------------------------------------------- commit b5e1944e2b069a7df3444e57bae0b4ee15bde73c Author: Ben Gamari Date: Fri Jul 3 21:30:31 2015 +0200 Use `+RTS -G1` for more stable residency measurements (#9675) Reviewers: ezyang, austin, thomie Subscribers: thomie, bgamari Differential Revision: https://phabricator.haskell.org/D1006 GHC Trac Issues: #10557 >--------------------------------------------------------------- b5e1944e2b069a7df3444e57bae0b4ee15bde73c testsuite/tests/perf/compiler/all.T | 56 +++++++++++++++++++++++++---------- testsuite/tests/perf/should_run/all.T | 14 +++++++-- 2 files changed, 51 insertions(+), 19 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 b5e1944e2b069a7df3444e57bae0b4ee15bde73c From git at git.haskell.org Fri Jul 3 20:44:20 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 3 Jul 2015 20:44:20 +0000 (UTC) Subject: [commit: ghc] master: Enable using qualified field of constructor in GHCi (1d6ead7) Message-ID: <20150703204420.90E5F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/1d6ead7d71ae9ad104f9bed9579462ce4a218594/ghc >--------------------------------------------------------------- commit 1d6ead7d71ae9ad104f9bed9579462ce4a218594 Author: Zejun Wu Date: Fri Jul 3 19:31:25 2015 +0200 Enable using qualified field of constructor in GHCi The -fimplicit-import-qualified made it possible to uses qualifed names in GHCi without explicitly import the modules. But it didn't work for field of constructor, this patch fixed this issue. Test Plan: cd testsuite/tests/rename/ && make cd testsuite/tests/ghci/ && make Reviewers: austin, simonpj Reviewed By: austin, simonpj Subscribers: bgamari, thomie Differential Revision: https://phabricator.haskell.org/D900 GHC Trac Issues: #10439 >--------------------------------------------------------------- 1d6ead7d71ae9ad104f9bed9579462ce4a218594 compiler/rename/RnEnv.hs | 9 +++++++-- testsuite/tests/ghci/scripts/T10439.script | 6 ++++++ testsuite/tests/ghci/scripts/T10439.stdout | 3 +++ testsuite/tests/ghci/scripts/all.T | 1 + 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/compiler/rename/RnEnv.hs b/compiler/rename/RnEnv.hs index 3dcf2cc..73dfbeb 100644 --- a/compiler/rename/RnEnv.hs +++ b/compiler/rename/RnEnv.hs @@ -482,8 +482,13 @@ lookupSubBndrOcc warnIfDeprec parent doc rdr_name [gre] -> do { addUsedRdrName warnIfDeprec gre (used_rdr_name gre) -- Add a usage; this is an *occurrence* site ; return (gre_name gre) } - [] -> do { addErr (unknownSubordinateErr doc rdr_name) - ; return (mkUnboundName rdr_name) } + [] -> do { ns <- lookupQualifiedNameGHCi rdr_name + ; case ns of { + (n:_) -> return n ; + -- Unlikely to be more than one...? + [] -> do + { addErr (unknownSubordinateErr doc rdr_name) + ; return (mkUnboundName rdr_name) } } } gres -> do { addNameClashErrRn rdr_name gres ; return (gre_name (head gres)) } } where diff --git a/testsuite/tests/ghci/scripts/T10439.script b/testsuite/tests/ghci/scripts/T10439.script new file mode 100644 index 0000000..7f481ab --- /dev/null +++ b/testsuite/tests/ghci/scripts/T10439.script @@ -0,0 +1,6 @@ +let tree = Data.Tree.Node 0 [] +Data.Tree.rootLabel tree +let f (Data.Tree.Node i j) k = Data.Tree.Node k j +f tree 1 +let g i j = i { Data.Tree.rootLabel = j } +g tree 2 diff --git a/testsuite/tests/ghci/scripts/T10439.stdout b/testsuite/tests/ghci/scripts/T10439.stdout new file mode 100644 index 0000000..63a6be7 --- /dev/null +++ b/testsuite/tests/ghci/scripts/T10439.stdout @@ -0,0 +1,3 @@ +0 +Node {rootLabel = 1, subForest = []} +Node {rootLabel = 2, subForest = []} diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T index 384868e..aecadc4 100755 --- a/testsuite/tests/ghci/scripts/all.T +++ b/testsuite/tests/ghci/scripts/all.T @@ -219,6 +219,7 @@ test('T10408B', normal, run_command, test('T10248', normal, ghci_script, ['T10248.script']) test('T10110', normal, ghci_script, ['T10110.script']) test('T10322', normal, ghci_script, ['T10322.script']) +test('T10439', normal, ghci_script, ['T10439.script']) test('T10466', normal, ghci_script, ['T10466.script']) test('T10501', normal, ghci_script, ['T10501.script']) test('T10508', normal, ghci_script, ['T10508.script']) From git at git.haskell.org Fri Jul 3 20:44:23 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 3 Jul 2015 20:44:23 +0000 (UTC) Subject: [commit: ghc] master: Fix Trac #10519 (f856383) Message-ID: <20150703204423.C224C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/f8563838603f9a60f5012c3837142c5df89b8de2/ghc >--------------------------------------------------------------- commit f8563838603f9a60f5012c3837142c5df89b8de2 Author: Thomas Winant Date: Fri Jul 3 19:35:29 2015 +0200 Fix Trac #10519 Look through nested foralls when checking the validity of a partial type signature. The combination of D836 and D613 prompts this change. Test Plan: The test T10519 must pass Reviewers: simonpj, alanz, austin Reviewed By: simonpj, alanz, austin Subscribers: thomie, bgamari Differential Revision: https://phabricator.haskell.org/D994 GHC Trac Issues: #10519 >--------------------------------------------------------------- f8563838603f9a60f5012c3837142c5df89b8de2 compiler/rename/RnTypes.hs | 2 +- testsuite/tests/partial-sigs/should_compile/T10519.hs | 6 ++++++ testsuite/tests/partial-sigs/should_compile/T10519.stderr | 4 ++++ testsuite/tests/partial-sigs/should_compile/all.T | 1 + 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/compiler/rename/RnTypes.hs b/compiler/rename/RnTypes.hs index 3766ed1..705ca55 100644 --- a/compiler/rename/RnTypes.hs +++ b/compiler/rename/RnTypes.hs @@ -554,7 +554,7 @@ rnLHsTypeWithWildCards doc ty = do { -- When there is a wild card at the end of the context, remove it and -- add its location as the extra-constraints wild card in the -- HsForAllTy. - let ty' = extractExtraCtsWc `fmap` ty + let ty' = extractExtraCtsWc `fmap` flattenTopLevelLHsForAllTy ty ; checkValidPartialType doc ty' diff --git a/testsuite/tests/partial-sigs/should_compile/T10519.hs b/testsuite/tests/partial-sigs/should_compile/T10519.hs new file mode 100644 index 0000000..66a59a7 --- /dev/null +++ b/testsuite/tests/partial-sigs/should_compile/T10519.hs @@ -0,0 +1,6 @@ +{-# LANGUAGE ExplicitForAll #-} +{-# LANGUAGE PartialTypeSignatures #-} +module T10519 where + +foo :: forall a. _ => a -> a -> Bool +foo x y = x == y diff --git a/testsuite/tests/partial-sigs/should_compile/T10519.stderr b/testsuite/tests/partial-sigs/should_compile/T10519.stderr new file mode 100644 index 0000000..254292f --- /dev/null +++ b/testsuite/tests/partial-sigs/should_compile/T10519.stderr @@ -0,0 +1,4 @@ + +T10519.hs:5:18: warning: + Found hole ?_? with inferred constraints: Eq a + In the type signature for ?foo?: _ => a -> a -> Bool diff --git a/testsuite/tests/partial-sigs/should_compile/all.T b/testsuite/tests/partial-sigs/should_compile/all.T index 56f1045..e649472 100644 --- a/testsuite/tests/partial-sigs/should_compile/all.T +++ b/testsuite/tests/partial-sigs/should_compile/all.T @@ -48,3 +48,4 @@ test('UncurryNamed', normal, compile, ['-ddump-types -fno-warn-partial-type-sign test('WarningWildcardInstantiations', normal, compile, ['-ddump-types']) test('T10403', normal, compile, ['']) test('T10438', normal, compile, ['']) +test('T10519', normal, compile, ['']) From git at git.haskell.org Fri Jul 3 20:44:26 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 3 Jul 2015 20:44:26 +0000 (UTC) Subject: [commit: ghc] master: Remove unnecessary OrdList from decl parser. (f07b7a8) Message-ID: <20150703204426.911DF3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/f07b7a876cb3b9d38bb7ed301503f5b84104fc90/ghc >--------------------------------------------------------------- commit f07b7a876cb3b9d38bb7ed301503f5b84104fc90 Author: Matthew Pickering Date: Fri Jul 3 19:35:45 2015 +0200 Remove unnecessary OrdList from decl parser. Each production produced a singleton list. Similar treatment is applied to the decl_cls parser. This changes the type of the parseDeclaration entry point to `parseDeclaration :: P (LHsDecl RdrName)` and `parseTypeSignature :: P (LHsDecl RdrName)` which is in line with the other parser entry points. This patch also updates the conflict commentary. There were 4 reduce/reduce conflicts introduced by `ffc21506894c7887d3620423aaf86bc6113a1071` which refactored tuple constraints. Reviewers: austin Reviewed By: austin Subscribers: thomie, bgamari Differential Revision: https://phabricator.haskell.org/D1007 >--------------------------------------------------------------- f07b7a876cb3b9d38bb7ed301503f5b84104fc90 compiler/parser/Parser.y | 185 ++++++++++++++++++++++++++++------------------- 1 file changed, 112 insertions(+), 73 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 f07b7a876cb3b9d38bb7ed301503f5b84104fc90 From git at git.haskell.org Fri Jul 3 20:44:29 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 3 Jul 2015 20:44:29 +0000 (UTC) Subject: [commit: ghc] master: users_guide: Describe order-dependence of -f and -O flags (6400c76) Message-ID: <20150703204429.659383A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/6400c7687223c5b2141176aa92f7ff987f61aba6/ghc >--------------------------------------------------------------- commit 6400c7687223c5b2141176aa92f7ff987f61aba6 Author: Ben Gamari Date: Fri Jul 3 19:36:12 2015 +0200 users_guide: Describe order-dependence of -f and -O flags The behavior of the -f and -O options can be quite surprising. Document this fact. At some point this behavior should likely be changed. Test Plan: documentation only Reviewers: austin, trofi Reviewed By: austin, trofi Subscribers: thomie, bgamari Differential Revision: https://phabricator.haskell.org/D1008 GHC Trac Issues: #10560 >--------------------------------------------------------------- 6400c7687223c5b2141176aa92f7ff987f61aba6 docs/users_guide/flags.xml | 2 +- docs/users_guide/using.xml | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/docs/users_guide/flags.xml b/docs/users_guide/flags.xml index a0be2cb..b7345cb 100644 --- a/docs/users_guide/flags.xml +++ b/docs/users_guide/flags.xml @@ -1753,7 +1753,7 @@ Optimisation levels - These options are described in more detail in + These options are described in more detail in . diff --git a/docs/users_guide/using.xml b/docs/users_guide/using.xml index 4d4b01f..5642ea5 100644 --- a/docs/users_guide/using.xml +++ b/docs/users_guide/using.xml @@ -2105,6 +2105,29 @@ _ = rhs3 -- No warning: lone wild-card pattern machine-specific optimisations to be turned on/off. + Most of these options are boolean and have options to turn them both + “on” and “off” (beginning with the prefix + ). For instance, while + enables specialisation, disables it. When + multiple flags for the same option appear in the command-line they are + evaluated from left to right. For instance will enable specialisation. + + + It is important to note that the flags are roughly + equivalent to combinations of flags. For this reason, + the effect of the and flags is + dependent upon the order in which they occur on the command line. + + + For instance, take the example of . Despite the appearing in the + command line, specialisation will still be enabled. This is the case + as implies , overriding + the previous flag. By contrast, will + compile without specialisation, as one would expect. + + <option>-O*</option>: convenient “packages” of optimisation flags. From git at git.haskell.org Fri Jul 3 20:44:32 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 3 Jul 2015 20:44:32 +0000 (UTC) Subject: [commit: ghc] master: Remove redundant parser entry point (e4bf4bf) Message-ID: <20150703204432.58A183A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e4bf4bf07aa37e96b29d8602eb46aa90d5cd00fb/ghc >--------------------------------------------------------------- commit e4bf4bf07aa37e96b29d8602eb46aa90d5cd00fb Author: Matthew Pickering Date: Fri Jul 3 19:36:48 2015 +0200 Remove redundant parser entry point `parseFullStmt` and `parseStatement` exposed the same parser entry point. Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: gibiansky, alanz, thomie, bgamari Differential Revision: https://phabricator.haskell.org/D1014 >--------------------------------------------------------------- e4bf4bf07aa37e96b29d8602eb46aa90d5cd00fb compiler/parser/Parser.y | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/compiler/parser/Parser.y b/compiler/parser/Parser.y index 6a9dc47..b20b50c 100644 --- a/compiler/parser/Parser.y +++ b/compiler/parser/Parser.y @@ -33,7 +33,7 @@ module Parser (parseModule, parseImport, parseStatement, parseDeclaration, parseExpression, parsePattern, parseTypeSignature, - parseFullStmt, parseStmt, parseIdentifier, + parseStmt, parseIdentifier, parseType, parseHeader) where -- base @@ -604,7 +604,6 @@ TH_QQUASIQUOTE { L _ (ITqQuasiQuote _) } %name parseExpression exp %name parsePattern pat %name parseTypeSignature sigdecl -%name parseFullStmt stmt %name parseStmt maybe_stmt %name parseIdentifier identifier %name parseType ctype From git at git.haskell.org Fri Jul 3 20:44:35 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 3 Jul 2015 20:44:35 +0000 (UTC) Subject: [commit: ghc] master: parser: Allow Lm (MODIFIER LETTER) category in identifiers (6b01d3c) Message-ID: <20150703204435.C63943A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/6b01d3ce6c681428e7a9865af85685c2a76ba657/ghc >--------------------------------------------------------------- commit 6b01d3ce6c681428e7a9865af85685c2a76ba657 Author: Thomas Miedema Date: Fri Jul 3 22:37:18 2015 +0200 parser: Allow Lm (MODIFIER LETTER) category in identifiers Easy fix in the parser to stop regressions, due to Unicode 7.0 changing the classification of some prior code points. Signed-off-by: Austin Seipp Test Plan: `tests/parser/should_compile/T10196.hs` Reviewers: hvr, austin, bgamari Reviewed By: austin, bgamari Subscribers: thomie, bgamari Differential Revision: https://phabricator.haskell.org/D969 GHC Trac Issues: #10196 >--------------------------------------------------------------- 6b01d3ce6c681428e7a9865af85685c2a76ba657 compiler/basicTypes/Lexeme.hs | 11 ++++++++++- compiler/parser/Lexer.x | 8 ++++++-- compiler/utils/Util.hs | 5 +++++ testsuite/tests/parser/should_compile/T10196.hs | 13 +++++++++++++ testsuite/tests/parser/should_compile/all.T | 1 + testsuite/tests/parser/should_fail/T10196Fail1.hs | 4 ++++ testsuite/tests/parser/should_fail/T10196Fail1.stderr | 2 ++ testsuite/tests/parser/should_fail/T10196Fail2.hs | 4 ++++ testsuite/tests/parser/should_fail/T10196Fail2.stderr | 2 ++ testsuite/tests/parser/should_fail/T10196Fail3.hs | 6 ++++++ testsuite/tests/parser/should_fail/T10196Fail3.stderr | 2 ++ testsuite/tests/parser/should_fail/all.T | 3 +++ 12 files changed, 58 insertions(+), 3 deletions(-) diff --git a/compiler/basicTypes/Lexeme.hs b/compiler/basicTypes/Lexeme.hs index c5bda4d..a240961 100644 --- a/compiler/basicTypes/Lexeme.hs +++ b/compiler/basicTypes/Lexeme.hs @@ -28,6 +28,7 @@ module Lexeme ( ) where import FastString +import Util ((<||>)) import Data.Char import qualified Data.Set as Set @@ -194,7 +195,8 @@ okConSymOcc str = all okSymChar str && -- but not worrying about case or clashing with reserved words? okIdOcc :: String -> Bool okIdOcc str - = let hashes = dropWhile okIdChar str in + -- TODO. #10196. Only allow modifier letters in the suffix of an identifier. + = let hashes = dropWhile (okIdChar <||> okIdSuffixChar) str in all (== '#') hashes -- -XMagicHash allows a suffix of hashes -- of course, `all` says "True" to an empty list @@ -210,6 +212,13 @@ okIdChar c = case generalCategory c of OtherNumber -> True _ -> c == '\'' || c == '_' +-- | Is this character acceptable in the suffix of an identifier. +-- See alexGetByte in Lexer.x +okIdSuffixChar :: Char -> Bool +okIdSuffixChar c = case generalCategory c of + ModifierLetter -> True -- See #10196 + _ -> False + -- | Is this character acceptable in a symbol (after the first char)? -- See alexGetByte in Lexer.x okSymChar :: Char -> Bool diff --git a/compiler/parser/Lexer.x b/compiler/parser/Lexer.x index 5839a41..2e883fd 100644 --- a/compiler/parser/Lexer.x +++ b/compiler/parser/Lexer.x @@ -156,7 +156,10 @@ $graphic = [$small $large $symbol $digit $special $unigraphic \"\'] $binit = 0-1 $octit = 0-7 $hexit = [$decdigit A-F a-f] -$idchar = [$small $large $digit \'] + +$suffix = \x07 -- Trick Alex into handling Unicode. See alexGetByte. +-- TODO #10196. Only allow modifier letters in the suffix of an identifier. +$idchar = [$small $large $digit $suffix \'] $pragmachar = [$small $large $digit] @@ -1842,6 +1845,7 @@ alexGetByte (AI loc s) symbol = '\x04' space = '\x05' other_graphic = '\x06' + suffix = '\x07' adj_c | c <= '\x06' = non_graphic @@ -1858,7 +1862,7 @@ alexGetByte (AI loc s) UppercaseLetter -> upper LowercaseLetter -> lower TitlecaseLetter -> upper - ModifierLetter -> other_graphic + ModifierLetter -> suffix -- see #10196 OtherLetter -> lower -- see #1103 NonSpacingMark -> other_graphic SpacingCombiningMark -> other_graphic diff --git a/compiler/utils/Util.hs b/compiler/utils/Util.hs index 732f2b8f..96cd752 100644 --- a/compiler/utils/Util.hs +++ b/compiler/utils/Util.hs @@ -55,6 +55,7 @@ module Util ( isEqual, eqListBy, eqMaybeBy, thenCmp, cmpList, removeSpaces, + (<&&>), (<||>), -- * Edit distance fuzzyMatch, fuzzyLookup, @@ -665,6 +666,10 @@ removeSpaces = dropWhileEndLE isSpace . dropWhile isSpace (<&&>) = liftA2 (&&) infixr 3 <&&> -- same as (&&) +(<||>) :: Applicative f => f Bool -> f Bool -> f Bool +(<||>) = liftA2 (||) +infixr 2 <||> -- same as (||) + {- ************************************************************************ * * diff --git a/testsuite/tests/parser/should_compile/T10196.hs b/testsuite/tests/parser/should_compile/T10196.hs new file mode 100644 index 0000000..f809118 --- /dev/null +++ b/testsuite/tests/parser/should_compile/T10196.hs @@ -0,0 +1,13 @@ +module T10196 where + +data X = X? | X? | X? | X? | X? | X? + +f :: Int +f = + let x? = 1 + x? = x? + x? = x? + x? = x? + x? = x? + x? = x? + in x? diff --git a/testsuite/tests/parser/should_compile/all.T b/testsuite/tests/parser/should_compile/all.T index 68845c1..521b5a4 100644 --- a/testsuite/tests/parser/should_compile/all.T +++ b/testsuite/tests/parser/should_compile/all.T @@ -101,4 +101,5 @@ test('T5682', normal, compile, ['']) test('T9723a', normal, compile, ['']) test('T9723b', normal, compile, ['']) test('T10188', normal, compile, ['']) +test('T10196', normal, compile, ['']) test('T10582', expect_broken(10582), compile, ['']) diff --git a/testsuite/tests/parser/should_fail/T10196Fail1.hs b/testsuite/tests/parser/should_fail/T10196Fail1.hs new file mode 100644 index 0000000..2f1c8f3 --- /dev/null +++ b/testsuite/tests/parser/should_fail/T10196Fail1.hs @@ -0,0 +1,4 @@ +module T10196Fail1 where + +-- Constructors are not allowed to start with a modifier letter. +data Foo = ?foo diff --git a/testsuite/tests/parser/should_fail/T10196Fail1.stderr b/testsuite/tests/parser/should_fail/T10196Fail1.stderr new file mode 100644 index 0000000..3c4a173 --- /dev/null +++ b/testsuite/tests/parser/should_fail/T10196Fail1.stderr @@ -0,0 +1,2 @@ + +T10196Fail1.hs:4:12: error: lexical error at character '\7526' diff --git a/testsuite/tests/parser/should_fail/T10196Fail2.hs b/testsuite/tests/parser/should_fail/T10196Fail2.hs new file mode 100644 index 0000000..64b3cac --- /dev/null +++ b/testsuite/tests/parser/should_fail/T10196Fail2.hs @@ -0,0 +1,4 @@ +module T10196Fail2 where + +-- Variables are not allowed to start with a modifier letter. +? = 1 diff --git a/testsuite/tests/parser/should_fail/T10196Fail2.stderr b/testsuite/tests/parser/should_fail/T10196Fail2.stderr new file mode 100644 index 0000000..abba8aa --- /dev/null +++ b/testsuite/tests/parser/should_fail/T10196Fail2.stderr @@ -0,0 +1,2 @@ + +T10196Fail2.hs:4:1: error: lexical error at character '\7526' diff --git a/testsuite/tests/parser/should_fail/T10196Fail3.hs b/testsuite/tests/parser/should_fail/T10196Fail3.hs new file mode 100644 index 0000000..09b80dd --- /dev/null +++ b/testsuite/tests/parser/should_fail/T10196Fail3.hs @@ -0,0 +1,6 @@ +module T10196Fail3 where + +-- Modifier letters are not allowed in the middle of an identifier. +-- And this should not be lexed as 2 separate identifiers either. +x?x :: Int +x?x = 1 diff --git a/testsuite/tests/parser/should_fail/T10196Fail3.stderr b/testsuite/tests/parser/should_fail/T10196Fail3.stderr new file mode 100644 index 0000000..6403744 --- /dev/null +++ b/testsuite/tests/parser/should_fail/T10196Fail3.stderr @@ -0,0 +1,2 @@ + +T10196Fail3.hs:5:2: error: lexical error at character '/7526' diff --git a/testsuite/tests/parser/should_fail/all.T b/testsuite/tests/parser/should_fail/all.T index affea92..33da721 100644 --- a/testsuite/tests/parser/should_fail/all.T +++ b/testsuite/tests/parser/should_fail/all.T @@ -88,3 +88,6 @@ test('T8431', compile_timeout_multiplier(0.05), compile_fail, ['-XAlternativeLayoutRule']) test('T8506', normal, compile_fail, ['']) test('T9225', normal, compile_fail, ['']) +test('T10196Fail1', normal, compile_fail, ['']) +test('T10196Fail2', normal, compile_fail, ['']) +test('T10196Fail3', expect_broken(10196), compile_fail, ['']) From git at git.haskell.org Fri Jul 3 20:44:38 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 3 Jul 2015 20:44:38 +0000 (UTC) Subject: [commit: ghc] master: Generalize traceM, traceShowM (fixes #10023) (39d83f2) Message-ID: <20150703204438.8BF363A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/39d83f239d33b1d214bdb7f7b3ce94d76d3e1467/ghc >--------------------------------------------------------------- commit 39d83f239d33b1d214bdb7f7b3ce94d76d3e1467 Author: RyanGlScott Date: Fri Jul 3 19:37:06 2015 +0200 Generalize traceM, traceShowM (fixes #10023) This generalizes the type signatures of `traceM` and `traceShowM` to use `Applicative` rather than `Monad`. Reviewers: austin, ekmett, hvr, bgamari Reviewed By: ekmett, hvr, bgamari Subscribers: thomie, bgamari Differential Revision: https://phabricator.haskell.org/D1029 GHC Trac Issues: #10023 >--------------------------------------------------------------- 39d83f239d33b1d214bdb7f7b3ce94d76d3e1467 libraries/base/Debug/Trace.hs | 12 ++++++------ libraries/base/changelog.md | 3 +++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/libraries/base/Debug/Trace.hs b/libraries/base/Debug/Trace.hs index 16aba3c..26a19d8 100644 --- a/libraries/base/Debug/Trace.hs +++ b/libraries/base/Debug/Trace.hs @@ -149,9 +149,9 @@ traceShowId :: (Show a) => a -> a traceShowId a = trace (show a) a {-| -Like 'trace' but returning unit in an arbitrary monad. Allows for convenient -use in do-notation. Note that the application of 'trace' is not an action in the -monad, as 'traceIO' is in the 'IO' monad. +Like 'trace' but returning unit in an arbitrary 'Applicative' context. Allows +for convenient use in do-notation. Note that the application of 'trace' is not +an action in the 'Applicative' context, as 'traceIO' is in the 'IO' type. > ... = do > x <- ... @@ -161,8 +161,8 @@ monad, as 'traceIO' is in the 'IO' monad. @since 4.7.0.0 -} -traceM :: (Monad m) => String -> m () -traceM string = trace string $ return () +traceM :: (Applicative f) => String -> f () +traceM string = trace string $ pure () {-| Like 'traceM', but uses 'show' on the argument to convert it to a 'String'. @@ -175,7 +175,7 @@ Like 'traceM', but uses 'show' on the argument to convert it to a 'String'. @since 4.7.0.0 -} -traceShowM :: (Show a, Monad m) => a -> m () +traceShowM :: (Show a, Applicative f) => a -> f () traceShowM = traceM . show -- | like 'trace', but additionally prints a call stack if one is diff --git a/libraries/base/changelog.md b/libraries/base/changelog.md index df691e3..363210d 100644 --- a/libraries/base/changelog.md +++ b/libraries/base/changelog.md @@ -37,6 +37,9 @@ * `IO` now has a `Monoid` instance + * Generalize `Debug.Trace.{traceM, traceShowM}` from `Monad` to `Applicative` + (#10023) + ## 4.8.1.0 *TBA* * Bundled with GHC 7.10.2 From git at git.haskell.org Fri Jul 3 20:44:41 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 3 Jul 2015 20:44:41 +0000 (UTC) Subject: [commit: ghc] master: Add "since" column for LANGUAGE extensions in user guide (8b55788) Message-ID: <20150703204441.57CC73A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/8b55788cae54c9b79b9fc973e9e77f0de1ccc49b/ghc >--------------------------------------------------------------- commit 8b55788cae54c9b79b9fc973e9e77f0de1ccc49b Author: Alexey Shmalko Date: Fri Jul 3 19:36:56 2015 +0200 Add "since" column for LANGUAGE extensions in user guide Reviewers: austin Reviewed By: austin Subscribers: thomie, bgamari Differential Revision: https://phabricator.haskell.org/D1019 GHC Trac Issues: #9665 >--------------------------------------------------------------- 8b55788cae54c9b79b9fc973e9e77f0de1ccc49b docs/users_guide/flags.xml | 98 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 97 insertions(+), 1 deletion(-) 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 8b55788cae54c9b79b9fc973e9e77f0de1ccc49b From git at git.haskell.org Sat Jul 4 08:26:37 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 4 Jul 2015 08:26:37 +0000 (UTC) Subject: [commit: ghc] master: Fix some validation errors. (889c81c) Message-ID: <20150704082637.84C4C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/889c81c657b5719a8f4091099b7bf186127e9f53/ghc >--------------------------------------------------------------- commit 889c81c657b5719a8f4091099b7bf186127e9f53 Author: Richard Eisenberg Date: Sat Jul 4 09:38:59 2015 +0200 Fix some validation errors. Summary: This fixes test cases T10019 and T10534 The patch for T10019 should be back-ported to master as well. Posting via Phab as a way to distribute a patch against the ghc-7.10 branch, which I don't have push access to. Test Plan: validate Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie, bgamari, mzero Differential Revision: https://phabricator.haskell.org/D1036 >--------------------------------------------------------------- 889c81c657b5719a8f4091099b7bf186127e9f53 testsuite/tests/th/T10019.script | 9 +-------- testsuite/tests/th/T10019.stdout | 2 +- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/testsuite/tests/th/T10019.script b/testsuite/tests/th/T10019.script index 97ecbe1..bb3d0d4 100644 --- a/testsuite/tests/th/T10019.script +++ b/testsuite/tests/th/T10019.script @@ -1,11 +1,4 @@ :set -XTemplateHaskell import Language.Haskell.TH data Option a = Some a | None -$(reify 'Some >>= litE . integerL . toInteger . length . show) --- By taking the length we avoid wobbling when the exact uniques --- chosen by TH change --- --- This was the original --- $(reify 'Some >>= stringE . show) --- which yields --- "DataConI Ghci1.Some (ForallT [KindedTV a_1627391549 StarT] [] (AppT (AppT ArrowT (VarT a_1627391549)) (AppT (ConT Ghci1.Option) (VarT a_1627391549)))) Ghci1.Option (Fixity 9 InfixL)" \ No newline at end of file +$(reify 'Some >>= stringE . pprint) diff --git a/testsuite/tests/th/T10019.stdout b/testsuite/tests/th/T10019.stdout index d65e8e3..e079405 100644 --- a/testsuite/tests/th/T10019.stdout +++ b/testsuite/tests/th/T10019.stdout @@ -1 +1 @@ -181 +"Constructor from Ghci1.Option: Ghci1.Some :: forall (a_0 :: *) . a_0 ->\n Ghci1.Option a_0" From git at git.haskell.org Sat Jul 4 08:36:53 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 4 Jul 2015 08:36:53 +0000 (UTC) Subject: [commit: ghc] master: Replace usages of `-w` by `-fno-warn`s (69beef5) Message-ID: <20150704083653.71B813A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/69beef56a4c020d08e1b0243d4c1a629f972e019/ghc >--------------------------------------------------------------- commit 69beef56a4c020d08e1b0243d4c1a629f972e019 Author: Thomas Miedema Date: Fri Jul 3 01:19:59 2015 +0200 Replace usages of `-w` by `-fno-warn`s And remove unused imports and language pragmas. I checked that the minimum Happy and Alex version requirements, as listed in aclocal.m4, don't have to change. Before building ghc, I ran: - cabal install happy==1.19.4 --with-ghc=ghc-7.8.4 - cabal install alex==3.1.0 --with-ghc=ghc-7.6.3 Differential Revision: https://phabricator.haskell.org/D1032 >--------------------------------------------------------------- 69beef56a4c020d08e1b0243d4c1a629f972e019 aclocal.m4 | 11 +++++++---- compiler/cmm/CmmLex.x | 11 +++++++---- compiler/cmm/CmmParse.y | 8 -------- compiler/parser/Lexer.x | 23 +++++++++++------------ compiler/parser/Parser.y | 8 -------- utils/genapply/GenApply.hs | 11 ++++++++--- utils/genprimopcode/Lexer.x | 18 +++++++++++------- utils/genprimopcode/Parser.y | 8 -------- utils/hpc/HpcParser.y | 16 ---------------- 9 files changed, 44 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 69beef56a4c020d08e1b0243d4c1a629f972e019 From git at git.haskell.org Sat Jul 4 10:51:35 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 4 Jul 2015 10:51:35 +0000 (UTC) Subject: [commit: ghc] master: Support MO_{Add, Sub}IntC and MO_Add2 in the LLVM backend (b1d1c65) Message-ID: <20150704105135.E692C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/b1d1c652908ecd7bfcf13cf2e5dd06ac7926992c/ghc >--------------------------------------------------------------- commit b1d1c652908ecd7bfcf13cf2e5dd06ac7926992c Author: Michal Terepeta Date: Sat Jul 4 12:52:02 2015 +0200 Support MO_{Add,Sub}IntC and MO_Add2 in the LLVM backend This includes: - Adding new LlvmType called LMStructP that represents an unpacked struct (this is necessary since LLVM's instructions the llvm.sadd.with.overflow.* return an unpacked struct). - Modifications to LlvmCodeGen.CodeGen to generate the LLVM instructions for the primops. - Modifications to StgCmmPrim to actually use those three instructions if we use the LLVM backend (so far they were only used for NCG). Test Plan: validate Reviewers: austin, rwbarton, bgamari Reviewed By: bgamari Subscribers: thomie, bgamari Differential Revision: https://phabricator.haskell.org/D991 GHC Trac Issues: #9430 >--------------------------------------------------------------- b1d1c652908ecd7bfcf13cf2e5dd06ac7926992c compiler/codeGen/StgCmmPrim.hs | 13 +++-- compiler/llvmGen/Llvm/AbsSyn.hs | 8 +++ compiler/llvmGen/Llvm/PpLlvm.hs | 7 +++ compiler/llvmGen/Llvm/Types.hs | 14 ++++- compiler/llvmGen/LlvmCodeGen/CodeGen.hs | 87 ++++++++++++++++++++++++++++- testsuite/tests/primops/should_run/T9430.hs | 75 +++++++++++++++++++++++++ testsuite/tests/primops/should_run/all.T | 3 +- 7 files changed, 198 insertions(+), 9 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 b1d1c652908ecd7bfcf13cf2e5dd06ac7926992c From git at git.haskell.org Sat Jul 4 13:35:33 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 4 Jul 2015 13:35:33 +0000 (UTC) Subject: [commit: ghc] master: Testsuite: add -ignore-dot-ghci to some tests (124f399) Message-ID: <20150704133533.5DA7F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/124f3999d78d8ef6b093e4f1bb1dcef87e4283da/ghc >--------------------------------------------------------------- commit 124f3999d78d8ef6b093e4f1bb1dcef87e4283da Author: Thomas Miedema Date: Sat Jul 4 11:57:44 2015 +0200 Testsuite: add -ignore-dot-ghci to some tests Since T10408A and T10408B would become the same now, delete T10408A and rename T10408B to T10408. The test without -ignore-dot-ghci (T10408A) didn't add anything (#10408). >--------------------------------------------------------------- 124f3999d78d8ef6b093e4f1bb1dcef87e4283da testsuite/tests/driver/Makefile | 12 ++++++------ testsuite/tests/driver/all.T | 2 +- testsuite/tests/ghci/scripts/Makefile | 11 ++++------- .../tests/ghci/scripts/{T10408A.stdout => T10408.stdout} | 0 testsuite/tests/ghci/scripts/T10408B.stdout | 2 -- testsuite/tests/ghci/scripts/all.T | 6 ++---- testsuite/tests/th/Makefile | 2 +- 7 files changed, 14 insertions(+), 21 deletions(-) diff --git a/testsuite/tests/driver/Makefile b/testsuite/tests/driver/Makefile index d463ebf..d5ce683 100644 --- a/testsuite/tests/driver/Makefile +++ b/testsuite/tests/driver/Makefile @@ -434,14 +434,14 @@ T2566:: mode001: "$(TEST_HC)" $(TEST_HC_OPTS_NO_RECOMP) --make --help | sed '2,$$d' "$(TEST_HC)" $(TEST_HC_OPTS_NO_RECOMP) --help --make | sed '2,$$d' - "$(TEST_HC)" $(TEST_HC_OPTS_NO_RECOMP) --interactive --help | sed '2,$$d' - "$(TEST_HC)" $(TEST_HC_OPTS_NO_RECOMP) --help --interactive | sed '2,$$d' + "$(TEST_HC)" $(TEST_HC_OPTS_NO_RECOMP) --interactive --help -ignore-dot-ghci | sed '2,$$d' + "$(TEST_HC)" $(TEST_HC_OPTS_NO_RECOMP) --help --interactive -ignore-dot-ghci | sed '2,$$d' "$(TEST_HC)" $(TEST_HC_OPTS_NO_RECOMP) --version --help | sed "s/, version.*//" "$(TEST_HC)" $(TEST_HC_OPTS_NO_RECOMP) --help --version | sed '2,$$d' - "$(TEST_HC)" $(TEST_HC_OPTS_NO_RECOMP) --interactive --version | sed "s/, version.*//" - "$(TEST_HC)" $(TEST_HC_OPTS_NO_RECOMP) --version --interactive | sed "s/, version.*//" - "$(TEST_HC)" $(TEST_HC_OPTS_NO_RECOMP) --interactive --show-options | grep -- --interactive | sed '2,$$d' - "$(TEST_HC)" $(TEST_HC_OPTS_NO_RECOMP) --show-options --interactive | grep -- --interactive | sed '2,$$d' + "$(TEST_HC)" $(TEST_HC_OPTS_NO_RECOMP) --interactive --version -ignore-dot-ghci | sed "s/, version.*//" + "$(TEST_HC)" $(TEST_HC_OPTS_NO_RECOMP) --version --interactive -ignore-dot-ghci | sed "s/, version.*//" + "$(TEST_HC)" $(TEST_HC_OPTS_NO_RECOMP) --interactive --show-options -ignore-dot-ghci | grep -- --interactive | sed '2,$$d' + "$(TEST_HC)" $(TEST_HC_OPTS_NO_RECOMP) --show-options --interactive -ignore-dot-ghci | grep -- --interactive | sed '2,$$d' # Test for building DLLs with ghc -shared, see #2745 shared001: diff --git a/testsuite/tests/driver/all.T b/testsuite/tests/driver/all.T index fa9e7b0..3f1ad79 100644 --- a/testsuite/tests/driver/all.T +++ b/testsuite/tests/driver/all.T @@ -428,7 +428,7 @@ test('T9938B', ['$MAKE -s --no-print-directory T9938B']) test('T9963', exit_code(1), run_command, - ['{compiler} --interactive --print-libdir']) + ['{compiler} --interactive -ignore-dot-ghci --print-libdir']) test('T10219', normal, run_command, # `-x hspp` in make mode should work. diff --git a/testsuite/tests/ghci/scripts/Makefile b/testsuite/tests/ghci/scripts/Makefile index 1c1dadb..730927b 100644 --- a/testsuite/tests/ghci/scripts/Makefile +++ b/testsuite/tests/ghci/scripts/Makefile @@ -48,12 +48,9 @@ T9367: T9762_prep: '$(TEST_HC)' $(TEST_HC_OPTS) -v0 -O -fhpc -dynamic T9762B.hs -.PHONY: T10408A -T10408A: - '$(TEST_HC)' $(TEST_HC_OPTS) --interactive -v0 \ - -ghci-script T10408A.script -ghci-script T10408B.script < /dev/null - -.PHONY: T10408B -T10408B: +.PHONY: T10408 +T10408: + # `-ghci-script`s should be executed in the order they are specified, + # 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 diff --git a/testsuite/tests/ghci/scripts/T10408A.stdout b/testsuite/tests/ghci/scripts/T10408.stdout similarity index 100% rename from testsuite/tests/ghci/scripts/T10408A.stdout rename to testsuite/tests/ghci/scripts/T10408.stdout diff --git a/testsuite/tests/ghci/scripts/T10408B.stdout b/testsuite/tests/ghci/scripts/T10408B.stdout deleted file mode 100644 index b13d0a4..0000000 --- a/testsuite/tests/ghci/scripts/T10408B.stdout +++ /dev/null @@ -1,2 +0,0 @@ -"T10408A" -"T10408B" diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T index aecadc4..747e708 100755 --- a/testsuite/tests/ghci/scripts/all.T +++ b/testsuite/tests/ghci/scripts/all.T @@ -212,10 +212,8 @@ test('T10122', normal, ghci_script, ['T10122.script']) test('T10321', normal, ghci_script, ['T10321.script']) -test('T10408A', normal, run_command, - ['$MAKE -s --no-print-directory T10408A']) -test('T10408B', normal, run_command, - ['$MAKE -s --no-print-directory T10408B']) +test('T10408', normal, run_command, + ['$MAKE -s --no-print-directory T10408']) test('T10248', normal, ghci_script, ['T10248.script']) test('T10110', normal, ghci_script, ['T10110.script']) test('T10322', normal, ghci_script, ['T10322.script']) diff --git a/testsuite/tests/th/Makefile b/testsuite/tests/th/Makefile index 031c285..d219e80 100644 --- a/testsuite/tests/th/Makefile +++ b/testsuite/tests/th/Makefile @@ -36,7 +36,7 @@ TH_Depends: T8333: - '$(TEST_HC)' $(TEST_HC_OPTS) $(ghcThWayFlags) --interactive -v0 -ignore-ghci-script T8333.hs < /dev/null + '$(TEST_HC)' $(TEST_HC_OPTS) $(ghcThWayFlags) --interactive -v0 -ignore-dot-ghci T8333.hs < /dev/null # This was an easy way to re-use the stdout testing # to check the contents of a generated file. From git at git.haskell.org Sat Jul 4 13:35:36 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 4 Jul 2015 13:35:36 +0000 (UTC) Subject: [commit: ghc] master: Remove dead code / overlapping pattern (#9723) (ced27de) Message-ID: <20150704133536.141FE3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/ced27def2d33119ed9fcc22f92856f132fd72217/ghc >--------------------------------------------------------------- commit ced27def2d33119ed9fcc22f92856f132fd72217 Author: Thomas Miedema Date: Sat Jul 4 15:27:45 2015 +0200 Remove dead code / overlapping pattern (#9723) >--------------------------------------------------------------- ced27def2d33119ed9fcc22f92856f132fd72217 compiler/parser/Lexer.x | 2 -- 1 file changed, 2 deletions(-) diff --git a/compiler/parser/Lexer.x b/compiler/parser/Lexer.x index 1ee5c03..8e6e67d 100644 --- a/compiler/parser/Lexer.x +++ b/compiler/parser/Lexer.x @@ -2167,8 +2167,6 @@ addTabWarning srcspan then s{tab_first = tf', tab_count = tc'} else s in POk s' () -addTabWarning _ - = P $ \s -> POk s () mkTabWarning :: PState -> Maybe ErrMsg mkTabWarning PState{tab_first=tf, tab_count=tc, dflags=d} = From git at git.haskell.org Sat Jul 4 13:35:38 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 4 Jul 2015 13:35:38 +0000 (UTC) Subject: [commit: ghc] master: Lexer: remove -fno-warn-unused-do-bind (a4b0342) Message-ID: <20150704133538.BA86B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a4b03428e402b36ba2d36da34bcb7465f603724d/ghc >--------------------------------------------------------------- commit a4b03428e402b36ba2d36da34bcb7465f603724d Author: Thomas Miedema Date: Sat Jul 4 15:20:04 2015 +0200 Lexer: remove -fno-warn-unused-do-bind >--------------------------------------------------------------- a4b03428e402b36ba2d36da34bcb7465f603724d compiler/cmm/CmmLex.x | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/compiler/cmm/CmmLex.x b/compiler/cmm/CmmLex.x index 820899b..cb71c7d 100644 --- a/compiler/cmm/CmmLex.x +++ b/compiler/cmm/CmmLex.x @@ -11,7 +11,6 @@ ----------------------------------------------------------------------------- { -{-# OPTIONS_GHC -fno-warn-unused-do-bind #-} {-# OPTIONS_GHC -fno-warn-unused-matches #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} {-# OPTIONS_GHC -fno-warn-tabs #-} @@ -190,7 +189,7 @@ begin :: Int -> Action begin code _span _str _len = do pushLexState code; lexToken pop :: Action -pop _span _buf _len = do popLexState; lexToken +pop _span _buf _len = popLexState >> lexToken special_char :: Action special_char span buf len = return (L span (CmmT_SpecChar (currentChar buf))) @@ -291,16 +290,14 @@ setLine code span buf len = do setSrcLoc (mkRealSrcLoc (srcSpanFile span) (fromIntegral line - 1) 1) -- subtract one: the line number refers to the *following* line -- trace ("setLine " ++ show line) $ do - popLexState - pushLexState code + popLexState >> pushLexState code lexToken setFile :: Int -> Action setFile code span buf len = do let file = lexemeToFastString (stepOn buf) (len-2) setSrcLoc (mkRealSrcLoc file (srcSpanEndLine span) (srcSpanEndCol span)) - popLexState - pushLexState code + popLexState >> pushLexState code lexToken -- ----------------------------------------------------------------------------- From git at git.haskell.org Sat Jul 4 13:49:04 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 4 Jul 2015 13:49:04 +0000 (UTC) Subject: [commit: ghc] master: Comments only [skip ci] (aa778c8) Message-ID: <20150704134904.BD2B63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/aa778c8e5142b5a30905be12062cf443268db7ae/ghc >--------------------------------------------------------------- commit aa778c8e5142b5a30905be12062cf443268db7ae Author: Thomas Miedema Date: Sat Jul 4 11:57:44 2015 +0200 Comments only [skip ci] Follow up to 124f3999d78d8ef6b093e4f1bb1dcef87e4283da. >--------------------------------------------------------------- aa778c8e5142b5a30905be12062cf443268db7ae ghc/InteractiveUI.hs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ghc/InteractiveUI.hs b/ghc/InteractiveUI.hs index d392327..3912198 100644 --- a/ghc/InteractiveUI.hs +++ b/ghc/InteractiveUI.hs @@ -597,6 +597,10 @@ nextInputLine show_prompt is_tty checkFileAndDirPerms :: FilePath -> IO Bool checkFileAndDirPerms file = do file_ok <- checkPerms file + -- Do not check dir perms when .ghci doesn't exist, otherwise GHCi will + -- print some confusing and useless warnings in some cases (e.g. in + -- travis). Note that we can't add a test for this, as all ghci tests should + -- run with -ignore-dot-ghci, which means we never get here. if file_ok then checkPerms (getDirectory file) else return False where getDirectory f = case takeDirectory f of From git at git.haskell.org Sat Jul 4 22:43:55 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 4 Jul 2015 22:43:55 +0000 (UTC) Subject: [commit: ghc] master: Use -fno-warn-unused-imports instead of hiding `ord` (c875b08) Message-ID: <20150704224355.DBB183A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/c875b085d95377771a5b3cf0f44bb2910dbfe966/ghc >--------------------------------------------------------------- commit c875b085d95377771a5b3cf0f44bb2910dbfe966 Author: Thomas Miedema Date: Sat Jul 4 18:20:06 2015 +0200 Use -fno-warn-unused-imports instead of hiding `ord` This is more future proof. Maybe later versions of Alex won't `import Data.Char (ord)` anymore. >--------------------------------------------------------------- c875b085d95377771a5b3cf0f44bb2910dbfe966 compiler/cmm/CmmLex.x | 3 ++- compiler/parser/Lexer.x | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/compiler/cmm/CmmLex.x b/compiler/cmm/CmmLex.x index cb71c7d..fca5a1e 100644 --- a/compiler/cmm/CmmLex.x +++ b/compiler/cmm/CmmLex.x @@ -13,6 +13,7 @@ { {-# OPTIONS_GHC -fno-warn-unused-matches #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} +{-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-tabs #-} {-# OPTIONS_GHC -fno-warn-missing-signatures #-} -- The above warning suppression flags are a temporary kludge. @@ -37,7 +38,7 @@ import Util --import TRACE import Data.Word -import Data.Char hiding (ord) +import Data.Char } $whitechar = [\ \t\n\r\f\v\xa0] -- \xa0 is Unicode no-break space diff --git a/compiler/parser/Lexer.x b/compiler/parser/Lexer.x index 8e6e67d..df7347e 100644 --- a/compiler/parser/Lexer.x +++ b/compiler/parser/Lexer.x @@ -45,6 +45,7 @@ {-# LANGUAGE BangPatterns #-} {-# OPTIONS_GHC -fno-warn-unused-matches #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} +{-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-tabs #-} {-# OPTIONS_GHC -fno-warn-missing-signatures #-} {-# OPTIONS_GHC -fno-warn-overlapping-patterns #-} @@ -84,7 +85,7 @@ import Control.Applicative #endif import Control.Monad import Data.Bits -import Data.Char hiding (ord) +import Data.Char import Data.List import Data.Maybe import Data.Word From git at git.haskell.org Sat Jul 4 22:43:58 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 4 Jul 2015 22:43:58 +0000 (UTC) Subject: [commit: ghc] master: Lexer.x and Parser.y: delete dead code (8e12a21) Message-ID: <20150704224358.ACF1A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/8e12a21546877003ee13d87ab784ee1b9d4bd4d7/ghc >--------------------------------------------------------------- commit 8e12a21546877003ee13d87ab784ee1b9d4bd4d7 Author: Thomas Miedema Date: Sat Jul 4 23:06:06 2015 +0200 Lexer.x and Parser.y: delete dead code >--------------------------------------------------------------- 8e12a21546877003ee13d87ab784ee1b9d4bd4d7 compiler/parser/Lexer.x | 11 +---------- compiler/parser/Parser.y | 7 ------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/compiler/parser/Lexer.x b/compiler/parser/Lexer.x index df7347e..a73487b 100644 --- a/compiler/parser/Lexer.x +++ b/compiler/parser/Lexer.x @@ -637,8 +637,6 @@ data Token | ITqconid (FastString,FastString) | ITqvarsym (FastString,FastString) | ITqconsym (FastString,FastString) - | ITprefixqvarsym (FastString,FastString) - | ITprefixqconsym (FastString,FastString) | ITdupipvarid FastString -- GHC extension: implicit param: ?x @@ -1147,11 +1145,9 @@ varid span buf len = conid :: StringBuffer -> Int -> Token conid buf len = ITconid $! lexemeToFastString buf len -qvarsym, qconsym, prefixqvarsym, prefixqconsym :: StringBuffer -> Int -> Token +qvarsym, qconsym :: StringBuffer -> Int -> Token qvarsym buf len = ITqvarsym $! splitQualName buf len False qconsym buf len = ITqconsym $! splitQualName buf len False -prefixqvarsym buf len = ITprefixqvarsym $! splitQualName buf len True -prefixqconsym buf len = ITprefixqconsym $! splitQualName buf len True varsym, consym :: Action varsym = sym ITvarsym @@ -1653,11 +1649,6 @@ quasiquote_error start = do -- ----------------------------------------------------------------------------- -- Warnings -warn :: WarningFlag -> SDoc -> Action -warn option warning srcspan _buf _len = do - addWarning option (RealSrcSpan srcspan) warning - lexToken - warnTab :: Action warnTab srcspan _buf _len = do addTabWarning srcspan diff --git a/compiler/parser/Parser.y b/compiler/parser/Parser.y index a2d89b2..d697253 100644 --- a/compiler/parser/Parser.y +++ b/compiler/parser/Parser.y @@ -546,8 +546,6 @@ for some background. QCONID { L _ (ITqconid _) } QVARSYM { L _ (ITqvarsym _) } QCONSYM { L _ (ITqconsym _) } - PREFIXQVARSYM { L _ (ITprefixqvarsym _) } - PREFIXQCONSYM { L _ (ITprefixqconsym _) } IPDUPVARID { L _ (ITdupipvarid _) } -- GHC extension @@ -2884,7 +2882,6 @@ qtyconop :: { Located RdrName } -- Qualified or unqualified qtycon :: { Located RdrName } -- Qualified or unqualified : QCONID { sL1 $1 $! mkQual tcClsName (getQCONID $1) } - | PREFIXQCONSYM { sL1 $1 $! mkQual tcClsName (getPREFIXQCONSYM $1) } | tycon { $1 } tycon :: { Located RdrName } -- Unqualified @@ -2982,7 +2979,6 @@ qvar :: { Located RdrName } qvarid :: { Located RdrName } : varid { $1 } | QVARID { sL1 $1 $! mkQual varName (getQVARID $1) } - | PREFIXQVARSYM { sL1 $1 $! mkQual varName (getPREFIXQVARSYM $1) } -- Note that 'role' and 'family' get lexed separately regardless of -- the use of extensions. However, because they are listed here, this @@ -3047,7 +3043,6 @@ special_sym : '!' {% ams (sL1 $1 (fsLit "!")) [mj AnnBang $1] } qconid :: { Located RdrName } -- Qualified or unqualified : conid { $1 } | QCONID { sL1 $1 $! mkQual dataName (getQCONID $1) } - | PREFIXQCONSYM { sL1 $1 $! mkQual dataName (getPREFIXQCONSYM $1) } conid :: { Located RdrName } : CONID { sL1 $1 $ mkUnqual dataName (getCONID $1) } @@ -3146,8 +3141,6 @@ getQVARID (L _ (ITqvarid x)) = x getQCONID (L _ (ITqconid x)) = x getQVARSYM (L _ (ITqvarsym x)) = x getQCONSYM (L _ (ITqconsym x)) = x -getPREFIXQVARSYM (L _ (ITprefixqvarsym x)) = x -getPREFIXQCONSYM (L _ (ITprefixqconsym x)) = x getIPDUPVARID (L _ (ITdupipvarid x)) = x getCHAR (L _ (ITchar _ x)) = x getSTRING (L _ (ITstring _ x)) = x From git at git.haskell.org Sat Jul 4 23:40:16 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 4 Jul 2015 23:40:16 +0000 (UTC) Subject: [commit: ghc] master: Easy way to defer type errors (implements #8353) (5d48e67) Message-ID: <20150704234016.2ED213A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/5d48e67fac952f7188fc9ebcfbf6e3ccb9b75705/ghc >--------------------------------------------------------------- commit 5d48e67fac952f7188fc9ebcfbf6e3ccb9b75705 Author: Benjamin Bykowski Date: Sun Jul 5 01:38:22 2015 +0200 Easy way to defer type errors (implements #8353) Added load! and reload! commands, effectively setting "-fdefer-type-errors" before loading a file and unsetting it after loading if it has not been set before. Differential Revision: https://phabricator.haskell.org/D960 >--------------------------------------------------------------- 5d48e67fac952f7188fc9ebcfbf6e3ccb9b75705 docs/users_guide/7.12.1-notes.xml | 5 ++++ docs/users_guide/ghci.xml | 22 ++++++++++++++-- ghc/InteractiveUI.hs | 42 ++++++++++++++++++++----------- testsuite/tests/ghci/scripts/Defer03.hs | 7 ++++++ testsuite/tests/ghci/scripts/T8353.script | 22 ++++++++++++++++ testsuite/tests/ghci/scripts/T8353.stderr | 25 ++++++++++++++++++ testsuite/tests/ghci/scripts/all.T | 1 + 7 files changed, 108 insertions(+), 16 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 5d48e67fac952f7188fc9ebcfbf6e3ccb9b75705 From git at git.haskell.org Sun Jul 5 10:37:38 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 5 Jul 2015 10:37:38 +0000 (UTC) Subject: [commit: ghc] master: Fix typo [skip ci] (#10605) (3fabb71) Message-ID: <20150705103738.889BA3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/3fabb71a559b493efdfb5bb91907f6a0f696a114/ghc >--------------------------------------------------------------- commit 3fabb71a559b493efdfb5bb91907f6a0f696a114 Author: Thomas Miedema Date: Sun Jul 5 12:37:33 2015 +0200 Fix typo [skip ci] (#10605) >--------------------------------------------------------------- 3fabb71a559b493efdfb5bb91907f6a0f696a114 libraries/base/Data/Traversable.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/base/Data/Traversable.hs b/libraries/base/Data/Traversable.hs index cc72392..1d3ef93 100644 --- a/libraries/base/Data/Traversable.hs +++ b/libraries/base/Data/Traversable.hs @@ -104,7 +104,7 @@ import qualified GHC.List as List ( foldr ) -- > instance Functor Identity where -- > fmap f (Identity x) = Identity (f x) -- > --- > instance Applicative Indentity where +-- > instance Applicative Identity where -- > pure x = Identity x -- > Identity f <*> Identity x = Identity (f x) -- > From git at git.haskell.org Sun Jul 5 23:15:38 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 5 Jul 2015 23:15:38 +0000 (UTC) Subject: [commit: ghc] master: rts: fix incorrect checking start for -x arguments (#9839) (75de613) Message-ID: <20150705231538.5C34B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/75de6131efc780dbdba30fa3fc48c16231ab66a9/ghc >--------------------------------------------------------------- commit 75de6131efc780dbdba30fa3fc48c16231ab66a9 Author: Nikita Kartashov Date: Mon Jul 6 01:09:26 2015 +0200 rts: fix incorrect checking start for -x arguments (#9839) After previous fix, flag combinations such as -xt and -xc resulted in an error due to the fact that the checking started from index 2, which was always 'x' in that case. Now they are correctly processed. Differential Revision: https://phabricator.haskell.org/D1039 >--------------------------------------------------------------- 75de6131efc780dbdba30fa3fc48c16231ab66a9 rts/RtsFlags.c | 18 ++++++++++++++++-- .../tests/{ghc-api/T7478/C.hs => rts/T9839_04.hs} | 0 .../tests/{ghc-api/T7478/C.hs => rts/T9839_05.hs} | 0 .../tests/{ghc-api/T7478/C.hs => rts/T9839_06.hs} | 0 testsuite/tests/rts/all.T | 12 ++++++++++++ 5 files changed, 28 insertions(+), 2 deletions(-) diff --git a/rts/RtsFlags.c b/rts/RtsFlags.c index 4e23eb8..9955518 100644 --- a/rts/RtsFlags.c +++ b/rts/RtsFlags.c @@ -643,6 +643,7 @@ static void procRtsOpts (int rts_argc0, { rtsBool error = rtsFalse; int arg; + int unchecked_arg_start; if (!(rts_argc0 < rts_argc)) return; @@ -671,7 +672,9 @@ static void procRtsOpts (int rts_argc0, error = rtsTrue; } else { - + /* 0 is dash, 1 is first letter */ + /* see Trac #9839 */ + unchecked_arg_start = 1; switch(rts_argv[arg][1]) { /* process: general args, then PROFILING-only ones, then @@ -820,6 +823,7 @@ error = rtsTrue; case 'B': OPTION_UNSAFE; RtsFlags.GcFlags.ringBell = rtsTrue; + unchecked_arg_start++; goto check_rest; case 'c': @@ -835,6 +839,7 @@ error = rtsTrue; case 'w': OPTION_UNSAFE; RtsFlags.GcFlags.sweep = rtsTrue; + unchecked_arg_start++; goto check_rest; case 'F': @@ -1001,6 +1006,7 @@ error = rtsTrue; case 'T': OPTION_SAFE; RtsFlags.GcFlags.giveStats = COLLECT_GC_STATS; + unchecked_arg_start++; goto check_rest; /* Don't initialize statistics file. */ case 'S': @@ -1033,6 +1039,7 @@ error = rtsTrue; case 'Z': OPTION_UNSAFE; RtsFlags.GcFlags.squeezeUpdFrames = rtsFalse; + unchecked_arg_start++; goto check_rest; /* =========== PROFILING ========================== */ @@ -1061,6 +1068,7 @@ error = rtsTrue; } break; default: + unchecked_arg_start++; goto check_rest; } ) break; @@ -1378,6 +1386,7 @@ error = rtsTrue; /* =========== EXTENDED OPTIONS =================== */ case 'x': /* Extend the argument space */ + unchecked_arg_start++; switch(rts_argv[arg][2]) { case '\0': OPTION_SAFE; @@ -1418,6 +1427,7 @@ error = rtsTrue; PROFILING_BUILD_ONLY( RtsFlags.ProfFlags.showCCSOnException = rtsTrue; ); + unchecked_arg_start++; goto check_rest; case 't': /* Include memory used by TSOs in a heap profile */ @@ -1425,6 +1435,7 @@ error = rtsTrue; PROFILING_BUILD_ONLY( RtsFlags.ProfFlags.includeTSOs = rtsTrue; ); + unchecked_arg_start++; goto check_rest; /* @@ -1451,7 +1462,10 @@ error = rtsTrue; /* see Trac #9839 */ check_rest: { - if (rts_argv[arg][2] != '\0') { + /* start checking from the first unchecked position, + * not from index 2*/ + /* see Trac #9839 */ + if (rts_argv[arg][unchecked_arg_start] != '\0') { errorBelch("flag -%c given an argument" " when none was expected: %s", rts_argv[arg][1],rts_argv[arg]); diff --git a/testsuite/tests/ghc-api/T7478/C.hs b/testsuite/tests/rts/T9839_04.hs old mode 100644 new mode 100755 similarity index 100% copy from testsuite/tests/ghc-api/T7478/C.hs copy to testsuite/tests/rts/T9839_04.hs diff --git a/testsuite/tests/ghc-api/T7478/C.hs b/testsuite/tests/rts/T9839_05.hs old mode 100644 new mode 100755 similarity index 100% copy from testsuite/tests/ghc-api/T7478/C.hs copy to testsuite/tests/rts/T9839_05.hs diff --git a/testsuite/tests/ghc-api/T7478/C.hs b/testsuite/tests/rts/T9839_06.hs old mode 100644 new mode 100755 similarity index 100% copy from testsuite/tests/ghc-api/T7478/C.hs copy to testsuite/tests/rts/T9839_06.hs diff --git a/testsuite/tests/rts/all.T b/testsuite/tests/rts/all.T index 71c10d2..8f6137f 100644 --- a/testsuite/tests/rts/all.T +++ b/testsuite/tests/rts/all.T @@ -306,3 +306,15 @@ test('T9839_02', [ only_ways(prof_ways), ignore_output, exit_code(1), extra_run_ test('T9839_03', [ only_ways(prof_ways), ignore_output, exit_code(1), extra_run_opts('+RTS -Px')], compile_and_run, ['']) + +test('T9839_04', [ only_ways(prof_ways), ignore_output, exit_code(0), extra_run_opts('+RTS -xc')], + compile_and_run, + ['']) + +test('T9839_05', [ only_ways(prof_ways), ignore_output, exit_code(1), extra_run_opts('+RTS -xcx')], + compile_and_run, + ['']) + +test('T9839_06', [ only_ways(prof_ways), ignore_output, exit_code(1), extra_run_opts('+RTS -xtx')], + compile_and_run, + ['']) From git at git.haskell.org Sun Jul 5 23:15:41 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 5 Jul 2015 23:15:41 +0000 (UTC) Subject: [commit: ghc] master: Remove Hugs specific test setups (omit_compiler_type) (edb2c54) Message-ID: <20150705231541.0F9D63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/edb2c544151a11d6e7f0154ba3ca665850f46bda/ghc >--------------------------------------------------------------- commit edb2c544151a11d6e7f0154ba3ca665850f46bda Author: Thomas Miedema Date: Sat Jul 4 16:11:17 2015 +0200 Remove Hugs specific test setups (omit_compiler_type) >--------------------------------------------------------------- edb2c544151a11d6e7f0154ba3ca665850f46bda testsuite/tests/programs/andre_monad/test.T | 3 +-- testsuite/tests/programs/barton-mangler-bug/test.T | 3 --- testsuite/tests/programs/galois_raytrace/test.T | 2 -- testsuite/tests/programs/jules_xref/test.T | 3 +-- testsuite/tests/programs/life_space_leak/test.T | 1 - testsuite/tests/programs/seward-space-leak/test.T | 2 -- testsuite/tests/typecheck/should_compile/all.T | 2 +- 7 files changed, 3 insertions(+), 13 deletions(-) diff --git a/testsuite/tests/programs/andre_monad/test.T b/testsuite/tests/programs/andre_monad/test.T index 619f4fd..e76b0f1 100644 --- a/testsuite/tests/programs/andre_monad/test.T +++ b/testsuite/tests/programs/andre_monad/test.T @@ -1,8 +1,7 @@ -# exhausts Hugs's heap (CAF leak) test('andre_monad', [when(fast(), skip), extra_clean(['Main.hi', 'Main.o']), - omit_compiler_types(['hugs'])], + ], multimod_compile_and_run, ['Main', '']) diff --git a/testsuite/tests/programs/barton-mangler-bug/test.T b/testsuite/tests/programs/barton-mangler-bug/test.T index f6ad425..5a141fc 100644 --- a/testsuite/tests/programs/barton-mangler-bug/test.T +++ b/testsuite/tests/programs/barton-mangler-bug/test.T @@ -1,5 +1,3 @@ -# Exhausts Hugs's heap (CAF leak) - test('barton-mangler-bug', [when(fast(), skip), extra_clean(['Basic.hi', 'Basic.o', @@ -9,7 +7,6 @@ test('barton-mangler-bug', 'Plot.hi', 'Plot.o', 'PlotExample.hi', 'PlotExample.o', 'TypesettingTricks.hi', 'TypesettingTricks.o']), - omit_compiler_types(['hugs']), omit_ways('debug') # Fails for debug way due to annotation linting timeout ], multimod_compile_and_run, ['Main', '']) diff --git a/testsuite/tests/programs/galois_raytrace/test.T b/testsuite/tests/programs/galois_raytrace/test.T index 3bdcb75..94defef 100644 --- a/testsuite/tests/programs/galois_raytrace/test.T +++ b/testsuite/tests/programs/galois_raytrace/test.T @@ -1,5 +1,3 @@ -setTestOpts(omit_compiler_types(['hugs'])) # takes much too long - # Floating point differences on x86 using the NCG if config.platform.startswith('i386-') and \ config.platform != 'i386-unknown-openbsd': diff --git a/testsuite/tests/programs/jules_xref/test.T b/testsuite/tests/programs/jules_xref/test.T index a8941e0..25c1023 100644 --- a/testsuite/tests/programs/jules_xref/test.T +++ b/testsuite/tests/programs/jules_xref/test.T @@ -1,8 +1,7 @@ -# exhausts Hugs's heap test('jules_xref', [when(fast(), skip), extra_clean(['Main.hi', 'Main.o']), - omit_compiler_types(['hugs'])], + ], multimod_compile_and_run, ['Main', '']) diff --git a/testsuite/tests/programs/life_space_leak/test.T b/testsuite/tests/programs/life_space_leak/test.T index 4483137..a6d634a 100644 --- a/testsuite/tests/programs/life_space_leak/test.T +++ b/testsuite/tests/programs/life_space_leak/test.T @@ -1,4 +1,3 @@ -# exhausts Hugs's heap (CAF leak) test('life_space_leak', [when(fast(), skip), extra_clean(['Main.hi', 'Main.o'])], diff --git a/testsuite/tests/programs/seward-space-leak/test.T b/testsuite/tests/programs/seward-space-leak/test.T index 491da8e..8c22eb5 100644 --- a/testsuite/tests/programs/seward-space-leak/test.T +++ b/testsuite/tests/programs/seward-space-leak/test.T @@ -1,5 +1,3 @@ -setTestOpts(omit_compiler_types(['hugs'])) # takes much too long - test('seward-space-leak', [when(fast(), skip), extra_clean(['Main.hi', 'Main.o'])], multimod_compile_and_run, diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T index 178f9f3..2863db5 100644 --- a/testsuite/tests/typecheck/should_compile/all.T +++ b/testsuite/tests/typecheck/should_compile/all.T @@ -144,7 +144,7 @@ test('tc140', normal, compile, ['']) test('tc141', normal, compile_fail, ['']) test('tc142', normal, compile, ['']) test('tc143', normal, compile, ['']) -test('tc144', omit_compiler_types(['hugs']), compile, ['']) # Hugs loops +test('tc144', normal, compile, ['']) test('tc145', normal, compile, ['']) test('tc146', normal, compile, ['']) test('tc147', normal, compile, ['']) From git at git.haskell.org Sun Jul 5 23:15:43 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 5 Jul 2015 23:15:43 +0000 (UTC) Subject: [commit: ghc] master: Remove all *.stderr/stdout-hugs files (7a3d85e) Message-ID: <20150705231543.C96593A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/7a3d85e705665fbf2c28f83bb3997e8979f2b88c/ghc >--------------------------------------------------------------- commit 7a3d85e705665fbf2c28f83bb3997e8979f2b88c Author: Thomas Miedema Date: Sat Jul 4 16:13:11 2015 +0200 Remove all *.stderr/stdout-hugs files >--------------------------------------------------------------- 7a3d85e705665fbf2c28f83bb3997e8979f2b88c libraries/base/tests/IO/IOError001.stdout-hugs | 2 - libraries/base/tests/IO/hGetLine002.stdout-hugs | 2 - libraries/base/tests/IO/hGetPosn001.stdout-hugs | 5 - libraries/base/tests/IO/openFile002.stderr-hugs | 1 - libraries/base/tests/enum01.stdout-hugs | 246 --------------------- libraries/base/tests/enum02.stdout-hugs | 141 ------------ libraries/base/tests/enum03.stdout-hugs | 142 ------------ libraries/base/tests/unicode001.stdout-hugs | 14 -- .../tests/array/should_run/arr003.stderr-hugs | 1 - .../tests/array/should_run/arr004.stderr-hugs | 1 - .../tests/array/should_run/arr007.stderr-hugs | 1 - .../tests/array/should_run/arr008.stderr-hugs | 1 - .../tests/array/should_run/arr008.stdout-hugs | 2 - .../tests/deSugar/should_run/dsrun005.stderr-hugs | 1 - .../tests/deSugar/should_run/dsrun007.stderr-hugs | 1 - .../tests/deSugar/should_run/dsrun008.stderr-hugs | 1 - .../deriving/should_fail/drvfail002.stderr-hugs | 1 - .../deriving/should_fail/drvfail003.stderr-hugs | 1 - .../deriving/should_fail/drvfail004.stderr-hugs | 4 - .../deriving/should_fail/drvfail006.stderr-hugs | 1 - .../deriving/should_fail/drvfail007.stderr-hugs | 1 - .../deriving/should_fail/drvfail009.stderr-hugs | 1 - .../tests/ffi/should_compile/cc011.stderr-hugs | 2 - .../tests/mdo/should_fail/mdofail001.stderr-hugs | 1 - .../tests/mdo/should_fail/mdofail002.stderr-hugs | 1 - .../tests/mdo/should_fail/mdofail003.stderr-hugs | 1 - .../tests/mdo/should_fail/mdofail004.stderr-hugs | 1 - .../tests/mdo/should_fail/mdofail005.stderr-hugs | 1 - testsuite/tests/module/mod1.stderr-hugs | 1 - testsuite/tests/module/mod10.stderr-hugs | 1 - testsuite/tests/module/mod101.stderr-hugs | 1 - testsuite/tests/module/mod102.stderr-hugs | 1 - testsuite/tests/module/mod110.stderr-hugs | 2 - testsuite/tests/module/mod114.stderr-hugs | 1 - testsuite/tests/module/mod116.stderr-hugs | 1 - testsuite/tests/module/mod120.stderr-hugs | 1 - testsuite/tests/module/mod121.stderr-hugs | 1 - testsuite/tests/module/mod122.stderr-hugs | 1 - testsuite/tests/module/mod123.stderr-hugs | 1 - testsuite/tests/module/mod124.stderr-hugs | 1 - testsuite/tests/module/mod125.stderr-hugs | 1 - testsuite/tests/module/mod126.stderr-hugs | 1 - testsuite/tests/module/mod127.stderr-hugs | 1 - testsuite/tests/module/mod130.stderr-hugs | 1 - testsuite/tests/module/mod131.stderr-hugs | 2 - testsuite/tests/module/mod132.stderr-hugs | 1 - testsuite/tests/module/mod134.stderr-hugs | 1 - testsuite/tests/module/mod135.stderr-hugs | 1 - testsuite/tests/module/mod136.stderr-hugs | 1 - testsuite/tests/module/mod138.stderr-hugs | 1 - testsuite/tests/module/mod142.stderr-hugs | 2 - testsuite/tests/module/mod143.stderr-hugs | 2 - testsuite/tests/module/mod144.stderr-hugs | 2 - testsuite/tests/module/mod145.stderr-hugs | 2 - testsuite/tests/module/mod146.stderr-hugs | 2 - testsuite/tests/module/mod147.stderr-hugs | 1 - testsuite/tests/module/mod150.stderr-hugs | 2 - testsuite/tests/module/mod151.stderr-hugs | 3 - testsuite/tests/module/mod152.stderr-hugs | 3 - testsuite/tests/module/mod153.stderr-hugs | 3 - testsuite/tests/module/mod155.stderr-hugs | 2 - testsuite/tests/module/mod158.stderr-hugs | 1 - testsuite/tests/module/mod160.stderr-hugs | 1 - testsuite/tests/module/mod161.stderr-hugs | 1 - testsuite/tests/module/mod164.stderr-hugs | 3 - testsuite/tests/module/mod165.stderr-hugs | 3 - testsuite/tests/module/mod17.stderr-hugs | 1 - testsuite/tests/module/mod18.stderr-hugs | 1 - testsuite/tests/module/mod19.stderr-hugs | 1 - testsuite/tests/module/mod2.stderr-hugs | 1 - testsuite/tests/module/mod20.stderr-hugs | 1 - testsuite/tests/module/mod21.stderr-hugs | 1 - testsuite/tests/module/mod22.stderr-hugs | 1 - testsuite/tests/module/mod23.stderr-hugs | 1 - testsuite/tests/module/mod24.stderr-hugs | 1 - testsuite/tests/module/mod25.stderr-hugs | 1 - testsuite/tests/module/mod26.stderr-hugs | 1 - testsuite/tests/module/mod27.stderr-hugs | 1 - testsuite/tests/module/mod29.stderr-hugs | 1 - testsuite/tests/module/mod3.stderr-hugs | 1 - testsuite/tests/module/mod36.stderr-hugs | 1 - testsuite/tests/module/mod38.stderr-hugs | 1 - testsuite/tests/module/mod4.stderr-hugs | 1 - testsuite/tests/module/mod40.stderr-hugs | 1 - testsuite/tests/module/mod41.stderr-hugs | 1 - testsuite/tests/module/mod42.stderr-hugs | 1 - testsuite/tests/module/mod43.stderr-hugs | 1 - testsuite/tests/module/mod44.stderr-hugs | 4 - testsuite/tests/module/mod45.stderr-hugs | 1 - testsuite/tests/module/mod46.stderr-hugs | 4 - testsuite/tests/module/mod47.stderr-hugs | 4 - testsuite/tests/module/mod48.stderr-hugs | 1 - testsuite/tests/module/mod49.stderr-hugs | 1 - testsuite/tests/module/mod50.stderr-hugs | 1 - testsuite/tests/module/mod51.stderr-hugs | 4 - testsuite/tests/module/mod52.stderr-hugs | 4 - testsuite/tests/module/mod53.stderr-hugs | 1 - testsuite/tests/module/mod54.stderr-hugs | 4 - testsuite/tests/module/mod55.stderr-hugs | 1 - testsuite/tests/module/mod56.stderr-hugs | 1 - testsuite/tests/module/mod58.stderr-hugs | 1 - testsuite/tests/module/mod59.stderr-hugs | 1 - testsuite/tests/module/mod60.stderr-hugs | 1 - testsuite/tests/module/mod61.stderr-hugs | 1 - testsuite/tests/module/mod62.stderr-hugs | 1 - testsuite/tests/module/mod63.stderr-hugs | 1 - testsuite/tests/module/mod66.stderr-hugs | 1 - testsuite/tests/module/mod67.stderr-hugs | 1 - testsuite/tests/module/mod68.stderr-hugs | 1 - testsuite/tests/module/mod69.stderr-hugs | 1 - testsuite/tests/module/mod7.stderr-hugs | 1 - testsuite/tests/module/mod70.stderr-hugs | 1 - testsuite/tests/module/mod71.stderr-hugs | 1 - testsuite/tests/module/mod72.stderr-hugs | 1 - testsuite/tests/module/mod73.stderr-hugs | 1 - testsuite/tests/module/mod74.stderr-hugs | 1 - testsuite/tests/module/mod76.stderr-hugs | 1 - testsuite/tests/module/mod77.stderr-hugs | 1 - testsuite/tests/module/mod79.stderr-hugs | 1 - testsuite/tests/module/mod8.stderr-hugs | 1 - testsuite/tests/module/mod80.stderr-hugs | 1 - testsuite/tests/module/mod81.stderr-hugs | 1 - testsuite/tests/module/mod87.stderr-hugs | 1 - testsuite/tests/module/mod88.stderr-hugs | 1 - testsuite/tests/module/mod89.stderr-hugs | 1 - testsuite/tests/module/mod9.stderr-hugs | 1 - testsuite/tests/module/mod90.stderr-hugs | 1 - testsuite/tests/module/mod91.stderr-hugs | 1 - testsuite/tests/module/mod97.stderr-hugs | 1 - testsuite/tests/module/mod98.stderr-hugs | 1 - .../parser/should_fail/readFail001.stderr-hugs | 1 - .../parser/should_fail/readFail002.stderr-hugs | 1 - .../parser/should_fail/readFail003.stderr-hugs | 5 - .../parser/should_fail/readFail004.stderr-hugs | 1 - .../parser/should_fail/readFail005.stderr-hugs | 1 - .../parser/should_fail/readFail006.stderr-hugs | 1 - .../parser/should_fail/readFail008.stderr-hugs | 1 - .../parser/should_fail/readFail009.stderr-hugs | 1 - .../parser/should_fail/readFail011.stderr-hugs | 1 - .../parser/should_fail/readFail012.stderr-hugs | 1 - .../parser/should_fail/readFail013.stderr-hugs | 1 - .../parser/should_fail/readFail014.stderr-hugs | 1 - .../parser/should_fail/readFail015.stderr-hugs | 1 - .../parser/should_fail/readFail017.stderr-hugs | 1 - .../parser/should_fail/readFail018.stderr-hugs | 1 - .../parser/should_fail/readFail019.stderr-hugs | 1 - .../parser/should_fail/readFail020.stderr-hugs | 1 - .../parser/should_fail/readFail022.stderr-hugs | 1 - .../parser/should_fail/readFail024.stderr-hugs | 1 - .../parser/should_fail/readFail025.stderr-hugs | 1 - .../parser/should_fail/readFail026.stderr-hugs | 1 - .../rename/prog002/rename.prog002.stderr-hugs | 1 - .../rename/prog003/rename.prog003.stderr-hugs | 1 - .../tests/rename/should_fail/rnfail001.stderr-hugs | 1 - .../tests/rename/should_fail/rnfail002.stderr-hugs | 1 - .../tests/rename/should_fail/rnfail003.stderr-hugs | 1 - .../tests/rename/should_fail/rnfail004.stderr-hugs | 1 - .../tests/rename/should_fail/rnfail008.stderr-hugs | 1 - .../tests/rename/should_fail/rnfail009.stderr-hugs | 1 - .../tests/rename/should_fail/rnfail010.stderr-hugs | 1 - .../tests/rename/should_fail/rnfail011.stderr-hugs | 1 - .../tests/rename/should_fail/rnfail012.stderr-hugs | 1 - .../tests/rename/should_fail/rnfail013.stderr-hugs | 1 - .../tests/rename/should_fail/rnfail015.stderr-hugs | 1 - .../tests/rename/should_fail/rnfail016.stderr-hugs | 1 - .../tests/rename/should_fail/rnfail019.stderr-hugs | 1 - .../tests/rename/should_fail/rnfail021.stderr-hugs | 1 - .../tests/rename/should_fail/rnfail022.stderr-hugs | 1 - .../tests/rename/should_fail/rnfail023.stderr-hugs | 1 - .../tests/rename/should_fail/rnfail024.stderr-hugs | 1 - .../tests/rename/should_fail/rnfail025.stderr-hugs | 1 - .../tests/rename/should_fail/rnfail026.stderr-hugs | 1 - .../tests/rename/should_fail/rnfail027.stderr-hugs | 1 - .../tests/rename/should_fail/rnfail028.stderr-hugs | 1 - .../tests/rename/should_fail/rnfail029.stderr-hugs | 2 - .../tests/rename/should_fail/rnfail030.stderr-hugs | 1 - .../tests/rename/should_fail/rnfail031.stderr-hugs | 1 - .../tests/rename/should_fail/rnfail032.stderr-hugs | 1 - .../tests/rename/should_fail/rnfail033.stderr-hugs | 1 - .../tests/rename/should_fail/rnfail034.stderr-hugs | 1 - .../tests/rename/should_fail/rnfail035.stderr-hugs | 1 - .../tests/rename/should_fail/rnfail039.stderr-hugs | 1 - .../tests/rename/should_fail/rnfail040.stderr-hugs | 2 - .../tests/rename/should_fail/rnfail041.stderr-hugs | 1 - .../tests/rename/should_fail/rnfail042.stderr-hugs | 1 - .../typecheck/should_fail/tcfail001.stderr-hugs | 4 - .../typecheck/should_fail/tcfail002.stderr-hugs | 5 - .../typecheck/should_fail/tcfail003.stderr-hugs | 3 - .../typecheck/should_fail/tcfail004.stderr-hugs | 4 - .../typecheck/should_fail/tcfail005.stderr-hugs | 4 - .../typecheck/should_fail/tcfail006.stderr-hugs | 3 - .../typecheck/should_fail/tcfail007.stderr-hugs | 1 - .../typecheck/should_fail/tcfail008.stderr-hugs | 3 - .../typecheck/should_fail/tcfail009.stderr-hugs | 5 - .../typecheck/should_fail/tcfail010.stderr-hugs | 3 - .../typecheck/should_fail/tcfail011.stderr-hugs | 1 - .../typecheck/should_fail/tcfail012.stderr-hugs | 4 - .../typecheck/should_fail/tcfail013.stderr-hugs | 4 - .../typecheck/should_fail/tcfail014.stderr-hugs | 6 - .../typecheck/should_fail/tcfail015.stderr-hugs | 1 - .../typecheck/should_fail/tcfail016.stderr-hugs | 5 - .../typecheck/should_fail/tcfail017.stderr-hugs | 4 - .../typecheck/should_fail/tcfail018.stderr-hugs | 3 - .../typecheck/should_fail/tcfail019.stderr-hugs | 4 - .../typecheck/should_fail/tcfail020.stderr-hugs | 4 - .../typecheck/should_fail/tcfail021.stderr-hugs | 1 - .../typecheck/should_fail/tcfail023.stderr-hugs | 4 - .../typecheck/should_fail/tcfail027.stderr-hugs | 1 - .../typecheck/should_fail/tcfail028.stderr-hugs | 1 - .../typecheck/should_fail/tcfail029.stderr-hugs | 1 - .../typecheck/should_fail/tcfail031.stderr-hugs | 5 - .../typecheck/should_fail/tcfail032.stderr-hugs | 4 - .../typecheck/should_fail/tcfail033.stderr-hugs | 5 - .../typecheck/should_fail/tcfail035.stderr-hugs | 4 - .../typecheck/should_fail/tcfail036.stderr-hugs | 4 - .../typecheck/should_fail/tcfail037.stderr-hugs | 2 - .../typecheck/should_fail/tcfail038.stderr-hugs | 1 - .../typecheck/should_fail/tcfail040.stderr-hugs | 3 - .../typecheck/should_fail/tcfail042.stderr-hugs | 4 - .../typecheck/should_fail/tcfail043.stderr-hugs | 3 - .../typecheck/should_fail/tcfail044.stderr-hugs | 1 - .../typecheck/should_fail/tcfail046.stderr-hugs | 1 - .../typecheck/should_fail/tcfail047.stderr-hugs | 1 - .../typecheck/should_fail/tcfail048.stderr-hugs | 1 - .../typecheck/should_fail/tcfail049.stderr-hugs | 1 - .../typecheck/should_fail/tcfail050.stderr-hugs | 1 - .../typecheck/should_fail/tcfail051.stderr-hugs | 1 - .../typecheck/should_fail/tcfail052.stderr-hugs | 1 - .../typecheck/should_fail/tcfail053.stderr-hugs | 1 - .../typecheck/should_fail/tcfail054.stderr-hugs | 1 - .../typecheck/should_fail/tcfail055.stderr-hugs | 4 - .../typecheck/should_fail/tcfail056.stderr-hugs | 4 - .../typecheck/should_fail/tcfail057.stderr-hugs | 1 - .../typecheck/should_fail/tcfail058.stderr-hugs | 1 - .../typecheck/should_fail/tcfail061.stderr-hugs | 1 - .../typecheck/should_fail/tcfail062.stderr-hugs | 1 - .../typecheck/should_fail/tcfail063.stderr-hugs | 1 - .../typecheck/should_fail/tcfail065.stderr-hugs | 4 - .../typecheck/should_fail/tcfail067.stderr-hugs | 5 - .../typecheck/should_fail/tcfail069.stderr-hugs | 4 - .../typecheck/should_fail/tcfail070.stderr-hugs | 1 - .../typecheck/should_fail/tcfail072.stderr-hugs | 5 - .../typecheck/should_fail/tcfail073.stderr-hugs | 4 - .../typecheck/should_fail/tcfail076.stderr-hugs | 4 - .../typecheck/should_fail/tcfail077.stderr-hugs | 1 - .../typecheck/should_fail/tcfail078.stderr-hugs | 1 - .../typecheck/should_fail/tcfail080.stderr-hugs | 3 - .../typecheck/should_fail/tcfail082.stderr-hugs | 1 - .../typecheck/should_fail/tcfail083.stderr-hugs | 1 - .../typecheck/should_fail/tcfail084.stderr-hugs | 1 - .../typecheck/should_fail/tcfail085.stderr-hugs | 3 - .../typecheck/should_fail/tcfail086.stderr-hugs | 1 - .../typecheck/should_fail/tcfail088.stderr-hugs | 1 - .../typecheck/should_fail/tcfail089.stderr-hugs | 1 - .../typecheck/should_fail/tcfail091.stderr-hugs | 1 - .../typecheck/should_fail/tcfail094.stderr-hugs | 1 - .../typecheck/should_fail/tcfail096.stderr-hugs | 5 - .../typecheck/should_fail/tcfail097.stderr-hugs | 3 - .../typecheck/should_fail/tcfail098.stderr-hugs | 1 - .../typecheck/should_fail/tcfail099.stderr-hugs | 4 - .../typecheck/should_fail/tcfail100.stderr-hugs | 1 - .../typecheck/should_fail/tcfail101.stderr-hugs | 1 - .../typecheck/should_fail/tcfail102.stderr-hugs | 5 - .../typecheck/should_fail/tcfail105.stderr-hugs | 1 - .../typecheck/should_fail/tcfail106.stderr-hugs | 4 - .../typecheck/should_fail/tcfail107.stderr-hugs | 1 - .../typecheck/should_fail/tcfail108.stderr-hugs | 2 - .../typecheck/should_fail/tcfail109.stderr-hugs | 4 - .../typecheck/should_fail/tcfail110.stderr-hugs | 1 - .../typecheck/should_fail/tcfail111.stderr-hugs | 1 - .../typecheck/should_fail/tcfail112.stderr-hugs | 3 - .../typecheck/should_fail/tcfail113.stderr-hugs | 1 - .../typecheck/should_fail/tcfail114.stderr-hugs | 1 - .../typecheck/should_fail/tcfail116.stderr-hugs | 3 - .../typecheck/should_fail/tcfail117.stderr-hugs | 1 - .../typecheck/should_fail/tcfail118.stderr-hugs | 4 - .../typecheck/should_fail/tcfail119.stderr-hugs | 4 - .../typecheck/should_fail/tcfail125.stderr-hugs | 5 - .../typecheck/should_fail/tcfail128.stderr-hugs | 5 - .../typecheck/should_fail/tcfail129.stderr-hugs | 1 - .../typecheck/should_fail/tcfail130.stderr-hugs | 3 - .../typecheck/should_fail/tcfail132.stderr-hugs | 1 - .../typecheck/should_fail/tcfail134.stderr-hugs | 1 - .../typecheck/should_fail/tcfail135.stderr-hugs | 1 - 284 files changed, 1026 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 7a3d85e705665fbf2c28f83bb3997e8979f2b88c From git at git.haskell.org Mon Jul 6 08:48:19 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 6 Jul 2015 08:48:19 +0000 (UTC) Subject: [commit: ghc] ghc-7.4: -package P was loading all versions of P in GHCi (#7030) (73bde5b) Message-ID: <20150706084819.841063A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.4 Link : http://ghc.haskell.org/trac/ghc/changeset/73bde5b1a70ce02373ac73885b7260194f30fb44/ghc >--------------------------------------------------------------- commit 73bde5b1a70ce02373ac73885b7260194f30fb44 Author: Simon Marlow Date: Mon Jul 2 15:04:05 2012 +0100 -package P was loading all versions of P in GHCi (#7030) -package P means "the latest version of P" if multiple versions are installed. It was working as advertised, but we were eagerly *linking* all versions of P, which might cause an error if the package has some C code, because we can't link multiple instances of the same symbol. MERGED from commit 62164cf56bd91ddd9449d345f8d710fbbdbf4827 >--------------------------------------------------------------- 73bde5b1a70ce02373ac73885b7260194f30fb44 compiler/main/Packages.lhs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/main/Packages.lhs b/compiler/main/Packages.lhs index d7dc6bc..f8bac59 100644 --- a/compiler/main/Packages.lhs +++ b/compiler/main/Packages.lhs @@ -776,7 +776,9 @@ mkPackageState dflags pkgs0 preload0 this_package = do -- let preload1 = [ installedPackageId p | f <- flags, p <- get_exposed f ] - get_exposed (ExposePackage s) = filter (matchingStr s) pkgs2 + get_exposed (ExposePackage s) + = take 1 $ sortByVersion (filter (matchingStr s) pkgs2) + -- -package P means "the latest version of P" (#7030) get_exposed (ExposePackageId s) = filter (matchingId s) pkgs2 get_exposed _ = [] From git at git.haskell.org Mon Jul 6 08:48:22 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 6 Jul 2015 08:48:22 +0000 (UTC) Subject: [commit: ghc] ghc-7.8: testsuite/T9379: Use GHC.Conc instead of Control.Concurrent.STM (be8556f) Message-ID: <20150706084822.717393A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.8 Link : http://ghc.haskell.org/trac/ghc/changeset/be8556ff4ce8039a6cad59db9fe37ac971d6a31e/ghc >--------------------------------------------------------------- commit be8556ff4ce8039a6cad59db9fe37ac971d6a31e Author: Ben Gamari Date: Tue Aug 12 21:51:57 2014 -0400 testsuite/T9379: Use GHC.Conc instead of Control.Concurrent.STM Summary: `GHC.Conc` provides almost everything we need. Signed-off-by: Ben Gamari Test Plan: make test TEST=T9379 Reviewers: austin Subscribers: simonmar, relrod, ezyang, carter Differential Revision: https://phabricator.haskell.org/D152 GHC Trac Issues: >--------------------------------------------------------------- be8556ff4ce8039a6cad59db9fe37ac971d6a31e testsuite/tests/concurrent/should_run/T9379.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/testsuite/tests/concurrent/should_run/T9379.hs b/testsuite/tests/concurrent/should_run/T9379.hs index 49e6d1e..235b2aa 100644 --- a/testsuite/tests/concurrent/should_run/T9379.hs +++ b/testsuite/tests/concurrent/should_run/T9379.hs @@ -1,6 +1,6 @@ import Control.Exception import Control.Concurrent -import Control.Concurrent.STM +import GHC.Conc import Foreign.StablePtr main :: IO () @@ -10,6 +10,8 @@ main = do t <- mask_ $ forkIO (blockSTM tv) killThread t +check b = if b then return () else retry + blockSTM :: TVar Bool -> IO () blockSTM tv = do atomically $ do From git at git.haskell.org Mon Jul 6 08:48:26 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 6 Jul 2015 08:48:26 +0000 (UTC) Subject: [commit: ghc] ghc-7.8: Merge branch 'ghc-7.8' of https://github.com/ghc/ghc into ghc-7.8 (4816fea) Message-ID: <20150706084826.998303A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.8 Link : http://ghc.haskell.org/trac/ghc/changeset/4816feab0def73e85825216eb49d58eb0de3d43d/ghc >--------------------------------------------------------------- commit 4816feab0def73e85825216eb49d58eb0de3d43d Merge: be8556f 9555516 Author: Ben Gamari Date: Mon Mar 30 12:53:30 2015 -0400 Merge branch 'ghc-7.8' of https://github.com/ghc/ghc into ghc-7.8 >--------------------------------------------------------------- 4816feab0def73e85825216eb49d58eb0de3d43d Makefile | 7 + aclocal.m4 | 24 +- compiler/basicTypes/PatSyn.lhs | 8 +- compiler/cmm/CLabel.hs | 1 + compiler/cmm/PprC.hs | 30 +- compiler/coreSyn/CoreLint.lhs | 15 +- compiler/deSugar/DsArrows.lhs | 4 +- compiler/deSugar/DsCCall.lhs | 6 +- compiler/deSugar/DsExpr.lhs | 6 +- compiler/deSugar/DsMeta.hs | 2 +- compiler/deSugar/MatchLit.lhs | 2 +- compiler/ghc.mk | 90 +++--- compiler/main/DriverPipeline.hs | 44 +++ compiler/main/SysTools.lhs | 61 +++- compiler/main/TidyPgm.lhs | 15 +- compiler/nativeGen/X86/CodeGen.hs | 12 +- compiler/rename/RnBinds.lhs | 10 + compiler/rename/RnNames.lhs | 80 +++--- compiler/specialise/SpecConstr.lhs | 140 +++++++--- compiler/typecheck/TcGenGenerics.lhs | 9 +- compiler/typecheck/TcSimplify.lhs | 311 +++++++++++++-------- compiler/typecheck/TcSplice.lhs-boot | 8 +- compiler/typecheck/TcTyClsDecls.lhs | 19 +- compiler/typecheck/TcValidity.lhs | 5 +- compiler/types/Unify.lhs | 22 +- configure.ac | 54 +++- docs/users_guide/7.8.4-notes.xml | 158 +++++++++++ docs/users_guide/bugs.xml | 9 + docs/users_guide/intro.xml | 1 + docs/users_guide/ug-ent.xml.in | 1 + ghc/Main.hs | 2 +- includes/stg/SMP.h | 4 +- libffi/ghc.mk | 7 + libraries/Cabal | 2 +- mk/project.mk.in | 3 + rts/Linker.c | 1 + rts/OldARMAtomic.c | 11 +- rts/Prelude.h | 4 +- rts/RtsStartup.c | 2 +- rts/package.conf.in | 4 +- rts/posix/Signals.c | 2 +- rts/sm/Scav.c | 7 +- testsuite/mk/test.mk | 7 + testsuite/tests/generics/T9563.hs | 18 ++ testsuite/tests/generics/all.T | 1 + .../tests/indexed-types/should_compile/T9316.hs | 87 ++++++ testsuite/tests/indexed-types/should_compile/all.T | 1 + testsuite/tests/indexed-types/should_fail/T9371.hs | 25 ++ .../tests/indexed-types/should_fail/T9371.stderr | 5 + testsuite/tests/indexed-types/should_fail/T9433.hs | 15 + .../tests/indexed-types/should_fail/T9433.stderr | 4 + testsuite/tests/indexed-types/should_fail/all.T | 2 + testsuite/tests/patsyn/should_fail/T9705.hs | 3 + testsuite/tests/patsyn/should_fail/T9705.stderr | 4 + testsuite/tests/patsyn/should_fail/all.T | 1 + testsuite/tests/rename/should_fail/T9006.hs | 3 + testsuite/tests/rename/should_fail/T9006.stderr | 2 + testsuite/tests/rename/should_fail/T9006a.hs | 3 + testsuite/tests/rename/should_fail/all.T | 3 + testsuite/tests/rts/all.T | 2 + testsuite/tests/simplCore/should_run/T9390.hs | 27 ++ testsuite/tests/simplCore/should_run/T9390.stdout | 1 + testsuite/tests/simplCore/should_run/all.T | 1 + testsuite/tests/typecheck/should_fail/T9415.hs | 5 + testsuite/tests/typecheck/should_fail/T9415.stderr | 8 + testsuite/tests/typecheck/should_fail/all.T | 1 + 66 files changed, 1111 insertions(+), 321 deletions(-) From git at git.haskell.org Mon Jul 6 08:48:29 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 6 Jul 2015 08:48:29 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Fix some validation errors. (93790bb) Message-ID: <20150706084829.67D7E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/93790bbc33c2568d442426d15e8f99ea4fe45217/ghc >--------------------------------------------------------------- commit 93790bbc33c2568d442426d15e8f99ea4fe45217 Author: Richard Eisenberg Date: Sat Jul 4 09:35:14 2015 +0200 Fix some validation errors. Summary: This fixes test cases T10019 and T10534 The patch for T10019 should be back-ported to master as well. Posting via Phab as a way to distribute a patch against the ghc-7.10 branch, which I don't have push access to. Test Plan: validate Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie, bgamari, mzero Differential Revision: https://phabricator.haskell.org/D1036 >--------------------------------------------------------------- 93790bbc33c2568d442426d15e8f99ea4fe45217 testsuite/tests/th/T10019.script | 2 +- testsuite/tests/th/T10019.stdout | 2 +- testsuite/tests/typecheck/should_fail/T10534.stderr | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/testsuite/tests/th/T10019.script b/testsuite/tests/th/T10019.script index eef5fe7..bb3d0d4 100644 --- a/testsuite/tests/th/T10019.script +++ b/testsuite/tests/th/T10019.script @@ -1,4 +1,4 @@ :set -XTemplateHaskell import Language.Haskell.TH data Option a = Some a | None -$(reify 'Some >>= stringE . show) +$(reify 'Some >>= stringE . pprint) diff --git a/testsuite/tests/th/T10019.stdout b/testsuite/tests/th/T10019.stdout index 6345930..e079405 100644 --- a/testsuite/tests/th/T10019.stdout +++ b/testsuite/tests/th/T10019.stdout @@ -1 +1 @@ -"DataConI Ghci1.Some (ForallT [KindedTV a_1627391544 StarT] [] (AppT (AppT ArrowT (VarT a_1627391544)) (AppT (ConT Ghci1.Option) (VarT a_1627391544)))) Ghci1.Option (Fixity 9 InfixL)" +"Constructor from Ghci1.Option: Ghci1.Some :: forall (a_0 :: *) . a_0 ->\n Ghci1.Option a_0" diff --git a/testsuite/tests/typecheck/should_fail/T10534.stderr b/testsuite/tests/typecheck/should_fail/T10534.stderr index 5f44426..5053d71 100644 --- a/testsuite/tests/typecheck/should_fail/T10534.stderr +++ b/testsuite/tests/typecheck/should_fail/T10534.stderr @@ -1,15 +1,15 @@ -T10534a.hs:9:10: error: - Could not deduce: a ~ b - from the context: Coercible (DF a) (DF b) - bound by the type signature for: - silly :: Coercible (DF a) (DF b) => a -> b +T10534a.hs:9:10: + Could not deduce (a ~ b) + from the context (Coercible (DF a) (DF b)) + bound by the type signature for + silly :: Coercible (DF a) (DF b) => a -> b at T10534a.hs:9:10-42 ?a? is a rigid type variable bound by - the type signature for: silly :: Coercible (DF a) (DF b) => a -> b + the type signature for silly :: Coercible (DF a) (DF b) => a -> b at T10534a.hs:9:10 ?b? is a rigid type variable bound by - the type signature for: silly :: Coercible (DF a) (DF b) => a -> b + the type signature for silly :: Coercible (DF a) (DF b) => a -> b at T10534a.hs:9:10 arising from trying to show that the representations of ?DF a? and From git at git.haskell.org Mon Jul 6 08:48:32 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 6 Jul 2015 08:48:32 +0000 (UTC) Subject: [commit: ghc] master: Specialise: Avoid unnecessary recomputation of free variable information (4681f55) Message-ID: <20150706084832.32F0A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/4681f55970cabc6e33591d7e698621580818f9a2/ghc >--------------------------------------------------------------- commit 4681f55970cabc6e33591d7e698621580818f9a2 Author: Ben Gamari Date: Mon Jul 6 10:46:21 2015 +0200 Specialise: Avoid unnecessary recomputation of free variable information When examining compile times for code with large ADTs (particularly those with many record constructors), I found that the specialiser contributed disproportionately to the compiler runtime. Some profiling suggested that the a great deal of time was being spent in `pair_fvs` being called from `consDictBind`. @simonpj pointed out that `flattenDictBinds` as called by `specBind` was unnecessarily discarding cached free variable information, which then needed to be recomputed by `pair_fvs`. Here I refactor the specializer to retain the free variable cache whenever possible. **Open Qustions** * I used `fst` in a couple of places to extract the bindings from a `DictBind`. Perhaps this is a sign that `DictBind` has outgrown its type synonym status? Test Plan: validate Reviewers: austin, simonpj Reviewed By: simonpj Subscribers: thomie, bgamari, simonpj Differential Revision: https://phabricator.haskell.org/D1012 GHC Trac Issues: #7450 >--------------------------------------------------------------- 4681f55970cabc6e33591d7e698621580818f9a2 compiler/specialise/Specialise.hs | 56 ++++++++++++++++++++++++--------------- 1 file changed, 34 insertions(+), 22 deletions(-) diff --git a/compiler/specialise/Specialise.hs b/compiler/specialise/Specialise.hs index c64e678..b2193e3 100644 --- a/compiler/specialise/Specialise.hs +++ b/compiler/specialise/Specialise.hs @@ -1015,8 +1015,10 @@ specBind rhs_env (NonRec fn rhs) body_uds (free_uds, dump_dbs, float_all) = dumpBindUDs [fn] combined_uds -- See Note [From non-recursive to recursive] - final_binds | isEmptyBag dump_dbs = [NonRec b r | (b,r) <- pairs] - | otherwise = [Rec (flattenDictBinds dump_dbs pairs)] + final_binds :: [DictBind] + final_binds + | isEmptyBag dump_dbs = [mkDB $ NonRec b r | (b,r) <- pairs] + | otherwise = [flattenDictBinds dump_dbs pairs] ; if float_all then -- Rather than discard the calls mentioning the bound variables @@ -1025,7 +1027,7 @@ specBind rhs_env (NonRec fn rhs) body_uds else -- No call in final_uds mentions bound variables, -- so we can just leave the binding here - return (final_binds, free_uds) } + return (map fst final_binds, free_uds) } specBind rhs_env (Rec pairs) body_uds @@ -1046,13 +1048,13 @@ specBind rhs_env (Rec pairs) body_uds ; return (bndrs2, spec_defns2 ++ spec_defns1, uds2) } ; let (final_uds, dumped_dbs, float_all) = dumpBindUDs bndrs uds3 - bind = Rec (flattenDictBinds dumped_dbs $ - spec_defns3 ++ zip bndrs3 rhss') + bind = flattenDictBinds dumped_dbs + (spec_defns3 ++ zip bndrs3 rhss') ; if float_all then return ([], final_uds `snocDictBind` bind) else - return ([bind], final_uds) } + return ([fst bind], final_uds) } --------------------------- @@ -1294,7 +1296,7 @@ bindAuxiliaryDicts -> [DictId] -> [CoreExpr] -- Original dict bndrs, and the witnessing expressions -> [DictId] -- A cloned dict-id for each dict arg -> (SpecEnv, -- Substitute for all orig_dicts - [CoreBind], -- Auxiliary dict bindings + [DictBind], -- Auxiliary dict bindings [CoreExpr]) -- Witnessing expressions (all trivial) -- Bind any dictionary arguments to fresh names, to preserve sharing bindAuxiliaryDicts env@(SE { se_subst = subst, se_interesting = interesting }) @@ -1305,14 +1307,15 @@ bindAuxiliaryDicts env@(SE { se_subst = subst, se_interesting = interesting }) env' = env { se_subst = CoreSubst.extendIdSubstList subst (orig_dict_ids `zip` spec_dict_args) , se_interesting = interesting `unionVarSet` interesting_dicts } - interesting_dicts = mkVarSet [ dx_id | NonRec dx_id dx <- dx_binds + interesting_dicts = mkVarSet [ dx_id | (NonRec dx_id dx, _) <- dx_binds , interestingDict env dx ] -- See Note [Make the new dictionaries interesting] + go :: [CoreExpr] -> [CoreBndr] -> ([DictBind], [CoreExpr]) go [] _ = ([], []) go (dx:dxs) (dx_id:dx_ids) | exprIsTrivial dx = (dx_binds, dx:args) - | otherwise = (NonRec dx_id dx : dx_binds, Var dx_id : args) + | otherwise = (mkDB (NonRec dx_id dx) : dx_binds, Var dx_id : args) where (dx_binds, args) = go dxs dx_ids -- In the first case extend the substitution but not bindings; @@ -1642,9 +1645,9 @@ instance Outputable UsageDetails where [ptext (sLit "binds") <+> equals <+> ppr dbs, ptext (sLit "calls") <+> equals <+> ppr calls])) +-- | A 'DictBind' is a binding along with a cached set containing its free +-- variables (both type variables and dictionaries) type DictBind = (CoreBind, VarSet) - -- The set is the free vars of the binding - -- both tyvars and dicts type DictExpr = CoreExpr @@ -1856,9 +1859,11 @@ plusUDList = foldr plusUDs emptyUDs _dictBindBndrs :: Bag DictBind -> [Id] _dictBindBndrs dbs = foldrBag ((++) . bindersOf . fst) [] dbs +-- | Construct a 'DictBind' from a 'CoreBind' mkDB :: CoreBind -> DictBind mkDB bind = (bind, bind_fvs bind) +-- | Identify the free variables of a 'CoreBind' bind_fvs :: CoreBind -> VarSet bind_fvs (NonRec bndr rhs) = pair_fvs (bndr,rhs) bind_fvs (Rec prs) = foldl delVarSet rhs_fvs bndrs @@ -1874,27 +1879,34 @@ pair_fvs (bndr, rhs) = exprFreeVars rhs `unionVarSet` idFreeVars bndr -- type T a = Int -- x :: T a = 3 -flattenDictBinds :: Bag DictBind -> [(Id,CoreExpr)] -> [(Id,CoreExpr)] +-- | Flatten a set of 'DictBind's and some other binding pairs into a single +-- recursive binding, including some additional bindings. +flattenDictBinds :: Bag DictBind -> [(Id,CoreExpr)] -> DictBind flattenDictBinds dbs pairs - = foldrBag add pairs dbs + = (Rec bindings, fvs) where - add (NonRec b r,_) pairs = (b,r) : pairs - add (Rec prs1, _) pairs = prs1 ++ pairs - -snocDictBinds :: UsageDetails -> [CoreBind] -> UsageDetails + (bindings, fvs) = foldrBag add + ([], emptyVarSet) + (dbs `snocBag` mkDB (Rec pairs)) + add (NonRec b r, fvs') (pairs, fvs) = + ((b,r) : pairs, fvs `unionVarSet` fvs') + add (Rec prs1, fvs') (pairs, fvs) = + (prs1 ++ pairs, fvs `unionVarSet` fvs') + +snocDictBinds :: UsageDetails -> [DictBind] -> UsageDetails -- Add ud_binds to the tail end of the bindings in uds snocDictBinds uds dbs = uds { ud_binds = ud_binds uds `unionBags` - foldr (consBag . mkDB) emptyBag dbs } + foldr consBag emptyBag dbs } -consDictBind :: CoreBind -> UsageDetails -> UsageDetails -consDictBind bind uds = uds { ud_binds = mkDB bind `consBag` ud_binds uds } +consDictBind :: DictBind -> UsageDetails -> UsageDetails +consDictBind bind uds = uds { ud_binds = bind `consBag` ud_binds uds } addDictBinds :: [DictBind] -> UsageDetails -> UsageDetails addDictBinds binds uds = uds { ud_binds = listToBag binds `unionBags` ud_binds uds } -snocDictBind :: UsageDetails -> CoreBind -> UsageDetails -snocDictBind uds bind = uds { ud_binds = ud_binds uds `snocBag` mkDB bind } +snocDictBind :: UsageDetails -> DictBind -> UsageDetails +snocDictBind uds bind = uds { ud_binds = ud_binds uds `snocBag` bind } wrapDictBinds :: Bag DictBind -> [CoreBind] -> [CoreBind] wrapDictBinds dbs binds From git at git.haskell.org Mon Jul 6 09:18:58 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 6 Jul 2015 09:18:58 +0000 (UTC) Subject: [commit: ghc] ghc-7.8: Revert "testsuite/T9379: Use GHC.Conc instead of Control.Concurrent.STM" (10a7c13) Message-ID: <20150706091858.66B0B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.8 Link : http://ghc.haskell.org/trac/ghc/changeset/10a7c139e5fc72641f629fafbccaf5cd77cdf966/ghc >--------------------------------------------------------------- commit 10a7c139e5fc72641f629fafbccaf5cd77cdf966 Author: Ben Gamari Date: Mon Jul 6 11:19:30 2015 +0200 Revert "testsuite/T9379: Use GHC.Conc instead of Control.Concurrent.STM" This reverts commit be8556ff4ce8039a6cad59db9fe37ac971d6a31e which was accidentally pushed. >--------------------------------------------------------------- 10a7c139e5fc72641f629fafbccaf5cd77cdf966 testsuite/tests/concurrent/should_run/T9379.hs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/testsuite/tests/concurrent/should_run/T9379.hs b/testsuite/tests/concurrent/should_run/T9379.hs index 235b2aa..49e6d1e 100644 --- a/testsuite/tests/concurrent/should_run/T9379.hs +++ b/testsuite/tests/concurrent/should_run/T9379.hs @@ -1,6 +1,6 @@ import Control.Exception import Control.Concurrent -import GHC.Conc +import Control.Concurrent.STM import Foreign.StablePtr main :: IO () @@ -10,8 +10,6 @@ main = do t <- mask_ $ forkIO (blockSTM tv) killThread t -check b = if b then return () else retry - blockSTM :: TVar Bool -> IO () blockSTM tv = do atomically $ do From git at git.haskell.org Mon Jul 6 09:19:15 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 6 Jul 2015 09:19:15 +0000 (UTC) Subject: [commit: ghc] ghc-7.4: Revert "Add --verbose and --help flags to gen_contents_index" (fef5dc9) Message-ID: <20150706091915.3F7E73A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.4 Link : http://ghc.haskell.org/trac/ghc/changeset/fef5dc9ea61b5671101339e58a27b21eea6aa78d/ghc >--------------------------------------------------------------- commit fef5dc9ea61b5671101339e58a27b21eea6aa78d Author: Ben Gamari Date: Mon Jul 6 11:15:58 2015 +0200 Revert "Add --verbose and --help flags to gen_contents_index" This reverts commit e1e68550026b83ba15158fa776f406844cccedd1 which was accidentally pushed. >--------------------------------------------------------------- fef5dc9ea61b5671101339e58a27b21eea6aa78d libraries/gen_contents_index | 37 +++++++------------------------------ 1 file changed, 7 insertions(+), 30 deletions(-) diff --git a/libraries/gen_contents_index b/libraries/gen_contents_index index dde6fbe..c8d82c8d 100644 --- a/libraries/gen_contents_index +++ b/libraries/gen_contents_index @@ -2,32 +2,10 @@ set -e -USAGE="Usage: $0 [--inplace] [--verbose] [--help]" -INPLACE= -VERBOSE= - HADDOCK_ARGS= -while [ "$#" -ne "0" ] -do - case "$1" in - --inplace) - INPLACE=yes - ;; - --verbose) - VERBOSE=yes - ;; - --help) - echo "$USAGE" - exit 0 - ;; - esac - - shift -done - -if [ -n "$INPLACE" ] -then +case $* in +--inplace) HADDOCK=../inplace/bin/haddock for REPO in `grep '^libraries/[^ ]* *- ' ../packages | sed -e 's#libraries/##' -e 's/ .*//'` do @@ -54,7 +32,8 @@ then fi done done -else + ;; +*) HADDOCK=../../../../../bin/haddock # We don't want the GHC API to swamp the index HADDOCK_FILES=`ls -1 */*.haddock | grep -v '/ghc\.haddock' | sort` @@ -64,13 +43,11 @@ else HADDOCK_ARG="--read-interface=${NAME_VERSION},$HADDOCK_FILE" HADDOCK_ARGS="$HADDOCK_ARGS $HADDOCK_ARG" done -fi + ;; +esac # Now create the combined contents and index pages -if [ -n "$VERBOSE" ] -then - echo $HADDOCK_ARGS -fi +echo $HADDOCK_ARGS $HADDOCK --gen-index --gen-contents -o . \ -t "Haskell Hierarchical Libraries" \ -p "prologue.txt" \ From git at git.haskell.org Mon Jul 6 09:26:11 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 6 Jul 2015 09:26:11 +0000 (UTC) Subject: [commit: ghc] branch 'wip/lexer-warnings' created Message-ID: <20150706092611.04F1D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/lexer-warnings Referencing: 2765fcf6b8846be42d014ef4e29ad6c3aa87b79d From git at git.haskell.org Mon Jul 6 09:26:13 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 6 Jul 2015 09:26:13 +0000 (UTC) Subject: [commit: ghc] wip/lexer-warnings: Remove warnings for -fwarn-incomplete-patterns (2765fcf) Message-ID: <20150706092613.CA1FC3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/lexer-warnings Link : http://ghc.haskell.org/trac/ghc/changeset/2765fcf6b8846be42d014ef4e29ad6c3aa87b79d/ghc >--------------------------------------------------------------- commit 2765fcf6b8846be42d014ef4e29ad6c3aa87b79d Author: Alan Zimmerman Date: Mon Jul 6 11:13:05 2015 +0200 Remove warnings for -fwarn-incomplete-patterns And remove one unused bind. See https://phabricator.haskell.org/rGHCc0ad5bc03e02ce0d7d545599e4b1a68a6f727f2b for concerns raised prompting this change. >--------------------------------------------------------------- 2765fcf6b8846be42d014ef4e29ad6c3aa87b79d compiler/parser/Lexer.x | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/parser/Lexer.x b/compiler/parser/Lexer.x index a73487b..98d167d 100644 --- a/compiler/parser/Lexer.x +++ b/compiler/parser/Lexer.x @@ -49,7 +49,6 @@ {-# OPTIONS_GHC -fno-warn-tabs #-} {-# OPTIONS_GHC -fno-warn-missing-signatures #-} {-# OPTIONS_GHC -fno-warn-overlapping-patterns #-} -{-# OPTIONS_GHC -fno-warn-incomplete-patterns #-} -- The above warning suppression flags are a temporary kludge. -- While working on this module you are encouraged to remove it and fix -- any warnings in the module. See @@ -1358,12 +1357,12 @@ lex_string_prag mkTok span _buf _len lex_string_tok :: Action lex_string_tok span buf _len = do tok <- lex_string "" - end <- getSrcLoc (AI end bufEnd) <- getInput let tok' = case tok of ITprimstring _ bs -> ITprimstring src bs ITstring _ s -> ITstring src s + _ -> panic "lex_string_tok" src = lexemeToString buf (cur bufEnd - cur buf) return (L (mkRealSrcSpan (realSrcSpanStart span) end) tok') @@ -2321,7 +2320,7 @@ alternativeLayoutRuleToken t setNextToken t lexTokenAlr -} - (_, ALRLayout _ col : ls, Just expectingOCurly) + (_, ALRLayout _ col : _ls, Just expectingOCurly) | (thisCol > col) || (thisCol == col && isNonDecreasingIntentation expectingOCurly) -> @@ -2679,6 +2678,7 @@ commentToAnnotation (L l (ITdocOptions s)) = L l (AnnDocOptions s) commentToAnnotation (L l (ITdocOptionsOld s)) = L l (AnnDocOptionsOld s) commentToAnnotation (L l (ITlineComment s)) = L l (AnnLineComment s) commentToAnnotation (L l (ITblockComment s)) = L l (AnnBlockComment s) +commentToAnnotation _ = panic "commentToAnnotation" -- --------------------------------------------------------------------- From git at git.haskell.org Mon Jul 6 09:28:40 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 6 Jul 2015 09:28:40 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Specialise: Avoid unnecessary recomputation of free variable information (f7ede67) Message-ID: <20150706092840.7CAA13A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/f7ede672aa70bfc90e10f5fdc0d0941e251fd934/ghc >--------------------------------------------------------------- commit f7ede672aa70bfc90e10f5fdc0d0941e251fd934 Author: Ben Gamari Date: Mon Jul 6 10:46:21 2015 +0200 Specialise: Avoid unnecessary recomputation of free variable information When examining compile times for code with large ADTs (particularly those with many record constructors), I found that the specialiser contributed disproportionately to the compiler runtime. Some profiling suggested that the a great deal of time was being spent in `pair_fvs` being called from `consDictBind`. @simonpj pointed out that `flattenDictBinds` as called by `specBind` was unnecessarily discarding cached free variable information, which then needed to be recomputed by `pair_fvs`. Here I refactor the specializer to retain the free variable cache whenever possible. **Open Qustions** * I used `fst` in a couple of places to extract the bindings from a `DictBind`. Perhaps this is a sign that `DictBind` has outgrown its type synonym status? Test Plan: validate Reviewers: austin, simonpj Reviewed By: simonpj Subscribers: thomie, bgamari, simonpj Differential Revision: https://phabricator.haskell.org/D1012 GHC Trac Issues: #7450 >--------------------------------------------------------------- f7ede672aa70bfc90e10f5fdc0d0941e251fd934 compiler/specialise/Specialise.hs | 56 ++++++++++++++++++++++++--------------- 1 file changed, 34 insertions(+), 22 deletions(-) diff --git a/compiler/specialise/Specialise.hs b/compiler/specialise/Specialise.hs index de1bf08..473f86f 100644 --- a/compiler/specialise/Specialise.hs +++ b/compiler/specialise/Specialise.hs @@ -970,8 +970,10 @@ specBind rhs_env (NonRec fn rhs) body_uds (free_uds, dump_dbs, float_all) = dumpBindUDs [fn] combined_uds -- See Note [From non-recursive to recursive] - final_binds | isEmptyBag dump_dbs = [NonRec b r | (b,r) <- pairs] - | otherwise = [Rec (flattenDictBinds dump_dbs pairs)] + final_binds :: [DictBind] + final_binds + | isEmptyBag dump_dbs = [mkDB $ NonRec b r | (b,r) <- pairs] + | otherwise = [flattenDictBinds dump_dbs pairs] ; if float_all then -- Rather than discard the calls mentioning the bound variables @@ -980,7 +982,7 @@ specBind rhs_env (NonRec fn rhs) body_uds else -- No call in final_uds mentions bound variables, -- so we can just leave the binding here - return (final_binds, free_uds) } + return (map fst final_binds, free_uds) } specBind rhs_env (Rec pairs) body_uds @@ -1001,13 +1003,13 @@ specBind rhs_env (Rec pairs) body_uds ; return (bndrs2, spec_defns2 ++ spec_defns1, uds2) } ; let (final_uds, dumped_dbs, float_all) = dumpBindUDs bndrs uds3 - bind = Rec (flattenDictBinds dumped_dbs $ - spec_defns3 ++ zip bndrs3 rhss') + bind = flattenDictBinds dumped_dbs + (spec_defns3 ++ zip bndrs3 rhss') ; if float_all then return ([], final_uds `snocDictBind` bind) else - return ([bind], final_uds) } + return ([fst bind], final_uds) } --------------------------- @@ -1245,7 +1247,7 @@ bindAuxiliaryDicts -> [DictId] -> [CoreExpr] -- Original dict bndrs, and the witnessing expressions -> [DictId] -- A cloned dict-id for each dict arg -> (SpecEnv, -- Substitute for all orig_dicts - [CoreBind], -- Auxiliary dict bindings + [DictBind], -- Auxiliary dict bindings [CoreExpr]) -- Witnessing expressions (all trivial) -- Bind any dictionary arguments to fresh names, to preserve sharing bindAuxiliaryDicts env@(SE { se_subst = subst, se_interesting = interesting }) @@ -1256,14 +1258,15 @@ bindAuxiliaryDicts env@(SE { se_subst = subst, se_interesting = interesting }) env' = env { se_subst = CoreSubst.extendIdSubstList subst (orig_dict_ids `zip` spec_dict_args) , se_interesting = interesting `unionVarSet` interesting_dicts } - interesting_dicts = mkVarSet [ dx_id | NonRec dx_id dx <- dx_binds + interesting_dicts = mkVarSet [ dx_id | (NonRec dx_id dx, _) <- dx_binds , interestingDict env dx ] -- See Note [Make the new dictionaries interesting] + go :: [CoreExpr] -> [CoreBndr] -> ([DictBind], [CoreExpr]) go [] _ = ([], []) go (dx:dxs) (dx_id:dx_ids) | exprIsTrivial dx = (dx_binds, dx:args) - | otherwise = (NonRec dx_id dx : dx_binds, Var dx_id : args) + | otherwise = (mkDB (NonRec dx_id dx) : dx_binds, Var dx_id : args) where (dx_binds, args) = go dxs dx_ids -- In the first case extend the substitution but not bindings; @@ -1593,9 +1596,9 @@ instance Outputable UsageDetails where [ptext (sLit "binds") <+> equals <+> ppr dbs, ptext (sLit "calls") <+> equals <+> ppr calls])) +-- | A 'DictBind' is a binding along with a cached set containing its free +-- variables (both type variables and dictionaries) type DictBind = (CoreBind, VarSet) - -- The set is the free vars of the binding - -- both tyvars and dicts type DictExpr = CoreExpr @@ -1808,9 +1811,11 @@ plusUDList = foldr plusUDs emptyUDs _dictBindBndrs :: Bag DictBind -> [Id] _dictBindBndrs dbs = foldrBag ((++) . bindersOf . fst) [] dbs +-- | Construct a 'DictBind' from a 'CoreBind' mkDB :: CoreBind -> DictBind mkDB bind = (bind, bind_fvs bind) +-- | Identify the free variables of a 'CoreBind' bind_fvs :: CoreBind -> VarSet bind_fvs (NonRec bndr rhs) = pair_fvs (bndr,rhs) bind_fvs (Rec prs) = foldl delVarSet rhs_fvs bndrs @@ -1826,27 +1831,34 @@ pair_fvs (bndr, rhs) = exprFreeVars rhs `unionVarSet` idFreeVars bndr -- type T a = Int -- x :: T a = 3 -flattenDictBinds :: Bag DictBind -> [(Id,CoreExpr)] -> [(Id,CoreExpr)] +-- | Flatten a set of 'DictBind's and some other binding pairs into a single +-- recursive binding, including some additional bindings. +flattenDictBinds :: Bag DictBind -> [(Id,CoreExpr)] -> DictBind flattenDictBinds dbs pairs - = foldrBag add pairs dbs + = (Rec bindings, fvs) where - add (NonRec b r,_) pairs = (b,r) : pairs - add (Rec prs1, _) pairs = prs1 ++ pairs - -snocDictBinds :: UsageDetails -> [CoreBind] -> UsageDetails + (bindings, fvs) = foldrBag add + ([], emptyVarSet) + (dbs `snocBag` mkDB (Rec pairs)) + add (NonRec b r, fvs') (pairs, fvs) = + ((b,r) : pairs, fvs `unionVarSet` fvs') + add (Rec prs1, fvs') (pairs, fvs) = + (prs1 ++ pairs, fvs `unionVarSet` fvs') + +snocDictBinds :: UsageDetails -> [DictBind] -> UsageDetails -- Add ud_binds to the tail end of the bindings in uds snocDictBinds uds dbs = uds { ud_binds = ud_binds uds `unionBags` - foldr (consBag . mkDB) emptyBag dbs } + foldr consBag emptyBag dbs } -consDictBind :: CoreBind -> UsageDetails -> UsageDetails -consDictBind bind uds = uds { ud_binds = mkDB bind `consBag` ud_binds uds } +consDictBind :: DictBind -> UsageDetails -> UsageDetails +consDictBind bind uds = uds { ud_binds = bind `consBag` ud_binds uds } addDictBinds :: [DictBind] -> UsageDetails -> UsageDetails addDictBinds binds uds = uds { ud_binds = listToBag binds `unionBags` ud_binds uds } -snocDictBind :: UsageDetails -> CoreBind -> UsageDetails -snocDictBind uds bind = uds { ud_binds = ud_binds uds `snocBag` mkDB bind } +snocDictBind :: UsageDetails -> DictBind -> UsageDetails +snocDictBind uds bind = uds { ud_binds = ud_binds uds `snocBag` bind } wrapDictBinds :: Bag DictBind -> [CoreBind] -> [CoreBind] wrapDictBinds dbs binds From git at git.haskell.org Mon Jul 6 09:37:30 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 6 Jul 2015 09:37:30 +0000 (UTC) Subject: [commit: ghc] master's head updated: Remove warnings for -fwarn-incomplete-patterns (2765fcf) Message-ID: <20150706093730.5282B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Branch 'master' now includes: 2765fcf Remove warnings for -fwarn-incomplete-patterns From git at git.haskell.org Mon Jul 6 10:08:07 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 6 Jul 2015 10:08:07 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Fix typo in error message (df6665e) Message-ID: <20150706100807.6E15E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/df6665e0cfdd23567bd32d222154ab25dbc39079/ghc >--------------------------------------------------------------- commit df6665e0cfdd23567bd32d222154ab25dbc39079 Author: Gabor Greif Date: Tue Feb 17 16:00:24 2015 +0100 Fix typo in error message >--------------------------------------------------------------- df6665e0cfdd23567bd32d222154ab25dbc39079 libraries/base/GHC/IO/Exception.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/base/GHC/IO/Exception.hs b/libraries/base/GHC/IO/Exception.hs index 0ed504c..387644f 100644 --- a/libraries/base/GHC/IO/Exception.hs +++ b/libraries/base/GHC/IO/Exception.hs @@ -323,7 +323,7 @@ instance Show IOErrorType where ResourceVanished -> "resource vanished" SystemError -> "system error" TimeExpired -> "timeout" - UnsatisfiedConstraints -> "unsatisified constraints" -- ultra-precise! + UnsatisfiedConstraints -> "unsatisfied constraints" -- ultra-precise! UnsupportedOperation -> "unsupported operation" -- | Construct an 'IOError' value with a string describing the error. From git at git.haskell.org Mon Jul 6 13:36:16 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 6 Jul 2015 13:36:16 +0000 (UTC) Subject: [commit: ghc] master: Spelling in comments (a07898e) Message-ID: <20150706133616.AFF253A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a07898e47709d643ffba1bffd83411fc3146ed27/ghc >--------------------------------------------------------------- commit a07898e47709d643ffba1bffd83411fc3146ed27 Author: Gabor Greif Date: Tue Jun 23 16:35:20 2015 +0200 Spelling in comments >--------------------------------------------------------------- a07898e47709d643ffba1bffd83411fc3146ed27 compiler/hsSyn/HsPat.hs | 2 +- compiler/typecheck/TcHsType.hs | 2 +- compiler/typecheck/TcSMonad.hs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/hsSyn/HsPat.hs b/compiler/hsSyn/HsPat.hs index c146133..09f669c 100644 --- a/compiler/hsSyn/HsPat.hs +++ b/compiler/hsSyn/HsPat.hs @@ -137,7 +137,7 @@ data Pat id | ConPatOut { pat_con :: Located ConLike, - pat_arg_tys :: [Type], -- The univeral arg types, 1-1 with the universal + pat_arg_tys :: [Type], -- The universal arg types, 1-1 with the universal -- tyvars of the constructor/pattern synonym -- Use (conLikeResTy pat_con pat_arg_tys) to get -- the type of the pattern diff --git a/compiler/typecheck/TcHsType.hs b/compiler/typecheck/TcHsType.hs index 677b5a8..53c0234 100644 --- a/compiler/typecheck/TcHsType.hs +++ b/compiler/typecheck/TcHsType.hs @@ -1242,7 +1242,7 @@ This is bad because throwing away the kind checked type throws away its splices. But too bad for now. [July 03] Historical note: - We no longer specify that these type variables must be univerally + We no longer specify that these type variables must be universally quantified (lots of email on the subject). If you want to put that back in, you need to a) Do a checkSigTyVars after thing_inside diff --git a/compiler/typecheck/TcSMonad.hs b/compiler/typecheck/TcSMonad.hs index a8e75c0..8c06cd9 100644 --- a/compiler/typecheck/TcSMonad.hs +++ b/compiler/typecheck/TcSMonad.hs @@ -763,7 +763,7 @@ The idea is that have (a -fs-> a) in S, which contradicts (WF2). * The extended substitution satisfies (WF1) and (WF2) - - (K1) plus (L1) guarantee that the extended substiution satisfies (WF1). + - (K1) plus (L1) guarantee that the extended substitution satisfies (WF1). - (T3) guarantees (WF2). * (K2) is about inertness. Intuitively, any infinite chain T^0(f,t), From git at git.haskell.org Mon Jul 6 14:13:07 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 6 Jul 2015 14:13:07 +0000 (UTC) Subject: [commit: ghc] branch 'wip/T10527' created Message-ID: <20150706141307.4FE003A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/T10527 Referencing: eb6657550f163fd1b5ae11a0a38980560308b7e3 From git at git.haskell.org Mon Jul 6 14:13:10 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 6 Jul 2015 14:13:10 +0000 (UTC) Subject: [commit: ghc] wip/T10527: Use lazy substitution in simplCast (eb66575) Message-ID: <20150706141310.48B473A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T10527 Link : http://ghc.haskell.org/trac/ghc/changeset/eb6657550f163fd1b5ae11a0a38980560308b7e3/ghc >--------------------------------------------------------------- commit eb6657550f163fd1b5ae11a0a38980560308b7e3 Author: Simon Peyton Jones Date: Fri Jul 3 14:03:25 2015 +0100 Use lazy substitution in simplCast It turned out that the terrible compiler performance in Trac #10527 arose because we were simplifying a function argument that subseuqently was discarded, so the work was wasted. Moreover, the work turned out to be substantial; indeed it made an asymptotic difference to compile time. Ths solution in this 7.10 branch is a bit brutal; just duplicate CoreSubst.substExpr to be SimplEnv.substExprS. It works fine I'm working on a better solution for HEAD. >--------------------------------------------------------------- eb6657550f163fd1b5ae11a0a38980560308b7e3 compiler/simplCore/SimplEnv.hs | 85 ++++++++++++++++++++++++++++++++++++++++-- compiler/simplCore/Simplify.hs | 12 ++++-- 2 files changed, 89 insertions(+), 8 deletions(-) diff --git a/compiler/simplCore/SimplEnv.hs b/compiler/simplCore/SimplEnv.hs index 17367ef..a3489b6 100644 --- a/compiler/simplCore/SimplEnv.hs +++ b/compiler/simplCore/SimplEnv.hs @@ -23,6 +23,7 @@ module SimplEnv ( SimplSR(..), mkContEx, substId, lookupRecBndr, refineFromInScope, + substExprS, simplNonRecBndr, simplRecBndrs, simplBinder, simplBinders, substTy, substTyVar, getTvSubst, @@ -537,6 +538,72 @@ lookupRecBndr (SimplEnv { seInScope = in_scope, seIdSubst = ids }) v Just _ -> pprPanic "lookupRecBndr" (ppr v) Nothing -> refineFromInScope in_scope v + +substExprS :: SimplEnv -> CoreExpr -> CoreExpr +-- This entire substExprS thing is called in just one place +-- but we can't use substExpr because it uses a different shape +-- of substitution Better solution coming in HEAD. +substExprS env expr + = go expr + where + go (Var v) = case substId env v of + DoneId v' -> Var v' + DoneEx e -> e + ContEx tvs cvs ids e -> substExprS (setSubstEnv env tvs cvs ids) e + + go (Type ty) = Type (substTy env ty) + go (Coercion co) = Coercion (substCo env co) + go (Lit lit) = Lit lit + go (App fun arg) = App (go fun) (go arg) + go (Tick tickish e) = mkTick (substTickishS env tickish) (go e) + go (Cast e co) = Cast (go e) (substCo env co) + -- Do not optimise even identity coercions + -- Reason: substitution applies to the LHS of RULES, and + -- if you "optimise" an identity coercion, you may + -- lose a binder. We optimise the LHS of rules at + -- construction time + + go (Lam bndr body) = Lam bndr' (substExprS env' body) + where + (env', bndr') = substBndr env bndr + + go (Let bind body) = Let bind' (substExprS env' body) + where + (env', bind') = substBindS env bind + + go (Case scrut bndr ty alts) + = Case (go scrut) bndr' (substTy env ty) + (map (go_alt env') alts) + where + (env', bndr') = substBndr env bndr + + go_alt env (con, bndrs, rhs) = (con, bndrs', substExprS env' rhs) + where + (env', bndrs') = substBndrs env bndrs + +substTickishS :: SimplEnv -> Tickish Id -> Tickish Id +substTickishS env (Breakpoint n ids) = Breakpoint n (map do_one ids) + where + do_one = getIdFromTrivialExpr . substExprS env . Var -- Ugh +substTickishS _subst other = other + +-- | Apply a substitution to an entire 'CoreBind', additionally returning an updated 'Subst' +-- that should be used by subsequent substitutions. +substBindS :: SimplEnv -> CoreBind -> (SimplEnv, CoreBind) + +substBindS env (NonRec bndr rhs) = (env', NonRec bndr' (substExprS env rhs)) + where + (env', bndr') = substBndr env bndr + +substBindS env (Rec pairs) + = (env', Rec (bndrs' `zip` rhss')) + where + (bndrs, rhss) = unzip pairs + (env', bndrs') = substBndrs env bndrs + rhss' = map (substExprS env') rhss + -- No need for the complexity of CoreSubst.substRecBndrs, because + -- we zap all IdInfo that depends on free variables + {- ************************************************************************ * * @@ -545,13 +612,17 @@ lookupRecBndr (SimplEnv { seInScope = in_scope, seIdSubst = ids }) v ************************************************************************ -These functions are in the monad only so that they can be made strict via seq. +* substBndr, substBndrs: non-monadic version + +* sinplBndr, simplBndrs: monadic version, only so that they + can be made strict via seq. + -} +------------- simplBinders :: SimplEnv -> [InBndr] -> SimplM (SimplEnv, [OutBndr]) simplBinders env bndrs = mapAccumLM simplBinder env bndrs -------------- simplBinder :: SimplEnv -> InBndr -> SimplM (SimplEnv, OutBndr) -- Used for lambda and case-bound variables -- Clone Id if necessary, substitute type @@ -564,14 +635,12 @@ simplBinder env bndr | otherwise = do { let (env', id) = substIdBndr env bndr ; seqId id `seq` return (env', id) } ---------------- simplNonRecBndr :: SimplEnv -> InBndr -> SimplM (SimplEnv, OutBndr) -- A non-recursive let binder simplNonRecBndr env id = do { let (env1, id1) = substIdBndr env id ; seqId id1 `seq` return (env1, id1) } ---------------- simplRecBndrs :: SimplEnv -> [InBndr] -> SimplM SimplEnv -- Recursive let binders simplRecBndrs env@(SimplEnv {}) ids @@ -579,6 +648,14 @@ simplRecBndrs env@(SimplEnv {}) ids ; seqIds ids1 `seq` return env1 } --------------- +substBndr :: SimplEnv -> InBndr -> (SimplEnv, OutBndr) +substBndr env bndr + | isTyVar bndr = substTyVarBndr env bndr + | otherwise = substIdBndr env bndr + +substBndrs :: SimplEnv -> [InBndr] -> (SimplEnv, [OutBndr]) +substBndrs env bndrs = mapAccumL substBndr env bndrs + substIdBndr :: SimplEnv -> InBndr -> (SimplEnv, OutBndr) -- Might be a coercion variable substIdBndr env bndr diff --git a/compiler/simplCore/Simplify.hs b/compiler/simplCore/Simplify.hs index efefa23..2e1dcef 100644 --- a/compiler/simplCore/Simplify.hs +++ b/compiler/simplCore/Simplify.hs @@ -1179,11 +1179,15 @@ simplCast env body co0 cont0 -- But it isn't a common case. -- -- Example of use: Trac #995 - = do { (dup', arg_se', arg') <- simplArg env dup arg_se arg - ; cont' <- addCoerce co2 cont + = do { let arg' = substExprS arg_se arg + -- It's important that this is lazy, because this argument + -- may be disarded if turns out to be the argument of + -- (\_ -> e) This can make a huge difference; + -- see Trac #10527 + ; cont' <- addCoerce co2 cont ; return (ApplyToVal { sc_arg = mkCast arg' (mkSymCo co1) - , sc_env = arg_se' - , sc_dup = dup' + , sc_env = zapSubstEnv arg_se + , sc_dup = dup , sc_cont = cont' }) } where -- we split coercion t1->t2 ~ s1->s2 into t1 ~ s1 and From git at git.haskell.org Mon Jul 6 14:39:39 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 6 Jul 2015 14:39:39 +0000 (UTC) Subject: [commit: ghc] master: Fix offset calculation in __stg_gc_fun (9180df1) Message-ID: <20150706143939.45DC53A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/9180df19dd938901791b84ef7f260f7e2f1f894f/ghc >--------------------------------------------------------------- commit 9180df19dd938901791b84ef7f260f7e2f1f894f Author: Simon Marlow Date: Mon Jul 6 14:09:50 2015 +0100 Fix offset calculation in __stg_gc_fun Summary: We were not treating the offset as a signed field in this rare case, so it would blow up if the offset was negative. Test Plan: Looked at the assembly Reviewers: austin, bgamari, rwbarton Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1042 >--------------------------------------------------------------- 9180df19dd938901791b84ef7f260f7e2f1f894f rts/HeapStackCheck.cmm | 5 +++-- utils/deriveConstants/DeriveConstants.hs | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/rts/HeapStackCheck.cmm b/rts/HeapStackCheck.cmm index a1e18ca..9430a09 100644 --- a/rts/HeapStackCheck.cmm +++ b/rts/HeapStackCheck.cmm @@ -405,8 +405,9 @@ __stg_gc_fun /* explicit stack */ if (type == ARG_GEN_BIG) { #ifdef TABLES_NEXT_TO_CODE // bitmap field holds an offset - size = StgLargeBitmap_size( StgFunInfoExtra_bitmap(info) - + %GET_ENTRY(UNTAG(R1)) /* ### */ ); + size = StgLargeBitmap_size( + TO_W_(StgFunInfoExtraRev_bitmap_offset(info)) + + %GET_ENTRY(UNTAG(R1)) /* ### */ ); #else size = StgLargeBitmap_size( StgFunInfoExtra_bitmap(info) ); #endif diff --git a/utils/deriveConstants/DeriveConstants.hs b/utils/deriveConstants/DeriveConstants.hs index ccf9028..6563550 100644 --- a/utils/deriveConstants/DeriveConstants.hs +++ b/utils/deriveConstants/DeriveConstants.hs @@ -568,6 +568,7 @@ wanteds = concat ,structField C "StgFunInfoExtraRev" "fun_type" ,structFieldH Both "StgFunInfoExtraRev" "arity" ,structField_ C "StgFunInfoExtraRev_bitmap" "StgFunInfoExtraRev" "b.bitmap" + ,structField_ C "StgFunInfoExtraRev_bitmap_offset" "StgFunInfoExtraRev" "b.bitmap_offset" ,structField C "StgLargeBitmap" "size" ,fieldOffset C "StgLargeBitmap" "bitmap" From git at git.haskell.org Mon Jul 6 15:49:44 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 6 Jul 2015 15:49:44 +0000 (UTC) Subject: [commit: ghc] wip/gadtpm: It works (b4bcb69) Message-ID: <20150706154944.91AA83A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/gadtpm Link : http://ghc.haskell.org/trac/ghc/changeset/b4bcb697676cef8fb3293147af952740d462579f/ghc >--------------------------------------------------------------- commit b4bcb697676cef8fb3293147af952740d462579f Author: George Karachalias Date: Mon Jul 6 16:28:26 2015 +0200 It works >--------------------------------------------------------------- b4bcb697676cef8fb3293147af952740d462579f compiler/deSugar/Check.hs | 18 ++++++++-------- compiler/deSugar/Match.hs | 53 ++++++++++++++++++++--------------------------- 2 files changed, 32 insertions(+), 39 deletions(-) diff --git a/compiler/deSugar/Check.hs b/compiler/deSugar/Check.hs index 2b537e5..3484df7 100644 --- a/compiler/deSugar/Check.hs +++ b/compiler/deSugar/Check.hs @@ -8,7 +8,7 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE DataKinds, GADTs, KindSignatures #-} -module Check ( toTcTypeBag, pprUncovered, check, checkSingle2, checkMatches2, showMeTheGuards ) where +module Check ( toTcTypeBag, pprUncovered, check, checkSingle2, checkMatches2, showMeTheGuards, ValAbs, PmConstraint, PmResult2 ) where #include "HsVersions.h" @@ -1196,7 +1196,7 @@ pprUncovered vsa = vcat (map pprOne vsa) instance Outputable PmConstraint where ppr (TmConstraint x expr) = ppr x <+> equals <+> ppr expr - ppr (TyConstraint theta) = empty -- pprSet $ map idType theta + ppr (TyConstraint theta) = pprSet $ map idType theta ppr (BtConstraint x) = braces (ppr x <+> ptext (sLit "~") <+> ptext (sLit "_|_")) instance Outputable (PmPat abs) where @@ -1454,25 +1454,24 @@ patVectProc2 :: (PatVec, [PatVec]) -> ValSetAbs -> PmM (Bool, Bool, ValSetAbs) - patVectProc2 (vec,gvs) vsa = do us <- getUniqueSupplyM let (c_def, u_def, d_def) = process_guards us gvs -- default (the continuation) + (usC, usU, usD) <- getUniqueSupplyM3 mb_c <- anySatValSetAbs (covered2 usC c_def vec vsa) mb_d <- anySatValSetAbs (divergent2 usD d_def vec vsa) return (mb_c, mb_d, uncovered2 usU u_def vec vsa) -- Single pattern binding (let) -checkSingle2 :: Type -> Pat Id -> DsM (PmResult2 (Pat Id)) +checkSingle2 :: Type -> Pat Id -> DsM (PmResult2 [LPat Id]) checkSingle2 ty p = do + let lp = [noLoc p] vec <- liftUs (translatePat p) vsa <- initial_uncovered [ty] (c,d,us) <- patVectProc2 (vec,[]) vsa -- no guards let us' = valSetAbsToList us return $ case (c,d) of - (True, _) -> ([], [], us') - (False, True) -> ([], [p], us') - (False, False) -> ([p], [], us') - - --- lmatchToLPats :: LMatch id body -> [LPat id] + (True, _) -> ([], [], us') + (False, True) -> ([], [lp], us') + (False, False) -> ([lp], [], us') checkMatches2 :: [Type] -> [LMatch Id (LHsExpr Id)] -> DsM (PmResult2 [LPat Id]) checkMatches2 tys matches @@ -1492,6 +1491,7 @@ checkMatches'2 [] missing = do checkMatches'2 (m:ms) missing = do patterns_n_guards <- liftUs (translateMatch m) + -- pprInTcRnIf (ptext (sLit "translated") <+> ppr patterns_n_guards) (c, d, us ) <- patVectProc2 patterns_n_guards missing -- process_vector_alternative patterns_n_guards missing (rs, is, us') <- checkMatches'2 ms us return $ case (c,d) of diff --git a/compiler/deSugar/Match.hs b/compiler/deSugar/Match.hs index da4f1bd..f7610e8 100644 --- a/compiler/deSugar/Match.hs +++ b/compiler/deSugar/Match.hs @@ -694,17 +694,11 @@ matchWrapper ctxt (MG { mg_alts = matches , mg_arg_tys = arg_tys , mg_res_ty = rhs_ty , mg_origin = origin }) - = do { -- showMeTheGuards matches --just to see - dflags <- getDynFlags - ; let flag_i = wopt Opt_WarnOverlappingPatterns dflags - ; let flag_u = wopt Opt_WarnIncompletePatterns dflags - || wopt Opt_WarnIncompleteUniPatterns dflags - || wopt Opt_WarnIncompletePatternsRecUpd dflags - ; when (flag_i || flag_u) $ do - {- Checking -} (rs, is, us) <- checkMatches2 arg_tys matches - {- Checking -} pprInTcRnIf (ptext (sLit "rs:") <+> ppr rs) - {- Checking -} pprInTcRnIf (ptext (sLit "is:") <+> ppr is) - {- Checking -} pprInTcRnIf (pprUncovered us) + = do { dflags <- getDynFlags + ; locn <- getSrcSpanDs + + -- ; pmresult <- checkMatches2 arg_tys matches + ; dsPmWarn2 dflags (DsMatchContext ctxt locn) (checkMatches2 arg_tys matches) -- pmresult ; eqns_info <- mapM mk_eqn_info matches ; new_vars <- case matches of @@ -771,20 +765,13 @@ matchSinglePat :: CoreExpr -> HsMatchContext Name -> LPat Id -- Used for things like [ e | pat <- stuff ], where -- incomplete patterns are just fine matchSinglePat (Var var) ctx (L _ pat) ty match_result - = do { - dflags <- getDynFlags - ; let flag_i = wopt Opt_WarnOverlappingPatterns dflags - ; let flag_u = wopt Opt_WarnIncompletePatterns dflags - || wopt Opt_WarnIncompleteUniPatterns dflags - || wopt Opt_WarnIncompletePatternsRecUpd dflags - ; when (flag_i || flag_u) $ do - {- Checking -} (rs,is,us) <- checkSingle2 ty pat - {- Checking -} pprInTcRnIf (ptext (sLit "rs:") <+> ppr rs) - {- Checking -} pprInTcRnIf (ptext (sLit "is:") <+> ppr is) - {- Checking -} pprInTcRnIf (pprUncovered us) - - - ; locn <- getSrcSpanDs + = do { dflags <- getDynFlags + ; locn <- getSrcSpanDs + + -- Maybe I should remove this + -- ; (rs, is, us) <- checkSingle2 (idType var) pat + ; dsPmWarn2 dflags (DsMatchContext ctx locn) (checkSingle2 (idType var) pat) -- (map ((:[]) . noLoc) rs, map ((:[]) . noLoc) is, us) + ; matchCheck (DsMatchContext ctx locn) [var] ty [EqnInfo { eqn_pats = [pat], eqn_rhs = match_result }] } @@ -1022,10 +1009,16 @@ Hence we don't regard 1 and 2, or (n+1) and (n+2), as part of the same group. %************************************************************************ -} -dsPmWarn :: DynFlags -> DsMatchContext -> [Type] -> [EquationInfo] -> DsM () -dsPmWarn dflags ctx@(DsMatchContext kind loc) tys qs +-- DsM (PmResult2 [LPat Id]) +-- type PmResult2 a = ([a], [a], [([ValAbs],[PmConstraint])]) +-- ([LPat Id], [LPat Id], [([ValAbs],[PmConstraint])]) -- redundant, inaccessible, missing + + +dsPmWarn2 :: DynFlags -> DsMatchContext -> DsM (PmResult2 [LPat Id]) -> DsM () +-- ([[LPat Id]], [[LPat Id]], [([ValAbs],[PmConstraint])]) -> DsM () +dsPmWarn2 dflags ctx@(DsMatchContext kind loc) mPmResult -- (redundant, inaccessible, uncovered) = when (flag_i || flag_u) $ do - (redundant, inaccessible, uncovered) <- check tys qs + (redundant, inaccessible, uncovered) <- mPmResult let exists_r = flag_i && notNull redundant exists_i = flag_i && notNull inaccessible exists_u = flag_u && notNull uncovered @@ -1079,8 +1072,8 @@ ppr_shadow_pats :: HsMatchContext Name -> [Pat Id] -> SDoc ppr_shadow_pats kind pats = sep [ppr_pats pats, matchSeparator kind, ptext (sLit "...")] -ppr_eqn :: (SDoc -> SDoc) -> HsMatchContext Name -> EquationInfo -> SDoc -ppr_eqn prefixF kind eqn = prefixF (ppr_shadow_pats kind (eqn_pats eqn)) +ppr_eqn :: (SDoc -> SDoc) -> HsMatchContext Name -> [LPat Id] -> SDoc +ppr_eqn prefixF kind eqn = prefixF (ppr_shadow_pats kind (map unLoc eqn)) -- This variable shows the maximum number of lines of output generated for warnings. -- It will limit the number of patterns/equations displayed to maximum_output. From git at git.haskell.org Mon Jul 6 15:49:47 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 6 Jul 2015 15:49:47 +0000 (UTC) Subject: [commit: ghc] wip/gadtpm: Cleaning up (37485f5) Message-ID: <20150706154947.8884D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/gadtpm Link : http://ghc.haskell.org/trac/ghc/changeset/37485f5c262792753313d55ae523976452951295/ghc >--------------------------------------------------------------- commit 37485f5c262792753313d55ae523976452951295 Author: George Karachalias Date: Mon Jul 6 17:50:16 2015 +0200 Cleaning up >--------------------------------------------------------------- 37485f5c262792753313d55ae523976452951295 compiler/deSugar/Check.hs | 475 ++----------------------------------------- compiler/deSugar/Match.hs | 19 +- compiler/deSugar/TmOracle.hs | 87 ++++++++ 3 files changed, 110 insertions(+), 471 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 37485f5c262792753313d55ae523976452951295 From git at git.haskell.org Mon Jul 6 16:06:31 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 6 Jul 2015 16:06:31 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Use lazy substitution in simplCast (07a1f32) Message-ID: <20150706160631.1CF853A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/07a1f32e8bacecd450112607df3fdf39e553c91e/ghc >--------------------------------------------------------------- commit 07a1f32e8bacecd450112607df3fdf39e553c91e Author: Simon Peyton Jones Date: Fri Jul 3 14:03:25 2015 +0100 Use lazy substitution in simplCast It turned out that the terrible compiler performance in Trac #10527 arose because we were simplifying a function argument that subseuqently was discarded, so the work was wasted. Moreover, the work turned out to be substantial; indeed it made an asymptotic difference to compile time. Ths solution in this 7.10 branch is a bit brutal; just duplicate CoreSubst.substExpr to be SimplEnv.substExprS. It works fine I'm working on a better solution for HEAD. >--------------------------------------------------------------- 07a1f32e8bacecd450112607df3fdf39e553c91e compiler/simplCore/SimplEnv.hs | 85 ++++++++++++++++++++++++++++++++++++++++-- compiler/simplCore/Simplify.hs | 12 ++++-- 2 files changed, 89 insertions(+), 8 deletions(-) diff --git a/compiler/simplCore/SimplEnv.hs b/compiler/simplCore/SimplEnv.hs index 17367ef..a3489b6 100644 --- a/compiler/simplCore/SimplEnv.hs +++ b/compiler/simplCore/SimplEnv.hs @@ -23,6 +23,7 @@ module SimplEnv ( SimplSR(..), mkContEx, substId, lookupRecBndr, refineFromInScope, + substExprS, simplNonRecBndr, simplRecBndrs, simplBinder, simplBinders, substTy, substTyVar, getTvSubst, @@ -537,6 +538,72 @@ lookupRecBndr (SimplEnv { seInScope = in_scope, seIdSubst = ids }) v Just _ -> pprPanic "lookupRecBndr" (ppr v) Nothing -> refineFromInScope in_scope v + +substExprS :: SimplEnv -> CoreExpr -> CoreExpr +-- This entire substExprS thing is called in just one place +-- but we can't use substExpr because it uses a different shape +-- of substitution Better solution coming in HEAD. +substExprS env expr + = go expr + where + go (Var v) = case substId env v of + DoneId v' -> Var v' + DoneEx e -> e + ContEx tvs cvs ids e -> substExprS (setSubstEnv env tvs cvs ids) e + + go (Type ty) = Type (substTy env ty) + go (Coercion co) = Coercion (substCo env co) + go (Lit lit) = Lit lit + go (App fun arg) = App (go fun) (go arg) + go (Tick tickish e) = mkTick (substTickishS env tickish) (go e) + go (Cast e co) = Cast (go e) (substCo env co) + -- Do not optimise even identity coercions + -- Reason: substitution applies to the LHS of RULES, and + -- if you "optimise" an identity coercion, you may + -- lose a binder. We optimise the LHS of rules at + -- construction time + + go (Lam bndr body) = Lam bndr' (substExprS env' body) + where + (env', bndr') = substBndr env bndr + + go (Let bind body) = Let bind' (substExprS env' body) + where + (env', bind') = substBindS env bind + + go (Case scrut bndr ty alts) + = Case (go scrut) bndr' (substTy env ty) + (map (go_alt env') alts) + where + (env', bndr') = substBndr env bndr + + go_alt env (con, bndrs, rhs) = (con, bndrs', substExprS env' rhs) + where + (env', bndrs') = substBndrs env bndrs + +substTickishS :: SimplEnv -> Tickish Id -> Tickish Id +substTickishS env (Breakpoint n ids) = Breakpoint n (map do_one ids) + where + do_one = getIdFromTrivialExpr . substExprS env . Var -- Ugh +substTickishS _subst other = other + +-- | Apply a substitution to an entire 'CoreBind', additionally returning an updated 'Subst' +-- that should be used by subsequent substitutions. +substBindS :: SimplEnv -> CoreBind -> (SimplEnv, CoreBind) + +substBindS env (NonRec bndr rhs) = (env', NonRec bndr' (substExprS env rhs)) + where + (env', bndr') = substBndr env bndr + +substBindS env (Rec pairs) + = (env', Rec (bndrs' `zip` rhss')) + where + (bndrs, rhss) = unzip pairs + (env', bndrs') = substBndrs env bndrs + rhss' = map (substExprS env') rhss + -- No need for the complexity of CoreSubst.substRecBndrs, because + -- we zap all IdInfo that depends on free variables + {- ************************************************************************ * * @@ -545,13 +612,17 @@ lookupRecBndr (SimplEnv { seInScope = in_scope, seIdSubst = ids }) v ************************************************************************ -These functions are in the monad only so that they can be made strict via seq. +* substBndr, substBndrs: non-monadic version + +* sinplBndr, simplBndrs: monadic version, only so that they + can be made strict via seq. + -} +------------- simplBinders :: SimplEnv -> [InBndr] -> SimplM (SimplEnv, [OutBndr]) simplBinders env bndrs = mapAccumLM simplBinder env bndrs -------------- simplBinder :: SimplEnv -> InBndr -> SimplM (SimplEnv, OutBndr) -- Used for lambda and case-bound variables -- Clone Id if necessary, substitute type @@ -564,14 +635,12 @@ simplBinder env bndr | otherwise = do { let (env', id) = substIdBndr env bndr ; seqId id `seq` return (env', id) } ---------------- simplNonRecBndr :: SimplEnv -> InBndr -> SimplM (SimplEnv, OutBndr) -- A non-recursive let binder simplNonRecBndr env id = do { let (env1, id1) = substIdBndr env id ; seqId id1 `seq` return (env1, id1) } ---------------- simplRecBndrs :: SimplEnv -> [InBndr] -> SimplM SimplEnv -- Recursive let binders simplRecBndrs env@(SimplEnv {}) ids @@ -579,6 +648,14 @@ simplRecBndrs env@(SimplEnv {}) ids ; seqIds ids1 `seq` return env1 } --------------- +substBndr :: SimplEnv -> InBndr -> (SimplEnv, OutBndr) +substBndr env bndr + | isTyVar bndr = substTyVarBndr env bndr + | otherwise = substIdBndr env bndr + +substBndrs :: SimplEnv -> [InBndr] -> (SimplEnv, [OutBndr]) +substBndrs env bndrs = mapAccumL substBndr env bndrs + substIdBndr :: SimplEnv -> InBndr -> (SimplEnv, OutBndr) -- Might be a coercion variable substIdBndr env bndr diff --git a/compiler/simplCore/Simplify.hs b/compiler/simplCore/Simplify.hs index efefa23..2e1dcef 100644 --- a/compiler/simplCore/Simplify.hs +++ b/compiler/simplCore/Simplify.hs @@ -1179,11 +1179,15 @@ simplCast env body co0 cont0 -- But it isn't a common case. -- -- Example of use: Trac #995 - = do { (dup', arg_se', arg') <- simplArg env dup arg_se arg - ; cont' <- addCoerce co2 cont + = do { let arg' = substExprS arg_se arg + -- It's important that this is lazy, because this argument + -- may be disarded if turns out to be the argument of + -- (\_ -> e) This can make a huge difference; + -- see Trac #10527 + ; cont' <- addCoerce co2 cont ; return (ApplyToVal { sc_arg = mkCast arg' (mkSymCo co1) - , sc_env = arg_se' - , sc_dup = dup' + , sc_env = zapSubstEnv arg_se + , sc_dup = dup , sc_cont = cont' }) } where -- we split coercion t1->t2 ~ s1->s2 into t1 ~ s1 and From git at git.haskell.org Tue Jul 7 08:06:53 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 7 Jul 2015 08:06:53 +0000 (UTC) Subject: [commit: ghc] master: Don't eagerly blackhole single-entry thunks (#10414) (aaa0cd2) Message-ID: <20150707080653.BC9DA3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/aaa0cd20fdaf8e923e3a083befc2612154cba629/ghc >--------------------------------------------------------------- commit aaa0cd20fdaf8e923e3a083befc2612154cba629 Author: Reid Barton Date: Mon Jul 6 19:24:31 2015 +0200 Don't eagerly blackhole single-entry thunks (#10414) In a parallel program they can actually be entered more than once, leading to deadlock. Reviewers: austin, simonmar Subscribers: michaelt, thomie, bgamari Differential Revision: https://phabricator.haskell.org/D1040 GHC Trac Issues: #10414 >--------------------------------------------------------------- aaa0cd20fdaf8e923e3a083befc2612154cba629 compiler/codeGen/StgCmmClosure.hs | 12 +++++++- testsuite/.gitignore | 1 + testsuite/tests/codeGen/should_run/T10414.hs | 38 ++++++++++++++++++++++++ testsuite/tests/codeGen/should_run/T10414.stdout | 1 + testsuite/tests/codeGen/should_run/all.T | 2 ++ 5 files changed, 53 insertions(+), 1 deletion(-) diff --git a/compiler/codeGen/StgCmmClosure.hs b/compiler/codeGen/StgCmmClosure.hs index b65d56b..984e704 100644 --- a/compiler/codeGen/StgCmmClosure.hs +++ b/compiler/codeGen/StgCmmClosure.hs @@ -754,6 +754,16 @@ mkClosureInfo dflags is_static id lf_info tot_wds ptr_wds val_descr -- was on. But it didn't work, and it wasn't strictly necessary -- to bring back minimal ticky-ticky, so now EAGER_BLACKHOLING -- is unconditionally disabled. -- krc 1/2007 +-- +-- +-- A single-entry (non-updatable) thunk can actually be entered +-- more than once in a parallel program, if work is duplicated +-- by two threads both entering the same updatable thunk before +-- the other has blackholed it. So, we must not eagerly +-- blackhole non-updatable thunks, or the second thread to +-- enter one will become blocked indefinitely. (They are not +-- blackholed by lazy blackholing either, since they have no +-- associated update frame.) See Trac #10414. -- Static closures are never themselves black-holed. @@ -766,7 +776,7 @@ blackHoleOnEntry cl_info = case closureLFInfo cl_info of LFReEntrant _ _ _ _ -> False LFLetNoEscape -> False - LFThunk _ _no_fvs _updatable _ _ -> True + LFThunk _ _no_fvs updatable _ _ -> updatable _other -> panic "blackHoleOnEntry" -- Should never happen isStaticClosure :: ClosureInfo -> Bool diff --git a/testsuite/.gitignore b/testsuite/.gitignore index 1c36308..3583a06 100644 --- a/testsuite/.gitignore +++ b/testsuite/.gitignore @@ -164,6 +164,7 @@ mk/ghcconfig*_inplace_bin_ghc-stage2.exe.mk /tests/codeGen/should_run/SizeOfSmallArray /tests/codeGen/should_run/StaticArraySize /tests/codeGen/should_run/StaticByteArraySize +/tests/codeGen/should_run/T10414 /tests/codeGen/should_run/T10521 /tests/codeGen/should_run/T10521b /tests/codeGen/should_run/T1852 diff --git a/testsuite/tests/codeGen/should_run/T10414.hs b/testsuite/tests/codeGen/should_run/T10414.hs new file mode 100644 index 0000000..197206a --- /dev/null +++ b/testsuite/tests/codeGen/should_run/T10414.hs @@ -0,0 +1,38 @@ +{-# LANGUAGE MagicHash, UnboxedTuples #-} +import GHC.Exts +newtype Eval a = Eval {runEval :: State# RealWorld -> (# State# RealWorld, a #)} + +-- inline sequence :: [Eval a] -> Eval [a] +well_sequenced :: [Eval a] -> Eval [a] +well_sequenced = foldr cons nil where + cons e es = Eval $ \s -> case runEval e s of + (# s', a #) -> case runEval es s' of + (# s'', as #) -> (# s'', a : as #) + nil = Eval $ \s -> (# s, [] #) + +-- seemingly demonic use of spark# +ill_sequenced :: [Eval a] -> Eval [a] +ill_sequenced as = Eval $ spark# (case well_sequenced as of + Eval f -> case f realWorld# of (# _, a' #) -> a') + +-- 'parallelized' version of (show >=> show >=> show >=> show >=> show) +main :: IO () +main = putStrLn ((layer . layer . layer . layer . layer) (:[]) 'y') + where + layer :: (Char -> String) -> (Char -> String) + layer f = (\(Eval x) -> case x realWorld# of (# _, as #) -> concat as) + . well_sequenced -- [Eval String] -> Eval [String] + . map ill_sequenced -- [[Eval Char]] -> [Eval String]; + -- 'map well_sequenced' is fine + . map (map (\x -> Eval $ \s -> (# s, x #))) -- wrap each Char in Eval + . chunk' -- String -> [String] + . concatMap f + . show -- add single quotes + + chunk' :: String -> [String] + chunk' [] = [] + chunk' xs = as : chunk' bs where (as,bs) = splitAt 3 xs + + -- this doesn't work: + -- chunk (a:b:c:xs) = [a,b,c]:chunk xs + -- chunk xs = [xs] diff --git a/testsuite/tests/codeGen/should_run/T10414.stdout b/testsuite/tests/codeGen/should_run/T10414.stdout new file mode 100644 index 0000000..8e22b0c --- /dev/null +++ b/testsuite/tests/codeGen/should_run/T10414.stdout @@ -0,0 +1 @@ +'\'''\\''\'''\'''\'''\\''\\''\'''\'''\\''\'''\'''\'''\\''\'''\'''\'''\\''\'''\'''\'''\\''\\''\'''\'''\\''\\''\'''\'''\\''\'''\'''\'''\\''\'''\'''\'''\\''\\''\'''\'''\\''\'''\'''\'''\\''\'''\'''\'''\\''\'''\'''\'''\\''\\''\'''\'''\\''\'''\'''\'''\\''\'''\'''\'''\\''\'''\'''\'''\\''\\''\'''\'''\\''\'''\'''\'''\\''\'''\'''\'''\\''\'''\'''\'''y''\'''\'''\\''\'''\'''\'''\\''\'''\'''\'''\\''\\''\'''\'''\\''\'''\'''\'''\\''\'''\'''\'''\\''\'''\'''\'''\\''\\''\'''\'''\\''\'''\'''\'''\\''\'''\'''\'''\\''\'''\'''\'''\\''\\''\'''\'''\\''\\''\'''\'''\\''\'''\'''\'''\\''\'''\'''\'''\\''\\''\'''\'''\\''\'''\'''\'''\\''\'''\'''\'''\\''\'''\'''\'''\\''\\''\'''\'''\\''\'''\'''\'''\\''\'''\'' diff --git a/testsuite/tests/codeGen/should_run/all.T b/testsuite/tests/codeGen/should_run/all.T index db2d04e..bae6d10 100644 --- a/testsuite/tests/codeGen/should_run/all.T +++ b/testsuite/tests/codeGen/should_run/all.T @@ -133,5 +133,7 @@ test('cgrun074', normal, compile_and_run, ['']) test('CmmSwitchTest', when(fast(), skip), compile_and_run, ['']) test('T10245', expect_broken(10246), compile_and_run, ['']) test('T10246', expect_broken(10246), compile_and_run, ['']) +test('T10414', [only_ways(['threaded2']), extra_ways(['threaded2'])], + compile_and_run, ['-feager-blackholing']) test('T10521', normal, compile_and_run, ['']) test('T10521b', normal, compile_and_run, ['']) From git at git.haskell.org Tue Jul 7 08:06:56 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 7 Jul 2015 08:06:56 +0000 (UTC) Subject: [commit: ghc] master: Add more discussion of black-holing logic for #10414 (d27e7fd) Message-ID: <20150707080656.87E5E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d27e7fdb1f16ebb28fee007fc0b1dfbd761789d7/ghc >--------------------------------------------------------------- commit d27e7fdb1f16ebb28fee007fc0b1dfbd761789d7 Author: Ben Gamari Date: Mon Jul 6 19:29:21 2015 +0200 Add more discussion of black-holing logic for #10414 Signed-off-by: Ben Gamari >--------------------------------------------------------------- d27e7fdb1f16ebb28fee007fc0b1dfbd761789d7 compiler/codeGen/StgCmmClosure.hs | 68 +++++++++++++++++++++++++++++++++------ 1 file changed, 59 insertions(+), 9 deletions(-) diff --git a/compiler/codeGen/StgCmmClosure.hs b/compiler/codeGen/StgCmmClosure.hs index 984e704..850632c 100644 --- a/compiler/codeGen/StgCmmClosure.hs +++ b/compiler/codeGen/StgCmmClosure.hs @@ -756,16 +756,10 @@ mkClosureInfo dflags is_static id lf_info tot_wds ptr_wds val_descr -- is unconditionally disabled. -- krc 1/2007 -- -- --- A single-entry (non-updatable) thunk can actually be entered --- more than once in a parallel program, if work is duplicated --- by two threads both entering the same updatable thunk before --- the other has blackholed it. So, we must not eagerly --- blackhole non-updatable thunks, or the second thread to --- enter one will become blocked indefinitely. (They are not --- blackholed by lazy blackholing either, since they have no --- associated update frame.) See Trac #10414. - -- Static closures are never themselves black-holed. +-- +-- We also never black-hole non-updatable thunks. +-- See Note [Black-holing non-updatable thunks] blackHoleOnEntry :: ClosureInfo -> Bool blackHoleOnEntry cl_info @@ -779,6 +773,62 @@ blackHoleOnEntry cl_info LFThunk _ _no_fvs updatable _ _ -> updatable _other -> panic "blackHoleOnEntry" -- Should never happen +{- +Note [Black-holing non-updatable thunks] +========================================= + +We cannot black-hole non-updatable thunks otherwise we run into issues like +#10414. A single-entry (non-updatable) thunk can actually be entered more than +once in a parallel program, if work is duplicated by two threads both entering +the same updatable thunk before the other has blackholed it. So, we must not +eagerly blackhole non-updatable thunks, or the second thread to enter one will +become blocked indefinitely. (They are not blackholed by lazy blackholing +either, since they have no associated update frame.) + +For instance, let's consider the following value (in pseudo-Core, example due to +Reid Barton), + + x = \u [] concat [[1], []] + +with the following definitions, + + concat x = case x of + [] -> [] + (:) x xs -> (++) x (concat xs) + + (++) xs ys = case xs of + [] -> ys + (:) x rest -> (:) x ((++) rest ys) + +Where we use the syntax @\u []@ to denote an updatable thunk and @\s []@ to +denote a single-entry (i.e. non-updatable) thunk. After a thread evaluates @x@ +to WHNF and calls @(++)@ the heap will contain the following thunks, + + x = 1 : y + y = \u [] (++) [] z + z = \s [] concat [] + +Now that the stage is set, consider the follow evaluations by two racing threads +A and B, + + 1. Both threads enter @y@ before either is able to replace it with an + indirection + + 2. Thread A does the case analysis in @(++)@ and consequently enters @z@, + replacing it with a black-hole + + 3. At some later point thread B does the same case analysis and also attempts + to enter @z at . However, it finds that it has been replaced with a black-hole + so it blocks. + + 4. Thread A eventually finishes evaluating @z@ (to @[]@) and updates @y@ + accordingly. It does *not* update @z@, however, as it is single-entry. This + leaves Thread B blocked forever on a black-hole which will never be + updated. + +To avoid this sort of condition we never black-hole non-updatable thunks. +-} + isStaticClosure :: ClosureInfo -> Bool isStaticClosure cl_info = isStaticRep (closureSMRep cl_info) From git at git.haskell.org Tue Jul 7 08:09:57 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 7 Jul 2015 08:09:57 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Don't eagerly blackhole single-entry thunks (#10414) (caacd1d) Message-ID: <20150707080957.E29663A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/caacd1d60dbea9e7c129c6036071d6fe7c0e2fbb/ghc >--------------------------------------------------------------- commit caacd1d60dbea9e7c129c6036071d6fe7c0e2fbb Author: Reid Barton Date: Mon Jul 6 19:24:31 2015 +0200 Don't eagerly blackhole single-entry thunks (#10414) In a parallel program they can actually be entered more than once, leading to deadlock. Reviewers: austin, simonmar Subscribers: michaelt, thomie, bgamari Differential Revision: https://phabricator.haskell.org/D1040 GHC Trac Issues: #10414 Conflicts: testsuite/tests/codeGen/should_run/all.T >--------------------------------------------------------------- caacd1d60dbea9e7c129c6036071d6fe7c0e2fbb compiler/codeGen/StgCmmClosure.hs | 12 +++++++- testsuite/.gitignore | 1 + testsuite/tests/codeGen/should_run/T10414.hs | 38 ++++++++++++++++++++++++ testsuite/tests/codeGen/should_run/T10414.stdout | 1 + testsuite/tests/codeGen/should_run/all.T | 2 ++ 5 files changed, 53 insertions(+), 1 deletion(-) diff --git a/compiler/codeGen/StgCmmClosure.hs b/compiler/codeGen/StgCmmClosure.hs index b65d56b..984e704 100644 --- a/compiler/codeGen/StgCmmClosure.hs +++ b/compiler/codeGen/StgCmmClosure.hs @@ -754,6 +754,16 @@ mkClosureInfo dflags is_static id lf_info tot_wds ptr_wds val_descr -- was on. But it didn't work, and it wasn't strictly necessary -- to bring back minimal ticky-ticky, so now EAGER_BLACKHOLING -- is unconditionally disabled. -- krc 1/2007 +-- +-- +-- A single-entry (non-updatable) thunk can actually be entered +-- more than once in a parallel program, if work is duplicated +-- by two threads both entering the same updatable thunk before +-- the other has blackholed it. So, we must not eagerly +-- blackhole non-updatable thunks, or the second thread to +-- enter one will become blocked indefinitely. (They are not +-- blackholed by lazy blackholing either, since they have no +-- associated update frame.) See Trac #10414. -- Static closures are never themselves black-holed. @@ -766,7 +776,7 @@ blackHoleOnEntry cl_info = case closureLFInfo cl_info of LFReEntrant _ _ _ _ -> False LFLetNoEscape -> False - LFThunk _ _no_fvs _updatable _ _ -> True + LFThunk _ _no_fvs updatable _ _ -> updatable _other -> panic "blackHoleOnEntry" -- Should never happen isStaticClosure :: ClosureInfo -> Bool diff --git a/testsuite/.gitignore b/testsuite/.gitignore index b1ed887..7510527 100644 --- a/testsuite/.gitignore +++ b/testsuite/.gitignore @@ -165,6 +165,7 @@ mk/ghcconfig*_inplace_bin_ghc-stage2.exe.mk /tests/codeGen/should_run/SizeOfSmallArray /tests/codeGen/should_run/StaticArraySize /tests/codeGen/should_run/StaticByteArraySize +/tests/codeGen/should_run/T10414 /tests/codeGen/should_run/T10521 /tests/codeGen/should_run/T10521b /tests/codeGen/should_run/T1852 diff --git a/testsuite/tests/codeGen/should_run/T10414.hs b/testsuite/tests/codeGen/should_run/T10414.hs new file mode 100644 index 0000000..197206a --- /dev/null +++ b/testsuite/tests/codeGen/should_run/T10414.hs @@ -0,0 +1,38 @@ +{-# LANGUAGE MagicHash, UnboxedTuples #-} +import GHC.Exts +newtype Eval a = Eval {runEval :: State# RealWorld -> (# State# RealWorld, a #)} + +-- inline sequence :: [Eval a] -> Eval [a] +well_sequenced :: [Eval a] -> Eval [a] +well_sequenced = foldr cons nil where + cons e es = Eval $ \s -> case runEval e s of + (# s', a #) -> case runEval es s' of + (# s'', as #) -> (# s'', a : as #) + nil = Eval $ \s -> (# s, [] #) + +-- seemingly demonic use of spark# +ill_sequenced :: [Eval a] -> Eval [a] +ill_sequenced as = Eval $ spark# (case well_sequenced as of + Eval f -> case f realWorld# of (# _, a' #) -> a') + +-- 'parallelized' version of (show >=> show >=> show >=> show >=> show) +main :: IO () +main = putStrLn ((layer . layer . layer . layer . layer) (:[]) 'y') + where + layer :: (Char -> String) -> (Char -> String) + layer f = (\(Eval x) -> case x realWorld# of (# _, as #) -> concat as) + . well_sequenced -- [Eval String] -> Eval [String] + . map ill_sequenced -- [[Eval Char]] -> [Eval String]; + -- 'map well_sequenced' is fine + . map (map (\x -> Eval $ \s -> (# s, x #))) -- wrap each Char in Eval + . chunk' -- String -> [String] + . concatMap f + . show -- add single quotes + + chunk' :: String -> [String] + chunk' [] = [] + chunk' xs = as : chunk' bs where (as,bs) = splitAt 3 xs + + -- this doesn't work: + -- chunk (a:b:c:xs) = [a,b,c]:chunk xs + -- chunk xs = [xs] diff --git a/testsuite/tests/codeGen/should_run/T10414.stdout b/testsuite/tests/codeGen/should_run/T10414.stdout new file mode 100644 index 0000000..8e22b0c --- /dev/null +++ b/testsuite/tests/codeGen/should_run/T10414.stdout @@ -0,0 +1 @@ +'\'''\\''\'''\'''\'''\\''\\''\'''\'''\\''\'''\'''\'''\\''\'''\'''\'''\\''\'''\'''\'''\\''\\''\'''\'''\\''\\''\'''\'''\\''\'''\'''\'''\\''\'''\'''\'''\\''\\''\'''\'''\\''\'''\'''\'''\\''\'''\'''\'''\\''\'''\'''\'''\\''\\''\'''\'''\\''\'''\'''\'''\\''\'''\'''\'''\\''\'''\'''\'''\\''\\''\'''\'''\\''\'''\'''\'''\\''\'''\'''\'''\\''\'''\'''\'''y''\'''\'''\\''\'''\'''\'''\\''\'''\'''\'''\\''\\''\'''\'''\\''\'''\'''\'''\\''\'''\'''\'''\\''\'''\'''\'''\\''\\''\'''\'''\\''\'''\'''\'''\\''\'''\'''\'''\\''\'''\'''\'''\\''\\''\'''\'''\\''\\''\'''\'''\\''\'''\'''\'''\\''\'''\'''\'''\\''\\''\'''\'''\\''\'''\'''\'''\\''\'''\'''\'''\\''\'''\'''\'''\\''\\''\'''\'''\\''\'''\'''\'''\\''\'''\'' diff --git a/testsuite/tests/codeGen/should_run/all.T b/testsuite/tests/codeGen/should_run/all.T index b2970a2..9a04bcf 100644 --- a/testsuite/tests/codeGen/should_run/all.T +++ b/testsuite/tests/codeGen/should_run/all.T @@ -129,5 +129,7 @@ test('T9013', omit_ways(['ghci']), # ghci doesn't support unboxed tuples compile_and_run, ['']) test('T9340', normal, compile_and_run, ['']) test('cgrun074', normal, compile_and_run, ['']) +test('T10414', [only_ways(['threaded2']), extra_ways(['threaded2'])], + compile_and_run, ['-feager-blackholing']) test('T10521', normal, compile_and_run, ['']) test('T10521b', normal, compile_and_run, ['']) From git at git.haskell.org Tue Jul 7 08:10:00 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 7 Jul 2015 08:10:00 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Add more discussion of black-holing logic for #10414 (32c4e7a) Message-ID: <20150707081000.B137C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/32c4e7a4f96f26d48bfe42501e36fa08ed03c990/ghc >--------------------------------------------------------------- commit 32c4e7a4f96f26d48bfe42501e36fa08ed03c990 Author: Ben Gamari Date: Mon Jul 6 19:29:21 2015 +0200 Add more discussion of black-holing logic for #10414 Signed-off-by: Ben Gamari >--------------------------------------------------------------- 32c4e7a4f96f26d48bfe42501e36fa08ed03c990 compiler/codeGen/StgCmmClosure.hs | 68 +++++++++++++++++++++++++++++++++------ 1 file changed, 59 insertions(+), 9 deletions(-) diff --git a/compiler/codeGen/StgCmmClosure.hs b/compiler/codeGen/StgCmmClosure.hs index 984e704..850632c 100644 --- a/compiler/codeGen/StgCmmClosure.hs +++ b/compiler/codeGen/StgCmmClosure.hs @@ -756,16 +756,10 @@ mkClosureInfo dflags is_static id lf_info tot_wds ptr_wds val_descr -- is unconditionally disabled. -- krc 1/2007 -- -- --- A single-entry (non-updatable) thunk can actually be entered --- more than once in a parallel program, if work is duplicated --- by two threads both entering the same updatable thunk before --- the other has blackholed it. So, we must not eagerly --- blackhole non-updatable thunks, or the second thread to --- enter one will become blocked indefinitely. (They are not --- blackholed by lazy blackholing either, since they have no --- associated update frame.) See Trac #10414. - -- Static closures are never themselves black-holed. +-- +-- We also never black-hole non-updatable thunks. +-- See Note [Black-holing non-updatable thunks] blackHoleOnEntry :: ClosureInfo -> Bool blackHoleOnEntry cl_info @@ -779,6 +773,62 @@ blackHoleOnEntry cl_info LFThunk _ _no_fvs updatable _ _ -> updatable _other -> panic "blackHoleOnEntry" -- Should never happen +{- +Note [Black-holing non-updatable thunks] +========================================= + +We cannot black-hole non-updatable thunks otherwise we run into issues like +#10414. A single-entry (non-updatable) thunk can actually be entered more than +once in a parallel program, if work is duplicated by two threads both entering +the same updatable thunk before the other has blackholed it. So, we must not +eagerly blackhole non-updatable thunks, or the second thread to enter one will +become blocked indefinitely. (They are not blackholed by lazy blackholing +either, since they have no associated update frame.) + +For instance, let's consider the following value (in pseudo-Core, example due to +Reid Barton), + + x = \u [] concat [[1], []] + +with the following definitions, + + concat x = case x of + [] -> [] + (:) x xs -> (++) x (concat xs) + + (++) xs ys = case xs of + [] -> ys + (:) x rest -> (:) x ((++) rest ys) + +Where we use the syntax @\u []@ to denote an updatable thunk and @\s []@ to +denote a single-entry (i.e. non-updatable) thunk. After a thread evaluates @x@ +to WHNF and calls @(++)@ the heap will contain the following thunks, + + x = 1 : y + y = \u [] (++) [] z + z = \s [] concat [] + +Now that the stage is set, consider the follow evaluations by two racing threads +A and B, + + 1. Both threads enter @y@ before either is able to replace it with an + indirection + + 2. Thread A does the case analysis in @(++)@ and consequently enters @z@, + replacing it with a black-hole + + 3. At some later point thread B does the same case analysis and also attempts + to enter @z at . However, it finds that it has been replaced with a black-hole + so it blocks. + + 4. Thread A eventually finishes evaluating @z@ (to @[]@) and updates @y@ + accordingly. It does *not* update @z@, however, as it is single-entry. This + leaves Thread B blocked forever on a black-hole which will never be + updated. + +To avoid this sort of condition we never black-hole non-updatable thunks. +-} + isStaticClosure :: ClosureInfo -> Bool isStaticClosure cl_info = isStaticRep (closureSMRep cl_info) From git at git.haskell.org Tue Jul 7 09:50:37 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 7 Jul 2015 09:50:37 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Fix "CPP directive" in comment (dde2095) Message-ID: <20150707095037.B3E123A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/dde2095916c670f318ee8328cfe2f20adff8f4e6/ghc >--------------------------------------------------------------- commit dde2095916c670f318ee8328cfe2f20adff8f4e6 Author: Ben Gamari Date: Tue Jul 7 11:50:48 2015 +0200 Fix "CPP directive" in comment >--------------------------------------------------------------- dde2095916c670f318ee8328cfe2f20adff8f4e6 compiler/codeGen/StgCmmClosure.hs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/compiler/codeGen/StgCmmClosure.hs b/compiler/codeGen/StgCmmClosure.hs index 850632c..f8741b7 100644 --- a/compiler/codeGen/StgCmmClosure.hs +++ b/compiler/codeGen/StgCmmClosure.hs @@ -778,12 +778,12 @@ Note [Black-holing non-updatable thunks] ========================================= We cannot black-hole non-updatable thunks otherwise we run into issues like -#10414. A single-entry (non-updatable) thunk can actually be entered more than -once in a parallel program, if work is duplicated by two threads both entering -the same updatable thunk before the other has blackholed it. So, we must not -eagerly blackhole non-updatable thunks, or the second thread to enter one will -become blocked indefinitely. (They are not blackholed by lazy blackholing -either, since they have no associated update frame.) +Trac #10414. A single-entry (non-updatable) thunk can actually be entered more +than once in a parallel program, if work is duplicated by two threads both +entering the same updatable thunk before the other has blackholed it. So, we +must not eagerly blackhole non-updatable thunks, or the second thread to enter +one will become blocked indefinitely. (They are not blackholed by lazy +blackholing either, since they have no associated update frame.) For instance, let's consider the following value (in pseudo-Core, example due to Reid Barton), From git at git.haskell.org Tue Jul 7 09:51:12 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 7 Jul 2015 09:51:12 +0000 (UTC) Subject: [commit: ghc] master: Fix "CPP directive" in comment (d59cf4e) Message-ID: <20150707095112.55BB33A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d59cf4e503cb5f129b163e1280f5fe4a83e8e4d5/ghc >--------------------------------------------------------------- commit d59cf4e503cb5f129b163e1280f5fe4a83e8e4d5 Author: Ben Gamari Date: Tue Jul 7 11:50:48 2015 +0200 Fix "CPP directive" in comment >--------------------------------------------------------------- d59cf4e503cb5f129b163e1280f5fe4a83e8e4d5 compiler/codeGen/StgCmmClosure.hs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/compiler/codeGen/StgCmmClosure.hs b/compiler/codeGen/StgCmmClosure.hs index 850632c..f8741b7 100644 --- a/compiler/codeGen/StgCmmClosure.hs +++ b/compiler/codeGen/StgCmmClosure.hs @@ -778,12 +778,12 @@ Note [Black-holing non-updatable thunks] ========================================= We cannot black-hole non-updatable thunks otherwise we run into issues like -#10414. A single-entry (non-updatable) thunk can actually be entered more than -once in a parallel program, if work is duplicated by two threads both entering -the same updatable thunk before the other has blackholed it. So, we must not -eagerly blackhole non-updatable thunks, or the second thread to enter one will -become blocked indefinitely. (They are not blackholed by lazy blackholing -either, since they have no associated update frame.) +Trac #10414. A single-entry (non-updatable) thunk can actually be entered more +than once in a parallel program, if work is duplicated by two threads both +entering the same updatable thunk before the other has blackholed it. So, we +must not eagerly blackhole non-updatable thunks, or the second thread to enter +one will become blocked indefinitely. (They are not blackholed by lazy +blackholing either, since they have no associated update frame.) For instance, let's consider the following value (in pseudo-Core, example due to Reid Barton), From git at git.haskell.org Tue Jul 7 10:33:48 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 7 Jul 2015 10:33:48 +0000 (UTC) Subject: [commit: ghc] master: Add Note [Warnings in code generated by Alex] (db530f1) Message-ID: <20150707103348.D4D983A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/db530f18784fe1a29394470a0edc56702727bcde/ghc >--------------------------------------------------------------- commit db530f18784fe1a29394470a0edc56702727bcde Author: Thomas Miedema Date: Mon Jul 6 20:28:04 2015 +0200 Add Note [Warnings in code generated by Alex] Differential Revision: https://phabricator.haskell.org/D1044 >--------------------------------------------------------------- db530f18784fe1a29394470a0edc56702727bcde compiler/cmm/CmmLex.x | 6 +----- compiler/parser/Lexer.x | 42 +++++++++++++++++++++++++++++++++++------- utils/genprimopcode/Lexer.x | 6 +----- 3 files changed, 37 insertions(+), 17 deletions(-) diff --git a/compiler/cmm/CmmLex.x b/compiler/cmm/CmmLex.x index fca5a1e..89ae796 100644 --- a/compiler/cmm/CmmLex.x +++ b/compiler/cmm/CmmLex.x @@ -11,16 +11,12 @@ ----------------------------------------------------------------------------- { +-- See Note [Warnings in code generated by Alex] in compiler/parser/Lexer.x {-# OPTIONS_GHC -fno-warn-unused-matches #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-tabs #-} {-# OPTIONS_GHC -fno-warn-missing-signatures #-} --- The above warning suppression flags are a temporary kludge. --- While working on this module you are encouraged to remove it and fix --- any warnings in the module. See --- http://ghc.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings --- for details module CmmLex ( CmmToken(..), cmmlex, diff --git a/compiler/parser/Lexer.x b/compiler/parser/Lexer.x index 98d167d..01e7de3 100644 --- a/compiler/parser/Lexer.x +++ b/compiler/parser/Lexer.x @@ -41,20 +41,16 @@ -- Alex "Haskell code fragment top" { --- XXX The above flags turn off warnings in the generated code: {-# LANGUAGE BangPatterns #-} + +-- See Note [Warnings in code generated by Alex] in compiler/parser/Lexer.x {-# OPTIONS_GHC -fno-warn-unused-matches #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -fno-warn-tabs #-} {-# OPTIONS_GHC -fno-warn-missing-signatures #-} -{-# OPTIONS_GHC -fno-warn-overlapping-patterns #-} --- The above warning suppression flags are a temporary kludge. --- While working on this module you are encouraged to remove it and fix --- any warnings in the module. See --- http://ghc.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings --- for details +{-# OPTIONS_GHC -fno-warn-overlapping-patterns #-} {-# OPTIONS_GHC -funbox-strict-fields #-} module Lexer ( @@ -2695,4 +2691,36 @@ isDocComment (ITdocSection _ _) = True isDocComment (ITdocOptions _) = True isDocComment (ITdocOptionsOld _) = True isDocComment _ = False + +{- Note [Warnings in code generated by Alex] + +We add the following warning suppression flags to all code generated by Alex: + +{-# OPTIONS_GHC -fno-warn-unused-matches #-} +{-# OPTIONS_GHC -fno-warn-unused-binds #-} +{-# OPTIONS_GHC -fno-warn-unused-imports #-} +{-# OPTIONS_GHC -fno-warn-tabs #-} +{-# OPTIONS_GHC -fno-warn-missing-signatures #-} + +Without these flags, current versions of Alex will generate code that is not +warning free. Note that this is the result of Alex' internals, not of the way +we have have written our (Lexer).x files. + +As always, we need code to be warning free when validating with -Werror. + +The list of flags is as short as possible (at the time of writing), to try to +avoid suppressing warnings for bugs in our own code. + +TODO. Reevaluate this situation once Alex >3.1.4 is released. Hopefully you +can remove these flags from all (Lexer).x files in the repository, and also +delete this Note. Don't forget to update aclocal.m4, and send a HEADS UP +message to ghc-devs. + +The first release of Alex after 3.1.4 will either suppress all warnings itself +[1] (bad), or most warnings will be fixed and only a few select ones will be +suppressed by default [2] (better). + +[1] https://github.com/simonmar/alex/commit/1eefcde22ba1bb9b51d523814415714e20f0761e +[2] https://github.com/simonmar/alex/pull/69 +-} } diff --git a/utils/genprimopcode/Lexer.x b/utils/genprimopcode/Lexer.x index 3ec6c2e..ad2590b 100644 --- a/utils/genprimopcode/Lexer.x +++ b/utils/genprimopcode/Lexer.x @@ -1,15 +1,11 @@ { +-- See Note [Warnings in code generated by Alex] in compiler/parser/Lexer.x {-# OPTIONS_GHC -fno-warn-unused-matches #-} {-# OPTIONS_GHC -fno-warn-unused-binds #-} {-# OPTIONS_GHC -fno-warn-tabs #-} {-# OPTIONS_GHC -fno-warn-missing-signatures #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} --- The above warning suppression flags are a temporary kludge. --- While working on this module you are encouraged to remove it and fix --- any warnings in the module. See --- http://ghc.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings --- for details module Lexer (lex_tok) where From git at git.haskell.org Tue Jul 7 10:40:46 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 7 Jul 2015 10:40:46 +0000 (UTC) Subject: [commit: ghc] master: Build system: don't set GhcLibWays explicitly in build.mk.sample (#10536) (37de4ad) Message-ID: <20150707104046.82DC93A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/37de4ad76b75d403e6a8dae9539af08c859d46a4/ghc >--------------------------------------------------------------- commit 37de4ad76b75d403e6a8dae9539af08c859d46a4 Author: Thomas Miedema Date: Mon Jun 29 22:42:42 2015 +0200 Build system: don't set GhcLibWays explicitly in build.mk.sample (#10536) We used to have the following in mk/build.mk.sample: GhcLibWays = $(if $(filter $(DYNAMIC_GHC_PROGRAMS),YES),v dyn,v) This commit removes that statement for the following reasons: 1) It depends on the variable DYNAMIC_GHC_PROGRAMS, which is set later in the file for some BuildFlavours. Although this works because `make` does multiple passes when reading Makefiles, it is confusing to users [1]. Instead, test for DYNAMIC_GHC_PROGRAMS in mk/config.mk.in. 2) Although it looks like that line is about compiling the `dyn` way, its purpose is really to not build the `prof` way. This commit introduces the variable BUILD_PROF_LIBS, to make this more explicit. This simplifies mk/build.mk.sample and mk/validate-settings.mk. Note that setting GhcLibWays explicitly still works, and DYNAMIC_GHC_PROGRAMS=NO in build.mk does not build the `dyn` way. [1] https://mail.haskell.org/pipermail/ghc-devs/2014-December/007725.html Differential Revision: https://phabricator.haskell.org/D1021 >--------------------------------------------------------------- 37de4ad76b75d403e6a8dae9539af08c859d46a4 mk/build.mk.sample | 42 +++++++++++++++++++++--------------------- mk/config.mk.in | 15 ++++++++++----- mk/validate-settings.mk | 15 ++------------- 3 files changed, 33 insertions(+), 39 deletions(-) diff --git a/mk/build.mk.sample b/mk/build.mk.sample index 7969b40..3f97702 100644 --- a/mk/build.mk.sample +++ b/mk/build.mk.sample @@ -72,8 +72,6 @@ V = 1 # Uncomment the following line to enable building DPH #BUILD_DPH=YES -GhcLibWays = $(if $(filter $(DYNAMIC_GHC_PROGRAMS),YES),v dyn,v) - # Uncomment the following to force `integer-gmp` to use the in-tree GMP 5.0.4 # (other sometimes useful configure-options: `--with-gmp-{includes,libraries}`) #libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-intree-gmp @@ -84,40 +82,34 @@ ifeq "$(BuildFlavour)" "perf" # perf matches the default settings, repeated here for comparison: -SRC_HC_OPTS = -O -H64m -GhcStage1HcOpts = -O -GhcStage2HcOpts = -O2 -GhcLibHcOpts = -O2 +SRC_HC_OPTS = -O -H64m +GhcStage1HcOpts = -O +GhcStage2HcOpts = -O2 +GhcLibHcOpts = -O2 +BUILD_PROF_LIBS = YES #SplitObjs #HADDOCK_DOCS #BUILD_DOCBOOK_HTML #BUILD_DOCBOOK_PS #BUILD_DOCBOOK_PDF -GhcLibWays = v -GhcLibWays += p -ifeq "$(PlatformSupportsSharedLibs)" "YES" -GhcLibWays += dyn -endif - endif # ---------------- Perf build using LLVM -------------------------------------- ifeq "$(BuildFlavour)" "perf-llvm" -SRC_HC_OPTS = -O -H64m -fllvm -GhcStage1HcOpts = -O -fllvm -GhcStage2HcOpts = -O2 -fllvm -GhcLibHcOpts = -O2 +SRC_HC_OPTS = -O -H64m -fllvm +GhcStage1HcOpts = -O -fllvm +GhcStage2HcOpts = -O2 -fllvm +GhcLibHcOpts = -O2 +BUILD_PROF_LIBS = YES #SplitObjs #HADDOCK_DOCS #BUILD_DOCBOOK_HTML #BUILD_DOCBOOK_PS #BUILD_DOCBOOK_PDF -GhcLibWays += p - endif # ------- A Perf build configured for cross-compilation ---------------------- @@ -128,14 +120,13 @@ SRC_HC_OPTS = -O -H64m -fllvm GhcStage1HcOpts = -O2 GhcStage2HcOpts = -O2 -fllvm GhcLibHcOpts = -O2 +BUILD_PROF_LIBS = YES #SplitObjs HADDOCK_DOCS = NO BUILD_DOCBOOK_HTML = NO BUILD_DOCBOOK_PS = NO BUILD_DOCBOOK_PDF = NO -GhcLibWays += p - INTEGER_LIBRARY = integer-simple Stage1Only = YES DYNAMIC_BY_DEFAULT = NO @@ -151,6 +142,7 @@ SRC_HC_OPTS = -H64m -O0 GhcStage1HcOpts = -O GhcStage2HcOpts = -O0 GhcLibHcOpts = -O0 +BUILD_PROF_LIBS = NO SplitObjs = NO HADDOCK_DOCS = NO BUILD_DOCBOOK_HTML = NO @@ -167,6 +159,7 @@ SRC_HC_OPTS = -H64m -O0 GhcStage1HcOpts = -O GhcStage2HcOpts = -O0 GhcLibHcOpts = -O +BUILD_PROF_LIBS = NO SplitObjs = NO HADDOCK_DOCS = NO BUILD_DOCBOOK_HTML = NO @@ -183,6 +176,7 @@ SRC_HC_OPTS = -H64m -O0 -fllvm GhcStage1HcOpts = -O -fllvm GhcStage2HcOpts = -O0 -fllvm GhcLibHcOpts = -O -fllvm +BUILD_PROF_LIBS = NO SplitObjs = NO HADDOCK_DOCS = NO BUILD_DOCBOOK_HTML = NO @@ -199,6 +193,7 @@ SRC_HC_OPTS = -H64m -O0 GhcStage1HcOpts = -O GhcStage2HcOpts = -O0 -fllvm GhcLibHcOpts = -O -fllvm +BUILD_PROF_LIBS = NO SplitObjs = NO HADDOCK_DOCS = NO BUILD_DOCBOOK_HTML = NO @@ -220,13 +215,13 @@ SRC_HC_OPTS = -H64m -O0 GhcStage1HcOpts = -O GhcStage2HcOpts = -O GhcLibHcOpts = -O +BUILD_PROF_LIBS = YES SplitObjs = NO HADDOCK_DOCS = NO BUILD_DOCBOOK_HTML = NO BUILD_DOCBOOK_PS = NO BUILD_DOCBOOK_PDF = NO -GhcLibWays += p GhcProfiled = YES endif @@ -239,6 +234,7 @@ SRC_HC_OPTS = -H64m -O GhcStage1HcOpts = -O0 -DDEBUG GhcStage2HcOpts = -O GhcLibHcOpts = -O -dcore-lint +BUILD_PROF_LIBS = NO SplitObjs = NO HADDOCK_DOCS = NO BUILD_DOCBOOK_HTML = NO @@ -257,6 +253,7 @@ SRC_HC_OPTS = -H64m -O GhcStage1HcOpts = -O GhcStage2HcOpts = -O0 -DDEBUG GhcLibHcOpts = -O -dcore-lint +BUILD_PROF_LIBS = NO SplitObjs = NO HADDOCK_DOCS = NO BUILD_DOCBOOK_HTML = NO @@ -275,6 +272,7 @@ SRC_HC_OPTS = -O -H64m GhcStage1HcOpts = -O GhcStage2HcOpts = -O0 GhcLibHcOpts = -O2 +BUILD_PROF_LIBS = NO SplitObjs = NO HADDOCK_DOCS = NO BUILD_DOCBOOK_HTML = NO @@ -291,6 +289,7 @@ SRC_HC_OPTS = -O -H64m GhcStage1HcOpts = -O -fllvm GhcStage2HcOpts = -O0 -fllvm GhcLibHcOpts = -O2 -fllvm +BUILD_PROF_LIBS = NO SplitObjs = NO HADDOCK_DOCS = NO BUILD_DOCBOOK_HTML = NO @@ -307,6 +306,7 @@ SRC_HC_OPTS = -O -H64m GhcStage1HcOpts = -O GhcStage2HcOpts = -O0 GhcLibHcOpts = -O2 +BUILD_PROF_LIBS = NO SplitObjs = NO HADDOCK_DOCS = NO BUILD_DOCBOOK_HTML = NO diff --git a/mk/config.mk.in b/mk/config.mk.in index ebc1992..bcdebbf 100644 --- a/mk/config.mk.in +++ b/mk/config.mk.in @@ -219,15 +219,20 @@ ExtraMakefileSanityChecks = NO INTEGER_LIBRARY=integer-gmp # We build the libraries at least the "vanilla" way (way "v") +# Technically we don't need the v way if DYNAMIC_GHC_PROGRAMS is YES, +# but with -dynamic-too it's cheap, and makes life easier. GhcLibWays = v # In addition to the normal sequential way, the default is to also build # profiled prelude libraries -GhcLibWays += p - -ifeq "$(PlatformSupportsSharedLibs)" "YES" -GhcLibWays += dyn -endif +# $(if $(filter ...)) allows controlling this expression from build.mk. +GhcLibWays += $(if $(filter $(BUILD_PROF_LIBS),NO),,p) + +# Backward compatibility: although it would be cleaner to test for +# PlatformSupportsSharedLibs, or perhaps a new variable BUILD_SHARED_LIBS, +# some users currently expect that DYNAMIC_GHC_PROGRAMS=NO in build.mk implies +# that dyn is not added to GhcLibWays. +GhcLibWays += $(if $(filter $(DYNAMIC_GHC_PROGRAMS),NO),,dyn) # Handy way to test whether we're building shared libs or not. BuildSharedLibs=$(strip $(if $(findstring dyn,$(GhcLibWays)),YES,NO)) diff --git a/mk/validate-settings.mk b/mk/validate-settings.mk index ef3a58e..c71158e 100644 --- a/mk/validate-settings.mk +++ b/mk/validate-settings.mk @@ -14,19 +14,8 @@ GhcStage2HcOpts += -O -dcore-lint GhcLibHcOpts += -O -dcore-lint -# We define DefaultFastGhcLibWays in this style so that the value is -# correct even if the user alters DYNAMIC_GHC_PROGRAMS. -# Technically we don't need the v way if DYNAMIC_GHC_PROGRAMS is YES, -# but with -dynamic-too it's cheap, and makes life easier. -DefaultFastGhcLibWays = $(if $(filter $(DYNAMIC_GHC_PROGRAMS),YES),v dyn,v) -DefaultProfGhcLibWays = $(if $(filter $(GhcProfiled),YES),p,) - -ifeq "$(ValidateSpeed)" "FAST" -GhcLibWays = $(DefaultFastGhcLibWays) -else -GhcLibWays := $(filter v dyn,$(GhcLibWays)) -endif -GhcLibWays += $(DefaultProfGhcLibWays) +BUILD_PROF_LIBS = NO + SplitObjs = NO NoFibWays = STRIP_CMD = : From git at git.haskell.org Tue Jul 7 13:52:43 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 7 Jul 2015 13:52:43 +0000 (UTC) Subject: [commit: ghc] master: Fix word repetitions in comments (62fcf05) Message-ID: <20150707135243.B7DA33A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/62fcf0515112b918152dd8bf053f84d9ec0d1501/ghc >--------------------------------------------------------------- commit 62fcf0515112b918152dd8bf053f84d9ec0d1501 Author: Gabor Greif Date: Tue Jul 7 15:52:57 2015 +0200 Fix word repetitions in comments >--------------------------------------------------------------- 62fcf0515112b918152dd8bf053f84d9ec0d1501 compiler/parser/Lexer.x | 2 +- compiler/typecheck/TcDeriv.hs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/parser/Lexer.x b/compiler/parser/Lexer.x index 01e7de3..a9293da 100644 --- a/compiler/parser/Lexer.x +++ b/compiler/parser/Lexer.x @@ -2704,7 +2704,7 @@ We add the following warning suppression flags to all code generated by Alex: Without these flags, current versions of Alex will generate code that is not warning free. Note that this is the result of Alex' internals, not of the way -we have have written our (Lexer).x files. +we have written our (Lexer).x files. As always, we need code to be warning free when validating with -Werror. diff --git a/compiler/typecheck/TcDeriv.hs b/compiler/typecheck/TcDeriv.hs index 9045e39..7e5e75c 100644 --- a/compiler/typecheck/TcDeriv.hs +++ b/compiler/typecheck/TcDeriv.hs @@ -1147,7 +1147,7 @@ The DeriveAnyClass extension adds a third way to derive instances, based on empty instance declarations. The canonical use case is in combination with GHC.Generics and default method -signatures. These allow us have have instance declarations be empty, but still +signatures. These allow us to have instance declarations being empty, but still useful, e.g. data T a = ...blah..blah... deriving( Generic ) From git at git.haskell.org Tue Jul 7 14:07:13 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 7 Jul 2015 14:07:13 +0000 (UTC) Subject: [commit: ghc] master: Update comments around blackholes (ebfc2fb) Message-ID: <20150707140713.D4D503A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/ebfc2fb884764eae65df4c5da68d2ad5aaa7b95a/ghc >--------------------------------------------------------------- commit ebfc2fb884764eae65df4c5da68d2ad5aaa7b95a Author: Simon Marlow Date: Tue Jul 7 08:52:53 2015 +0100 Update comments around blackholes Test Plan: validate Reviewers: austin, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1047 >--------------------------------------------------------------- ebfc2fb884764eae65df4c5da68d2ad5aaa7b95a rts/StgMiscClosures.cmm | 16 +++++++++------- rts/ThreadPaused.c | 7 ++++--- rts/sm/Scav.c | 2 +- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/rts/StgMiscClosures.cmm b/rts/StgMiscClosures.cmm index dd25706..e3be2cb 100644 --- a/rts/StgMiscClosures.cmm +++ b/rts/StgMiscClosures.cmm @@ -355,17 +355,12 @@ retry: } } -INFO_TABLE(__stg_EAGER_BLACKHOLE,1,0,BLACKHOLE,"BLACKHOLE","BLACKHOLE") - (P_ node) -{ - jump ENTRY_LBL(stg_BLACKHOLE) (node); -} - // CAF_BLACKHOLE is allocated when entering a CAF. The reason it is // distinct from BLACKHOLE is so that we can tell the difference // between an update frame on the stack that points to a CAF under // evaluation, and one that points to a closure that is under -// evaluation by another thread (a BLACKHOLE). See threadPaused(). +// evaluation by another thread (a BLACKHOLE). see Note [suspend +// duplicate work] in ThreadPaused.c // INFO_TABLE(stg_CAF_BLACKHOLE,1,0,BLACKHOLE,"BLACKHOLE","BLACKHOLE") (P_ node) @@ -373,6 +368,13 @@ INFO_TABLE(stg_CAF_BLACKHOLE,1,0,BLACKHOLE,"BLACKHOLE","BLACKHOLE") jump ENTRY_LBL(stg_BLACKHOLE) (node); } +// EAGER_BLACKHOLE exists for the same reason as CAF_BLACKHOLE (see above). +INFO_TABLE(__stg_EAGER_BLACKHOLE,1,0,BLACKHOLE,"BLACKHOLE","BLACKHOLE") + (P_ node) +{ + jump ENTRY_LBL(stg_BLACKHOLE) (node); +} + INFO_TABLE(stg_BLOCKING_QUEUE_CLEAN,4,0,BLOCKING_QUEUE,"BLOCKING_QUEUE","BLOCKING_QUEUE") { foreign "C" barf("BLOCKING_QUEUE_CLEAN object entered!") never returns; } diff --git a/rts/ThreadPaused.c b/rts/ThreadPaused.c index 15339c4..1f1d0af 100644 --- a/rts/ThreadPaused.c +++ b/rts/ThreadPaused.c @@ -211,9 +211,8 @@ threadPaused(Capability *cap, StgTSO *tso) maybePerformBlockedException (cap, tso); if (tso->what_next == ThreadKilled) { return; } - // NB. Blackholing is *compulsory*, we must either do lazy - // blackholing, or eager blackholing consistently. See Note - // [upd-black-hole] in sm/Scav.c. + // NB. Updatable thunks *must* be blackholed, either by eager blackholing or + // lazy blackholing. See Note [upd-black-hole] in sm/Scav.c. stack_end = tso->stackobj->stack + tso->stackobj->stack_size; @@ -244,6 +243,8 @@ threadPaused(Capability *cap, StgTSO *tso) #ifdef THREADED_RTS retry: #endif + // Note [suspend duplicate work] + // // If the info table is a WHITEHOLE or a BLACKHOLE, then // another thread has claimed it (via the SET_INFO() // below), or is in the process of doing so. In that case diff --git a/rts/sm/Scav.c b/rts/sm/Scav.c index 781840c..a8f0ab0 100644 --- a/rts/sm/Scav.c +++ b/rts/sm/Scav.c @@ -1807,6 +1807,7 @@ scavenge_stack(StgPtr p, StgPtr stack_end) switch (info->i.type) { case UPDATE_FRAME: + // Note [upd-black-hole] // In SMP, we can get update frames that point to indirections // when two threads evaluate the same thunk. We do attempt to // discover this situation in threadPaused(), but it's @@ -1832,7 +1833,6 @@ scavenge_stack(StgPtr p, StgPtr stack_end) // compulsory (otherwise we would have to check for thunks // too). // - // Note [upd-black-hole] // One slight hiccup is that the THUNK_SELECTOR machinery can // overwrite the updatee with an IND. In parallel GC, this // could even be happening concurrently, so we can't check for From git at git.haskell.org Tue Jul 7 15:19:25 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 7 Jul 2015 15:19:25 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Merge remote-tracking branch 'origin/master' into wip/orf-reboot (18bd41c) Message-ID: <20150707151925.354483A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/18bd41c9927dec764075c29d752c13b696755981/ghc >--------------------------------------------------------------- commit 18bd41c9927dec764075c29d752c13b696755981 Merge: 97fd90b daa5097 Author: Adam Gundry Date: Wed Jul 1 14:58:46 2015 +0100 Merge remote-tracking branch 'origin/master' into wip/orf-reboot Conflicts: compiler/hsSyn/HsExpr.hs compiler/rename/RnEnv.hs compiler/rename/RnExpr.hs >--------------------------------------------------------------- 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 18bd41c9927dec764075c29d752c13b696755981 From git at git.haskell.org Tue Jul 7 15:19:28 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 7 Jul 2015 15:19:28 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Get rid of extendRecordFieldEnv, do it in getLocalNonValBinders instead (74835a4) Message-ID: <20150707151928.03B013A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/74835a498bc4c782956d2ed2623e961b24eab000/ghc >--------------------------------------------------------------- commit 74835a498bc4c782956d2ed2623e961b24eab000 Author: Adam Gundry Date: Wed Jul 1 14:59:19 2015 +0100 Get rid of extendRecordFieldEnv, do it in getLocalNonValBinders instead >--------------------------------------------------------------- 74835a498bc4c782956d2ed2623e961b24eab000 compiler/rename/RnNames.hs | 11 ++++++++--- compiler/rename/RnSource.hs | 28 ++-------------------------- 2 files changed, 10 insertions(+), 29 deletions(-) diff --git a/compiler/rename/RnNames.hs b/compiler/rename/RnNames.hs index 96ebfd0..b3fa348 100644 --- a/compiler/rename/RnNames.hs +++ b/compiler/rename/RnNames.hs @@ -516,7 +516,7 @@ extendGlobalRdrEnvRn avails new_fixities ********************************************************************* -} getLocalNonValBinders :: MiniFixityEnv -> HsGroup RdrName - -> RnM ((TcGblEnv, TcLclEnv), NameSet, [(Name, [FieldLabel])]) + -> RnM ((TcGblEnv, TcLclEnv), NameSet) -- Get all the top-level binders bound the group *except* -- for value bindings, which are treated separately -- Specifically we return AvailInfo for @@ -559,9 +559,14 @@ getLocalNonValBinders fixity_env availsToNameSet tc_avails flds = concat nti_fldss ++ concat tc_fldss ; traceRn (text "getLocalNonValBinders 2" <+> ppr avails) - ; envs <- extendGlobalRdrEnvRn avails fixity_env + ; (tcg_env, tcl_env) <- extendGlobalRdrEnvRn avails fixity_env - ; return (envs, new_bndrs, flds) } } + -- Extend tcg_field_env with new fields (this used to be the + -- work of extendRecordFieldEnv) + ; let field_env = extendNameEnvList (tcg_field_env tcg_env) flds + envs = (tcg_env { tcg_field_env = field_env }, tcl_env) + + ; return (envs, new_bndrs) } } where ValBindsIn _val_binds val_sigs = binds diff --git a/compiler/rename/RnSource.hs b/compiler/rename/RnSource.hs index 38162a9..95b14bb 100644 --- a/compiler/rename/RnSource.hs +++ b/compiler/rename/RnSource.hs @@ -111,18 +111,12 @@ rnSrcDecls extra_deps group0@(HsGroup { hs_valds = val_decls, -- * For hs-boot files, include the value signatures -- Again, they have no value declarations -- - (tc_envs, tc_bndrs, flds) <- getLocalNonValBinders local_fix_env group ; + (tc_envs, tc_bndrs) <- getLocalNonValBinders local_fix_env group ; setEnvs tc_envs $ do { failIfErrsM ; -- No point in continuing if (say) we have duplicate declarations - -- (C) Extract the mapping from data constructors to field names and - -- extend the record field env. - -- This depends on the data constructors and field names being in - -- scope from (B) above - inNewEnv (extendRecordFieldEnv flds) $ \ _ -> do { - -- (D1) Bring pattern synonyms into scope. -- Need to do this before (D2) because rnTopBindsLHS -- looks up those pattern synonyms (Trac #9889) @@ -227,7 +221,7 @@ rnSrcDecls extra_deps group0@(HsGroup { hs_valds = val_decls, traceRn (text "finish rnSrc" <+> ppr rn_group) ; traceRn (text "finish Dus" <+> ppr src_dus ) ; return (final_tcg_env, rn_group) - }}}}} + }}}} -- some utils because we do this a bunch above -- compute and install the new env @@ -1494,24 +1488,6 @@ badRecResTy doc = ptext (sLit "Malformed constructor signature") $$ doc {- ********************************************************* * * -\subsection{Support code for type/data declarations} -* * -********************************************************* - -Get the mapping from constructors to fields for this module. -This used to be complicated, but now all the work is done by -RnNames.getLocalNonValBinders. --} - -extendRecordFieldEnv :: [(Name, [FieldLabel])] -> TcM TcGblEnv -extendRecordFieldEnv flds - = do { tcg_env <- getGblEnv - ; let field_env' = extendNameEnvList (tcg_field_env tcg_env) flds - ; return (tcg_env { tcg_field_env = field_env' }) } - -{- -********************************************************* -* * \subsection{Support code to rename types} * * ********************************************************* From git at git.haskell.org Tue Jul 7 15:19:30 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 7 Jul 2015 15:19:30 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Introduce FieldOcc for occurrences of fields in HsExpr (ad5c18c) Message-ID: <20150707151930.D4F133A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/ad5c18c9e79ca39e8d24e5c409acda22e8dff3fc/ghc >--------------------------------------------------------------- commit ad5c18c9e79ca39e8d24e5c409acda22e8dff3fc Author: Adam Gundry Date: Wed Jul 1 15:48:30 2015 +0100 Introduce FieldOcc for occurrences of fields in HsExpr >--------------------------------------------------------------- ad5c18c9e79ca39e8d24e5c409acda22e8dff3fc compiler/basicTypes/FieldLabel.hs | 10 +++++++++- compiler/hsSyn/HsExpr.hs | 7 +++---- compiler/hsSyn/HsTypes.hs | 14 ++++++++++++++ compiler/hsSyn/PlaceHolder.hs | 2 ++ compiler/rename/RnExpr.hs | 4 +++- compiler/typecheck/TcExpr.hs | 20 ++++++++++---------- 6 files changed, 41 insertions(+), 16 deletions(-) diff --git a/compiler/basicTypes/FieldLabel.hs b/compiler/basicTypes/FieldLabel.hs index 34d07f4..6f901b2 100644 --- a/compiler/basicTypes/FieldLabel.hs +++ b/compiler/basicTypes/FieldLabel.hs @@ -39,7 +39,12 @@ dfuns/axioms differ. Each FieldLabel value is unique to its type constructor. -} -{-# LANGUAGE CPP, DeriveFunctor, DeriveFoldable, DeriveTraversable #-} +{-# LANGUAGE CPP #-} +{-# LANGUAGE DeriveDataTypeable #-} +{-# LANGUAGE DeriveFunctor #-} +{-# LANGUAGE DeriveFoldable #-} +{-# LANGUAGE DeriveTraversable #-} +{-# LANGUAGE StandaloneDeriving #-} module FieldLabel ( FieldLabelString , FieldLabelEnv @@ -54,6 +59,8 @@ import Name import FastString import Outputable +import Data.Data + #if __GLASGOW_HASKELL__ < 709 import Data.Foldable ( Foldable ) import Data.Traversable ( Traversable ) @@ -76,6 +83,7 @@ data FieldLbl a = FieldLabel { flSelector :: a -- ^ Record selector function } deriving (Functor, Foldable, Traversable) +deriving instance Data a => Data (FieldLbl a) instance Outputable a => Outputable (FieldLbl a) where ppr fl = ppr (flLabel fl) <> braces (ppr (flSelector fl)) diff --git a/compiler/hsSyn/HsExpr.hs b/compiler/hsSyn/HsExpr.hs index c13e0c5..5ad8ff2 100644 --- a/compiler/hsSyn/HsExpr.hs +++ b/compiler/hsSyn/HsExpr.hs @@ -135,6 +135,8 @@ data HsExpr id -- Turned into HsVar by type checker, to support deferred -- type errors. (The HsUnboundVar only has an OccName.) + | HsSingleRecFld (FieldOcc id) -- ^ Variable that corresponds to a record selector + | HsIPVar HsIPName -- ^ Implicit parameter | HsOverLit (HsOverLit id) -- ^ Overloaded literals @@ -301,9 +303,6 @@ data HsExpr id -- For a type family, the arg types are of the *instance* tycon, -- not the family tycon - -- | Used to attach a selector id to non-overloaded fields - | HsSingleRecFld RdrName id - -- | Expression with an explicit type signature. @e :: type@ -- -- - 'ApiAnnotation.AnnKeywordId' : 'ApiAnnotation.AnnDcolon' @@ -773,7 +772,7 @@ ppr_expr (HsArrForm (L _ (HsVar v)) (Just _) [arg1, arg2]) ppr_expr (HsArrForm op _ args) = hang (ptext (sLit "(|") <+> ppr_lexpr op) 4 (sep (map (pprCmdArg.unLoc) args) <+> ptext (sLit "|)")) -ppr_expr (HsSingleRecFld f _) = ppr f +ppr_expr (HsSingleRecFld f) = ppr f {- HsSyn records exactly where the user put parens, with HsPar. diff --git a/compiler/hsSyn/HsTypes.hs b/compiler/hsSyn/HsTypes.hs index 815dd1a..536e4ee 100644 --- a/compiler/hsSyn/HsTypes.hs +++ b/compiler/hsSyn/HsTypes.hs @@ -33,6 +33,8 @@ module HsTypes ( ConDeclField(..), LConDeclField, pprConDeclFields, + FieldOcc(..), + HsWildCardInfo(..), mkAnonWildCardTy, mkNamedWildCardTy, wildCardName, sameWildCard, isAnonWildCard, isNamedWildCard, @@ -70,6 +72,7 @@ import TysWiredIn import PrelNames( ipClassName ) import HsDoc import BasicTypes +import FieldLabel import SrcLoc import StaticFlags import Outputable @@ -552,6 +555,17 @@ data ConDeclField name -- Record fields have Haddoc docs on them deriving (Typeable) deriving instance (DataId name) => Data (ConDeclField name) +-- | Represents an *occurrence* of an unambiguous field. We store +-- both the 'RdrName' the user originally wrote, and after the +-- renamer, the 'FieldLbl' including the selector function. +data FieldOcc name = FieldOcc RdrName (PostRn name (FieldLbl name)) + +instance Outputable (FieldOcc name) where + ppr (FieldOcc rdr _) = ppr rdr + +deriving instance (DataId name) => Data (FieldOcc name) + + {- Note [ConDeclField names] ~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/compiler/hsSyn/PlaceHolder.hs b/compiler/hsSyn/PlaceHolder.hs index 00a2cdf..a934a17 100644 --- a/compiler/hsSyn/PlaceHolder.hs +++ b/compiler/hsSyn/PlaceHolder.hs @@ -12,6 +12,7 @@ import NameSet import RdrName import Var import Coercion +import FieldLabel import Data.Data hiding ( Fixity ) import BasicTypes (Fixity) @@ -99,6 +100,7 @@ type DataId id = , Data (PostRn id Bool) , Data (PostRn id Name) , Data (PostRn id [Name]) + , Data (PostRn id (FieldLbl id)) , Data (PostTc id Type) , Data (PostTc id Coercion) diff --git a/compiler/rename/RnExpr.hs b/compiler/rename/RnExpr.hs index 1e11dea..41f436d 100644 --- a/compiler/rename/RnExpr.hs +++ b/compiler/rename/RnExpr.hs @@ -30,6 +30,7 @@ import RnPat import DynFlags import BasicTypes ( FixityDirection(..), Fixity(..), minPrecedence ) import PrelNames +import FieldLabel import Name import NameSet @@ -109,7 +110,8 @@ rnExpr (HsVar v) | otherwise -> finishHsVar name ; Just (Right ((_, sel_name):ns)) -> ASSERT( null ns ) - return (HsSingleRecFld v sel_name, unitFV sel_name) ; + -- AMG TODO push up into lookupOccRn_overloaded? False is wrong! + return (HsSingleRecFld (FieldOcc v (FieldLabel (occNameFS $ rdrNameOcc v) False sel_name)), unitFV sel_name) ; Just (Right []) -> error "runExpr/HsVar" } } rnExpr (HsIPVar v) diff --git a/compiler/typecheck/TcExpr.hs b/compiler/typecheck/TcExpr.hs index 8902fd1..9023d0a 100644 --- a/compiler/typecheck/TcExpr.hs +++ b/compiler/typecheck/TcExpr.hs @@ -762,8 +762,8 @@ tcExpr (RecordUpd record_expr rbnds _ _ _) res_ty RecordUpd (mkLHsWrap scrut_co record_expr') rbinds' relevant_cons scrut_inst_tys result_inst_tys } -tcExpr (HsSingleRecFld f sel_name) res_ty - = tcCheckRecSelId f sel_name res_ty +tcExpr (HsSingleRecFld f) res_ty + = tcCheckRecSelId f res_ty {- ************************************************************************ @@ -947,8 +947,8 @@ tcInferFun (L loc (HsVar name)) -- Don't wrap a context around a plain Id ; return (L loc fun, ty) } -tcInferFun (L loc (HsSingleRecFld lbl name)) - = do { (fun, ty) <- setSrcSpan loc (tcInferRecSelId lbl name) +tcInferFun (L loc (HsSingleRecFld f)) + = do { (fun, ty) <- setSrcSpan loc (tcInferRecSelId f) -- Don't wrap a context around a plain Id ; return (L loc fun, ty) } @@ -1044,10 +1044,10 @@ tcCheckId name res_ty ; addErrCtxtM (funResCtxt False (HsVar name) actual_res_ty res_ty) $ tcWrapResult expr actual_res_ty res_ty } -tcCheckRecSelId :: RdrName -> Name -> TcRhoType -> TcM (HsExpr TcId) -tcCheckRecSelId lbl name res_ty - = do { (expr, actual_res_ty) <- tcInferRecSelId lbl name - ; addErrCtxtM (funResCtxt False (HsSingleRecFld lbl name) actual_res_ty res_ty) $ +tcCheckRecSelId :: FieldOcc Name -> TcRhoType -> TcM (HsExpr TcId) +tcCheckRecSelId f res_ty + = do { (expr, actual_res_ty) <- tcInferRecSelId f + ; addErrCtxtM (funResCtxt False (HsSingleRecFld f) actual_res_ty res_ty) $ tcWrapResult expr actual_res_ty res_ty } ------------------------ @@ -1055,8 +1055,8 @@ tcInferId :: Name -> TcM (HsExpr TcId, TcRhoType) -- Infer type, and deeply instantiate tcInferId n = tcInferIdWithOrig (OccurrenceOf n) (nameRdrName n) n -tcInferRecSelId :: RdrName -> Name -> TcM (HsExpr TcId, TcRhoType) -tcInferRecSelId lbl n = tcInferIdWithOrig (OccurrenceOfRecSel lbl) lbl n +tcInferRecSelId :: FieldOcc Name -> TcM (HsExpr TcId, TcRhoType) +tcInferRecSelId (FieldOcc lbl fl) = tcInferIdWithOrig (OccurrenceOfRecSel lbl) lbl (flSelector fl) ------------------------ tcInferIdWithOrig :: CtOrigin -> RdrName -> Name -> From git at git.haskell.org Tue Jul 7 15:19:33 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 7 Jul 2015 15:19:33 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Use FieldOcc for ConDeclField names; hsLTyClDeclBinders et al become a bit nicer (b0c6061) Message-ID: <20150707151933.B4A393A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/b0c6061e0aa02be40a7fee31a48e2c73d4a3c4b1/ghc >--------------------------------------------------------------- commit b0c6061e0aa02be40a7fee31a48e2c73d4a3c4b1 Author: Adam Gundry Date: Wed Jul 1 15:51:25 2015 +0100 Use FieldOcc for ConDeclField names; hsLTyClDeclBinders et al become a bit nicer >--------------------------------------------------------------- b0c6061e0aa02be40a7fee31a48e2c73d4a3c4b1 compiler/deSugar/DsMeta.hs | 5 ++++- compiler/hsSyn/Convert.hs | 2 +- compiler/hsSyn/HsTypes.hs | 20 ++++++++++++++------ compiler/hsSyn/HsUtils.hs | 26 +++++++++++++------------- compiler/parser/Parser.y | 2 +- compiler/rename/RnNames.hs | 10 +++++----- compiler/rename/RnTypes.hs | 8 ++++---- 7 files changed, 42 insertions(+), 31 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 b0c6061e0aa02be40a7fee31a48e2c73d4a3c4b1 From git at git.haskell.org Tue Jul 7 15:19:36 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 7 Jul 2015 15:19:36 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Simplify hsLTyClDeclBinders still further (0cb7992) Message-ID: <20150707151936.7F72E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/0cb7992fcbfa3781b6c5d0961775bb6a083573c7/ghc >--------------------------------------------------------------- commit 0cb7992fcbfa3781b6c5d0961775bb6a083573c7 Author: Adam Gundry Date: Wed Jul 1 15:58:03 2015 +0100 Simplify hsLTyClDeclBinders still further >--------------------------------------------------------------- 0cb7992fcbfa3781b6c5d0961775bb6a083573c7 compiler/hsSyn/HsUtils.hs | 40 ++++++++++++++++------------------------ compiler/rename/RnNames.hs | 4 ++-- 2 files changed, 18 insertions(+), 26 deletions(-) diff --git a/compiler/hsSyn/HsUtils.hs b/compiler/hsSyn/HsUtils.hs index 8c6a480..466dfc7 100644 --- a/compiler/hsSyn/HsUtils.hs +++ b/compiler/hsSyn/HsUtils.hs @@ -759,18 +759,16 @@ hsTyClForeignBinders tycl_decls inst_decls foreign_decls ++ getSelectorNames (foldMap (foldMap hsLTyClDeclBinders . group_tyclds) tycl_decls `mappend` foldMap hsLInstDeclBinders inst_decls) where - getSelectorNames :: ([Located Name], [(LFieldOcc Name, Located Name)]) -> [Name] - getSelectorNames (ns, fs) = map unLoc ns ++ map (flSelector . labelFieldOcc . unLoc . fst) fs + getSelectorNames :: ([Located Name], [LFieldOcc Name]) -> [Name] + getSelectorNames (ns, fs) = map unLoc ns ++ map (flSelector . labelFieldOcc . unLoc) fs ------------------- -hsLTyClDeclBinders :: Located (TyClDecl name) -> - ([Located name], [(LFieldOcc name, Located name)]) --- ^ Returns all the /binding/ names of the decl. --- The first one is guaranteed to be the name of the decl. The first component --- represents all binding names except fields; the second represents fields as --- (occurrence, tycon name) triples. For record fields --- mentioned in multiple constructors, the SrcLoc will be from the first --- occurrence. We use the equality to filter out duplicate field names. +hsLTyClDeclBinders :: Located (TyClDecl name) -> ([Located name], [LFieldOcc name]) +-- ^ Returns all the /binding/ names of the decl. The first one is +-- guaranteed to be the name of the decl. The first component +-- represents all binding names except record fields; the second +-- represents field occurrences. For record fields mentioned in +-- multiple constructors, the SrcLoc will be from the first occurrence. -- -- Each returned (Located name) has a SrcSpan for the /whole/ declaration. -- See Note [SrcSpan for binders] @@ -785,7 +783,7 @@ hsLTyClDeclBinders (L loc (ClassDecl { tcdLName = L _ cls_name [ L mem_loc mem_name | L mem_loc (TypeSig ns _ _) <- sigs, L _ mem_name <- ns ] , []) hsLTyClDeclBinders (L loc (DataDecl { tcdLName = L _ name, tcdDataDefn = defn })) - = (\ (xs, ys) -> (L loc name : xs, ys)) $ withTyCon (L loc name) $ hsDataDefnBinders defn + = (\ (xs, ys) -> (L loc name : xs, ys)) $ hsDataDefnBinders defn ------------------- hsForeignDeclsBinders :: [LForeignDecl name] -> [Located name] @@ -810,8 +808,7 @@ addPatSynBndr bind pss = pss ------------------- -hsLInstDeclBinders :: LInstDecl name - -> ([Located name], [(LFieldOcc name, Located name)]) +hsLInstDeclBinders :: LInstDecl name -> ([Located name], [LFieldOcc name]) hsLInstDeclBinders (L _ (ClsInstD { cid_inst = ClsInstDecl { cid_datafam_insts = dfis } })) = foldMap (hsDataFamInstBinders . unLoc) dfis hsLInstDeclBinders (L _ (DataFamInstD { dfid_inst = fi })) @@ -820,23 +817,20 @@ hsLInstDeclBinders (L _ (TyFamInstD {})) = mempty ------------------- -- the SrcLoc returned are for the whole declarations, not just the names -hsDataFamInstBinders :: DataFamInstDecl name -> - ([Located name], [(LFieldOcc name, Located name)]) -hsDataFamInstBinders (DataFamInstDecl { dfid_tycon = tycon_name, dfid_defn = defn }) - = withTyCon tycon_name (hsDataDefnBinders defn) +hsDataFamInstBinders :: DataFamInstDecl name -> ([Located name], [LFieldOcc name]) +hsDataFamInstBinders (DataFamInstDecl { dfid_defn = defn }) + = hsDataDefnBinders defn -- There can't be repeated symbols because only data instances have binders ------------------- -- the SrcLoc returned are for the whole declarations, not just the names -hsDataDefnBinders :: HsDataDefn name -> - ([Located name], [LFieldOcc name]) +hsDataDefnBinders :: HsDataDefn name -> ([Located name], [LFieldOcc name]) hsDataDefnBinders (HsDataDefn { dd_cons = cons }) = hsConDeclsBinders cons -- See Note [Binders in family instances] ------------------- -hsConDeclsBinders :: [LConDecl name] -> - ([Located name], [LFieldOcc name]) +hsConDeclsBinders :: [LConDecl name] -> ([Located name], [LFieldOcc name]) -- See hsLTyClDeclBinders for what this does -- The function is boringly complicated because of the records -- And since we only have equality, we have to be a little careful @@ -860,10 +854,8 @@ hsConDeclsBinders cons = go id cons (map (L loc . unLoc) names ++ ns, fs) where (ns, fs) = go remSeen rs -withTyCon :: name -> (a, [r]) -> (a, [(r, name)]) -withTyCon tycon_name (xs, ys) = (xs, map (\ r -> (r, tycon_name)) ys) - {- + Note [SrcSpan for binders] ~~~~~~~~~~~~~~~~~~~~~~~~~~ When extracting the (Located RdrNme) for a binder, at least for the diff --git a/compiler/rename/RnNames.hs b/compiler/rename/RnNames.hs index 59d7587..cfa6a8b 100644 --- a/compiler/rename/RnNames.hs +++ b/compiler/rename/RnNames.hs @@ -590,7 +590,7 @@ getLocalNonValBinders fixity_env = do { let (bndrs, flds) = hsLTyClDeclBinders tc_decl ; names@(main_name : _) <- mapM newTopSrcBinder bndrs ; let main_occ = nameOccName main_name - ; flds' <- mapM (new_rec_sel overload_ok main_occ . fst) flds + ; flds' <- mapM (new_rec_sel overload_ok main_occ) flds ; let fld_env = case unLoc tc_decl of DataDecl { tcdDataDefn = d } -> mk_fld_env d names flds' _ -> [] @@ -658,7 +658,7 @@ getLocalNonValBinders fixity_env ; let rep_tycon = expectJust "getLocalNonValBinders/new_di" $ dfid_rep_tycon ti_decl rep_tc_occ = rdrNameOcc rep_tycon - ; flds' <- mapM (new_rec_sel overload_ok rep_tc_occ . fst) flds + ; flds' <- mapM (new_rec_sel overload_ok rep_tc_occ) flds ; let avail = AvailTC (unLoc main_name) sub_names (fieldLabelsToAvailFields flds') -- main_name is not bound here! From git at git.haskell.org Tue Jul 7 15:19:39 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 7 Jul 2015 15:19:39 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Use first datacon name instead of tycon name when mangling selector names (eb8c8c8) Message-ID: <20150707151939.4FF553A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/eb8c8c8d735590b781b09cb82e5e21eaa016779d/ghc >--------------------------------------------------------------- commit eb8c8c8d735590b781b09cb82e5e21eaa016779d Author: Adam Gundry Date: Wed Jul 1 16:36:06 2015 +0100 Use first datacon name instead of tycon name when mangling selector names >--------------------------------------------------------------- eb8c8c8d735590b781b09cb82e5e21eaa016779d compiler/basicTypes/Avail.hs | 4 +-- compiler/basicTypes/FieldLabel.hs | 37 ++++++++++++++++------ compiler/basicTypes/RdrName.hs | 2 +- compiler/hsSyn/HsImpExp.hs | 4 +-- compiler/hsSyn/HsPat.hs | 4 +-- compiler/hsSyn/HsTypes.hs | 10 +++--- compiler/iface/IfaceSyn.hs | 18 ++++++----- compiler/iface/TcIface.hs | 16 ++++------ compiler/rename/RnNames.hs | 17 ++++------ .../should_run/overloadedrecfldsrun04.stdout | 2 +- 10 files changed, 64 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 eb8c8c8d735590b781b09cb82e5e21eaa016779d From git at git.haskell.org Tue Jul 7 15:19:42 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 7 Jul 2015 15:19:42 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Get rid of dfid_rep_tycon and the whole assignInstDeclNames malarkey (45f91cb) Message-ID: <20150707151942.21B553A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/45f91cb5d47b1ac0e79787d066e62d0d150907e3/ghc >--------------------------------------------------------------- commit 45f91cb5d47b1ac0e79787d066e62d0d150907e3 Author: Adam Gundry Date: Wed Jul 1 16:42:09 2015 +0100 Get rid of dfid_rep_tycon and the whole assignInstDeclNames malarkey >--------------------------------------------------------------- 45f91cb5d47b1ac0e79787d066e62d0d150907e3 compiler/hsSyn/Convert.hs | 2 -- compiler/hsSyn/HsDecls.hs | 6 ---- compiler/parser/RdrHsSyn.hs | 1 - compiler/rename/RnSource.hs | 66 ++-------------------------------------- compiler/typecheck/TcInstDcls.hs | 3 +- 5 files changed, 4 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 45f91cb5d47b1ac0e79787d066e62d0d150907e3 From git at git.haskell.org Tue Jul 7 15:19:44 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 7 Jul 2015 15:19:44 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Fix silly bug in ifaceConDeclFields for empty data types (2346399) Message-ID: <20150707151944.F141B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/23463995005a57e560ac55c9c749cf11bbd9feab/ghc >--------------------------------------------------------------- commit 23463995005a57e560ac55c9c749cf11bbd9feab Author: Adam Gundry Date: Wed Jul 1 16:58:33 2015 +0100 Fix silly bug in ifaceConDeclFields for empty data types >--------------------------------------------------------------- 23463995005a57e560ac55c9c749cf11bbd9feab compiler/iface/IfaceSyn.hs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/compiler/iface/IfaceSyn.hs b/compiler/iface/IfaceSyn.hs index 7fcabaa..4b7a311 100644 --- a/compiler/iface/IfaceSyn.hs +++ b/compiler/iface/IfaceSyn.hs @@ -332,13 +332,13 @@ visibleIfConDecls (IfNewTyCon c _ _) = [c] ifaceConDeclFields :: IfaceConDecls -> [FieldLbl OccName] ifaceConDeclFields x = case x of - IfAbstractTyCon {} -> [] - IfDataFamTyCon {} -> [] - IfDataTyCon cons is_overloaded labels -> help cons is_overloaded labels - IfNewTyCon con is_overloaded labels -> help [con] is_overloaded labels + IfAbstractTyCon {} -> [] + IfDataFamTyCon {} -> [] + IfDataTyCon cons is_over labels -> map (help cons is_over) labels + IfNewTyCon con is_over labels -> map (help [con] is_over) labels where - help (dc:_) is_overloaded = map (\ lbl -> mkFieldLabelOccs lbl (ifConOcc dc) is_overloaded) - help [] _ = error "ifaceConDeclFields: data type has no constructors!" + help (dc:_) is_over lbl = mkFieldLabelOccs lbl (ifConOcc dc) is_over + help [] _ _ = error "ifaceConDeclFields: data type has no constructors!" ifaceDeclImplicitBndrs :: IfaceDecl -> [OccName] -- *Excludes* the 'main' name, but *includes* the implicitly-bound names From git at git.haskell.org Tue Jul 7 15:19:47 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 7 Jul 2015 15:19:47 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Big refactoring to distinguish HsRecField from HsRecUpdField (f3bf2fa) Message-ID: <20150707151947.D8DD13A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/f3bf2fa76bc6de593cc159553f1ffc97f2d7ab94/ghc >--------------------------------------------------------------- commit f3bf2fa76bc6de593cc159553f1ffc97f2d7ab94 Author: Adam Gundry Date: Fri Jul 3 15:58:38 2015 +0100 Big refactoring to distinguish HsRecField from HsRecUpdField >--------------------------------------------------------------- f3bf2fa76bc6de593cc159553f1ffc97f2d7ab94 compiler/deSugar/Coverage.hs | 14 ++++- compiler/deSugar/DsExpr.hs | 19 +++--- compiler/deSugar/DsMeta.hs | 10 +++- compiler/deSugar/MatchCon.hs | 3 +- compiler/hsSyn/Convert.hs | 28 +++++---- compiler/hsSyn/HsExpr.hs | 4 +- compiler/hsSyn/HsPat.hs | 78 +++++++++++++++++-------- compiler/hsSyn/HsTypes.hs | 6 +- compiler/parser/Parser.y | 4 +- compiler/parser/RdrHsSyn.hs | 5 +- compiler/rename/RnExpr.hs | 2 +- compiler/rename/RnPat.hs | 116 +++++++++++++++++++++++++------------ compiler/typecheck/TcExpr.hs | 100 +++++++++++++++++++++----------- compiler/typecheck/TcHsSyn.hs | 18 +++++- compiler/typecheck/TcPat.hs | 9 ++- compiler/typecheck/TcTyClsDecls.hs | 3 +- 16 files changed, 281 insertions(+), 138 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 f3bf2fa76bc6de593cc159553f1ffc97f2d7ab94 From git at git.haskell.org Tue Jul 7 15:19:50 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 7 Jul 2015 15:19:50 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Do not store (lexical) parents in hsRecUpdFieldSel (aa0c512) Message-ID: <20150707151950.B54063A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/aa0c512f6da0e0980e5996bbd0fd325315ee5314/ghc >--------------------------------------------------------------- commit aa0c512f6da0e0980e5996bbd0fd325315ee5314 Author: Adam Gundry Date: Tue Jul 7 16:12:27 2015 +0100 Do not store (lexical) parents in hsRecUpdFieldSel >--------------------------------------------------------------- aa0c512f6da0e0980e5996bbd0fd325315ee5314 compiler/deSugar/DsMeta.hs | 8 +++-- compiler/hsSyn/Convert.hs | 2 +- compiler/hsSyn/HsPat.hs | 82 ++++++++++++++++++++++--------------------- compiler/hsSyn/PlaceHolder.hs | 2 ++ compiler/parser/RdrHsSyn.hs | 2 +- compiler/rename/RnPat.hs | 7 ++-- compiler/typecheck/TcExpr.hs | 77 +++++++++++++++++++++------------------- compiler/typecheck/TcHsSyn.hs | 4 +-- 8 files changed, 96 insertions(+), 88 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 aa0c512f6da0e0980e5996bbd0fd325315ee5314 From git at git.haskell.org Tue Jul 7 15:19:54 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 7 Jul 2015 15:19:54 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Extra tests for odd corner cases (094c9e1) Message-ID: <20150707151954.527D03A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/094c9e1ca01c88675c987380097a962700ce4358/ghc >--------------------------------------------------------------- commit 094c9e1ca01c88675c987380097a962700ce4358 Author: Adam Gundry Date: Tue Jul 7 16:13:00 2015 +0100 Extra tests for odd corner cases >--------------------------------------------------------------- 094c9e1ca01c88675c987380097a962700ce4358 testsuite/tests/overloadedrecflds/should_fail/all.T | 2 ++ .../overloadedrecflds/should_fail/overloadedrecfldsfail08.hs | 11 +++++++++++ .../should_fail/overloadedrecfldsfail08.stderr | 5 +++++ .../overloadedrecflds/should_fail/overloadedrecfldsfail09.hs | 11 +++++++++++ .../should_fail/overloadedrecfldsfail09.stderr | 4 ++++ 5 files changed, 33 insertions(+) diff --git a/testsuite/tests/overloadedrecflds/should_fail/all.T b/testsuite/tests/overloadedrecflds/should_fail/all.T index a8b9308..1447985 100644 --- a/testsuite/tests/overloadedrecflds/should_fail/all.T +++ b/testsuite/tests/overloadedrecflds/should_fail/all.T @@ -9,3 +9,5 @@ test('overloadedrecfldsfail06', extra_clean(['OverloadedRecFldsFail06_A.hi', 'OverloadedRecFldsFail06_A.o']), multimod_compile_fail, ['overloadedrecfldsfail06', '']) test('overloadedrecfldsfail07', normal, compile_fail, ['']) +test('overloadedrecfldsfail08', normal, compile_fail, ['']) +test('overloadedrecfldsfail09', normal, compile_fail, ['']) diff --git a/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail08.hs b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail08.hs new file mode 100644 index 0000000..e55a6c1 --- /dev/null +++ b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail08.hs @@ -0,0 +1,11 @@ +{-# LANGUAGE AllowDuplicateRecordFields, TypeFamilies #-} + +data family F a +data instance F Int = MkFInt { x :: Int } +data instance F Bool = MkFBool { y :: Bool } + +-- No data type has both these fields, but they belong to the same +-- lexical parent (F). This used to confuse AllowDuplicateRecordFields. +foo e = e { x = 3, y = True } + +main = return () diff --git a/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail08.stderr b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail08.stderr new file mode 100644 index 0000000..cf37520 --- /dev/null +++ b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail08.stderr @@ -0,0 +1,5 @@ + +overloadedrecfldsfail08.hs:9:9: error: + No constructor has all these fields: ?x?, ?y? + In the expression: e {x = 3, y = True} + In an equation for ?foo?: foo e = e {x = 3, y = True} diff --git a/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail09.hs b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail09.hs new file mode 100644 index 0000000..d4c0672 --- /dev/null +++ b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail09.hs @@ -0,0 +1,11 @@ +{-# LANGUAGE AllowDuplicateRecordFields, TemplateHaskell #-} + +data S = MkS { x :: Int } +data T = MkT { x :: Int } + +-- This tests what happens when an ambiguous record update is used in +-- a splice: since it can't be represented in TH, it should error +-- cleanly, rather than panicking or silently using one field. +foo = [e| (MkS 3) { x = 3 } |] + +main = return () diff --git a/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail09.stderr b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail09.stderr new file mode 100644 index 0000000..8d892e3 --- /dev/null +++ b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail09.stderr @@ -0,0 +1,4 @@ + +overloadedrecfldsfail09.hs:9:11: error: + ambiguous record updates not (yet) handled by Template Haskell + x = 3 From git at git.haskell.org Tue Jul 7 15:19:57 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 7 Jul 2015 15:19:57 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Merge branch 'wip/orf-reboot' of git://git.haskell.org/ghc into wip/orf-reboot (4986d6a) Message-ID: <20150707151957.46B3D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/4986d6a41036860bb492999f21ae4fee9effe8bc/ghc >--------------------------------------------------------------- commit 4986d6a41036860bb492999f21ae4fee9effe8bc Merge: 094c9e1 3f7494e Author: Adam Gundry Date: Tue Jul 7 16:20:00 2015 +0100 Merge branch 'wip/orf-reboot' of git://git.haskell.org/ghc into wip/orf-reboot >--------------------------------------------------------------- 4986d6a41036860bb492999f21ae4fee9effe8bc compiler/basicTypes/FieldLabel.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) From git at git.haskell.org Tue Jul 7 15:19:59 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 7 Jul 2015 15:19:59 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot's head updated: Merge branch 'wip/orf-reboot' of git://git.haskell.org/ghc into wip/orf-reboot (4986d6a) Message-ID: <20150707151959.DFC083A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Branch 'wip/orf-reboot' now includes: 85d5397 Make GHC install libraries to e.g. xhtml-3000.2.1-0ACfOp3hebWD9jGWE4v4Gh. 0cb1f5c Filter orphan rules based on imports, fixes #10294 and #10420. 29bc13a Fix all.T for T8131/T8131b. 15ef5fc Remove duplicate test. 13ba87f Build system: unset HADDOCK when haddock is not found 4854fce Change `Typeable` instance for type-lis to use the Known* classes. 38f3745 Add parsePattern parser entry point b5a2e87 Documentation: add section on .haskeline file (#2531) e60dbf3 Check KnownSymbol => Typeable deduction f70fb68 Use -package-id to specify libraries on command line. 6c5a66a Fix #10551 by using LIB_NAMES. 01f7e44 Rename $1_$2_$3_LIB_NAME to LIB_FILE. 55843f1 Further elaborate Trac #10403 test c084796 powerpc: add basic support for PLT relocations (#10402) 73a6265 Make $1 in $1_$2_$3_FOO actually be directory. 95d5031 Build system: delete unused variables in config.mk.in ece2c43 Drop prefix from package keys. aa26731 Clean outdated ext-core references in comments. 4d1316a driver: pass '-fPIC' option to all CC invocations 9a34864 Improve kind-checking for 'deriving' clauses c7b6fb5 Test Trac #10562 a2f828a Be aware of overlapping global STG registers in CmmSink (#10521) a7eee0d Comments only 3edc186 White space only 9195927 Improve pretty-printing for CoPat ff8a671 Use a Representaional coercion for data families 0b7e538 Allow recursive unwrapping of data families cc0dba1 Minor fix to free-vars in RnTypes 9014a7e Fix addDataConStrictness b69dc73 Don't float out alpha[sig] ~ Int 97e313c Add module header to test 2f16a3b Get rid of irrlevant result type signature 95fc6d5 Get rid of irrelevant impredicative polymoprhism fb7b692 Treat out-of-scope variables as holes b98ff25 Error message wibbles from out-of-scope changes 0aaea5b Tiny refactor plus comments be0ce87 Fix for crash in setnumcapabilities001 111ba4b Fix deadlock (#10545) 7c8ffd3 GHCi docs: layout rule is respected inside :{ :} cbd9278 Comments only caf9d42 Small doc fixes 0696fc6 Improve CPR behavior for strict constructors 7c07cf1 closeOverKinds *before* oclose in coverage check 614ba3c Kill off sizePred 8e34783 Make fvType ignore kinds a64a26f Better tracing and tiny refactoring ceb3c84 Improve error message for Typeable k (T k) 0e1e798 Test Trac #10524 8d221bb Test #10582 89834d6 Add -fcross-module-specialise flag 302d937 Add -fcross-module-specialise flag bb0e462 Mask to avoid uncaught ^C exceptions 9b5df2a Update performance numbers due to #10482 c6bb2fc Correct BangPat SrcSpan calculation c495c67 Build system: remove unused variable CHECK_PACKAGES 897a46c Testsuite: accept T2592.stderr (minor changes) 6b9fc65 Testsuite: put extra_run_opts last on command line daa5097 Build system: prevent "warning: overriding commands for target..." 18bd41c Merge remote-tracking branch 'origin/master' into wip/orf-reboot 74835a4 Get rid of extendRecordFieldEnv, do it in getLocalNonValBinders instead ad5c18c Introduce FieldOcc for occurrences of fields in HsExpr b0c6061 Use FieldOcc for ConDeclField names; hsLTyClDeclBinders et al become a bit nicer 0cb7992 Simplify hsLTyClDeclBinders still further eb8c8c8 Use first datacon name instead of tycon name when mangling selector names 45f91cb Get rid of dfid_rep_tycon and the whole assignInstDeclNames malarkey 2346399 Fix silly bug in ifaceConDeclFields for empty data types f3bf2fa Big refactoring to distinguish HsRecField from HsRecUpdField aa0c512 Do not store (lexical) parents in hsRecUpdFieldSel 094c9e1 Extra tests for odd corner cases 4986d6a Merge branch 'wip/orf-reboot' of git://git.haskell.org/ghc into wip/orf-reboot From git at git.haskell.org Tue Jul 7 16:32:24 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 7 Jul 2015 16:32:24 +0000 (UTC) Subject: [commit: ghc] wip/gadtpm: Fixed string handling (f9f62b5) Message-ID: <20150707163224.A202C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/gadtpm Link : http://ghc.haskell.org/trac/ghc/changeset/f9f62b50821e3cc5930da5474499cfeda095b9c5/ghc >--------------------------------------------------------------- commit f9f62b50821e3cc5930da5474499cfeda095b9c5 Author: George Karachalias Date: Tue Jul 7 12:11:22 2015 +0200 Fixed string handling >--------------------------------------------------------------- f9f62b50821e3cc5930da5474499cfeda095b9c5 compiler/deSugar/Check.hs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/compiler/deSugar/Check.hs b/compiler/deSugar/Check.hs index 0957835..8e790d3 100644 --- a/compiler/deSugar/Check.hs +++ b/compiler/deSugar/Check.hs @@ -290,10 +290,14 @@ translatePat pat = case pat of guard = eqTrueExpr (PmExprEq (PmExprVar var) olit) return [VarAbs var, guard] - LitPat lit -> do - var <- mkPmIdSM (hsPatType pat) - let guard = eqTrueExpr $ PmExprEq (PmExprVar var) (PmExprLit lit) - return [VarAbs var, guard] + LitPat lit + | HsString src s <- lit -> -- If it is a real string convert it to a list of characters + foldr (mkListPmPat charTy) [nilPmPat charTy] <$> + translatePatVec (map (LitPat . HsChar src) (unpackFS s)) + | otherwise -> do + var <- mkPmIdSM (hsPatType pat) + let guard = eqTrueExpr $ PmExprEq (PmExprVar var) (PmExprLit lit) + return [VarAbs var, guard] PArrPat ps ty -> do tidy_ps <-translatePatVec (map unLoc ps) From git at git.haskell.org Tue Jul 7 17:17:30 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 7 Jul 2015 17:17:30 +0000 (UTC) Subject: [commit: ghc] master: Allow deferred type error warnings to be suppressed (f753cf1) Message-ID: <20150707171730.6746A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/f753cf11eb9e310b54b08d9a1ea1d11540d8eb69/ghc >--------------------------------------------------------------- commit f753cf11eb9e310b54b08d9a1ea1d11540d8eb69 Author: David Kraeutmann Date: Tue Jul 7 16:59:34 2015 +0200 Allow deferred type error warnings to be suppressed Adds a flag -fwarn-deferred-type-errors similar to -fwarn-typed-holes. Changes the boolean flag of -fdefer-type-errors to a 3-state flag similar to the one used by -fdefer-typed-holes/-fwarn-typed-holes. Test Plan: Since only the absence of deferred type error warnings when -fno-warn-deferred-type-errors is passed has to be tested, I duplicated a test case checking -fdefer-type-errors and adjusted it accordingly. Reviewers: nomeata, simonpj, austin, thomie, bgamari, hvr Reviewed By: nomeata, simonpj, austin, thomie, bgamari, hvr Subscribers: bgamari, simonpj, nomeata, thomie Projects: #ghc Differential Revision: https://phabricator.haskell.org/D864 GHC Trac Issues: #10283 >--------------------------------------------------------------- f753cf11eb9e310b54b08d9a1ea1d11540d8eb69 compiler/main/DynFlags.hs | 3 ++ compiler/typecheck/TcErrors.hs | 55 +++++++++++++--------- docs/users_guide/flags.xml | 13 ++++- docs/users_guide/glasgow_exts.xml | 3 +- docs/users_guide/using.xml | 11 +++++ .../should_compile/{T9834.hs => T10283.hs} | 2 +- testsuite/tests/typecheck/should_compile/all.T | 1 + 7 files changed, 64 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 f753cf11eb9e310b54b08d9a1ea1d11540d8eb69 From git at git.haskell.org Tue Jul 7 17:17:33 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 7 Jul 2015 17:17:33 +0000 (UTC) Subject: [commit: ghc] master: Fix todo in compiler/nativeGen: Rename Size to Format (31580e2) Message-ID: <20150707171733.917063A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/31580e2c81543a58c0d352154c6109d843978cdf/ghc >--------------------------------------------------------------- commit 31580e2c81543a58c0d352154c6109d843978cdf Author: markus Date: Tue Jul 7 16:59:40 2015 +0200 Fix todo in compiler/nativeGen: Rename Size to Format This commit renames the Size module in the native code generator to Format, as proposed by a todo, as well as adjusting parameter names in other modules that use it. Test Plan: validate Reviewers: austin, simonmar, bgamari Reviewed By: simonmar, bgamari Subscribers: bgamari, simonmar, thomie Projects: #ghc Differential Revision: https://phabricator.haskell.org/D865 >--------------------------------------------------------------- 31580e2c81543a58c0d352154c6109d843978cdf compiler/ghc.cabal.in | 2 +- compiler/nativeGen/{Size.hs => Format.hs} | 77 +++-- compiler/nativeGen/NCGMonad.hs | 8 +- compiler/nativeGen/PPC/CodeGen.hs | 188 +++++------ compiler/nativeGen/PPC/Instr.hs | 79 ++--- compiler/nativeGen/PPC/Ppr.hs | 82 ++--- compiler/nativeGen/PPC/Regs.hs | 10 +- compiler/nativeGen/SPARC/CodeGen.hs | 30 +- compiler/nativeGen/SPARC/CodeGen/Amode.hs | 2 +- compiler/nativeGen/SPARC/CodeGen/Base.hs | 22 +- compiler/nativeGen/SPARC/CodeGen/CondCode.hs | 4 +- compiler/nativeGen/SPARC/CodeGen/Expand.hs | 2 +- compiler/nativeGen/SPARC/CodeGen/Gen32.hs | 64 ++-- compiler/nativeGen/SPARC/CodeGen/Gen64.hs | 4 +- compiler/nativeGen/SPARC/Instr.hs | 40 +-- compiler/nativeGen/SPARC/Ppr.hs | 91 +++--- compiler/nativeGen/SPARC/Regs.hs | 12 +- compiler/nativeGen/TargetReg.hs | 4 +- compiler/nativeGen/X86/CodeGen.hs | 462 ++++++++++++++------------- compiler/nativeGen/X86/Instr.hs | 254 +++++++-------- compiler/nativeGen/X86/Ppr.hs | 436 +++++++++++++------------ compiler/nativeGen/X86/RegInfo.hs | 8 +- 22 files changed, 945 insertions(+), 936 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 31580e2c81543a58c0d352154c6109d843978cdf From git at git.haskell.org Tue Jul 7 17:17:37 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 7 Jul 2015 17:17:37 +0000 (UTC) Subject: [commit: ghc] master: Deferred type errors now throw TypeError (#10284) (9a3e165) Message-ID: <20150707171737.5B5B33A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/9a3e1657db4c0292fc06d6183a802af631c3666a/ghc >--------------------------------------------------------------- commit 9a3e1657db4c0292fc06d6183a802af631c3666a Author: David Kraeutmann Date: Tue Jul 7 16:59:52 2015 +0200 Deferred type errors now throw TypeError (#10284) Depends on D864. Previous behaviour was ErrorCall, which might mask issues in tests using -fdefer-type-errors Signed-off-by: David Kraeutmann Test Plan: Test whether the error thrown is indeed TypeError and not ErrorCall. Reviewers: hvr, nomeata, austin Reviewed By: nomeata, austin Subscribers: nomeata, simonpj, thomie Differential Revision: https://phabricator.haskell.org/D866 GHC Trac Issues: #10284 >--------------------------------------------------------------- 9a3e1657db4c0292fc06d6183a802af631c3666a compiler/coreSyn/MkCore.hs | 10 ++++++++-- compiler/deSugar/DsBinds.hs | 2 +- compiler/prelude/PrelNames.hs | 5 ++++- docs/users_guide/glasgow_exts.xml | 12 ++++++------ libraries/base/Control/Exception.hs | 1 + libraries/base/Control/Exception/Base.hs | 18 ++++++++++++++++-- testsuite/tests/typecheck/should_run/T10284.hs | 17 +++++++++++++++++ testsuite/tests/typecheck/should_run/T10284.stderr | 5 +++++ testsuite/tests/typecheck/should_run/T10284.stdout | 5 +++++ testsuite/tests/typecheck/should_run/all.T | 1 + 10 files changed, 64 insertions(+), 12 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 9a3e1657db4c0292fc06d6183a802af631c3666a From git at git.haskell.org Tue Jul 7 17:17:40 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 7 Jul 2015 17:17:40 +0000 (UTC) Subject: [commit: ghc] master: fix EBADF unqueueing in select backend (Trac #10590) (5857e0a) Message-ID: <20150707171740.785E23A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/5857e0afb5823987e84e6d3dd8d0b269b7546166/ghc >--------------------------------------------------------------- commit 5857e0afb5823987e84e6d3dd8d0b269b7546166 Author: Sergei Trofimovich Date: Tue Jul 7 17:00:23 2015 +0200 fix EBADF unqueueing in select backend (Trac #10590) Alexander found a interesting case: 1. We have a queue of two waiters in a blocked_queue 2. first file descriptor changes state to RUNNABLE, second changes to INVALID 3. awaitEvent function dequeued RUNNABLE thread to a run queue and attempted to dequeue INVALID descriptor to a run queue. Unqueueing INVALID fails thusly: #3 0x000000000045cf1c in barf (s=0x4c1cb0 "removeThreadFromDeQueue: not found") at rts/RtsMessages.c:42 #4 0x000000000046848b in removeThreadFromDeQueue (...) at rts/Threads.c:249 #5 0x000000000049a120 in removeFromQueues (...) at rts/RaiseAsync.c:719 #6 0x0000000000499502 in throwToSingleThreaded__ (...) at rts/RaiseAsync.c:67 #7 0x0000000000499555 in throwToSingleThreaded (..) at rts/RaiseAsync.c:75 #8 0x000000000047c27d in awaitEvent (wait=rtsFalse) at rts/posix/Select.c:415 The problem here is a throwToSingleThreaded function that tries to unqueue a TSO from blocked_queue, but awaitEvent function leaves blocked_queue in a inconsistent state while traverses over blocked_queue: case RTS_FD_IS_READY: IF_DEBUG(scheduler, debugBelch("Waking up blocked thread %lu\n", (unsigned long)tso->id)); tso->why_blocked = NotBlocked; tso->_link = END_TSO_QUEUE; // Here we break the queue head pushOnRunQueue(&MainCapability,tso); break; Signed-off-by: Sergei Trofimovich Test Plan: tested on a sample from T10590 Reviewers: austin, bgamari, simonmar Reviewed By: bgamari, simonmar Subscribers: qnikst, thomie, bgamari Differential Revision: https://phabricator.haskell.org/D1024 GHC Trac Issues: #10590, #4934 >--------------------------------------------------------------- 5857e0afb5823987e84e6d3dd8d0b269b7546166 rts/RaiseAsync.c | 8 +------- rts/RaiseAsync.h | 6 ++++++ rts/posix/Select.c | 10 ++++++++-- testsuite/tests/rts/T10590.hs | 37 +++++++++++++++++++++++++++++++++++++ testsuite/tests/rts/all.T | 5 +++++ 5 files changed, 57 insertions(+), 9 deletions(-) diff --git a/rts/RaiseAsync.c b/rts/RaiseAsync.c index 3b206ff..267707c 100644 --- a/rts/RaiseAsync.c +++ b/rts/RaiseAsync.c @@ -23,12 +23,6 @@ #include "win32/IOManager.h" #endif -static StgTSO* raiseAsync (Capability *cap, - StgTSO *tso, - StgClosure *exception, - rtsBool stop_at_atomically, - StgUpdateFrame *stop_here); - static void removeFromQueues(Capability *cap, StgTSO *tso); static void removeFromMVarBlockedQueue (StgTSO *tso); @@ -777,7 +771,7 @@ removeFromQueues(Capability *cap, StgTSO *tso) * * -------------------------------------------------------------------------- */ -static StgTSO * +StgTSO * raiseAsync(Capability *cap, StgTSO *tso, StgClosure *exception, rtsBool stop_at_atomically, StgUpdateFrame *stop_here) { diff --git a/rts/RaiseAsync.h b/rts/RaiseAsync.h index 6bfed8d..1f939d4 100644 --- a/rts/RaiseAsync.h +++ b/rts/RaiseAsync.h @@ -19,6 +19,12 @@ void blockedThrowTo (Capability *cap, StgTSO *target, MessageThrowTo *msg); +StgTSO* raiseAsync (Capability *cap, + StgTSO *tso, + StgClosure *exception, + rtsBool stop_at_atomically, + StgUpdateFrame *stop_here); + void throwToSingleThreaded (Capability *cap, StgTSO *tso, StgClosure *exception); diff --git a/rts/posix/Select.c b/rts/posix/Select.c index 4b19235..d5c9b55 100644 --- a/rts/posix/Select.c +++ b/rts/posix/Select.c @@ -375,6 +375,12 @@ awaitEvent(rtsBool wait) prev = NULL; { + /* + * The queue is being rebuilt in this loop: + * 'blocked_queue_hd' will contain already + * traversed blocked TSOs. As a result you + * can't use functions accessing 'blocked_queue_hd'. + */ for(tso = blocked_queue_hd; tso != END_TSO_QUEUE; tso = next) { next = tso->_link; int fd; @@ -412,8 +418,8 @@ awaitEvent(rtsBool wait) IF_DEBUG(scheduler, debugBelch("Killing blocked thread %lu on bad fd=%i\n", (unsigned long)tso->id, fd)); - throwToSingleThreaded(&MainCapability, tso, - (StgClosure *)blockedOnBadFD_closure); + raiseAsync(&MainCapability, tso, + (StgClosure *)blockedOnBadFD_closure, rtsFalse, NULL); break; case RTS_FD_IS_READY: IF_DEBUG(scheduler, diff --git a/testsuite/tests/rts/T10590.hs b/testsuite/tests/rts/T10590.hs new file mode 100644 index 0000000..24198ab --- /dev/null +++ b/testsuite/tests/rts/T10590.hs @@ -0,0 +1,37 @@ +import Foreign.C +import Foreign.Marshal.Array +import Foreign.Storable +import Control.Concurrent + +-- The test works only on UNIX like. +-- unportable bits: +import qualified System.Posix.Internals as SPI +import qualified System.Posix.Types as SPT + +pipe :: IO (CInt, CInt) +pipe = allocaArray 2 $ \fds -> do + throwErrnoIfMinus1_ "pipe" $ SPI.c_pipe fds + rd <- peekElemOff fds 0 + wr <- peekElemOff fds 1 + return (rd, wr) + +main :: IO () +main = do + (r1, w1) <- pipe + (r2, _w2) <- pipe + _ <- forkIO $ do -- thread A + threadWaitRead (SPT.Fd r1) + _ <- forkIO $ do -- thread B + threadWaitRead (SPT.Fd r2) + yield -- switch to A, then B + -- now both are blocked + _ <- SPI.c_close w1 -- unblocking thread A fd + _ <- SPI.c_close r2 -- breaking thread B fd + yield -- kick RTS IO manager + +{- + Trac #10590 exposed a bug as: + T10590: internal error: removeThreadFromDeQueue: not found + (GHC version 7.11.20150702 for x86_64_unknown_linux) + Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug + -} diff --git a/testsuite/tests/rts/all.T b/testsuite/tests/rts/all.T index 8f6137f..0e89249 100644 --- a/testsuite/tests/rts/all.T +++ b/testsuite/tests/rts/all.T @@ -318,3 +318,8 @@ test('T9839_05', [ only_ways(prof_ways), ignore_output, exit_code(1), extra_run_ test('T9839_06', [ only_ways(prof_ways), ignore_output, exit_code(1), extra_run_opts('+RTS -xtx')], compile_and_run, ['']) + +# ignore_output as RTS reports slightly different error messages +# in 'epoll' and 'select' backends on reading from EBADF +# mingw32 skip as UNIX pipe and close(fd) is used to exercise the problem +test('T10590', [ignore_output, when(opsys('mingw32'),skip)], compile_and_run, ['']) From git at git.haskell.org Tue Jul 7 17:17:43 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 7 Jul 2015 17:17:43 +0000 (UTC) Subject: [commit: ghc] master: Generalize `Control.Monad.forever` (6d69c3a) Message-ID: <20150707171743.48E5E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/6d69c3a264a1cfbbc7ecda0e704598afa45848c2/ghc >--------------------------------------------------------------- commit 6d69c3a264a1cfbbc7ecda0e704598afa45848c2 Author: Ben Gamari Date: Tue Jul 7 17:07:06 2015 +0200 Generalize `Control.Monad.forever` This generalizes forever to depend on Applicative, rather than Monad. This was proposed a month ago (https://mail.haskell.org/pipermail/libraries/2015-May/025711.html). Differential Revision: https://phabricator.haskell.org/D1045 >--------------------------------------------------------------- 6d69c3a264a1cfbbc7ecda0e704598afa45848c2 libraries/base/Control/Monad.hs | 4 ++-- libraries/base/changelog.md | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libraries/base/Control/Monad.hs b/libraries/base/Control/Monad.hs index 6fa4a07..be3765d 100644 --- a/libraries/base/Control/Monad.hs +++ b/libraries/base/Control/Monad.hs @@ -113,9 +113,9 @@ f >=> g = \x -> f x >>= g (<=<) = flip (>=>) -- | @'forever' act@ repeats the action infinitely. -forever :: (Monad m) => m a -> m b +forever :: (Applicative f) => f a -> f b {-# INLINE forever #-} -forever a = let a' = a >> a' in a' +forever a = let a' = a *> a' in a' -- Use explicit sharing here, as it is prevents a space leak regardless of -- optimizations. diff --git a/libraries/base/changelog.md b/libraries/base/changelog.md index 363210d..bb09199 100644 --- a/libraries/base/changelog.md +++ b/libraries/base/changelog.md @@ -40,6 +40,8 @@ * Generalize `Debug.Trace.{traceM, traceShowM}` from `Monad` to `Applicative` (#10023) + * Generalise `forever` from `Monad` to `Applicative` + ## 4.8.1.0 *TBA* * Bundled with GHC 7.10.2 From git at git.haskell.org Tue Jul 7 18:49:28 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 7 Jul 2015 18:49:28 +0000 (UTC) Subject: [commit: ghc] master: always use -fPIC on OpenBSD/AMD64 platform (d03bcfa) Message-ID: <20150707184928.1BFDA3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d03bcfaa255279c7f0c0d931b3202d45faa9b8e0/ghc >--------------------------------------------------------------- commit d03bcfaa255279c7f0c0d931b3202d45faa9b8e0 Author: Karel Gardas Date: Tue Jul 7 18:35:09 2015 +0200 always use -fPIC on OpenBSD/AMD64 platform Summary: This patch switches -fPIC on for every invocation of GHC on OpenBSD/AMD64 platform. The reason is OpenBSD's support for PIE (PIC for executables) hence -fPIC is also needed for GHC compiled code. Fixes #10597 Reviewers: austin Subscribers: thomie, bgamari Differential Revision: https://phabricator.haskell.org/D1027 >--------------------------------------------------------------- d03bcfaa255279c7f0c0d931b3202d45faa9b8e0 compiler/main/DynFlags.hs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 23a5fed..78614a4 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -3228,6 +3228,12 @@ default_PIC :: Platform -> [GeneralFlag] default_PIC platform = case (platformOS platform, platformArch platform) of (OSDarwin, ArchX86_64) -> [Opt_PIC] + (OSOpenBSD, ArchX86_64) -> [Opt_PIC] -- Due to PIE support in + -- OpenBSD since 5.3 release + -- (1 May 2013) we need to + -- always generate PIC. See + -- #10597 for more + -- information. _ -> [] impliedGFlags :: [(GeneralFlag, TurnOnFlag, GeneralFlag)] From git at git.haskell.org Tue Jul 7 19:20:39 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 7 Jul 2015 19:20:39 +0000 (UTC) Subject: [commit: ghc] master: Fix #10596 by looking up 'Int' not 'Maybe Int' in the map. (00c8d4d) Message-ID: <20150707192039.5B2433A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/00c8d4d551472940303437be1496bf23b882273b/ghc >--------------------------------------------------------------- commit 00c8d4d551472940303437be1496bf23b882273b Author: Edward Z. Yang Date: Tue Jul 7 21:19:54 2015 +0200 Fix #10596 by looking up 'Int' not 'Maybe Int' in the map. Test Plan: validate Reviewers: goldfire, austin, simonpj, bgamari Reviewed By: bgamari Subscribers: simonpj, rwbarton, thomie, bgamari Differential Revision: https://phabricator.haskell.org/D1026 GHC Trac Issues: #10596 >--------------------------------------------------------------- 00c8d4d551472940303437be1496bf23b882273b compiler/typecheck/TcSplice.hs | 15 +++++++++++---- testsuite/tests/th/T10596.hs | 11 +++++++++++ testsuite/tests/th/T10596.stderr | 1 + testsuite/tests/th/all.T | 1 + 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/compiler/typecheck/TcSplice.hs b/compiler/typecheck/TcSplice.hs index a7363d8..2e368a9 100644 --- a/compiler/typecheck/TcSplice.hs +++ b/compiler/typecheck/TcSplice.hs @@ -6,7 +6,11 @@ TcSplice: Template Haskell splices -} -{-# LANGUAGE CPP, FlexibleInstances, MagicHash, ScopedTypeVariables #-} +{-# LANGUAGE CPP #-} +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE MagicHash #-} +{-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE InstanceSigs #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module TcSplice( @@ -106,7 +110,7 @@ import GHC.Desugar ( AnnotationWrapper(..) ) import qualified Data.Map as Map import Data.Dynamic ( fromDynamic, toDyn ) -import Data.Typeable ( typeOf ) +import Data.Typeable ( typeOf, Typeable ) import Data.Data (Data) import GHC.Exts ( unsafeCoerce# ) #endif @@ -833,11 +837,14 @@ instance TH.Quasi (IOEnv (Env TcGblEnv TcLclEnv)) where th_modfinalizers_var <- fmap tcg_th_modfinalizers getGblEnv updTcRef th_modfinalizers_var (\fins -> fin:fins) + qGetQ :: forall a. Typeable a => IOEnv (Env TcGblEnv TcLclEnv) (Maybe a) qGetQ = do th_state_var <- fmap tcg_th_state getGblEnv th_state <- readTcRef th_state_var - let x = Map.lookup (typeOf x) th_state >>= fromDynamic - return x + -- See #10596 for why we use a scoped type variable here. + -- ToDo: convert @undefined :: a@ to @proxy :: Proxy a@ when + -- we drop support for GHC 7.6. + return (Map.lookup (typeOf (undefined :: a)) th_state >>= fromDynamic) qPutQ x = do th_state_var <- fmap tcg_th_state getGblEnv diff --git a/testsuite/tests/th/T10596.hs b/testsuite/tests/th/T10596.hs new file mode 100644 index 0000000..c861156 --- /dev/null +++ b/testsuite/tests/th/T10596.hs @@ -0,0 +1,11 @@ +{-# LANGUAGE TemplateHaskell #-} +module T10596 where +import Language.Haskell.TH +import Language.Haskell.TH.Syntax +do + putQ (100 :: Int) + x <- (getQ :: Q (Maybe Int)) + + -- It should print "Just 100" + runIO $ print x + return [] diff --git a/testsuite/tests/th/T10596.stderr b/testsuite/tests/th/T10596.stderr new file mode 100644 index 0000000..4b58162 --- /dev/null +++ b/testsuite/tests/th/T10596.stderr @@ -0,0 +1 @@ +Just 100 diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index 084ace5..1ec99d5 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -345,3 +345,4 @@ test('T10047', normal, ghci_script, ['T10047.script']) test('T10019', normal, ghci_script, ['T10019.script']) test('T10279', normal, compile_fail, ['-v0']) test('T10306', normal, compile, ['-v0']) +test('T10596', normal, compile, ['-v0']) From git at git.haskell.org Tue Jul 7 19:20:42 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 7 Jul 2015 19:20:42 +0000 (UTC) Subject: [commit: ghc] master: Export more types from GHC.RTS.Flags (#9970) (1967a52) Message-ID: <20150707192042.2FD313A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/1967a52df5bea5539e46393fa0da0a1ebd6d9db8/ghc >--------------------------------------------------------------- commit 1967a52df5bea5539e46393fa0da0a1ebd6d9db8 Author: RyanGlScott Date: Tue Jul 7 21:20:07 2015 +0200 Export more types from GHC.RTS.Flags (#9970) Export the data types `GiveGCStats`, `DoCostCentres`, `DoHeapProfiles`, and `DoTrace`, as well as the type synonyms `Time` and `RtsNat`. The above data types appear as fields in the `-Stats` data types in `GHC.RTS.Flags`, but since they only have `Show` instances, it is practically impossible to due anything useful with the above types unless they are exported. Reviewers: hvr, ekmett, austin, ezyang, bgamari Reviewed By: bgamari Subscribers: thomie, bgamari Differential Revision: https://phabricator.haskell.org/D1030 GHC Trac Issues: #9970 >--------------------------------------------------------------- 1967a52df5bea5539e46393fa0da0a1ebd6d9db8 libraries/base/GHC/RTS/Flags.hsc | 20 +++++++++++++------- libraries/base/changelog.md | 3 +++ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/libraries/base/GHC/RTS/Flags.hsc b/libraries/base/GHC/RTS/Flags.hsc index 308aafb..d2afcab 100644 --- a/libraries/base/GHC/RTS/Flags.hsc +++ b/libraries/base/GHC/RTS/Flags.hsc @@ -9,13 +9,19 @@ -- @since 4.8.0.0 -- module GHC.RTS.Flags - ( RTSFlags (..) + ( RtsTime + , RtsNat + , RTSFlags (..) + , GiveGCStats (..) , GCFlags (..) , ConcFlags (..) , MiscFlags (..) , DebugFlags (..) + , DoCostCentres (..) , CCFlags (..) + , DoHeapProfile (..) , ProfFlags (..) + , DoTrace (..) , TraceFlags (..) , TickyFlags (..) , getRTSFlags @@ -48,7 +54,7 @@ import GHC.Show import GHC.Word -- | @'Time'@ is defined as a @'StgWord64'@ in @stg/Types.h@ -type Time = Word64 +type RtsTime = Word64 -- | @'nat'@ defined in @rts/Types.h@ type RtsNat = #{type unsigned int} @@ -98,19 +104,19 @@ data GCFlags = GCFlags -- ^ use "mostly mark-sweep" instead of copying for the oldest generation , ringBell :: Bool , frontpanel :: Bool - , idleGCDelayTime :: Time + , idleGCDelayTime :: RtsTime , doIdleGC :: Bool , heapBase :: Word -- ^ address to ask the OS for memory , allocLimitGrace :: Word } deriving (Show) data ConcFlags = ConcFlags - { ctxtSwitchTime :: Time + { ctxtSwitchTime :: RtsTime , ctxtSwitchTicks :: Int } deriving (Show) data MiscFlags = MiscFlags - { tickInterval :: Time + { tickInterval :: RtsTime , installSignalHandlers :: Bool , machineReadable :: Bool , linkerMemBase :: Word @@ -198,8 +204,8 @@ instance Enum DoHeapProfile where data ProfFlags = ProfFlags { doHeapProfile :: DoHeapProfile - , heapProfileInterval :: Time -- ^ time between samples - , heapProfileIntervalTicks :: Word -- ^ ticks between samples (derived) + , heapProfileInterval :: RtsTime -- ^ time between samples + , heapProfileIntervalTicks :: Word -- ^ ticks between samples (derived) , includeTSOs :: Bool , showCCSOnException :: Bool , maxRetainerSetSize :: Word diff --git a/libraries/base/changelog.md b/libraries/base/changelog.md index bb09199..53bcb10 100644 --- a/libraries/base/changelog.md +++ b/libraries/base/changelog.md @@ -42,6 +42,9 @@ * Generalise `forever` from `Monad` to `Applicative` + * Exported `GiveGCStats`, `DoCostCentres`, `DoHeapProfile`, `DoTrace`, + `RtsTime`, and `RtsNat` from `GHC.RTS.Flags` + ## 4.8.1.0 *TBA* * Bundled with GHC 7.10.2 From git at git.haskell.org Tue Jul 7 22:30:40 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 7 Jul 2015 22:30:40 +0000 (UTC) Subject: [commit: ghc] wip/gadtpm: Fixed Record Pattern Translation (62d6edd) Message-ID: <20150707223040.051053A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/gadtpm Link : http://ghc.haskell.org/trac/ghc/changeset/62d6edd41cd71f259a1e4b092c51a0499b21078d/ghc >--------------------------------------------------------------- commit 62d6edd41cd71f259a1e4b092c51a0499b21078d Author: George Karachalias Date: Wed Jul 8 00:31:16 2015 +0200 Fixed Record Pattern Translation >--------------------------------------------------------------- 62d6edd41cd71f259a1e4b092c51a0499b21078d compiler/deSugar/Check.hs | 63 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 45 insertions(+), 18 deletions(-) diff --git a/compiler/deSugar/Check.hs b/compiler/deSugar/Check.hs index 8e790d3..5150188 100644 --- a/compiler/deSugar/Check.hs +++ b/compiler/deSugar/Check.hs @@ -42,7 +42,7 @@ import UniqSupply -- ( UniqSupply -- , splitUniqSupply -- :: UniqSupply -> (UniqSupply, UniqSupply) -- , listSplitUniqSupply -- :: UniqSupply -> [UniqSupply] -- , uniqFromSupply ) -- :: UniqSupply -> Unique -import Control.Monad (liftM3) +import Control.Monad (liftM3, forM) import Data.Maybe (isNothing, fromJust) import DsGRHSs (isTrueLHsExpr) @@ -280,7 +280,7 @@ translatePat pat = case pat of , pat_tvs = ex_tvs , pat_dicts = dicts , pat_args = ps } -> do - args <- translateConPatVec con ps + args <- translateConPatVec arg_tys ex_tvs con ps return [mkPmConPat con arg_tys ex_tvs dicts args] NPat lit mb_neg eq -> do @@ -319,22 +319,43 @@ translatePat pat = case pat of translatePatVec :: [Pat Id] -> UniqSM [PatVec] -- Do not concatenate them (sometimes we need them separately) translatePatVec pats = mapM translatePat pats -translateConPatVec :: DataCon -> HsConPatDetails Id -> UniqSM PatVec -translateConPatVec _ (PrefixCon ps) = concat <$> translatePatVec (map unLoc ps) -translateConPatVec _ (InfixCon p1 p2) = concat <$> translatePatVec (map unLoc [p1,p2]) -translateConPatVec c (RecCon (HsRecFields fs _)) - | null fs = mapM mkPmVarSM $ dataConOrigArgTys c - | otherwise = concat <$> translatePatVec (map (unLoc . snd) all_pats) +translateConPatVec :: [Type] -> [TyVar] -> DataCon -> HsConPatDetails Id -> UniqSM PatVec +translateConPatVec _univ_tys _ex_tvs _ (PrefixCon ps) = concat <$> translatePatVec (map unLoc ps) +translateConPatVec _univ_tys _ex_tvs _ (InfixCon p1 p2) = concat <$> translatePatVec (map unLoc [p1,p2]) +translateConPatVec univ_tys ex_tvs c (RecCon (HsRecFields fs _)) + | null fs = mkPmVarsSM arg_tys -- Nothing matched. Make up some fresh variables + | null orig_lbls = ASSERT (null matched_lbls) mkPmVarsSM arg_tys -- If it is not a record but uses record syntax it can only be {}. So just like above +-- It is an optimisation anyway, we can avoid doing it.. +-- | matched_lbls `subsetOf` orig_lbls = do -- Ordered: The easy case (no additional guards) +-- arg_pats <- zip orig_lbls <$> mkPmVarsSM arg_tys +-- {- WE'VE GOT WORK TO DO -} +-- undefined +-- subsetOf :: Eq a => [a] -> [a] -> Bool +-- subsetOf [] _ = True +-- subsetOf (_:_) [] = False +-- subsetOf (x:xs) (y:ys) +-- | x == y = subsetOf xs ys +-- | otherwise = subsetOf (x:xs) ys + | otherwise = do -- Not Ordered: We match against all patterns and add (strict) guards to match in the right order + arg_var_pats <- mkPmVarsSM arg_tys -- the normal variable patterns -- no forcing yet + + translated_pats <- forM matched_pats $ \(x,pat) -> do + pvec <- translatePat pat + return (idName x, pvec) + + let zipped = zip orig_lbls [ x | VarAbs x <- arg_var_pats ] -- [(Name, Id)] + guards = map (\(name,pvec) -> case lookup name zipped of + Just x -> GBindAbs pvec (PmExprVar x)) translated_pats + + return (arg_var_pats ++ guards) where - -- TODO: The functions below are ugly and they do not care much about types too - field_pats = map (\lbl -> (lbl, noLoc (WildPat (dataConFieldType c lbl)))) (dataConFieldLabels c) - all_pats = foldr (\(L _ (HsRecField id p _)) acc -> insertNm (getName (unLoc id)) p acc) - field_pats fs + -- The actual argument types (instantiated) + arg_tys = dataConInstOrigArgTys c (univ_tys ++ mkTyVarTys ex_tvs) - insertNm nm p [] = [(nm,p)] - insertNm nm p (x@(n,_):xs) - | nm == n = (nm,p):xs - | otherwise = x : insertNm nm p xs + -- Some label information + orig_lbls = dataConFieldLabels c + matched_lbls = [idName id | L _ (HsRecField (L _ id) _ _) <- fs] + matched_pats = [(id,pat) | L _ (HsRecField (L _ id) (L _ pat) _) <- fs] translateMatch :: LMatch Id (LHsExpr Id) -> UniqSM (PatVec,[PatVec]) translateMatch (L _ (Match lpats _ grhss)) = do @@ -620,6 +641,9 @@ mkPmVar usupply ty = VarAbs (mkPmId usupply ty) mkPmVarSM :: Type -> UniqSM (PmPat abs) mkPmVarSM ty = flip mkPmVar ty <$> getUniqueSupplyM +mkPmVarsSM :: [Type] -> UniqSM [PmPat abs] +mkPmVarsSM tys = mapM mkPmVarSM tys + mkPmId :: UniqSupply -> Type -> Id mkPmId usupply ty = mkLocalId name ty where @@ -862,6 +886,11 @@ allTheSame :: Eq a => [a] -> Bool allTheSame [] = True allTheSame (x:xs) = all (==x) xs +sameArity :: PatVec -> ValSetAbs -> Bool +sameArity pv vsa = vsaArity pv_a vsa == pv_a + where pv_a = patVecArity pv + + {- %************************************************************************ %* * @@ -1030,7 +1059,6 @@ patVectProc2 :: (PatVec, [PatVec]) -> ValSetAbs -> PmM (Bool, Bool, ValSetAbs) - patVectProc2 (vec,gvs) vsa = do us <- getUniqueSupplyM let (c_def, u_def, d_def) = process_guards us gvs -- default (the continuation) - (usC, usU, usD) <- getUniqueSupplyM3 mb_c <- anySatValSetAbs (covered2 usC c_def vec vsa) mb_d <- anySatValSetAbs (divergent2 usD d_def vec vsa) @@ -1066,7 +1094,6 @@ checkMatches'2 [] missing = do checkMatches'2 (m:ms) missing = do patterns_n_guards <- liftUs (translateMatch m) - -- pprInTcRnIf (ptext (sLit "translated") <+> ppr patterns_n_guards) (c, d, us ) <- patVectProc2 patterns_n_guards missing (rs, is, us') <- checkMatches'2 ms us return $ case (c,d) of From git at git.haskell.org Wed Jul 8 02:49:22 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 02:49:22 +0000 (UTC) Subject: [commit: ghc] master: Backpack: Flesh out more Cabal details (8800a73) Message-ID: <20150708024922.90C003A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/8800a73a03c70357c81f24ef53f4644de6668d9d/ghc >--------------------------------------------------------------- commit 8800a73a03c70357c81f24ef53f4644de6668d9d Author: Edward Z. Yang Date: Tue Jul 7 19:49:32 2015 -0700 Backpack: Flesh out more Cabal details Signed-off-by: Edward Z. Yang >--------------------------------------------------------------- 8800a73a03c70357c81f24ef53f4644de6668d9d docs/backpack/algorithm.pdf | Bin 288880 -> 299029 bytes docs/backpack/algorithm.tex | 328 +++++++++++++++++++++++++++++++++++++------- 2 files changed, 282 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 8800a73a03c70357c81f24ef53f4644de6668d9d From git at git.haskell.org Wed Jul 8 05:11:45 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 05:11:45 +0000 (UTC) Subject: [commit: ghc] master: holePackageKey and isHoleModule utility functions. (d71b65f) Message-ID: <20150708051145.D108C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d71b65f53a1daa2631d2c818c7ea6add77813532/ghc >--------------------------------------------------------------- commit d71b65f53a1daa2631d2c818c7ea6add77813532 Author: Edward Z. Yang Date: Tue Jun 23 13:31:15 2015 -0700 holePackageKey and isHoleModule utility functions. Signed-off-by: Edward Z. Yang >--------------------------------------------------------------- d71b65f53a1daa2631d2c818c7ea6add77813532 compiler/basicTypes/Module.hs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/compiler/basicTypes/Module.hs b/compiler/basicTypes/Module.hs index a20de2d..2c60463 100644 --- a/compiler/basicTypes/Module.hs +++ b/compiler/basicTypes/Module.hs @@ -42,6 +42,7 @@ module Module dphParPackageKey, mainPackageKey, thisGhcPackageKey, + holePackageKey, isHoleModule, interactivePackageKey, isInteractiveModule, wiredInPackageKeys, @@ -399,9 +400,17 @@ interactivePackageKey = fsToPackageKey (fsLit "interactive") -- to symbol names, since there can be only one main package per program. mainPackageKey = fsToPackageKey (fsLit "main") +-- | This is a fake package id used to provide identities to any un-implemented +-- signatures. The set of hole identities is global over an entire compilation. +holePackageKey :: PackageKey +holePackageKey = fsToPackageKey (fsLit "hole") + isInteractiveModule :: Module -> Bool isInteractiveModule mod = modulePackageKey mod == interactivePackageKey +isHoleModule :: Module -> Bool +isHoleModule mod = modulePackageKey mod == holePackageKey + wiredInPackageKeys :: [PackageKey] wiredInPackageKeys = [ primPackageKey, integerPackageKey, From git at git.haskell.org Wed Jul 8 08:17:45 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:17:45 +0000 (UTC) Subject: [commit: ghc] wip/gadtpm: Prune uncovered at every step (had huge space leaks) (ded5c0f) Message-ID: <20150708081745.CCCF43A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/gadtpm Link : http://ghc.haskell.org/trac/ghc/changeset/ded5c0fe9b6cde02b4bf64458c04f0b8f5b4ced4/ghc >--------------------------------------------------------------- commit ded5c0fe9b6cde02b4bf64458c04f0b8f5b4ced4 Author: George Karachalias Date: Wed Jul 8 10:18:17 2015 +0200 Prune uncovered at every step (had huge space leaks) >--------------------------------------------------------------- ded5c0fe9b6cde02b4bf64458c04f0b8f5b4ced4 compiler/deSugar/Check.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/deSugar/Check.hs b/compiler/deSugar/Check.hs index 5150188..ec08a2a 100644 --- a/compiler/deSugar/Check.hs +++ b/compiler/deSugar/Check.hs @@ -1062,7 +1062,8 @@ patVectProc2 (vec,gvs) vsa = do (usC, usU, usD) <- getUniqueSupplyM3 mb_c <- anySatValSetAbs (covered2 usC c_def vec vsa) mb_d <- anySatValSetAbs (divergent2 usD d_def vec vsa) - return (mb_c, mb_d, uncovered2 usU u_def vec vsa) + vsa' <- pruneValSetAbs (uncovered2 usU u_def vec vsa) + return (mb_c, mb_d, vsa') -- Single pattern binding (let) checkSingle2 :: Type -> Pat Id -> DsM PmResult From git at git.haskell.org Wed Jul 8 08:26:12 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:26:12 +0000 (UTC) Subject: [commit: haddock] branch 'T6018-injective-type-families' created Message-ID: <20150708082612.045B23A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock New branch : T6018-injective-type-families Referencing: bd3f059a6d8cc66c5053997cbba58b612a992c39 From git at git.haskell.org Wed Jul 8 08:26:14 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:26:14 +0000 (UTC) Subject: [commit: haddock] branch 'fix-travis' created Message-ID: <20150708082614.043593A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock New branch : fix-travis Referencing: 6983ac92979d78ef7832c863e08d0b01f18049aa From git at git.haskell.org Wed Jul 8 08:26:16 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:26:16 +0000 (UTC) Subject: [commit: haddock] branch 'wip/remove-cabal-dep' created Message-ID: <20150708082616.057593A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock New branch : wip/remove-cabal-dep Referencing: b2a807da55d197c648fd2df1f156f9862711d92b From git at git.haskell.org Wed Jul 8 08:26:18 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:26:18 +0000 (UTC) Subject: [commit: haddock] branch 'wip/T8584' created Message-ID: <20150708082618.068083A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock New branch : wip/T8584 Referencing: bf80e2f594777c0c32fae092454bff0c13ae6181 From git at git.haskell.org Wed Jul 8 08:26:20 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:26:20 +0000 (UTC) Subject: [commit: haddock] branch 'wip/ast-prepare-annotations-final5' created Message-ID: <20150708082620.07BF03A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock New branch : wip/ast-prepare-annotations-final5 Referencing: 0d6891a57ba43faba3995bce6a1a0a02889a21ed From git at git.haskell.org Wed Jul 8 08:26:22 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:26:22 +0000 (UTC) Subject: [commit: haddock] branch 'wip/ast-prepare-annotations-final4' created Message-ID: <20150708082622.096413A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock New branch : wip/ast-prepare-annotations-final4 Referencing: ef4f3bfcfe1241f9e4518e85d81fa9ebfe2fd139 From git at git.haskell.org Wed Jul 8 08:26:24 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:26:24 +0000 (UTC) Subject: [commit: haddock] branch 'wip/ast-prepare-annotations-final6' created Message-ID: <20150708082624.09EA53A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock New branch : wip/ast-prepare-annotations-final6 Referencing: e5c8fdab729c98527d132f4a68760430e1f59141 From git at git.haskell.org Wed Jul 8 08:26:26 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:26:26 +0000 (UTC) Subject: [commit: haddock] branch 'wip/ast-annotations-separate' created Message-ID: <20150708082626.0A2033A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock New branch : wip/ast-annotations-separate Referencing: b31be07d250cd006d0654efe2e16f82274c9acb6 From git at git.haskell.org Wed Jul 8 08:26:28 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:26:28 +0000 (UTC) Subject: [commit: haddock] branch 'wip/ast-prepare-annotations-final3' created Message-ID: <20150708082628.0BAF93A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock New branch : wip/ast-prepare-annotations-final3 Referencing: fa621a64af55724e7ec6b044e786b8dd497a2a2a From git at git.haskell.org Wed Jul 8 08:26:30 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:26:30 +0000 (UTC) Subject: [commit: haddock] branch 'wip/ast-prepare-annotations-final2' created Message-ID: <20150708082630.0D0753A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock New branch : wip/ast-prepare-annotations-final2 Referencing: dd68ece83fdf04b0466ebf93dab0bcf534224d81 From git at git.haskell.org Wed Jul 8 08:26:32 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:26:32 +0000 (UTC) Subject: [commit: haddock] branch 'wip/D538' created Message-ID: <20150708082632.0D8913A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock New branch : wip/D538 Referencing: 814dfd7ed36e7dba9081f0a7df6d33925f35070a From git at git.haskell.org Wed Jul 8 08:26:34 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:26:34 +0000 (UTC) Subject: [commit: haddock] branch 'wip/D548-master' created Message-ID: <20150708082634.0ED733A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock New branch : wip/D548-master Referencing: 0bceabc3bd56408bddcbeb0c5a919f0098a3d9a7 From git at git.haskell.org Wed Jul 8 08:26:36 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:26:36 +0000 (UTC) Subject: [commit: haddock] branch 'wip/pattern-synonym-sig-backport' created Message-ID: <20150708082636.0FA8B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock New branch : wip/pattern-synonym-sig-backport Referencing: 327b3d07a2eb7e12ad151d11787e119905d9ff24 From git at git.haskell.org Wed Jul 8 08:26:38 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:26:38 +0000 (UTC) Subject: [commit: haddock] branch 'wip/api-ann-hstylit' created Message-ID: <20150708082638.110B73A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock New branch : wip/api-ann-hstylit Referencing: 7138dbaf893df33e3f80ac624c80ac8d310a6719 From git at git.haskell.org Wed Jul 8 08:26:40 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:26:40 +0000 (UTC) Subject: [commit: haddock] branch 'wip/landmine-param-family' created Message-ID: <20150708082640.123773A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock New branch : wip/landmine-param-family Referencing: f5ff5394e00deb809b9b7a35cf6c6da1a079b6b3 From git at git.haskell.org Wed Jul 8 08:26:42 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:26:42 +0000 (UTC) Subject: [commit: haddock] branch '2.15.0.2' created Message-ID: <20150708082642.12F673A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock New branch : 2.15.0.2 Referencing: a6016cd3424c5caa4ae41996801d62e4be6f52a7 From git at git.haskell.org Wed Jul 8 08:26:44 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:26:44 +0000 (UTC) Subject: [commit: haddock] branch '2.15.0.1' created Message-ID: <20150708082644.13D5D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock New branch : 2.15.0.1 Referencing: d230feffebc89c61dbd243a54fe4ccc2694dd052 From git at git.haskell.org Wed Jul 8 08:26:46 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:26:46 +0000 (UTC) Subject: [commit: haddock] branch 'wip/api-annots-ghc-7.10-3' created Message-ID: <20150708082646.148DE3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock New branch : wip/api-annots-ghc-7.10-3 Referencing: 81affaaf19ea33ad07bc7d5c15a949644a10c76a From git at git.haskell.org Wed Jul 8 08:26:48 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:26:48 +0000 (UTC) Subject: [commit: haddock] branch 'metainfo' created Message-ID: <20150708082648.15B0B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock New branch : metainfo Referencing: d453ce0df20a588e80287352954a79a4b3d70eb0 From git at git.haskell.org Wed Jul 8 08:26:50 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:26:50 +0000 (UTC) Subject: [commit: haddock] branch 'wip/orf-new' created Message-ID: <20150708082650.16EE93A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock New branch : wip/orf-new Referencing: b0e3edfc12754e264846f5863351755c3436ddb5 From git at git.haskell.org Wed Jul 8 08:26:52 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:26:52 +0000 (UTC) Subject: [commit: haddock] branch 'wip/D548-master-2' created Message-ID: <20150708082652.196B13A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock New branch : wip/D548-master-2 Referencing: 7cce80ac19748cef4446e0373b9078d69b2319a5 From git at git.haskell.org Wed Jul 8 08:26:54 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:26:54 +0000 (UTC) Subject: [commit: haddock] branch '2.15' created Message-ID: <20150708082654.18CF83A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock New branch : 2.15 Referencing: a6016cd3424c5caa4ae41996801d62e4be6f52a7 From git at git.haskell.org Wed Jul 8 08:26:56 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:26:56 +0000 (UTC) Subject: [commit: haddock] branch 'adamse-D1033' created Message-ID: <20150708082656.19C4C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock New branch : adamse-D1033 Referencing: 53c47c6fc6cdaa5084b36ea6ba8320a460fa7106 From git at git.haskell.org Wed Jul 8 08:26:58 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:26:58 +0000 (UTC) Subject: [commit: haddock] branch 'wip/T10483' created Message-ID: <20150708082658.1A9553A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock New branch : wip/T10483 Referencing: cb2efca2ec78c8245e70d15b1d9df14a82b70feb From git at git.haskell.org Wed Jul 8 08:27:00 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:27:00 +0000 (UTC) Subject: [commit: haddock] branch 'wip/attoparsec-update' created Message-ID: <20150708082700.1C40F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock New branch : wip/attoparsec-update Referencing: ddf11f0c5c45a5e5b065df1e58de9cc3d57631cb From git at git.haskell.org Wed Jul 8 08:27:02 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:27:02 +0000 (UTC) Subject: [commit: haddock] branch 'wip/10268' created Message-ID: <20150708082702.1CC7A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock New branch : wip/10268 Referencing: 44c7fdf4316348d321f59cfef95ca29c7d7abc63 From git at git.haskell.org Wed Jul 8 08:27:04 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:27:04 +0000 (UTC) Subject: [commit: haddock] branch 'wip/10313' created Message-ID: <20150708082704.1DCD63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock New branch : wip/10313 Referencing: 45df734c8e0242ca2e88fba5359207e49d7bf158 From git at git.haskell.org Wed Jul 8 08:27:06 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:27:06 +0000 (UTC) Subject: [commit: haddock] branch 'wip/ast-prepare-annotations-final' created Message-ID: <20150708082706.1E8203A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock New branch : wip/ast-prepare-annotations-final Referencing: d86af79f2c314193a89fc40c7204d9b4198ce738 From git at git.haskell.org Wed Jul 8 08:27:08 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:27:08 +0000 (UTC) Subject: [commit: haddock] branch 'wip/orf-reboot' created Message-ID: <20150708082708.1FCDF3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock New branch : wip/orf-reboot Referencing: 637b695e6a72083d81748af56c667b8e83d977fd From git at git.haskell.org Wed Jul 8 08:27:10 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:27:10 +0000 (UTC) Subject: [commit: haddock] branch 'wip/api-ann-hstylit-5' created Message-ID: <20150708082710.211FB3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock New branch : wip/api-ann-hstylit-5 Referencing: 5ccca44efa0833227622973276c4f63566fc27ab From git at git.haskell.org Wed Jul 8 08:27:12 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:27:12 +0000 (UTC) Subject: [commit: haddock] branch 'wip/api-ann-hstylit-4' created Message-ID: <20150708082712.222B63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock New branch : wip/api-ann-hstylit-4 Referencing: 1a507afaa2212634c7b5724ec6ca7e3699b714bf From git at git.haskell.org Wed Jul 8 08:27:14 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:27:14 +0000 (UTC) Subject: [commit: haddock] branch 'wip/api-ann-hstylit-3' created Message-ID: <20150708082714.22DCD3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock New branch : wip/api-ann-hstylit-3 Referencing: f18360f9a2330492374726c3a29e54702109371f From git at git.haskell.org Wed Jul 8 08:27:16 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:27:16 +0000 (UTC) Subject: [commit: haddock] branch 'wip/api-ann-hstylit-2' created Message-ID: <20150708082716.23D293A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock New branch : wip/api-ann-hstylit-2 Referencing: 23a6b47ebf1d08b9683b32ef0fe00f1e95911105 From git at git.haskell.org Wed Jul 8 08:27:18 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:27:18 +0000 (UTC) Subject: [commit: haddock] branch 'wip/api-ann-hstylit-1' created Message-ID: <20150708082718.248F53A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock New branch : wip/api-ann-hstylit-1 Referencing: 5eef94be45732c802c0816e3103e12b9f9095e13 From git at git.haskell.org Wed Jul 8 08:27:20 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:27:20 +0000 (UTC) Subject: [commit: haddock] branch 'wip/rae' created Message-ID: <20150708082720.263EE3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock New branch : wip/rae Referencing: 73b03f8c88720a7288bd4ca439a8bfa5adb350a0 From git at git.haskell.org Wed Jul 8 08:27:22 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:27:22 +0000 (UTC) Subject: [commit: haddock] branch 'v2.15' created Message-ID: <20150708082722.270AB3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock New branch : v2.15 Referencing: a6016cd3424c5caa4ae41996801d62e4be6f52a7 From git at git.haskell.org Wed Jul 8 08:27:24 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:27:24 +0000 (UTC) Subject: [commit: haddock] branch 'wip/ast-prepare-annotations' created Message-ID: <20150708082724.279D43A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock New branch : wip/ast-prepare-annotations Referencing: c209a37e001f5df4de584b7fa109abecf2d345d9 From git at git.haskell.org Wed Jul 8 08:27:26 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:27:26 +0000 (UTC) Subject: [commit: haddock] branch 'wip/trac-9744' created Message-ID: <20150708082726.28D2C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock New branch : wip/trac-9744 Referencing: f510419b1e918ec76d98190b966003cdbec107bb From git at git.haskell.org Wed Jul 8 08:27:28 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:27:28 +0000 (UTC) Subject: [commit: haddock] branch 'wip/api-annot-tweaks-7.10' created Message-ID: <20150708082728.297B13A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock New branch : wip/api-annot-tweaks-7.10 Referencing: 89fc5605c865d0e0ce5ed7e396102e678426533b From git at git.haskell.org Wed Jul 8 08:27:30 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:27:30 +0000 (UTC) Subject: [commit: haddock] branch 'wip/T9840' created Message-ID: <20150708082730.2A8713A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock New branch : wip/T9840 Referencing: 31d1ed31e8708bcf5c141f200a2609692cbe2c59 From git at git.haskell.org Wed Jul 8 08:27:32 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:27:32 +0000 (UTC) Subject: [commit: haddock] branch 'wip/D538-2' created Message-ID: <20150708082732.2B5B83A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock New branch : wip/D538-2 Referencing: f0bddaed1812155b716c5b0760d58372aa3412ed From git at git.haskell.org Wed Jul 8 08:27:34 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:27:34 +0000 (UTC) Subject: [commit: haddock] branch 'wip/D538-3' created Message-ID: <20150708082734.2C2773A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock New branch : wip/D538-3 Referencing: fd25ec56e3e4b504e1643ebb2f4b1ac24e635e61 From git at git.haskell.org Wed Jul 8 08:27:36 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:27:36 +0000 (UTC) Subject: [commit: haddock] branch 'wip/D538-1' created Message-ID: <20150708082736.2D6193A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock New branch : wip/D538-1 Referencing: e9a17bd9407e9ae780737cfc0ae457f7a294ff60 From git at git.haskell.org Wed Jul 8 08:27:38 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:27:38 +0000 (UTC) Subject: [commit: haddock] branch 'wip/D538-6' created Message-ID: <20150708082738.2E2A53A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock New branch : wip/D538-6 Referencing: f60be3d460aa7e1e7c568a8d43d7ef7dbe25e0bf From git at git.haskell.org Wed Jul 8 08:27:40 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:27:40 +0000 (UTC) Subject: [commit: haddock] branch 'wip/D538-4' created Message-ID: <20150708082740.2F6A13A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock New branch : wip/D538-4 Referencing: d1db447d6922f46250042b69317eeec9fbdcf8d9 From git at git.haskell.org Wed Jul 8 08:27:42 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:27:42 +0000 (UTC) Subject: [commit: haddock] branch 'wip/D538-5' created Message-ID: <20150708082742.304A63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock New branch : wip/D538-5 Referencing: 54c5e7cd0b5844712301cacc826a6b112dbc1090 From git at git.haskell.org Wed Jul 8 08:27:44 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:27:44 +0000 (UTC) Subject: [commit: haddock] branch 'clean' created Message-ID: <20150708082744.31BD83A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock New branch : clean Referencing: fefef1c49075acc4390db822fad7e351c777e847 From git at git.haskell.org Wed Jul 8 08:27:46 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:27:46 +0000 (UTC) Subject: [commit: haddock] branch 'ghc-head' created Message-ID: <20150708082746.31DF93A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock New branch : ghc-head Referencing: 553c719236972f3a1d445146352ec94614979b63 From git at git.haskell.org Wed Jul 8 08:27:48 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:27:48 +0000 (UTC) Subject: [commit: haddock] branch 'wip/T9023' created Message-ID: <20150708082748.339AC3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock New branch : wip/T9023 Referencing: e04e1183698d1bab42d72ccff7314652ab4f8f44 From git at git.haskell.org Wed Jul 8 08:27:50 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:27:50 +0000 (UTC) Subject: [commit: haddock] tag 'haddock-2.16.0-release' created Message-ID: <20150708082750.347993A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock New tag : haddock-2.16.0-release Referencing: 08a4a4235d4028b7ee7956afad9b50e7a867ed4f From git at git.haskell.org Wed Jul 8 08:27:52 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:27:52 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, fix-travis, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/ast-annotations-separate, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/attoparsec-update, wip/landmine-param-family, wip/orf-new, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/remove-cabal-dep, wip/trac-9744: Prepare modules for parser split. (7ac2d0f) Message-ID: <20150708082752.4D3A23A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/attoparsec-update,wip/landmine-param-family,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/remove-cabal-dep,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/7ac2d0f2d31c2e1c7ede09828f3d5ba5626bd0d4 >--------------------------------------------------------------- commit 7ac2d0f2d31c2e1c7ede09828f3d5ba5626bd0d4 Author: Mateusz Kowalczyk Date: Mon May 5 05:16:19 2014 +0200 Prepare modules for parser split. We have to generalise the Doc (now DocH) slightly to remove the dependency on GHC-supplied type. >--------------------------------------------------------------- 7ac2d0f2d31c2e1c7ede09828f3d5ba5626bd0d4 src/Haddock.hs | 2 +- src/Haddock/Doc.hs | 8 +- src/Haddock/Interface/LexParseRn.hs | 2 +- src/Haddock/Interface/ParseModuleHeader.hs | 2 +- src/Haddock/InterfaceFile.hs | 2 +- src/Haddock/Parser.hs | 260 ++++++++++++++++------------- src/Haddock/Parser/Util.hs | 44 ++--- src/Haddock/Types.hs | 30 ++-- test/Haddock/Parser/UtilSpec.hs | 2 +- test/Haddock/ParserSpec.hs | 23 ++- 10 files changed, 206 insertions(+), 169 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 7ac2d0f2d31c2e1c7ede09828f3d5ba5626bd0d4 From git at git.haskell.org Wed Jul 8 08:27:54 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:27:54 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, fix-travis, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/ast-annotations-separate, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/attoparsec-update, wip/landmine-param-family, wip/orf-new, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/remove-cabal-dep, wip/trac-9744: Move parser + parser tests out to own package. (cc269e6) Message-ID: <20150708082754.780E43A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/attoparsec-update,wip/landmine-param-family,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/remove-cabal-dep,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/cc269e6b0b615e9e237c35a985e4ace7b9ab0dd9 >--------------------------------------------------------------- commit cc269e6b0b615e9e237c35a985e4ace7b9ab0dd9 Author: Mateusz Kowalczyk Date: Mon May 5 09:01:03 2014 +0200 Move parser + parser tests out to own package. We move some types out that are necessary as well and then re-export and specialise them in the core Haddock. Reason for moving out spec tests is that if we're working on the parser, we can simply work on that and we can ignore the rest of Haddock. The downside is that it's a little inconvenient if at the end of the day we want to see that everything passes. >--------------------------------------------------------------- cc269e6b0b615e9e237c35a985e4ace7b9ab0dd9 .ghci | 2 +- .gitignore | 1 + haddock-library/.ghci | 1 + LICENSE => haddock-library/LICENSE | 0 haddock-library/Setup.hs | 2 + haddock-library/haddock-library.cabal | 75 +++ .../src/Documentation}/Haddock/Doc.hs | 13 +- .../src/Documentation}/Haddock/Parser.hs | 130 ++--- .../src/Documentation/Haddock/Parser/Util.hs | 61 +++ haddock-library/src/Documentation/Haddock/Types.hs | 70 +++ .../src/Documentation}/Haddock/Utf8.hs | 2 +- .../test/Documentation}/Haddock/Parser/UtilSpec.hs | 11 +- .../test/Documentation}/Haddock/ParserSpec.hs | 19 +- .../test/Documentation}/Haddock/Utf8Spec.hs | 9 +- {test => haddock-library/test}/Spec.hs | 0 .../vendor}/attoparsec-0.10.4.0/Data/Attoparsec.hs | 0 .../Data/Attoparsec/ByteString.hs | 0 .../Data/Attoparsec/ByteString/Char8.hs | 0 .../Data/Attoparsec/ByteString/FastSet.hs | 0 .../Data/Attoparsec/ByteString/Internal.hs | 0 .../Data/Attoparsec/Combinator.hs | 0 .../Data/Attoparsec/Internal.hs | 0 .../Data/Attoparsec/Internal/Types.hs | 0 .../attoparsec-0.10.4.0/Data/Attoparsec/Number.hs | 0 haddock.cabal | 59 +-- src/Documentation/Haddock.hs | 3 +- src/Haddock.hs | 2 +- src/Haddock/Doc.hs | 51 +- src/Haddock/Interface/LexParseRn.hs | 20 +- src/Haddock/Interface/ParseModuleHeader.hs | 2 +- src/Haddock/Parser.hs | 529 ++------------------- src/Haddock/Parser/Util.hs | 28 -- src/Haddock/Types.hs | 58 +-- test/Helper.hs | 186 -------- 34 files changed, 330 insertions(+), 1004 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 cc269e6b0b615e9e237c35a985e4ace7b9ab0dd9 From git at git.haskell.org Wed Jul 8 08:27:56 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:27:56 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, fix-travis, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/ast-annotations-separate, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/attoparsec-update, wip/landmine-param-family, wip/orf-new, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/remove-cabal-dep, wip/trac-9744: Move out Show and Eq instances to Types (70ce2cb) Message-ID: <20150708082756.835133A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/attoparsec-update,wip/landmine-param-family,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/remove-cabal-dep,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/70ce2cbf11ea6c861b5597527f768039d0571bf2 >--------------------------------------------------------------- commit 70ce2cbf11ea6c861b5597527f768039d0571bf2 Author: Mateusz Kowalczyk Date: Mon May 5 11:14:47 2014 +0200 Move out Show and Eq instances to Types They are much more useful to the users here. >--------------------------------------------------------------- 70ce2cbf11ea6c861b5597527f768039d0571bf2 haddock-library/src/Documentation/Haddock/Types.hs | 6 ++++++ haddock-library/test/Documentation/Haddock/ParserSpec.hs | 10 ++-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/haddock-library/src/Documentation/Haddock/Types.hs b/haddock-library/src/Documentation/Haddock/Types.hs index 3e25d23..b3118cc 100644 --- a/haddock-library/src/Documentation/Haddock/Types.hs +++ b/haddock-library/src/Documentation/Haddock/Types.hs @@ -24,6 +24,12 @@ instance Foldable Header where instance Traversable Header where traverse f (Header l a) = Header l `fmap` f a + +deriving instance Show a => Show (Header a) +deriving instance (Show a, Show b) => Show (DocH a b) +deriving instance Eq a => Eq (Header a) +deriving instance (Eq a, Eq b) => Eq (DocH a b) + data Hyperlink = Hyperlink { hyperlinkUrl :: String , hyperlinkLabel :: Maybe String diff --git a/haddock-library/test/Documentation/Haddock/ParserSpec.hs b/haddock-library/test/Documentation/Haddock/ParserSpec.hs index 3889d55..8e73848 100644 --- a/haddock-library/test/Documentation/Haddock/ParserSpec.hs +++ b/haddock-library/test/Documentation/Haddock/ParserSpec.hs @@ -1,6 +1,5 @@ -{-# LANGUAGE OverloadedStrings, StandaloneDeriving - , FlexibleInstances, UndecidableInstances - , IncoherentInstances #-} +{-# LANGUAGE OverloadedStrings, FlexibleInstances #-} +{-# LANGUAGE IncoherentInstances, UndecidableInstances #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Documentation.Haddock.ParserSpec (main, spec) where @@ -14,11 +13,6 @@ import Test.QuickCheck type Doc id = DocH () id -deriving instance Show a => Show (Header a) -deriving instance Show a => Show (Doc a) -deriving instance Eq a => Eq (Header a) -deriving instance Eq a => Eq (Doc a) - instance IsString (Doc String) where fromString = DocString From git at git.haskell.org Wed Jul 8 08:27:58 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:27:58 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, fix-travis, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/ast-annotations-separate, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/attoparsec-update, wip/landmine-param-family, wip/orf-new, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/remove-cabal-dep, wip/trac-9744: Remove no longer necessary parser error handling. (e8756e5) Message-ID: <20150708082758.933C23A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/attoparsec-update,wip/landmine-param-family,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/remove-cabal-dep,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/e8756e5bfcd128817b7942cb439ee3287dd0637a >--------------------------------------------------------------- commit e8756e5bfcd128817b7942cb439ee3287dd0637a Author: Mateusz Kowalczyk Date: Tue May 6 13:39:23 2014 +0200 Remove no longer necessary parser error handling. We can now drop some Maybe tests and even lets us strip an error handling monad away in a few places. >--------------------------------------------------------------- e8756e5bfcd128817b7942cb439ee3287dd0637a src/Haddock.hs | 7 +- src/Haddock/Interface/Create.hs | 129 +++++++++++++---------------- src/Haddock/Interface/LexParseRn.hs | 53 +++++------- src/Haddock/Interface/ParseModuleHeader.hs | 46 ++++------ src/Haddock/Parser.hs | 17 ++-- 5 files changed, 105 insertions(+), 147 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 e8756e5bfcd128817b7942cb439ee3287dd0637a From git at git.haskell.org Wed Jul 8 08:28:00 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:28:00 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, fix-travis, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/ast-annotations-separate, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/attoparsec-update, wip/landmine-param-family, wip/orf-new, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/remove-cabal-dep, wip/trac-9744: Please the GHC build-system. (a19af87) Message-ID: <20150708082800.A08373A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/attoparsec-update,wip/landmine-param-family,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/remove-cabal-dep,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/a19af87d6bfee1abc6c179f79eb391b381a26d81 >--------------------------------------------------------------- commit a19af87d6bfee1abc6c179f79eb391b381a26d81 Author: Mateusz Kowalczyk Date: Wed May 14 02:23:55 2014 +0200 Please the GHC build-system. As I can not figure out how to do this properly, if we're in GHC tree, we treat the library as being the same package. If we're not in the tree, we require that the library be installed separately. >--------------------------------------------------------------- a19af87d6bfee1abc6c179f79eb391b381a26d81 haddock.cabal | 49 +++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 41 insertions(+), 8 deletions(-) diff --git a/haddock.cabal b/haddock.cabal index b308a02..6485815 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -73,7 +73,7 @@ executable haddock build-depends: base >= 4.3 && < 4.8 if flag(in-ghc-tree) - hs-source-dirs: src, vendor/attoparsec-0.10.4.0 + hs-source-dirs: src, haddock-library/vendor/attoparsec-0.10.4.0, haddock-library/src cpp-options: -DIN_GHC_TREE build-depends: filepath, @@ -84,10 +84,24 @@ executable haddock xhtml >= 3000.2 && < 3000.3, Cabal >= 1.10, ghc == 7.9.*, - bytestring, - haddock-library + bytestring other-modules: + Documentation.Haddock.Parser + Documentation.Haddock.Types + Documentation.Haddock.Doc + Data.Attoparsec + Data.Attoparsec.ByteString + Data.Attoparsec.ByteString.Char8 + Data.Attoparsec.Combinator + Data.Attoparsec.Number + Data.Attoparsec.ByteString.FastSet + Data.Attoparsec.ByteString.Internal + Data.Attoparsec.Internal + Data.Attoparsec.Internal.Types + Documentation.Haddock.Utf8 + Documentation.Haddock.Parser.Util + Documentation.Haddock Haddock Haddock.Interface @@ -97,7 +111,6 @@ executable haddock Haddock.Interface.LexParseRn Haddock.Interface.ParseModuleHeader Haddock.Parser - Haddock.Utf8 Haddock.Utils Haddock.Backends.Xhtml Haddock.Backends.Xhtml.Decl @@ -134,15 +147,35 @@ library array, xhtml >= 3000.2 && < 3000.3, Cabal >= 1.10, - ghc == 7.9.*, - haddock-library + ghc == 7.9.* if flag(in-ghc-tree) cpp-options: -DIN_GHC_TREE + hs-source-dirs: src, haddock-library/vendor/attoparsec-0.10.4.0, haddock-library/src + + exposed-modules: + Documentation.Haddock.Parser + Documentation.Haddock.Types + Documentation.Haddock.Doc + + other-modules: + Data.Attoparsec + Data.Attoparsec.ByteString + Data.Attoparsec.ByteString.Char8 + Data.Attoparsec.Combinator + Data.Attoparsec.Number + Data.Attoparsec.ByteString.FastSet + Data.Attoparsec.ByteString.Internal + Data.Attoparsec.Internal + Data.Attoparsec.Internal.Types + Documentation.Haddock.Utf8 + Documentation.Haddock.Parser.Util + else - build-depends: ghc-paths + build-depends: ghc-paths, haddock-library + hs-source-dirs: src + - hs-source-dirs: src if flag(dev) ghc-options: -funbox-strict-fields -Wall -fwarn-tabs else From git at git.haskell.org Wed Jul 8 08:28:02 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:28:02 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, fix-travis, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/ast-annotations-separate, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/attoparsec-update, wip/landmine-param-family, wip/orf-new, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/remove-cabal-dep, wip/trac-9744: Update issue tracker URL (6bdd39c) Message-ID: <20150708082802.AD61E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/attoparsec-update,wip/landmine-param-family,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/remove-cabal-dep,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/6bdd39c20a902498fbbaf298567bb837e22d581c >--------------------------------------------------------------- commit 6bdd39c20a902498fbbaf298567bb837e22d581c Author: Mateusz Kowalczyk Date: Wed May 14 14:50:25 2014 +0200 Update issue tracker URL >--------------------------------------------------------------- 6bdd39c20a902498fbbaf298567bb837e22d581c haddock.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haddock.cabal b/haddock.cabal index 6485815..0163719 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -8,7 +8,7 @@ license-file: LICENSE author: Simon Marlow, David Waern maintainer: Simon Hengel , Mateusz Kowalczyk homepage: http://www.haskell.org/haddock/ -bug-reports: http://trac.haskell.org/haddock +bug-reports: https://github.com/haskell/haddock/issues copyright: (c) Simon Marlow, David Waern category: Documentation build-type: Simple From git at git.haskell.org Wed Jul 8 08:28:04 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:28:04 +0000 (UTC) Subject: [commit: haddock] ghc-7.8, v2.14, wip/T9023, wip/pattern-synonym-sig-backport: Update issue tracker URL (92ceb34) Message-ID: <20150708082804.B8B963A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: ghc-7.8,v2.14,wip/T9023,wip/pattern-synonym-sig-backport Link : http://git.haskell.org/haddock.git/commitdiff/92ceb34bc2913c05f249fec35d331e7fd7d7a945 >--------------------------------------------------------------- commit 92ceb34bc2913c05f249fec35d331e7fd7d7a945 Author: Mateusz Kowalczyk Date: Wed May 14 14:50:25 2014 +0200 Update issue tracker URL >--------------------------------------------------------------- 92ceb34bc2913c05f249fec35d331e7fd7d7a945 haddock.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haddock.cabal b/haddock.cabal index cdcbcb4..a10be61 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -8,7 +8,7 @@ license-file: LICENSE author: Simon Marlow, David Waern maintainer: Simon Hengel , Mateusz Kowalczyk homepage: http://www.haskell.org/haddock/ -bug-reports: http://trac.haskell.org/haddock +bug-reports: https://github.com/haskell/haddock/issues copyright: (c) Simon Marlow, David Waern category: Documentation build-type: Simple From git at git.haskell.org Wed Jul 8 08:28:06 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:28:06 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, fix-travis, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/ast-annotations-separate, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/attoparsec-update, wip/landmine-param-family, wip/orf-new, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/remove-cabal-dep, wip/trac-9744: Update issue tracker URL for haddock-library (4b1f57e) Message-ID: <20150708082806.C5E813A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/attoparsec-update,wip/landmine-param-family,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/remove-cabal-dep,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/4b1f57ed262b04385138ec7244d93689a762e1a2 >--------------------------------------------------------------- commit 4b1f57ed262b04385138ec7244d93689a762e1a2 Author: Mateusz Kowalczyk Date: Wed May 14 14:53:32 2014 +0200 Update issue tracker URL for haddock-library >--------------------------------------------------------------- 4b1f57ed262b04385138ec7244d93689a762e1a2 haddock-library/haddock-library.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haddock-library/haddock-library.cabal b/haddock-library/haddock-library.cabal index 3a016c5..779f75c 100644 --- a/haddock-library/haddock-library.cabal +++ b/haddock-library/haddock-library.cabal @@ -9,7 +9,7 @@ license: BSD3 license-file: LICENSE maintainer: Simon Hengel , Mateusz Kowalczyk homepage: http://www.haskell.org/haddock/ -bug-reports: http://trac.haskell.org/haddock +bug-reports: https://github.com/haskell/haddock/issues category: Documentation build-type: Simple cabal-version: >= 1.10 From git at git.haskell.org Wed Jul 8 08:28:08 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:28:08 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, fix-travis, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/ast-annotations-separate, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/attoparsec-update, wip/landmine-param-family, wip/orf-new, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/remove-cabal-dep, wip/trac-9744: Accomodate change in PatSyn representation (57aa591) Message-ID: <20150708082808.D21F03A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/attoparsec-update,wip/landmine-param-family,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/remove-cabal-dep,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/57aa591362d7c8ba21285fccd6a958629a422091 >--------------------------------------------------------------- commit 57aa591362d7c8ba21285fccd6a958629a422091 Author: Dr. ERDI Gergo Date: Sun May 25 10:39:12 2014 +0800 Accomodate change in PatSyn representation >--------------------------------------------------------------- 57aa591362d7c8ba21285fccd6a958629a422091 src/Haddock/Convert.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Haddock/Convert.hs b/src/Haddock/Convert.hs index 1bf02e3..f7f3e2b 100644 --- a/src/Haddock/Convert.hs +++ b/src/Haddock/Convert.hs @@ -94,7 +94,7 @@ tyThingToLHsDecl t = noLoc $ case t of (synifyType ImplicitizeForAll (dataConUserType dc))) AConLike (PatSynCon ps) -> - let (_, _, (req_theta, prov_theta)) = patSynSig ps + let (_, _, req_theta, prov_theta) = patSynSig ps in SigD $ PatSynSig (synifyName ps) (fmap (synifyType WithinType) (patSynTyDetails ps)) (synifyType WithinType (patSynType ps)) From git at git.haskell.org Wed Jul 8 08:28:10 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:28:10 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, fix-travis, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/ast-annotations-separate, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/attoparsec-update, wip/landmine-param-family, wip/orf-new, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/remove-cabal-dep, wip/trac-9744: Revert "Accomodate change in PatSyn representation" (e110e6e) Message-ID: <20150708082810.DE2633A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/attoparsec-update,wip/landmine-param-family,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/remove-cabal-dep,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/e110e6e70e40eed06c06676fd2e62578da01d295 >--------------------------------------------------------------- commit e110e6e70e40eed06c06676fd2e62578da01d295 Author: Mateusz Kowalczyk Date: Thu May 29 03:15:29 2014 +0200 Revert "Accomodate change in PatSyn representation" This reverts commit 57aa591362d7c8ba21285fccd6a958629a422091. I am reverting this because I pushed it to master when it was meant to stay on a wip-branch. Sorry Gergo and everyone who had trouble due to this. >--------------------------------------------------------------- e110e6e70e40eed06c06676fd2e62578da01d295 src/Haddock/Convert.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Haddock/Convert.hs b/src/Haddock/Convert.hs index f7f3e2b..1bf02e3 100644 --- a/src/Haddock/Convert.hs +++ b/src/Haddock/Convert.hs @@ -94,7 +94,7 @@ tyThingToLHsDecl t = noLoc $ case t of (synifyType ImplicitizeForAll (dataConUserType dc))) AConLike (PatSynCon ps) -> - let (_, _, req_theta, prov_theta) = patSynSig ps + let (_, _, (req_theta, prov_theta)) = patSynSig ps in SigD $ PatSynSig (synifyName ps) (fmap (synifyType WithinType) (patSynTyDetails ps)) (synifyType WithinType (patSynType ps)) From git at git.haskell.org Wed Jul 8 08:28:12 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:28:12 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, fix-travis, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/ast-annotations-separate, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/attoparsec-update, wip/landmine-param-family, wip/orf-new, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/remove-cabal-dep, wip/trac-9744: Revert "Revert "Accomodate change in PatSyn representation"" (c4f6201) Message-ID: <20150708082812.EC4213A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/attoparsec-update,wip/landmine-param-family,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/remove-cabal-dep,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/c4f6201356b29023ecbd2f7bf1c91e5318586765 >--------------------------------------------------------------- commit c4f6201356b29023ecbd2f7bf1c91e5318586765 Author: Mateusz Kowalczyk Date: Thu May 29 03:24:11 2014 +0200 Revert "Revert "Accomodate change in PatSyn representation"" This reverts commit e110e6e70e40eed06c06676fd2e62578da01d295. Apparently as per GHC commit ac2796e6ddbd54c5762c53e2fcf29f20ea162fd5 this was actually intended. Embarrasing for me. >--------------------------------------------------------------- c4f6201356b29023ecbd2f7bf1c91e5318586765 src/Haddock/Convert.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Haddock/Convert.hs b/src/Haddock/Convert.hs index 1bf02e3..f7f3e2b 100644 --- a/src/Haddock/Convert.hs +++ b/src/Haddock/Convert.hs @@ -94,7 +94,7 @@ tyThingToLHsDecl t = noLoc $ case t of (synifyType ImplicitizeForAll (dataConUserType dc))) AConLike (PatSynCon ps) -> - let (_, _, (req_theta, prov_theta)) = patSynSig ps + let (_, _, req_theta, prov_theta) = patSynSig ps in SigD $ PatSynSig (synifyName ps) (fmap (synifyType WithinType) (patSynTyDetails ps)) (synifyType WithinType (patSynType ps)) From git at git.haskell.org Wed Jul 8 08:28:15 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:28:15 +0000 (UTC) Subject: [commit: haddock] ghc-7.8, wip/T9023, wip/pattern-synonym-sig-backport: Merge branch 'v2.14' into ghc-7.8 (24122a5) Message-ID: <20150708082815.038C23A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: ghc-7.8,wip/T9023,wip/pattern-synonym-sig-backport Link : http://git.haskell.org/haddock.git/commitdiff/24122a5e391b84284c6d6979375b509d3f15cbea >--------------------------------------------------------------- commit 24122a5e391b84284c6d6979375b509d3f15cbea Merge: 288756b 92ceb34 Author: Herbert Valerio Riedel Date: Sun Jun 1 17:55:11 2014 +0200 Merge branch 'v2.14' into ghc-7.8 (This just updates the issue tracker URL) Signed-off-by: Herbert Valerio Riedel >--------------------------------------------------------------- 24122a5e391b84284c6d6979375b509d3f15cbea haddock.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) From git at git.haskell.org Wed Jul 8 08:28:17 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:28:17 +0000 (UTC) Subject: [commit: haddock] 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/attoparsec-update,wip/landmine-param-family,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/remove-cabal-dep,wip/trac-9744: Clear up highlighting of identifiers with ‘'’s. (61f151a) Message-ID: <20150708082817.1057C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/attoparsec-update,wip/landmine-param-family,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/remove-cabal-dep,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/61f151adac04acc2fffab75f7564a390f6bf39d6 >--------------------------------------------------------------- commit 61f151adac04acc2fffab75f7564a390f6bf39d6 Author: Mateusz Kowalczyk Date: Thu Jun 5 19:49:27 2014 +0200 Clear up highlighting of identifiers with ?'?s. >--------------------------------------------------------------- 61f151adac04acc2fffab75f7564a390f6bf39d6 doc/haddock.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/haddock.xml b/doc/haddock.xml index 6f9f62e..1eaa7f0 100644 --- a/doc/haddock.xml +++ b/doc/haddock.xml @@ -1874,6 +1874,11 @@ module A where -- | I don't have to escape my apostrophes; great, isn't it? + Nothing special is needed to hyperlink identifiers which + contain apostrophes themselves: to hyperlink + foo' one would simply type + 'foo''. + For compatibility with other systems, the following alternative form of markup is accepted We chose not to use this as the primary markup for From git at git.haskell.org Wed Jul 8 08:28:19 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:28:19 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, fix-travis, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/ast-annotations-separate, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/attoparsec-update, wip/landmine-param-family, wip/orf-new, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/remove-cabal-dep, wip/trac-9744: Follow change in patSynSig (276f201) Message-ID: <20150708082819.1D3203A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/attoparsec-update,wip/landmine-param-family,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/remove-cabal-dep,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/276f201de589999690e49491089c7e7ec9cfbf3f >--------------------------------------------------------------- commit 276f201de589999690e49491089c7e7ec9cfbf3f Author: Simon Peyton Jones Date: Fri Jun 6 11:33:09 2014 +0100 Follow change in patSynSig >--------------------------------------------------------------- 276f201de589999690e49491089c7e7ec9cfbf3f src/Haddock/Convert.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Haddock/Convert.hs b/src/Haddock/Convert.hs index f7f3e2b..405bf20 100644 --- a/src/Haddock/Convert.hs +++ b/src/Haddock/Convert.hs @@ -94,10 +94,10 @@ tyThingToLHsDecl t = noLoc $ case t of (synifyType ImplicitizeForAll (dataConUserType dc))) AConLike (PatSynCon ps) -> - let (_, _, req_theta, prov_theta) = patSynSig ps + let (_, _, req_theta, prov_theta, _, res_ty) = patSynSig ps in SigD $ PatSynSig (synifyName ps) (fmap (synifyType WithinType) (patSynTyDetails ps)) - (synifyType WithinType (patSynType ps)) + (synifyType WithinType res_ty) (synifyCtx req_theta) (synifyCtx prov_theta) From git at git.haskell.org Wed Jul 8 08:28:21 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:28:21 +0000 (UTC) Subject: [commit: haddock] ghc-7.8, v2.14, wip/pattern-synonym-sig-backport: Follow change in patSynSig (e811b00) Message-ID: <20150708082821.298203A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: ghc-7.8,v2.14,wip/pattern-synonym-sig-backport Link : http://git.haskell.org/haddock.git/commitdiff/e811b00837d19340047ad83273b4aa2dc2534dd8 >--------------------------------------------------------------- commit e811b00837d19340047ad83273b4aa2dc2534dd8 Author: Simon Peyton Jones Date: Fri Jun 6 11:33:09 2014 +0100 Follow change in patSynSig Conflicts: src/Haddock/Convert.hs >--------------------------------------------------------------- e811b00837d19340047ad83273b4aa2dc2534dd8 src/Haddock/Convert.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Haddock/Convert.hs b/src/Haddock/Convert.hs index 1bf02e3..405bf20 100644 --- a/src/Haddock/Convert.hs +++ b/src/Haddock/Convert.hs @@ -94,10 +94,10 @@ tyThingToLHsDecl t = noLoc $ case t of (synifyType ImplicitizeForAll (dataConUserType dc))) AConLike (PatSynCon ps) -> - let (_, _, (req_theta, prov_theta)) = patSynSig ps + let (_, _, req_theta, prov_theta, _, res_ty) = patSynSig ps in SigD $ PatSynSig (synifyName ps) (fmap (synifyType WithinType) (patSynTyDetails ps)) - (synifyType WithinType (patSynType ps)) + (synifyType WithinType res_ty) (synifyCtx req_theta) (synifyCtx prov_theta) From git at git.haskell.org Wed Jul 8 08:28:23 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:28:23 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, fix-travis, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/ast-annotations-separate, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/attoparsec-update, wip/landmine-param-family, wip/orf-new, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/remove-cabal-dep, wip/trac-9744: Slightly update the readme. (18a5d55) Message-ID: <20150708082823.370083A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/attoparsec-update,wip/landmine-param-family,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/remove-cabal-dep,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/18a5d55f0c31fef9198ee8ed54f4f5fa8f609295 >--------------------------------------------------------------- commit 18a5d55f0c31fef9198ee8ed54f4f5fa8f609295 Author: Mateusz Kowalczyk Date: Thu Jun 12 07:24:29 2014 +0200 Slightly update the readme. Style-sheets are no longer a recent thing, dead links, old maintainers, different formats. >--------------------------------------------------------------- 18a5d55f0c31fef9198ee8ed54f4f5fa8f609295 README | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/README b/README index 9f205d3..53f84bf 100644 --- a/README +++ b/README @@ -6,13 +6,12 @@ from annotated Haskell source code. It is primary intended for documenting library interfaces, but it should be useful for any kind of Haskell code. -Like other systems ([1],[2]), Haddock lets you write documentation -annotations next to the definitions of functions and types in the -source code, in a syntax that is easy on the eye when writing the -source code (no heavyweight mark-up). The documentation generated by -Haddock is fully hyperlinked - click on a type name in a type -signature to go straight to the definition, and documentation, for -that type. +Haddock lets you write documentation annotations next to the +definitions of functions and types in the source code, in a syntax +that is easy on the eye when writing the source code (no heavyweight +mark-up). The documentation generated by Haddock is fully hyperlinked +- click on a type name in a type signature to go straight to the +definition, and documentation, for that type. Haddock understands Haskell's module system, so you can structure your code however you like without worrying that internal structure will be @@ -28,21 +27,11 @@ fact, even without any documentation annotations, Haddock can generate useful documentation from your source code. Haddock can generate documentation in multiple formats; currently HTML -is implemented, and there is partial support for generating DocBook. -The generated HTML uses stylesheets, so you need a fairly up-to-date -browser to view it properly (Mozilla, Konqueror, Opera, and IE 6 -should all be ok). +is implemented, and there is partial support for generating LaTeX and +Hoogle. Full documentation can be found in the doc/ subdirectory, in DocBook format. -Please send questions and suggestions to: - -David Waern or -Simon Marlow - - -[1] IDoc - A No Frills Haskell Interface Documentation System - http://www.cse.unsw.edu.au/~chak/haskell/idoc/ - -[2] HDoc http://www.fmi.uni-passau.de/~groessli/hdoc/ +Please create issues when you have any problems and pull requests if +you have some code. \ No newline at end of file From git at git.haskell.org Wed Jul 8 08:28:25 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:28:25 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, fix-travis, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/ast-annotations-separate, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/attoparsec-update, wip/landmine-param-family, wip/orf-new, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/remove-cabal-dep, wip/trac-9744: Update cabal files (fc16033) Message-ID: <20150708082825.44D083A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/attoparsec-update,wip/landmine-param-family,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/remove-cabal-dep,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/fc160334cbeea731301fc723d1da5577dc2e40a1 >--------------------------------------------------------------- commit fc160334cbeea731301fc723d1da5577dc2e40a1 Author: Mateusz Kowalczyk Date: Wed Jun 18 00:05:56 2014 +0200 Update cabal files Update repository urls, use subdir property for haddock-library and use a separate versioning scheme for haddock-library in preparation for release. >--------------------------------------------------------------- fc160334cbeea731301fc723d1da5577dc2e40a1 haddock-library/haddock-library.cabal | 5 +++-- haddock.cabal | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/haddock-library/haddock-library.cabal b/haddock-library/haddock-library.cabal index 779f75c..3fb5591 100644 --- a/haddock-library/haddock-library.cabal +++ b/haddock-library/haddock-library.cabal @@ -1,5 +1,5 @@ name: haddock-library -version: 2.15.0 +version: 1.0.0 synopsis: Library exposing some functionality of Haddock. description: Haddock is a documentation-generation tool for Haskell @@ -72,4 +72,5 @@ test-suite spec source-repository head type: git - location: http://git.haskell.org/haddock.git + subdir: haddock-library + location: https://github.com/haskell/haddock.git diff --git a/haddock.cabal b/haddock.cabal index 0163719..5c10656 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -234,4 +234,4 @@ test-suite latex-test source-repository head type: git - location: http://git.haskell.org/haddock.git + location: https://github.com/haskell/haddock.git From git at git.haskell.org Wed Jul 8 08:28:27 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:28:27 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, fix-travis, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/ast-annotations-separate, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/attoparsec-update, wip/landmine-param-family, wip/orf-new, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/remove-cabal-dep, wip/trac-9744: Compatibility with older versions of base and bytestring (b973784) Message-ID: <20150708082827.531913A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/attoparsec-update,wip/landmine-param-family,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/remove-cabal-dep,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/b973784c65c4d20c893b5377a7ced557d0a420cf >--------------------------------------------------------------- commit b973784c65c4d20c893b5377a7ced557d0a420cf Author: Simon Hengel Date: Wed Jun 18 11:01:18 2014 +0800 Compatibility with older versions of base and bytestring >--------------------------------------------------------------- b973784c65c4d20c893b5377a7ced557d0a420cf haddock-library/haddock-library.cabal | 1 + haddock-library/src/Documentation/Haddock/Parser.hs | 2 +- .../src/Documentation/Haddock/Parser/Util.hs | 19 ++++++++++++++++++- .../test/Documentation/Haddock/Parser/UtilSpec.hs | 2 +- 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/haddock-library/haddock-library.cabal b/haddock-library/haddock-library.cabal index 3fb5591..2dced3c 100644 --- a/haddock-library/haddock-library.cabal +++ b/haddock-library/haddock-library.cabal @@ -63,6 +63,7 @@ test-suite spec build-depends: base + , base-compat , hspec , bytestring , deepseq diff --git a/haddock-library/src/Documentation/Haddock/Parser.hs b/haddock-library/src/Documentation/Haddock/Parser.hs index 3d146d3..f059746 100644 --- a/haddock-library/src/Documentation/Haddock/Parser.hs +++ b/haddock-library/src/Documentation/Haddock/Parser.hs @@ -437,7 +437,7 @@ autoUrl = mkLink <$> url where url = mappend <$> ("http://" <|> "https://" <|> "ftp://") <*> takeWhile1 (not . isSpace) mkLink :: BS.ByteString -> DocH mod a - mkLink s = case BS.unsnoc s of + mkLink s = case unsnoc s of Just (xs, x) | x `elem` ",.!?" -> DocHyperlink (Hyperlink (decodeUtf8 xs) Nothing) <> DocString [x] _ -> DocHyperlink (Hyperlink (decodeUtf8 s) Nothing) diff --git a/haddock-library/src/Documentation/Haddock/Parser/Util.hs b/haddock-library/src/Documentation/Haddock/Parser/Util.hs index 25dba2d..ef2af14 100644 --- a/haddock-library/src/Documentation/Haddock/Parser/Util.hs +++ b/haddock-library/src/Documentation/Haddock/Parser/Util.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} -- | -- Module : Documentation.Haddock.Parser.Util -- Copyright : (c) Mateusz Kowalczyk 2013-2014, @@ -9,7 +10,14 @@ -- Portability : portable -- -- Various utility functions used by the parser. -module Documentation.Haddock.Parser.Util where +module Documentation.Haddock.Parser.Util ( + unsnoc +, strip +, takeUntil +, makeLabeled +, takeHorizontalSpace +, skipHorizontalSpace +) where import Control.Applicative import Control.Monad (mfilter) @@ -18,6 +26,15 @@ import Data.ByteString.Char8 (ByteString) import qualified Data.ByteString.Char8 as BS import Prelude hiding (takeWhile) +#if MIN_VERSION_bytestring(0,10,2) +import Data.ByteString.Char8 (unsnoc) +#else +unsnoc :: ByteString -> Maybe (ByteString, Char) +unsnoc bs + | BS.null bs = Nothing + | otherwise = Just (BS.init bs, BS.last bs) +#endif + -- | Remove all leading and trailing whitespace strip :: String -> String strip = (\f -> f . f) $ dropWhile isSpace . reverse diff --git a/haddock-library/test/Documentation/Haddock/Parser/UtilSpec.hs b/haddock-library/test/Documentation/Haddock/Parser/UtilSpec.hs index 265a4d4..a6ac49e 100644 --- a/haddock-library/test/Documentation/Haddock/Parser/UtilSpec.hs +++ b/haddock-library/test/Documentation/Haddock/Parser/UtilSpec.hs @@ -2,8 +2,8 @@ module Documentation.Haddock.Parser.UtilSpec (main, spec) where import Data.Attoparsec.ByteString.Char8 -import Data.Either import Documentation.Haddock.Parser.Util +import Data.Either.Compat (isLeft) import Test.Hspec main :: IO () From git at git.haskell.org Wed Jul 8 08:28:29 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:28:29 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, fix-travis, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/ast-annotations-separate, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/attoparsec-update, wip/landmine-param-family, wip/orf-new, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/remove-cabal-dep, wip/trac-9744: Enable travis-ci for haddock-library (7d4e156) Message-ID: <20150708082829.606033A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/attoparsec-update,wip/landmine-param-family,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/remove-cabal-dep,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/7d4e156b85a903ec35ca8a4362ee1a43ed9f3985 >--------------------------------------------------------------- commit 7d4e156b85a903ec35ca8a4362ee1a43ed9f3985 Author: Simon Hengel Date: Wed Jun 18 11:05:31 2014 +0800 Enable travis-ci for haddock-library >--------------------------------------------------------------- 7d4e156b85a903ec35ca8a4362ee1a43ed9f3985 .travis.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..2119072 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,7 @@ +language: haskell + +install: + - (cd haddock-library/ && cabal install --only-dependencies --enable-tests) + +script: + - (cd haddock-library/ && cabal configure --enable-tests --ghc-options=-Werror && cabal build && cabal test) From git at git.haskell.org Wed Jul 8 08:28:31 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:28:31 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, fix-travis, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/ast-annotations-separate, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/attoparsec-update, wip/landmine-param-family, wip/orf-new, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/remove-cabal-dep, wip/trac-9744: haddock-library: Do not depend on haddock-library in test suite (05db136) Message-ID: <20150708082831.6CC1A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/attoparsec-update,wip/landmine-param-family,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/remove-cabal-dep,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/05db136e9b002f0c7948c16274d3887d0ee52aa4 >--------------------------------------------------------------- commit 05db136e9b002f0c7948c16274d3887d0ee52aa4 Author: Simon Hengel Date: Wed Jun 18 11:07:30 2014 +0800 haddock-library: Do not depend on haddock-library in test suite I think you either add src to hs-source-dirs or the library to build-depends. But doing both does not make sense (AFAICT). >--------------------------------------------------------------- 05db136e9b002f0c7948c16274d3887d0ee52aa4 haddock-library/haddock-library.cabal | 2 -- 1 file changed, 2 deletions(-) diff --git a/haddock-library/haddock-library.cabal b/haddock-library/haddock-library.cabal index 2dced3c..bc77b72 100644 --- a/haddock-library/haddock-library.cabal +++ b/haddock-library/haddock-library.cabal @@ -68,8 +68,6 @@ test-suite spec , bytestring , deepseq , QuickCheck == 2.* - , haddock-library - source-repository head type: git From git at git.haskell.org Wed Jul 8 08:28:33 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:28:33 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, fix-travis, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/ast-annotations-separate, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/attoparsec-update, wip/landmine-param-family, wip/orf-new, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/remove-cabal-dep, wip/trac-9744: haddock-library: Use -Wall for specs (ab33b48) Message-ID: <20150708082833.76C5B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/attoparsec-update,wip/landmine-param-family,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/remove-cabal-dep,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/ab33b488f4d0559bf4b36287a86e4976602279be >--------------------------------------------------------------- commit ab33b488f4d0559bf4b36287a86e4976602279be Author: Simon Hengel Date: Wed Jun 18 11:16:28 2014 +0800 haddock-library: Use -Wall for specs >--------------------------------------------------------------- ab33b488f4d0559bf4b36287a86e4976602279be haddock-library/haddock-library.cabal | 2 ++ 1 file changed, 2 insertions(+) diff --git a/haddock-library/haddock-library.cabal b/haddock-library/haddock-library.cabal index bc77b72..8567312 100644 --- a/haddock-library/haddock-library.cabal +++ b/haddock-library/haddock-library.cabal @@ -53,6 +53,8 @@ test-suite spec , src , vendor/attoparsec-0.10.4.0 + ghc-options: -Wall + cpp-options: -DTEST From git at git.haskell.org Wed Jul 8 08:28:35 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:28:35 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, fix-travis, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/ast-annotations-separate, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/attoparsec-update, wip/landmine-param-family, wip/orf-new, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/remove-cabal-dep, wip/trac-9744: Use Travis with multiple GHC versions (fcad1df) Message-ID: <20150708082835.82E953A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/attoparsec-update,wip/landmine-param-family,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/remove-cabal-dep,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/fcad1df036670eeecbc78129e166d9026a062a0c >--------------------------------------------------------------- commit fcad1df036670eeecbc78129e166d9026a062a0c Author: Mateusz Kowalczyk Date: Wed Jun 18 06:30:37 2014 +0200 Use Travis with multiple GHC versions When using HEAD, we build haddock-library directly from repository as a dependency (and thanks to --enable-tests, the tests get ran anyway). In all other cases, we manually run the tests on haddock-library only and don't test the main project. >--------------------------------------------------------------- fcad1df036670eeecbc78129e166d9026a062a0c .travis.yml | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2119072..ab626be 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,33 @@ language: haskell +env: + - GHCVER=7.6.3 + - GHCVER=7.8.1 + - GHCVER=7.8.2 + - GHCVER=7.8.3 + - GHCVER=head + +before_install: + - sudo add-apt-repository -y ppa:hvr/ghc + - sudo apt-get update + - sudo apt-get install cabal-install-1.20 ghc-$GHCVER + - export PATH=/opt/ghc/$GHCVER/bin:$PATH + install: - - (cd haddock-library/ && cabal install --only-dependencies --enable-tests) + - case "$GHCVER" in + "head") (cd haddock-library/ && cabal install --enable-tests + && cd .. && cabal install --only-dependencies --enable-tests) ;; + *) + (cd haddock-library/ && cabal install --only-dependencies --enable-tests && cd ..) ;; + + esac script: - - (cd haddock-library/ && cabal configure --enable-tests --ghc-options=-Werror && cabal build && cabal test) + # Yes, in case of HEAD we do end up building haddock-library twice + # but we want to see the test results. + - (cd haddock-library/ && cabal configure --enable-tests --ghc-options=-Werror + && cabal build && cabal test && cabal install && cd ..) + - case "$GHCVER" in + "head") (cabal configure --enable-tests --ghc-options=-Werror && cabal build && cabal test) ;; + *) ;; + esac \ No newline at end of file From git at git.haskell.org Wed Jul 8 08:28:37 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:28:37 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, fix-travis, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/ast-annotations-separate, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/attoparsec-update, wip/landmine-param-family, wip/orf-new, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/remove-cabal-dep, wip/trac-9744: Comment improvements + few words in cabal file (89448ef) Message-ID: <20150708082837.8EEDE3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/attoparsec-update,wip/landmine-param-family,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/remove-cabal-dep,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/89448ef6c7ef3367f210562306cfa95c95d77250 >--------------------------------------------------------------- commit 89448ef6c7ef3367f210562306cfa95c95d77250 Author: Mateusz Kowalczyk Date: Wed Jun 18 07:44:00 2014 +0200 Comment improvements + few words in cabal file >--------------------------------------------------------------- 89448ef6c7ef3367f210562306cfa95c95d77250 haddock-library/haddock-library.cabal | 6 ++-- .../src/Documentation/Haddock/Parser.hs | 37 ++++++++++++++++------ 2 files changed, 32 insertions(+), 11 deletions(-) diff --git a/haddock-library/haddock-library.cabal b/haddock-library/haddock-library.cabal index 8567312..20e0e94 100644 --- a/haddock-library/haddock-library.cabal +++ b/haddock-library/haddock-library.cabal @@ -1,10 +1,12 @@ name: haddock-library version: 1.0.0 synopsis: Library exposing some functionality of Haddock. - description: Haddock is a documentation-generation tool for Haskell libraries. These modules expose some functionality of it - without pulling in the GHC dependency. + without pulling in the GHC dependency. Please note that the + API is likely to change so specify upper bounds in your + project if you can't release often. For interacting with Haddock + itself, see the ?haddock? package. license: BSD3 license-file: LICENSE maintainer: Simon Hengel , Mateusz Kowalczyk diff --git a/haddock-library/src/Documentation/Haddock/Parser.hs b/haddock-library/src/Documentation/Haddock/Parser.hs index f059746..b717884 100644 --- a/haddock-library/src/Documentation/Haddock/Parser.hs +++ b/haddock-library/src/Documentation/Haddock/Parser.hs @@ -13,7 +13,12 @@ -- Maintainer : haddock at projects.haskell.org -- Stability : experimental -- Portability : portable - +-- +-- Parser used for Haddock comments. For external users of this +-- library, the most commonly used combination of functions is going +-- to be +-- +-- @'toRegular' . 'parseParas'@ module Documentation.Haddock.Parser ( parseString, parseParas , overIdentifier, toRegular, Identifier ) where @@ -97,15 +102,16 @@ parseStringBS :: BS.ByteString -> DocH mod Identifier parseStringBS = parse p where p :: Parser (DocH mod Identifier) - p = mconcat <$> many (monospace <|> anchor <|> identifier - <|> moduleName <|> picture <|> hyperlink <|> autoUrl <|> bold - <|> emphasis <|> encodedChar <|> string' <|> skipSpecialChar) + p = mconcat <$> many (monospace <|> anchor <|> identifier <|> moduleName + <|> picture <|> hyperlink <|> autoUrl <|> bold + <|> emphasis <|> encodedChar <|> string' + <|> skipSpecialChar) -- | Parses and processes -- -- --- >>> parseOnly encodedChar "ABC" --- Right (DocString "ABC") +-- >>> parseOnly encodedChar "A" +-- Right (DocString "A") encodedChar :: Parser (DocH mod a) encodedChar = "&#" *> c <* ";" where @@ -183,7 +189,7 @@ moduleName = DocModule <$> (char '"' *> modid <* char '"') modid = intercalate "." <$> conid `sepBy1` "." conid = (:) <$> satisfy isAsciiUpper - -- NOTE: According to Haskell 2010 we shouldd actually only + -- NOTE: According to Haskell 2010 we should actually only -- accept {small | large | digit | ' } here. But as we can't -- match on unicode characters, this is currently not possible. <*> (decodeUtf8 <$> takeWhile (`notElem` " .&[{}(=*)+]!#|@/;,^?\"\n")) @@ -192,9 +198,9 @@ moduleName = DocModule <$> (char '"' *> modid <* char '"') -- a title for the picture. -- -- >>> parseOnly picture "<>" --- Right (DocPic (Picture "hello.png" Nothing)) +-- Right (DocPic (Picture {pictureUri = "hello.png", pictureTitle = Nothing})) -- >>> parseOnly picture "<>" --- Right (DocPic (Picture "hello.png" (Just "world"))) +-- Right (DocPic (Picture {pictureUri = "hello.png", pictureTitle = Just "world"})) picture :: Parser (DocH mod a) picture = DocPic . makeLabeled Picture . decodeUtf8 <$> disallowNewline ("<<" *> takeUntil ">>") @@ -205,6 +211,8 @@ paragraph = examples <|> skipSpace *> (list <|> birdtracks <|> codeblock <|> property <|> header <|> textParagraph) +-- | Headers inside the comment denoted with @=@ signs, up to 6 levels +-- deep. header :: Parser (DocH mod Identifier) header = do let psers = map (string . encodeUtf8 . concat . flip replicate "=") [6, 5 .. 1] @@ -330,6 +338,14 @@ takeNonEmptyLine :: Parser String takeNonEmptyLine = do (++ "\n") . decodeUtf8 <$> (takeWhile1 (/= '\n') >>= nonSpace) <* "\n" +-- | Blocks of text of the form: +-- +-- @ +-- > foo +-- > bar +-- > baz +-- @ +-- birdtracks :: Parser (DocH mod a) birdtracks = DocCodeBlock . DocString . intercalate "\n" . stripSpace <$> many1 line where @@ -427,11 +443,14 @@ codeblock = | isNewline && isSpace c = Just isNewline | otherwise = Just $ c == '\n' +-- | Parses links that were specifically marked as such. hyperlink :: Parser (DocH mod a) hyperlink = DocHyperlink . makeLabeled Hyperlink . decodeUtf8 <$> disallowNewline ("<" *> takeUntil ">") <|> autoUrl +-- | Looks for URL-like things to automatically hyperlink even if they +-- weren't marked as links. autoUrl :: Parser (DocH mod a) autoUrl = mkLink <$> url where From git at git.haskell.org Wed Jul 8 08:28:39 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:28:39 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, fix-travis, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/ast-annotations-separate, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/attoparsec-update, wip/landmine-param-family, wip/orf-new, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/remove-cabal-dep, wip/trac-9744: Use doctest to check examples in documentation (1bbda54) Message-ID: <20150708082839.9FA763A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/attoparsec-update,wip/landmine-param-family,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/remove-cabal-dep,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/1bbda54a9cf1c8db93c5ef226c2a94ed38a842ff >--------------------------------------------------------------- commit 1bbda54a9cf1c8db93c5ef226c2a94ed38a842ff Author: Simon Hengel Date: Wed Jun 18 13:50:34 2014 +0800 Use doctest to check examples in documentation >--------------------------------------------------------------- 1bbda54a9cf1c8db93c5ef226c2a94ed38a842ff haddock-library/haddock-library.cabal | 8 ++++++++ haddock-library/src/Documentation/Haddock/Parser.hs | 3 +++ haddock-library/test/doctests.hs | 11 +++++++++++ 3 files changed, 22 insertions(+) diff --git a/haddock-library/haddock-library.cabal b/haddock-library/haddock-library.cabal index 20e0e94..8af94a4 100644 --- a/haddock-library/haddock-library.cabal +++ b/haddock-library/haddock-library.cabal @@ -73,6 +73,14 @@ test-suite spec , deepseq , QuickCheck == 2.* +test-suite doctests + type: exitcode-stdio-1.0 + default-language: Haskell2010 + hs-source-dirs: test + main-is: doctests.hs + ghc-options: -threaded + build-depends: base, doctest >= 0.8 + source-repository head type: git subdir: haddock-library diff --git a/haddock-library/src/Documentation/Haddock/Parser.hs b/haddock-library/src/Documentation/Haddock/Parser.hs index b717884..c84217b 100644 --- a/haddock-library/src/Documentation/Haddock/Parser.hs +++ b/haddock-library/src/Documentation/Haddock/Parser.hs @@ -38,6 +38,9 @@ import Documentation.Haddock.Types import Documentation.Haddock.Utf8 import Prelude hiding (takeWhile) +-- $setup +-- >>> :set -XOverloadedStrings + -- | Identifier string surrounded with opening and closing quotes/backticks. type Identifier = (Char, String, Char) diff --git a/haddock-library/test/doctests.hs b/haddock-library/test/doctests.hs new file mode 100644 index 0000000..e4f9385 --- /dev/null +++ b/haddock-library/test/doctests.hs @@ -0,0 +1,11 @@ +module Main where + +import Test.DocTest + +main :: IO () +main = doctest [ + "-isrc" + , "-ivendor/attoparsec-0.10.4.0" + , "-optP-include", "-optPdist/build/autogen/cabal_macros.h" + , "src/Documentation/Haddock/Parser.hs" + ] From git at git.haskell.org Wed Jul 8 08:28:41 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:28:41 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, fix-travis, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/ast-annotations-separate, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/attoparsec-update, wip/landmine-param-family, wip/orf-new, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/remove-cabal-dep, wip/trac-9744: Remove doctest dependency (8857e50) Message-ID: <20150708082841.AA0233A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/attoparsec-update,wip/landmine-param-family,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/remove-cabal-dep,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/8857e5071f0c0eb8398b06d63104bbe844d3df25 >--------------------------------------------------------------- commit 8857e5071f0c0eb8398b06d63104bbe844d3df25 Author: Simon Hengel Date: Wed Jun 18 14:16:48 2014 +0800 Remove doctest dependency (so that we can use haddock-library with doctest) >--------------------------------------------------------------- 8857e5071f0c0eb8398b06d63104bbe844d3df25 .travis.yml | 5 +++-- haddock-library/haddock-library.cabal | 8 -------- haddock-library/test/doctests.hs | 11 ----------- 3 files changed, 3 insertions(+), 21 deletions(-) diff --git a/.travis.yml b/.travis.yml index ab626be..f446081 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,7 @@ install: "head") (cd haddock-library/ && cabal install --enable-tests && cd .. && cabal install --only-dependencies --enable-tests) ;; *) - (cd haddock-library/ && cabal install --only-dependencies --enable-tests && cd ..) ;; + (cd haddock-library/ && cabal install --only-dependencies --enable-tests) ;; esac @@ -26,7 +26,8 @@ script: # Yes, in case of HEAD we do end up building haddock-library twice # but we want to see the test results. - (cd haddock-library/ && cabal configure --enable-tests --ghc-options=-Werror - && cabal build && cabal test && cabal install && cd ..) + && cabal build && cabal test && cabal install && cabal install doctest + && doctest -isrc -ivendor/attoparsec-0.10.4.0 -optP-include -optPdist/build/autogen/cabal_macros.h src/Documentation/Haddock/Parser.hs) - case "$GHCVER" in "head") (cabal configure --enable-tests --ghc-options=-Werror && cabal build && cabal test) ;; *) ;; diff --git a/haddock-library/haddock-library.cabal b/haddock-library/haddock-library.cabal index 8af94a4..20e0e94 100644 --- a/haddock-library/haddock-library.cabal +++ b/haddock-library/haddock-library.cabal @@ -73,14 +73,6 @@ test-suite spec , deepseq , QuickCheck == 2.* -test-suite doctests - type: exitcode-stdio-1.0 - default-language: Haskell2010 - hs-source-dirs: test - main-is: doctests.hs - ghc-options: -threaded - build-depends: base, doctest >= 0.8 - source-repository head type: git subdir: haddock-library diff --git a/haddock-library/test/doctests.hs b/haddock-library/test/doctests.hs deleted file mode 100644 index e4f9385..0000000 --- a/haddock-library/test/doctests.hs +++ /dev/null @@ -1,11 +0,0 @@ -module Main where - -import Test.DocTest - -main :: IO () -main = doctest [ - "-isrc" - , "-ivendor/attoparsec-0.10.4.0" - , "-optP-include", "-optPdist/build/autogen/cabal_macros.h" - , "src/Documentation/Haddock/Parser.hs" - ] From git at git.haskell.org Wed Jul 8 08:28:43 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:28:43 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, fix-travis, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/ast-annotations-separate, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/attoparsec-update, wip/landmine-param-family, wip/orf-new, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/remove-cabal-dep, wip/trac-9744: Travis tweaks (ca2099a) Message-ID: <20150708082843.B42193A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/attoparsec-update,wip/landmine-param-family,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/remove-cabal-dep,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/ca2099a1b69d89e073d3291261f58cf3a8650434 >--------------------------------------------------------------- commit ca2099a1b69d89e073d3291261f58cf3a8650434 Author: Mateusz Kowalczyk Date: Wed Jun 18 08:40:37 2014 +0200 Travis tweaks >--------------------------------------------------------------- ca2099a1b69d89e073d3291261f58cf3a8650434 .travis.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f446081..1fe73b6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,10 @@ language: haskell +notifications: + email: + on_success: never + on_failure: change + env: - GHCVER=7.6.3 - GHCVER=7.8.1 @@ -10,7 +15,6 @@ env: before_install: - sudo add-apt-repository -y ppa:hvr/ghc - sudo apt-get update - - sudo apt-get install cabal-install-1.20 ghc-$GHCVER - export PATH=/opt/ghc/$GHCVER/bin:$PATH install: From git at git.haskell.org Wed Jul 8 08:28:45 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:28:45 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, fix-travis, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/ast-annotations-separate, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/attoparsec-update, wip/landmine-param-family, wip/orf-new, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/remove-cabal-dep, wip/trac-9744: Don't actually forget to install specified GHC. (dd3fee8) Message-ID: <20150708082845.BEB603A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/attoparsec-update,wip/landmine-param-family,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/remove-cabal-dep,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/dd3fee863579c88e49aa2b955cbc58e3c094ae4d >--------------------------------------------------------------- commit dd3fee863579c88e49aa2b955cbc58e3c094ae4d Author: Mateusz Kowalczyk Date: Wed Jun 18 08:58:43 2014 +0200 Don't actually forget to install specified GHC. >--------------------------------------------------------------- dd3fee863579c88e49aa2b955cbc58e3c094ae4d .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 1fe73b6..cd98e40 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,6 +15,7 @@ env: before_install: - sudo add-apt-repository -y ppa:hvr/ghc - sudo apt-get update + - sudo apt-get install ghc-$GHCVER - export PATH=/opt/ghc/$GHCVER/bin:$PATH install: From git at git.haskell.org Wed Jul 8 08:28:47 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:28:47 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, fix-travis, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/ast-annotations-separate, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/attoparsec-update, wip/landmine-param-family, wip/orf-new, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/remove-cabal-dep, wip/trac-9744: Removed reliance on LambdaCase (which breaks build with ghc 7.4). (e3f52bf) Message-ID: <20150708082847.C96523A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/attoparsec-update,wip/landmine-param-family,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/remove-cabal-dep,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/e3f52bff799e811d8b8a411be091a74979edc5fb >--------------------------------------------------------------- commit e3f52bff799e811d8b8a411be091a74979edc5fb Author: John MacFarlane Date: Wed Jun 18 10:43:57 2014 -0700 Removed reliance on LambdaCase (which breaks build with ghc 7.4). >--------------------------------------------------------------- e3f52bff799e811d8b8a411be091a74979edc5fb haddock-library/src/Documentation/Haddock/Parser.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/haddock-library/src/Documentation/Haddock/Parser.hs b/haddock-library/src/Documentation/Haddock/Parser.hs index c84217b..860271e 100644 --- a/haddock-library/src/Documentation/Haddock/Parser.hs +++ b/haddock-library/src/Documentation/Haddock/Parser.hs @@ -3,7 +3,6 @@ {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE IncoherentInstances #-} -{-# LANGUAGE LambdaCase #-} -- | -- Module : Documentation.Haddock.Parser -- Copyright : (c) Mateusz Kowalczyk 2013-2014, @@ -431,8 +430,9 @@ codeblock = -- and we lose information about whether the last line belongs to @ or to -- text which we need to decide whether we actually want to be dropping -- anything at all. - splitByNl = unfoldr (\case '\n':s -> Just (span (/= '\n') s) - _ -> Nothing) + splitByNl = unfoldr (\x -> case x of + '\n':s -> Just (span (/= '\n') s) + _ -> Nothing) . ('\n' :) dropSpace "" = Just "" From git at git.haskell.org Wed Jul 8 08:28:49 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:28:49 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, fix-travis, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/ast-annotations-separate, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/attoparsec-update, wip/landmine-param-family, wip/orf-new, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/remove-cabal-dep, wip/trac-9744: Fixed haddock warnings. (f656de2) Message-ID: <20150708082849.D51D03A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/attoparsec-update,wip/landmine-param-family,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/remove-cabal-dep,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/f656de23cc8b73a08264886dfb91060f936f0d70 >--------------------------------------------------------------- commit f656de23cc8b73a08264886dfb91060f936f0d70 Author: John MacFarlane Date: Wed Jun 18 10:54:56 2014 -0700 Fixed haddock warnings. >--------------------------------------------------------------- f656de23cc8b73a08264886dfb91060f936f0d70 haddock-library/src/Documentation/Haddock/Parser.hs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/haddock-library/src/Documentation/Haddock/Parser.hs b/haddock-library/src/Documentation/Haddock/Parser.hs index 860271e..37bf4ca 100644 --- a/haddock-library/src/Documentation/Haddock/Parser.hs +++ b/haddock-library/src/Documentation/Haddock/Parser.hs @@ -342,11 +342,9 @@ takeNonEmptyLine = do -- | Blocks of text of the form: -- --- @ --- > foo --- > bar --- > baz --- @ +-- >> foo +-- >> bar +-- >> baz -- birdtracks :: Parser (DocH mod a) birdtracks = DocCodeBlock . DocString . intercalate "\n" . stripSpace <$> many1 line @@ -409,7 +407,7 @@ property :: Parser (DocH mod a) property = DocProperty . strip . decodeUtf8 <$> ("prop>" *> takeWhile1 (/= '\n')) -- | --- Paragraph level codeblock. Anything between the two delimiting @ is parsed +-- Paragraph level codeblock. Anything between the two delimiting \@ is parsed -- for markup. codeblock :: Parser (DocH mod Identifier) codeblock = From git at git.haskell.org Wed Jul 8 08:28:51 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:28:51 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, fix-travis, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/ast-annotations-separate, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/attoparsec-update, wip/landmine-param-family, wip/orf-new, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/remove-cabal-dep, wip/trac-9744: Update Travis, bump version (5412c26) Message-ID: <20150708082851.DF7473A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/attoparsec-update,wip/landmine-param-family,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/remove-cabal-dep,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/5412c262f403e52be45d607b34eb3a5806ea2a76 >--------------------------------------------------------------- commit 5412c262f403e52be45d607b34eb3a5806ea2a76 Author: Mateusz Kowalczyk Date: Thu Jun 19 01:19:19 2014 +0200 Update Travis, bump version >--------------------------------------------------------------- 5412c262f403e52be45d607b34eb3a5806ea2a76 .travis.yml | 2 ++ haddock-library/haddock-library.cabal | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index cd98e40..4561411 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,8 @@ notifications: on_failure: change env: + - GHCVER=7.4.1 + - GHCVER=7.4.2 - GHCVER=7.6.3 - GHCVER=7.8.1 - GHCVER=7.8.2 diff --git a/haddock-library/haddock-library.cabal b/haddock-library/haddock-library.cabal index 20e0e94..2ea3307 100644 --- a/haddock-library/haddock-library.cabal +++ b/haddock-library/haddock-library.cabal @@ -1,5 +1,5 @@ name: haddock-library -version: 1.0.0 +version: 1.0.1 synopsis: Library exposing some functionality of Haddock. description: Haddock is a documentation-generation tool for Haskell libraries. These modules expose some functionality of it From git at git.haskell.org Wed Jul 8 08:28:53 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:28:53 +0000 (UTC) Subject: [commit: haddock] ghc-7.8, wip/T9023, wip/pattern-synonym-sig-backport: Accomodate change in PatSyn representation (e56a803) Message-ID: <20150708082853.EAF303A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: ghc-7.8,wip/T9023,wip/pattern-synonym-sig-backport Link : http://git.haskell.org/haddock.git/commitdiff/e56a8037c04a32922cb0951c66f64ecc6ebfecb3 >--------------------------------------------------------------- commit e56a8037c04a32922cb0951c66f64ecc6ebfecb3 Author: Dr. ERDI Gergo Date: Sun May 25 10:39:12 2014 +0800 Accomodate change in PatSyn representation (cherry picked from commit 57aa591362d7c8ba21285fccd6a958629a422091) >--------------------------------------------------------------- e56a8037c04a32922cb0951c66f64ecc6ebfecb3 src/Haddock/Convert.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Haddock/Convert.hs b/src/Haddock/Convert.hs index 1bf02e3..f7f3e2b 100644 --- a/src/Haddock/Convert.hs +++ b/src/Haddock/Convert.hs @@ -94,7 +94,7 @@ tyThingToLHsDecl t = noLoc $ case t of (synifyType ImplicitizeForAll (dataConUserType dc))) AConLike (PatSynCon ps) -> - let (_, _, (req_theta, prov_theta)) = patSynSig ps + let (_, _, req_theta, prov_theta) = patSynSig ps in SigD $ PatSynSig (synifyName ps) (fmap (synifyType WithinType) (patSynTyDetails ps)) (synifyType WithinType (patSynType ps)) From git at git.haskell.org Wed Jul 8 08:28:56 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:28:56 +0000 (UTC) Subject: [commit: haddock] ghc-7.8, wip/pattern-synonym-sig-backport: Revert "Accomodate change in PatSyn representation" (87a6eed) Message-ID: <20150708082856.00EBC3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: ghc-7.8,wip/pattern-synonym-sig-backport Link : http://git.haskell.org/haddock.git/commitdiff/87a6eed7f0d4e646c424a6c0a94b19f2c3d56666 >--------------------------------------------------------------- commit 87a6eed7f0d4e646c424a6c0a94b19f2c3d56666 Author: Austin Seipp Date: Mon Jun 23 04:25:01 2014 -0500 Revert "Accomodate change in PatSyn representation" This reverts commit e56a8037c04a32922cb0951c66f64ecc6ebfecb3. >--------------------------------------------------------------- 87a6eed7f0d4e646c424a6c0a94b19f2c3d56666 src/Haddock/Convert.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Haddock/Convert.hs b/src/Haddock/Convert.hs index f7f3e2b..1bf02e3 100644 --- a/src/Haddock/Convert.hs +++ b/src/Haddock/Convert.hs @@ -94,7 +94,7 @@ tyThingToLHsDecl t = noLoc $ case t of (synifyType ImplicitizeForAll (dataConUserType dc))) AConLike (PatSynCon ps) -> - let (_, _, req_theta, prov_theta) = patSynSig ps + let (_, _, (req_theta, prov_theta)) = patSynSig ps in SigD $ PatSynSig (synifyName ps) (fmap (synifyType WithinType) (patSynTyDetails ps)) (synifyType WithinType (patSynType ps)) From git at git.haskell.org Wed Jul 8 08:28:58 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:28:58 +0000 (UTC) Subject: [commit: haddock] wip/T9023: Follow change in patSynSig (e04e118) Message-ID: <20150708082858.0C0DF3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/T9023 Link : http://git.haskell.org/haddock.git/commitdiff/e04e1183698d1bab42d72ccff7314652ab4f8f44 >--------------------------------------------------------------- commit e04e1183698d1bab42d72ccff7314652ab4f8f44 Author: Simon Peyton Jones Date: Fri Jun 6 11:33:09 2014 +0100 Follow change in patSynSig >--------------------------------------------------------------- e04e1183698d1bab42d72ccff7314652ab4f8f44 src/Haddock/Convert.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Haddock/Convert.hs b/src/Haddock/Convert.hs index f7f3e2b..405bf20 100644 --- a/src/Haddock/Convert.hs +++ b/src/Haddock/Convert.hs @@ -94,10 +94,10 @@ tyThingToLHsDecl t = noLoc $ case t of (synifyType ImplicitizeForAll (dataConUserType dc))) AConLike (PatSynCon ps) -> - let (_, _, req_theta, prov_theta) = patSynSig ps + let (_, _, req_theta, prov_theta, _, res_ty) = patSynSig ps in SigD $ PatSynSig (synifyName ps) (fmap (synifyType WithinType) (patSynTyDetails ps)) - (synifyType WithinType (patSynType ps)) + (synifyType WithinType res_ty) (synifyCtx req_theta) (synifyCtx prov_theta) From git at git.haskell.org Wed Jul 8 08:29:00 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:29:00 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, fix-travis, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/ast-annotations-separate, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/attoparsec-update, wip/landmine-param-family, wip/orf-new, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/remove-cabal-dep, wip/trac-9744: Fix anchors. Closes #308. (5260671) Message-ID: <20150708082900.29A733A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/attoparsec-update,wip/landmine-param-family,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/remove-cabal-dep,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/526067188c056a5d73e7e44671ca98baf12d666b >--------------------------------------------------------------- commit 526067188c056a5d73e7e44671ca98baf12d666b Author: Mateusz Kowalczyk Date: Wed Jun 25 10:01:55 2014 +0200 Fix anchors. Closes #308. >--------------------------------------------------------------- 526067188c056a5d73e7e44671ca98baf12d666b CHANGES | 2 + doc/haddock.xml | 7 +++- .../src/Documentation/Haddock/Parser.hs | 11 ++++-- .../test/Documentation/Haddock/ParserSpec.hs | 13 +++++++ html-test/ref/{Bug201.html => Bug308.html} | 45 +++++++++++++--------- .../{Hyperlinks.html => Bug308CrossModule.html} | 36 +++++++++-------- html-test/src/Bug308.hs | 21 ++++++++++ html-test/src/Bug308CrossModule.hs | 17 ++++++++ src/Haddock/Backends/Xhtml/DocMarkup.hs | 7 +++- 9 files changed, 119 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 526067188c056a5d73e7e44671ca98baf12d666b From git at git.haskell.org Wed Jul 8 08:29:02 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:29:02 +0000 (UTC) Subject: [commit: haddock] ghc-7.8, v2.14, wip/pattern-synonym-sig-backport: Fix anchors. Closes #308. (9427cb0) Message-ID: <20150708082902.4BFE33A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: ghc-7.8,v2.14,wip/pattern-synonym-sig-backport Link : http://git.haskell.org/haddock.git/commitdiff/9427cb0aa7e80420a07b8792fc6d6cdb6610a03e >--------------------------------------------------------------- commit 9427cb0aa7e80420a07b8792fc6d6cdb6610a03e Author: Mateusz Kowalczyk Date: Wed Jun 25 10:18:57 2014 +0200 Fix anchors. Closes #308. >--------------------------------------------------------------- 9427cb0aa7e80420a07b8792fc6d6cdb6610a03e CHANGES | 2 + doc/haddock.xml | 8 +++- html-test/ref/{Bug201.html => Bug308.html} | 47 +++++++++++++--------- .../{Hyperlinks.html => Bug308CrossModule.html} | 38 +++++++++-------- html-test/src/Bug308.hs | 21 ++++++++++ html-test/src/Bug308CrossModule.hs | 17 ++++++++ src/Haddock/Backends/Xhtml/DocMarkup.hs | 7 +++- src/Haddock/Parser.hs | 11 +++-- test/Haddock/ParserSpec.hs | 13 ++++++ 9 files changed, 122 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 9427cb0aa7e80420a07b8792fc6d6cdb6610a03e From git at git.haskell.org Wed Jul 8 08:29:04 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:29:04 +0000 (UTC) Subject: [commit: haddock] ghc-7.8, v2.14, wip/pattern-synonym-sig-backport: Revert "Follow change in patSynSig" (32c6be7) Message-ID: <20150708082904.58B6A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: ghc-7.8,v2.14,wip/pattern-synonym-sig-backport Link : http://git.haskell.org/haddock.git/commitdiff/32c6be75514af7dd0093d9b83cd3d720dc342165 >--------------------------------------------------------------- commit 32c6be75514af7dd0093d9b83cd3d720dc342165 Author: Herbert Valerio Riedel Date: Wed Jun 25 11:48:20 2014 +0200 Revert "Follow change in patSynSig" This reverts commit e811b00837d19340047ad83273b4aa2dc2534dd8. since the respective change isn't in GHC 7.8.3 yet >--------------------------------------------------------------- 32c6be75514af7dd0093d9b83cd3d720dc342165 src/Haddock/Convert.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Haddock/Convert.hs b/src/Haddock/Convert.hs index 405bf20..1bf02e3 100644 --- a/src/Haddock/Convert.hs +++ b/src/Haddock/Convert.hs @@ -94,10 +94,10 @@ tyThingToLHsDecl t = noLoc $ case t of (synifyType ImplicitizeForAll (dataConUserType dc))) AConLike (PatSynCon ps) -> - let (_, _, req_theta, prov_theta, _, res_ty) = patSynSig ps + let (_, _, (req_theta, prov_theta)) = patSynSig ps in SigD $ PatSynSig (synifyName ps) (fmap (synifyType WithinType) (patSynTyDetails ps)) - (synifyType WithinType res_ty) + (synifyType WithinType (patSynType ps)) (synifyCtx req_theta) (synifyCtx prov_theta) From git at git.haskell.org Wed Jul 8 08:29:06 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:29:06 +0000 (UTC) Subject: [commit: haddock] ghc-7.8, wip/pattern-synonym-sig-backport: Merge branch 'v2.14' into ghc-7.8 (aaa00e8) Message-ID: <20150708082906.6F4533A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: ghc-7.8,wip/pattern-synonym-sig-backport Link : http://git.haskell.org/haddock.git/commitdiff/aaa00e86b224125aaa2d7d16bddb78c75103bff4 >--------------------------------------------------------------- commit aaa00e86b224125aaa2d7d16bddb78c75103bff4 Merge: 87a6eed 32c6be7 Author: Herbert Valerio Riedel Date: Wed Jun 25 11:49:34 2014 +0200 Merge branch 'v2.14' into ghc-7.8 >--------------------------------------------------------------- aaa00e86b224125aaa2d7d16bddb78c75103bff4 CHANGES | 2 + doc/haddock.xml | 8 +++- html-test/ref/{Bug201.html => Bug308.html} | 47 +++++++++++++--------- .../{Hyperlinks.html => Bug308CrossModule.html} | 38 +++++++++-------- html-test/src/Bug308.hs | 21 ++++++++++ html-test/src/Bug308CrossModule.hs | 17 ++++++++ src/Haddock/Backends/Xhtml/DocMarkup.hs | 7 +++- src/Haddock/Parser.hs | 11 +++-- test/Haddock/ParserSpec.hs | 13 ++++++ 9 files changed, 122 insertions(+), 42 deletions(-) From git at git.haskell.org Wed Jul 8 08:29:10 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:29:10 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, fix-travis, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/ast-annotations-separate, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/attoparsec-update, wip/landmine-param-family, wip/orf-new, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/remove-cabal-dep, wip/trac-9744: Don't mangle append order for nested lists. (f5be842) Message-ID: <20150708082910.8BBA73A301@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/attoparsec-update,wip/landmine-param-family,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/remove-cabal-dep,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/f5be8427d95217f4efd723575a79f8699b33d003 >--------------------------------------------------------------- commit f5be8427d95217f4efd723575a79f8699b33d003 Author: Mateusz Kowalczyk Date: Wed Jun 25 15:17:20 2014 +0200 Don't mangle append order for nested lists. The benefit of this is that the ?top-level? element of such lists is properly wrapped in

tags so any CSS working with these will be applied properly. It also just makes more sense. Pointed out at jgm/pandoc#1346. >--------------------------------------------------------------- f5be8427d95217f4efd723575a79f8699b33d003 CHANGES | 2 + .../src/Documentation/Haddock/Parser.hs | 16 +------ .../test/Documentation/Haddock/ParserSpec.hs | 16 +++---- html-test/ref/Nesting.html | 54 ++++++++++++++++------ 4 files changed, 51 insertions(+), 37 deletions(-) diff --git a/CHANGES b/CHANGES index ee20ca1..3814d09 100644 --- a/CHANGES +++ b/CHANGES @@ -4,6 +4,8 @@ Changes in version 2.15.0 * parser: don't wrap headers in DocParagraph (#307) + * parser: don't mangle append order for nested lists (pandoc #1346) + Changes in version 2.14.3 * Fix parsing of identifiers with ^ or ? in them (#298) diff --git a/haddock-library/src/Documentation/Haddock/Parser.hs b/haddock-library/src/Documentation/Haddock/Parser.hs index 1d98601..805b33f 100644 --- a/haddock-library/src/Documentation/Haddock/Parser.hs +++ b/haddock-library/src/Documentation/Haddock/Parser.hs @@ -265,7 +265,7 @@ innerList item = do (cs, items) <- more item let contents = docParagraph . parseString . dropNLs . unlines $ c : cs return $ case items of - Left p -> [contents `joinPara` p] + Left p -> [contents <> p] Right i -> contents : i -- | Parses definition lists. @@ -276,21 +276,9 @@ definitionList = do (cs, items) <- more definitionList let contents = parseString . dropNLs . unlines $ c : cs return $ case items of - Left p -> [(label, contents `joinPara` p)] + Left p -> [(label, contents <> p)] Right i -> (label, contents) : i --- | If possible, appends two 'Doc's under a 'DocParagraph' rather than --- outside of it. This allows to get structures like --- --- @DocParagraph (DocAppend ? ?)@ --- --- rather than --- --- @DocAppend (DocParagraph ?) ?@ -joinPara :: DocH mod id -> DocH mod id -> DocH mod id -joinPara (DocParagraph p) c = docParagraph $ p <> c -joinPara d p = d <> p - -- | Drops all trailing newlines. dropNLs :: String -> String dropNLs = reverse . dropWhile (== '\n') . reverse diff --git a/haddock-library/test/Documentation/Haddock/ParserSpec.hs b/haddock-library/test/Documentation/Haddock/ParserSpec.hs index 6d05791..a8c2199 100644 --- a/haddock-library/test/Documentation/Haddock/ParserSpec.hs +++ b/haddock-library/test/Documentation/Haddock/ParserSpec.hs @@ -547,34 +547,34 @@ spec = do context "when parsing paragraphs nested in lists" $ do it "can nest the same type of list" $ do "* foo\n\n * bar" `shouldParseTo` - DocUnorderedList [ DocParagraph $ "foo" + DocUnorderedList [ DocParagraph "foo" <> DocUnorderedList [DocParagraph "bar"]] it "can nest another type of list inside" $ do "* foo\n\n 1. bar" `shouldParseTo` - DocUnorderedList [ DocParagraph $ "foo" + DocUnorderedList [ DocParagraph "foo" <> DocOrderedList [DocParagraph "bar"]] it "can nest a code block inside" $ do "* foo\n\n @foo bar baz@" `shouldParseTo` - DocUnorderedList [ DocParagraph $ "foo" + DocUnorderedList [ DocParagraph "foo" <> DocCodeBlock "foo bar baz"] "* foo\n\n @\n foo bar baz\n @" `shouldParseTo` - DocUnorderedList [ DocParagraph $ "foo" + DocUnorderedList [ DocParagraph "foo" <> DocCodeBlock "foo bar baz\n"] it "can nest more than one level" $ do "* foo\n\n * bar\n\n * baz\n qux" `shouldParseTo` - DocUnorderedList [ DocParagraph $ "foo" - <> DocUnorderedList [ DocParagraph $ "bar" + DocUnorderedList [ DocParagraph "foo" + <> DocUnorderedList [ DocParagraph "bar" <> DocUnorderedList [DocParagraph "baz\nqux"] ] ] it "won't fail on not fully indented paragraph" $ do "* foo\n\n * bar\n\n * qux\nquux" `shouldParseTo` - DocUnorderedList [ DocParagraph $ "foo" + DocUnorderedList [ DocParagraph "foo" <> DocUnorderedList [ DocParagraph "bar" ] , DocParagraph "qux\nquux"] @@ -589,7 +589,7 @@ spec = do it "can come back to top level with a different list" $ do "* foo\n\n * bar\n\n1. baz" `shouldParseTo` - DocUnorderedList [ DocParagraph $ "foo" + DocUnorderedList [ DocParagraph "foo" <> DocUnorderedList [ DocParagraph "bar" ] ] <> DocOrderedList [ DocParagraph "baz" ] diff --git a/html-test/ref/Nesting.html b/html-test/ref/Nesting.html index 1a7f275..e3302d8 100644 --- a/html-test/ref/Nesting.html +++ b/html-test/ref/Nesting.html @@ -86,9 +86,13 @@ window.onload = function () {pageLoad();setSynopsis("mini_Nesting.html");}; >

  • We can

      We can

      • easily go back

          easily go back

          1. some indentation
          • Beginning of list

              Beginning of list

              • second list
              • Beginning of list

                Beginning of list

                nested code
                     we preserve the space correctly
                 
                • Beginning of list

                    Beginning of list

                    • Nested list
                    • Beginning of list

                      Beginning of list

                      nested
                       bird
                       tracks
                      • Beginning of list -This belongs to the list above!

                        Beginning of list +This belongs to the list above!

                        nested
                         bird
                         tracks
                        @@ -194,12 +208,18 @@ another line
                           without leading space
                        • Next list -More of the indented list.

                            Next list +More of the indented list.

                            • Deeper

                                Deeper

                                • Deeper

                                    Deeper

                                    • Even deeper!
                                      • Next list -with more of the indented list content.

                                        Next list +with more of the indented list content.

                                        Even more content on a new line.

                                        1. Different type of list

                                            Different type of list

                                            1. Deeper
                                            Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/attoparsec-update,wip/landmine-param-family,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/remove-cabal-dep,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/1a3f8f74116d749a17467c79ee30c5efabd694d2 >--------------------------------------------------------------- commit 1a3f8f74116d749a17467c79ee30c5efabd694d2 Author: Mateusz Kowalczyk Date: Wed Jun 25 15:19:45 2014 +0200 Bump haddock-library to 1.1.0 for release >--------------------------------------------------------------- 1a3f8f74116d749a17467c79ee30c5efabd694d2 haddock-library/haddock-library.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haddock-library/haddock-library.cabal b/haddock-library/haddock-library.cabal index 2ea3307..aa091ae 100644 --- a/haddock-library/haddock-library.cabal +++ b/haddock-library/haddock-library.cabal @@ -1,5 +1,5 @@ name: haddock-library -version: 1.0.1 +version: 1.1.0 synopsis: Library exposing some functionality of Haddock. description: Haddock is a documentation-generation tool for Haskell libraries. These modules expose some functionality of it From git at git.haskell.org Wed Jul 8 08:29:08 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:29:08 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, fix-travis, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/ast-annotations-separate, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/attoparsec-update, wip/landmine-param-family, wip/orf-new, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/remove-cabal-dep, wip/trac-9744: Drop DocParagraph from front of headers (64aee65) Message-ID: <20150708082908.7C4BC3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/attoparsec-update,wip/landmine-param-family,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/remove-cabal-dep,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/64aee65f62c7184f31d6778d0d3d9b6dc96e4e91 >--------------------------------------------------------------- commit 64aee65f62c7184f31d6778d0d3d9b6dc96e4e91 Author: Mateusz Kowalczyk Date: Wed Jun 25 15:02:48 2014 +0200 Drop DocParagraph from front of headers I can not remember why they were wrapped in paragraphs to begin with and it seems unnecessary now that I test it. Closes #307. >--------------------------------------------------------------- 64aee65f62c7184f31d6778d0d3d9b6dc96e4e91 CHANGES | 2 ++ haddock-library/src/Documentation/Haddock/Parser.hs | 7 ++++++- haddock-library/test/Documentation/Haddock/ParserSpec.hs | 9 ++++----- html-test/ref/Nesting.html | 6 ++---- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/CHANGES b/CHANGES index 6c13953..ee20ca1 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,8 @@ Changes in version 2.15.0 * Always read in prologue files as UTF8 (#286 and Cabal #1721) + * parser: don't wrap headers in DocParagraph (#307) + Changes in version 2.14.3 * Fix parsing of identifiers with ^ or ? in them (#298) diff --git a/haddock-library/src/Documentation/Haddock/Parser.hs b/haddock-library/src/Documentation/Haddock/Parser.hs index f13cedc..1d98601 100644 --- a/haddock-library/src/Documentation/Haddock/Parser.hs +++ b/haddock-library/src/Documentation/Haddock/Parser.hs @@ -220,6 +220,11 @@ paragraph = examples <|> skipSpace *> (list <|> birdtracks <|> codeblock -- | Headers inside the comment denoted with @=@ signs, up to 6 levels -- deep. +-- +-- >>> parseOnly header "= Hello" +-- Right (DocHeader (Header {headerLevel = 1, headerTitle = DocString "Hello"})) +-- >>> parseOnly header "== World" +-- Right (DocHeader (Header {headerLevel = 2, headerTitle = DocString "World"})) header :: Parser (DocH mod Identifier) header = do let psers = map (string . encodeUtf8 . concat . flip replicate "=") [6, 5 .. 1] @@ -227,7 +232,7 @@ header = do delim <- decodeUtf8 <$> pser line <- skipHorizontalSpace *> nonEmptyLine >>= return . parseString rest <- paragraph <|> return mempty - return $ DocParagraph (DocHeader (Header (length delim) line)) <> rest + return $ DocHeader (Header (length delim) line) <> rest textParagraph :: Parser (DocH mod Identifier) textParagraph = docParagraph . parseString . intercalate "\n" <$> many1 nonEmptyLine diff --git a/haddock-library/test/Documentation/Haddock/ParserSpec.hs b/haddock-library/test/Documentation/Haddock/ParserSpec.hs index 4bcbbec..6d05791 100644 --- a/haddock-library/test/Documentation/Haddock/ParserSpec.hs +++ b/haddock-library/test/Documentation/Haddock/ParserSpec.hs @@ -808,16 +808,15 @@ spec = do context "when parsing function documentation headers" $ do it "can parse a simple header" $ do "= Header 1\nHello." `shouldParseTo` - DocParagraph (DocHeader (Header 1 "Header 1")) + (DocHeader (Header 1 "Header 1")) <> DocParagraph "Hello." it "allow consecutive headers" $ do "= Header 1\n== Header 2" `shouldParseTo` - DocParagraph (DocHeader (Header 1 "Header 1")) - <> DocParagraph (DocHeader (Header 2 "Header 2")) + DocHeader (Header 1 "Header 1") + <> DocHeader (Header 2 "Header 2") it "accepts markup in the header" $ do "= /Header/ __1__\nFoo" `shouldParseTo` - DocParagraph (DocHeader - (Header 1 (DocEmphasis "Header" <> " " <> DocBold "1"))) + DocHeader (Header 1 (DocEmphasis "Header" <> " " <> DocBold "1")) <> DocParagraph "Foo" diff --git a/html-test/ref/Nesting.html b/html-test/ref/Nesting.html index 4abef7b..1a7f275 100644 --- a/html-test/ref/Nesting.html +++ b/html-test/ref/Nesting.html @@ -261,10 +261,8 @@ with more of the indented list content.

                                            No newline separation even in indented lists. We can have any paragraph level element that we normally - can, like headers

                                            Level 3 header

                                            Level 3 header

                                            with some content…

                                              Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/attoparsec-update,wip/landmine-param-family,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/remove-cabal-dep,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/8d20ca8d5a9bee73252ff2035ec45f9c03d0820c >--------------------------------------------------------------- commit 8d20ca8d5a9bee73252ff2035ec45f9c03d0820c Author: Iavor S. Diatchki Date: Mon Jun 30 13:19:09 2014 -0700 Propagate overloading-mode for instance declarations in haddock (#9242) >--------------------------------------------------------------- 8d20ca8d5a9bee73252ff2035ec45f9c03d0820c src/Haddock/Interface/Rename.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Haddock/Interface/Rename.hs b/src/Haddock/Interface/Rename.hs index 748e021..2eb2cc0 100644 --- a/src/Haddock/Interface/Rename.hs +++ b/src/Haddock/Interface/Rename.hs @@ -442,11 +442,15 @@ renameInstD (DataFamInstD { dfid_inst = d }) = do return (DataFamInstD { dfid_inst = d' }) renameClsInstD :: ClsInstDecl Name -> RnM (ClsInstDecl DocName) -renameClsInstD (ClsInstDecl { cid_poly_ty =ltype, cid_tyfam_insts = lATs, cid_datafam_insts = lADTs }) = do +renameClsInstD (ClsInstDecl { cid_overlap_mode = omode + , cid_poly_ty =ltype, cid_tyfam_insts = lATs + , cid_datafam_insts = lADTs }) = do ltype' <- renameLType ltype lATs' <- mapM (mapM renameTyFamInstD) lATs lADTs' <- mapM (mapM renameDataFamInstD) lADTs - return (ClsInstDecl { cid_poly_ty = ltype', cid_binds = emptyBag, cid_sigs = [] + return (ClsInstDecl { cid_overlap_mode = omode + , cid_poly_ty = ltype', cid_binds = emptyBag + , cid_sigs = [] , cid_tyfam_insts = lATs', cid_datafam_insts = lADTs' }) From git at git.haskell.org Wed Jul 8 08:29:16 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:29:16 +0000 (UTC) Subject: [commit: haddock] ghc-7.8, v2.14, wip/pattern-synonym-sig-backport: GHC 7.8: follow changes in PatSyn and LHsBindsLR (60aa88e) Message-ID: <20150708082916.AE6A33A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: ghc-7.8,v2.14,wip/pattern-synonym-sig-backport Link : http://git.haskell.org/haddock.git/commitdiff/60aa88ef69436c974212e9ffefe9edcc9ab731bf >--------------------------------------------------------------- commit 60aa88ef69436c974212e9ffefe9edcc9ab731bf Author: Austin Seipp Date: Thu Jul 3 17:22:23 2014 -0500 GHC 7.8: follow changes in PatSyn and LHsBindsLR Signed-off-by: Austin Seipp >--------------------------------------------------------------- 60aa88ef69436c974212e9ffefe9edcc9ab731bf src/Haddock/Convert.hs | 4 ++-- src/Haddock/Interface/Create.hs | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Haddock/Convert.hs b/src/Haddock/Convert.hs index 1bf02e3..405bf20 100644 --- a/src/Haddock/Convert.hs +++ b/src/Haddock/Convert.hs @@ -94,10 +94,10 @@ tyThingToLHsDecl t = noLoc $ case t of (synifyType ImplicitizeForAll (dataConUserType dc))) AConLike (PatSynCon ps) -> - let (_, _, (req_theta, prov_theta)) = patSynSig ps + let (_, _, req_theta, prov_theta, _, res_ty) = patSynSig ps in SigD $ PatSynSig (synifyName ps) (fmap (synifyType WithinType) (patSynTyDetails ps)) - (synifyType WithinType (patSynType ps)) + (synifyType WithinType res_ty) (synifyCtx req_theta) (synifyCtx prov_theta) diff --git a/src/Haddock/Interface/Create.hs b/src/Haddock/Interface/Create.hs index fb1038f..08810d6 100644 --- a/src/Haddock/Interface/Create.hs +++ b/src/Haddock/Interface/Create.hs @@ -364,7 +364,7 @@ classDecls class_ = filterDecls . collectDocs . sortByLoc $ decls where decls = docs ++ defs ++ sigs ++ ats docs = mkDecls tcdDocs DocD class_ - defs = mkDecls (map snd . bagToList . tcdMeths) ValD class_ + defs = mkDecls (bagToList . tcdMeths) ValD class_ sigs = mkDecls tcdSigs SigD class_ ats = mkDecls tcdATs (TyClD . FamDecl) class_ @@ -384,13 +384,13 @@ mkFixMap group_ = M.fromList [ (n,f) ungroup :: HsGroup Name -> [LHsDecl Name] ungroup group_ = mkDecls (tyClGroupConcat . hs_tyclds) TyClD group_ ++ - mkDecls hs_derivds DerivD group_ ++ - mkDecls hs_defds DefD group_ ++ - mkDecls hs_fords ForD group_ ++ - mkDecls hs_docs DocD group_ ++ - mkDecls hs_instds InstD group_ ++ - mkDecls (typesigs . hs_valds) SigD group_ ++ - mkDecls (map snd . valbinds . hs_valds) ValD group_ + mkDecls hs_derivds DerivD group_ ++ + mkDecls hs_defds DefD group_ ++ + mkDecls hs_fords ForD group_ ++ + mkDecls hs_docs DocD group_ ++ + mkDecls hs_instds InstD group_ ++ + mkDecls (typesigs . hs_valds) SigD group_ ++ + mkDecls (valbinds . hs_valds) ValD group_ where typesigs (ValBindsOut _ sigs) = filter isVanillaLSig sigs typesigs _ = error "expected ValBindsOut" From git at git.haskell.org Wed Jul 8 08:29:18 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:29:18 +0000 (UTC) Subject: [commit: haddock] ghc-7.8, wip/pattern-synonym-sig-backport: Merge branch 'v2.14' into ghc-7.8 (fdaec65) Message-ID: <20150708082918.BAC233A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: ghc-7.8,wip/pattern-synonym-sig-backport Link : http://git.haskell.org/haddock.git/commitdiff/fdaec6541b57da79c5b52a002e5eb7bc623523bb >--------------------------------------------------------------- commit fdaec6541b57da79c5b52a002e5eb7bc623523bb Merge: aaa00e8 60aa88e Author: Austin Seipp Date: Thu Jul 3 17:22:35 2014 -0500 Merge branch 'v2.14' into ghc-7.8 >--------------------------------------------------------------- fdaec6541b57da79c5b52a002e5eb7bc623523bb src/Haddock/Convert.hs | 4 ++-- src/Haddock/Interface/Create.hs | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) From git at git.haskell.org Wed Jul 8 08:29:20 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:29:20 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, fix-travis, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/ast-annotations-separate, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/attoparsec-update, wip/landmine-param-family, wip/orf-new, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/remove-cabal-dep, wip/trac-9744: Adapt to new definition of HsDecls.TyFamEqn (cb96b4f) Message-ID: <20150708082920.C6ADA3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/attoparsec-update,wip/landmine-param-family,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/remove-cabal-dep,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/cb96b4f1ed0462b4a394b9fda6612c3bea9886bd >--------------------------------------------------------------- commit cb96b4f1ed0462b4a394b9fda6612c3bea9886bd Author: Simon Peyton Jones Date: Mon Jul 14 16:23:15 2014 +0100 Adapt to new definition of HsDecls.TyFamEqn This is a knock-on from the refactoring from Trac #9063. I'll push the corresponding changes to GHC shortly. >--------------------------------------------------------------- cb96b4f1ed0462b4a394b9fda6612c3bea9886bd src/Haddock/Backends/Xhtml/Decl.hs | 4 ++-- src/Haddock/Convert.hs | 12 ++++++------ src/Haddock/GhcUtils.hs | 2 +- src/Haddock/Interface/Rename.hs | 24 +++++++++++++++++------- 4 files changed, 26 insertions(+), 16 deletions(-) diff --git a/src/Haddock/Backends/Xhtml/Decl.hs b/src/Haddock/Backends/Xhtml/Decl.hs index 8884f69..0429580 100644 --- a/src/Haddock/Backends/Xhtml/Decl.hs +++ b/src/Haddock/Backends/Xhtml/Decl.hs @@ -280,8 +280,8 @@ ppTyFam summary associated links instances fixities loc doc decl splice unicode = ppInstances instances docname unicode qual -- Individual equation of a closed type family - ppTyFamEqn TyFamInstEqn { tfie_tycon = n, tfie_rhs = rhs - , tfie_pats = HsWB { hswb_cts = ts }} + ppTyFamEqn TyFamEqn { tfe_tycon = n, tfe_rhs = rhs + , tfe_pats = HsWB { hswb_cts = ts }} = ( ppAppNameTypes (unLoc n) [] (map unLoc ts) unicode qual <+> equals <+> ppType unicode qual (unLoc rhs) , Nothing, [] ) diff --git a/src/Haddock/Convert.hs b/src/Haddock/Convert.hs index 405bf20..dfb0f14 100644 --- a/src/Haddock/Convert.hs +++ b/src/Haddock/Convert.hs @@ -64,7 +64,7 @@ tyThingToLHsDecl t = noLoc $ case t of extractFamilyDecl _ = error "tyThingToLHsDecl: impossible associated tycon" - atTyClDecls = [synifyTyCon Nothing at_tc | (at_tc, _) <- classATItems cl] + atTyClDecls = [synifyTyCon Nothing at_tc | ATI at_tc _ <- classATItems cl] atFamDecls = map extractFamilyDecl atTyClDecls in TyClD $ ClassDecl { tcdCtxt = synifyCtx (classSCTheta cl) @@ -107,11 +107,11 @@ synifyAxBranch tc (CoAxBranch { cab_tvs = tkvs, cab_lhs = args, cab_rhs = rhs }) typats = map (synifyType WithinType) args hs_rhs = synifyType WithinType rhs (kvs, tvs) = partition isKindVar tkvs - in TyFamInstEqn { tfie_tycon = name - , tfie_pats = HsWB { hswb_cts = typats - , hswb_kvs = map tyVarName kvs - , hswb_tvs = map tyVarName tvs } - , tfie_rhs = hs_rhs } + in TyFamEqn { tfe_tycon = name + , tfe_pats = HsWB { hswb_cts = typats + , hswb_kvs = map tyVarName kvs + , hswb_tvs = map tyVarName tvs } + , tfe_rhs = hs_rhs } synifyAxiom :: CoAxiom br -> HsDecl Name synifyAxiom ax@(CoAxiom { co_ax_tc = tc }) diff --git a/src/Haddock/GhcUtils.hs b/src/Haddock/GhcUtils.hs index c06b34a..8ea5485 100644 --- a/src/Haddock/GhcUtils.hs +++ b/src/Haddock/GhcUtils.hs @@ -102,7 +102,7 @@ getInstLoc (TyFamInstD (TyFamInstDecl -- Since CoAxioms' Names refer to the whole line for type family instances -- in particular, we need to dig a bit deeper to pull out the entire -- equation. This does not happen for data family instances, for some reason. - { tfid_eqn = L _ (TyFamInstEqn { tfie_rhs = L l _ })})) = l + { tfid_eqn = L _ (TyFamEqn { tfe_rhs = L l _ })})) = l -- Useful when there is a signature with multiple names, e.g. -- foo, bar :: Types.. diff --git a/src/Haddock/Interface/Rename.hs b/src/Haddock/Interface/Rename.hs index 2eb2cc0..a804f4a 100644 --- a/src/Haddock/Interface/Rename.hs +++ b/src/Haddock/Interface/Rename.hs @@ -323,7 +323,7 @@ renameTyClD d = case d of lfundeps' <- mapM renameLFunDep lfundeps lsigs' <- mapM renameLSig lsigs ats' <- mapM (renameLThing renameFamilyDecl) ats - at_defs' <- mapM (mapM renameTyFamInstD) at_defs + at_defs' <- mapM renameLTyFamDefltEqn at_defs -- we don't need the default methods or the already collected doc entities return (ClassDecl { tcdCtxt = lcontext', tcdLName = lname', tcdTyVars = ltyvars' , tcdFDs = lfundeps', tcdSigs = lsigs', tcdMeths= emptyBag @@ -351,7 +351,7 @@ renameFamilyInfo :: FamilyInfo Name -> RnM (FamilyInfo DocName) renameFamilyInfo DataFamily = return DataFamily renameFamilyInfo OpenTypeFamily = return OpenTypeFamily renameFamilyInfo (ClosedTypeFamily eqns) - = do { eqns' <- mapM (renameLThing renameTyFamInstEqn) eqns + = do { eqns' <- mapM renameLTyFamInstEqn eqns ; return $ ClosedTypeFamily eqns' } renameDataDefn :: HsDataDefn Name -> RnM (HsDataDefn DocName) @@ -456,17 +456,27 @@ renameClsInstD (ClsInstDecl { cid_overlap_mode = omode renameTyFamInstD :: TyFamInstDecl Name -> RnM (TyFamInstDecl DocName) renameTyFamInstD (TyFamInstDecl { tfid_eqn = eqn }) - = do { eqn' <- renameLThing renameTyFamInstEqn eqn + = do { eqn' <- renameLTyFamInstEqn eqn ; return (TyFamInstDecl { tfid_eqn = eqn' , tfid_fvs = placeHolderNames }) } -renameTyFamInstEqn :: TyFamInstEqn Name -> RnM (TyFamInstEqn DocName) -renameTyFamInstEqn (TyFamInstEqn { tfie_tycon = tc, tfie_pats = pats_w_bndrs, tfie_rhs = rhs }) +renameLTyFamInstEqn :: LTyFamInstEqn Name -> RnM (LTyFamInstEqn DocName) +renameLTyFamInstEqn (L loc (TyFamEqn { tfe_tycon = tc, tfe_pats = pats_w_bndrs, tfe_rhs = rhs })) = do { tc' <- renameL tc ; pats' <- mapM renameLType (hswb_cts pats_w_bndrs) ; rhs' <- renameLType rhs - ; return (TyFamInstEqn { tfie_tycon = tc', tfie_pats = pats_w_bndrs { hswb_cts = pats' } - , tfie_rhs = rhs' }) } + ; return (L loc (TyFamEqn { tfe_tycon = tc' + , tfe_pats = pats_w_bndrs { hswb_cts = pats' } + , tfe_rhs = rhs' })) } + +renameLTyFamDefltEqn :: LTyFamDefltEqn Name -> RnM (LTyFamDefltEqn DocName) +renameLTyFamDefltEqn (L loc (TyFamEqn { tfe_tycon = tc, tfe_pats = tvs, tfe_rhs = rhs })) + = do { tc' <- renameL tc + ; tvs' <- renameLTyVarBndrs tvs + ; rhs' <- renameLType rhs + ; return (L loc (TyFamEqn { tfe_tycon = tc' + , tfe_pats = tvs' + , tfe_rhs = rhs' })) } renameDataFamInstD :: DataFamInstDecl Name -> RnM (DataFamInstDecl DocName) renameDataFamInstD (DataFamInstDecl { dfid_tycon = tc, dfid_pats = pats_w_bndrs, dfid_defn = defn }) From git at git.haskell.org Wed Jul 8 08:29:22 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:29:22 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, fix-travis, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/ast-annotations-separate, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/attoparsec-update, wip/landmine-param-family, wip/orf-new, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/remove-cabal-dep, wip/trac-9744: Track GHC PackageId to PackageKey renaming. (8ac42d3) Message-ID: <20150708082922.D6E8B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/attoparsec-update,wip/landmine-param-family,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/remove-cabal-dep,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/8ac42d3327473939c013551750425cac191ff0fd >--------------------------------------------------------------- commit 8ac42d3327473939c013551750425cac191ff0fd Author: Edward Z. Yang Date: Sat Jul 19 17:11:01 2014 +0100 Track GHC PackageId to PackageKey renaming. Signed-off-by: Edward Z. Yang Conflicts: src/Haddock/Interface/Create.hs >--------------------------------------------------------------- 8ac42d3327473939c013551750425cac191ff0fd src/Haddock.hs | 10 +++++----- src/Haddock/Backends/Xhtml.hs | 2 +- src/Haddock/Backends/Xhtml/Layout.hs | 2 +- src/Haddock/Backends/Xhtml/Types.hs | 2 +- src/Haddock/GhcUtils.hs | 14 +++++++------- src/Haddock/Interface/Create.hs | 10 +++++----- src/Haddock/InterfaceFile.hs | 12 ++++++------ src/Haddock/ModuleTree.hs | 6 +++--- src/Haddock/Types.hs | 2 +- 9 files changed, 30 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 8ac42d3327473939c013551750425cac191ff0fd From git at git.haskell.org Wed Jul 8 08:29:24 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:29:24 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, fix-travis, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/ast-annotations-separate, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/attoparsec-update, wip/landmine-param-family, wip/orf-new, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/remove-cabal-dep, wip/trac-9744: Track changes for module reexports. (b99b57c) Message-ID: <20150708082924.E2D193A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/attoparsec-update,wip/landmine-param-family,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/remove-cabal-dep,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/b99b57c0df072d12b67816b45eca2a03cb1da96d >--------------------------------------------------------------- commit b99b57c0df072d12b67816b45eca2a03cb1da96d Author: Edward Z. Yang Date: Mon Jul 7 18:23:40 2014 +0100 Track changes for module reexports. Signed-off-by: Edward Z. Yang Conflicts: src/Haddock/Interface/Create.hs >--------------------------------------------------------------- b99b57c0df072d12b67816b45eca2a03cb1da96d src/Haddock/Interface/Create.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Haddock/Interface/Create.hs b/src/Haddock/Interface/Create.hs index abc65f1..d211530 100644 --- a/src/Haddock/Interface/Create.hs +++ b/src/Haddock/Interface/Create.hs @@ -45,6 +45,7 @@ import Bag import RdrName import TcRnTypes import FastString (concatFS) +import UniqFM -- | Use a 'TypecheckedModule' to produce an 'Interface'. @@ -170,9 +171,9 @@ lookupModuleDyn _ (Just pkgId) mdlName = Module.mkModule pkgId mdlName lookupModuleDyn dflags Nothing mdlName = flip Module.mkModule mdlName $ - case filter snd $ + case filter Packages.modConfExposed . eltsUFM $ Packages.lookupModuleInAllPackages dflags mdlName of - (pkgId,_):_ -> Packages.packageConfigId pkgId + m:_ -> Packages.packageConfigId (Packages.modConfPkg m) [] -> Module.mainPackageKey From git at git.haskell.org Wed Jul 8 08:29:26 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:29:26 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, fix-travis, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/ast-annotations-separate, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/attoparsec-update, wip/landmine-param-family, wip/orf-new, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/remove-cabal-dep, wip/trac-9744: Catch mid-line URLs. Fixes #314. (d6aec63) Message-ID: <20150708082926.EF01B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/attoparsec-update,wip/landmine-param-family,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/remove-cabal-dep,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/d6aec63c009c4e57181900eb03847d7dc0fc3c7c >--------------------------------------------------------------- commit d6aec63c009c4e57181900eb03847d7dc0fc3c7c Author: Mateusz Kowalczyk Date: Mon Jul 28 13:25:43 2014 +0200 Catch mid-line URLs. Fixes #314. >--------------------------------------------------------------- d6aec63c009c4e57181900eb03847d7dc0fc3c7c haddock-library/src/Documentation/Haddock/Parser.hs | 4 ++-- haddock-library/test/Documentation/Haddock/ParserSpec.hs | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/haddock-library/src/Documentation/Haddock/Parser.hs b/haddock-library/src/Documentation/Haddock/Parser.hs index 805b33f..68d9ece 100644 --- a/haddock-library/src/Documentation/Haddock/Parser.hs +++ b/haddock-library/src/Documentation/Haddock/Parser.hs @@ -105,7 +105,7 @@ parseStringBS = parse p where p :: Parser (DocH mod Identifier) p = mconcat <$> many (monospace <|> anchor <|> identifier <|> moduleName - <|> picture <|> hyperlink <|> autoUrl <|> bold + <|> picture <|> hyperlink <|> bold <|> emphasis <|> encodedChar <|> string' <|> skipSpecialChar) @@ -125,7 +125,7 @@ encodedChar = "&#" *> c <* ";" -- Once we have checked for any of these and tried to parse the -- relevant markup, we can assume they are used as regular text. specialChar :: [Char] -specialChar = "_/<@\"&'`#" +specialChar = "_/<@\"&'`# " -- | Plain, regular parser for text. Called as one of the last parsers -- to ensure that we have already given a chance to more meaningful parsers diff --git a/haddock-library/test/Documentation/Haddock/ParserSpec.hs b/haddock-library/test/Documentation/Haddock/ParserSpec.hs index a8c2199..5181a3f 100644 --- a/haddock-library/test/Documentation/Haddock/ParserSpec.hs +++ b/haddock-library/test/Documentation/Haddock/ParserSpec.hs @@ -137,6 +137,10 @@ spec = do "http://example.com/? Some other sentence." `shouldParseTo` hyperlink "http://example.com/" Nothing <> "? Some other sentence." + it "autolinks URLs occuring mid-sentence with multiple ?/?s" $ do + "foo https://example.com/example bar" `shouldParseTo` + "foo " <> hyperlink "https://example.com/example" Nothing <> " bar" + context "when parsing pictures" $ do let picture :: String -> Maybe String -> Doc String picture uri = DocPic . Picture uri From git at git.haskell.org Wed Jul 8 08:29:29 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:29:29 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, fix-travis, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/ast-annotations-separate, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/attoparsec-update, wip/landmine-param-family, wip/orf-new, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/remove-cabal-dep, wip/trac-9744: Track type signature change of lookupModuleInAllPackages (d59fec2) Message-ID: <20150708082929.05E0B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/attoparsec-update,wip/landmine-param-family,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/remove-cabal-dep,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/d59fec2c9551b5662a3507c0011e32a09a9c118f >--------------------------------------------------------------- commit d59fec2c9551b5662a3507c0011e32a09a9c118f Author: Edward Z. Yang Date: Sat Aug 2 00:58:19 2014 +0100 Track type signature change of lookupModuleInAllPackages Signed-off-by: Edward Z. Yang >--------------------------------------------------------------- d59fec2c9551b5662a3507c0011e32a09a9c118f src/Haddock/Interface/Create.hs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Haddock/Interface/Create.hs b/src/Haddock/Interface/Create.hs index d211530..ad6a1e9 100644 --- a/src/Haddock/Interface/Create.hs +++ b/src/Haddock/Interface/Create.hs @@ -45,7 +45,6 @@ import Bag import RdrName import TcRnTypes import FastString (concatFS) -import UniqFM -- | Use a 'TypecheckedModule' to produce an 'Interface'. @@ -170,11 +169,9 @@ lookupModuleDyn :: lookupModuleDyn _ (Just pkgId) mdlName = Module.mkModule pkgId mdlName lookupModuleDyn dflags Nothing mdlName = - flip Module.mkModule mdlName $ - case filter Packages.modConfExposed . eltsUFM $ - Packages.lookupModuleInAllPackages dflags mdlName of - m:_ -> Packages.packageConfigId (Packages.modConfPkg m) - [] -> Module.mainPackageKey + case Packages.lookupModuleInAllPackages dflags mdlName of + (m,_):_ -> m + [] -> Module.mkModule Module.mainPackageKey mdlName ------------------------------------------------------------------------------- From git at git.haskell.org Wed Jul 8 08:29:31 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:29:31 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, fix-travis, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/ast-annotations-separate, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/attoparsec-update, wip/landmine-param-family, wip/orf-new, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/remove-cabal-dep, wip/trac-9744: If GhcProfiled, also build Haddock profiled. (97b5fa2) Message-ID: <20150708082931.128393A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/attoparsec-update,wip/landmine-param-family,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/remove-cabal-dep,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/97b5fa2b7b9c8bd07d0be5068b2f031b58e8fc56 >--------------------------------------------------------------- commit 97b5fa2b7b9c8bd07d0be5068b2f031b58e8fc56 Author: Edward Z. Yang Date: Tue Aug 5 17:34:26 2014 +0100 If GhcProfiled, also build Haddock profiled. Signed-off-by: Edward Z. Yang >--------------------------------------------------------------- 97b5fa2b7b9c8bd07d0be5068b2f031b58e8fc56 ghc.mk | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ghc.mk b/ghc.mk index f562835..247c16e 100644 --- a/ghc.mk +++ b/ghc.mk @@ -8,6 +8,12 @@ utils/haddock_dist_INSTALL_INPLACE = YES utils/haddock_dist_INSTALL_SHELL_WRAPPER_NAME = haddock-ghc-$(ProjectVersion) utils/haddock_dist_PROGNAME = haddock +ifeq "$(GhcProfiled)" "YES" +utils/haddock_dist_PROGRAM_WAY = p +utils/haddock_dist_WAY = p +utils/haddock/dist/build/tmp/$(utils/haddock_dist_PROG) : $(utils/haddock_dist_p_LIB) +endif + ifeq "$(HADDOCK_DOCS)" "NO" utils/haddock_dist_NOT_NEEDED = YES endif From git at git.haskell.org Wed Jul 8 08:29:33 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:29:33 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, fix-travis, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/ast-annotations-separate, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/attoparsec-update, wip/landmine-param-family, wip/orf-new, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/remove-cabal-dep, wip/trac-9744: Ignore TAGS files. (d9b224f) Message-ID: <20150708082933.1E2323A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/attoparsec-update,wip/landmine-param-family,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/remove-cabal-dep,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/d9b224f124edc99f051dfc0dcab922041654c36a >--------------------------------------------------------------- commit d9b224f124edc99f051dfc0dcab922041654c36a Author: Edward Z. Yang Date: Thu Aug 7 14:23:35 2014 +0100 Ignore TAGS files. Signed-off-by: Edward Z. Yang >--------------------------------------------------------------- d9b224f124edc99f051dfc0dcab922041654c36a .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 4752003..d3ca28b 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,5 @@ /doc/config.mk /doc/config.status /doc/configure +tags +TAGS From git at git.haskell.org Wed Jul 8 08:29:35 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:29:35 +0000 (UTC) Subject: [commit: haddock] wip/attoparsec-update: Update to attoparsec-0.12.1.1 (44194c3) Message-ID: <20150708082935.475AB3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/attoparsec-update Link : http://git.haskell.org/haddock.git/commitdiff/44194c35829a2087545e5579bba2fb8dea96e1fe >--------------------------------------------------------------- commit 44194c35829a2087545e5579bba2fb8dea96e1fe Author: Mateusz Kowalczyk Date: Fri Aug 8 01:41:34 2014 +0200 Update to attoparsec-0.12.1.1 Preliminary results show a significant memory improvement and slight speed improvement. >--------------------------------------------------------------- 44194c35829a2087545e5579bba2fb8dea96e1fe haddock-library/.ghci | 2 +- haddock-library/haddock-library.cabal | 11 +- .../vendor/attoparsec-0.10.4.0/Data/Attoparsec.hs | 18 - .../Data/Attoparsec/Internal.hs | 31 -- .../Data/Attoparsec/Internal/Types.hs | 227 ----------- .../vendor/attoparsec-0.12.1.1/Data/Attoparsec.hs | 23 ++ .../Data/Attoparsec/ByteString.hs | 82 ++-- .../Data/Attoparsec/ByteString/Buffer.hs | 151 +++++++ .../Data/Attoparsec/ByteString/Char8.hs | 194 +++------ .../Data/Attoparsec/ByteString/FastSet.hs | 4 +- .../Data/Attoparsec/ByteString/Internal.hs | 439 ++++++++++----------- .../Data/Attoparsec/Combinator.hs | 93 +++-- .../Data/Attoparsec/Internal.hs | 142 +++++++ .../Data/Attoparsec/Internal/Fhthagn.hs | 18 + .../Data/Attoparsec/Internal/Types.hs | 230 +++++++++++ .../Data/Attoparsec/Number.hs | 12 +- haddock-library/vendor/attoparsec-0.12.1.1/LICENSE | 30 ++ 17 files changed, 979 insertions(+), 728 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 44194c35829a2087545e5579bba2fb8dea96e1fe From git at git.haskell.org Wed Jul 8 08:29:37 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:29:37 +0000 (UTC) Subject: [commit: haddock] wip/attoparsec-update: Update main cabal file too (ddf11f0) Message-ID: <20150708082937.50C6E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/attoparsec-update Link : http://git.haskell.org/haddock.git/commitdiff/ddf11f0c5c45a5e5b065df1e58de9cc3d57631cb >--------------------------------------------------------------- commit ddf11f0c5c45a5e5b065df1e58de9cc3d57631cb Author: Mateusz Kowalczyk Date: Fri Aug 8 04:43:12 2014 +0200 Update main cabal file too >--------------------------------------------------------------- ddf11f0c5c45a5e5b065df1e58de9cc3d57631cb haddock.cabal | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/haddock.cabal b/haddock.cabal index 5c10656..ef64526 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -73,7 +73,7 @@ executable haddock build-depends: base >= 4.3 && < 4.8 if flag(in-ghc-tree) - hs-source-dirs: src, haddock-library/vendor/attoparsec-0.10.4.0, haddock-library/src + hs-source-dirs: src, haddock-library/vendor/attoparsec-0.12.1.1, haddock-library/src cpp-options: -DIN_GHC_TREE build-depends: filepath, @@ -92,13 +92,15 @@ executable haddock Documentation.Haddock.Doc Data.Attoparsec Data.Attoparsec.ByteString + Data.Attoparsec.ByteString.Buffer Data.Attoparsec.ByteString.Char8 - Data.Attoparsec.Combinator - Data.Attoparsec.Number Data.Attoparsec.ByteString.FastSet Data.Attoparsec.ByteString.Internal + Data.Attoparsec.Combinator Data.Attoparsec.Internal + Data.Attoparsec.Internal.Fhthagn Data.Attoparsec.Internal.Types + Data.Attoparsec.Number Documentation.Haddock.Utf8 Documentation.Haddock.Parser.Util @@ -151,7 +153,7 @@ library if flag(in-ghc-tree) cpp-options: -DIN_GHC_TREE - hs-source-dirs: src, haddock-library/vendor/attoparsec-0.10.4.0, haddock-library/src + hs-source-dirs: src, haddock-library/vendor/attoparsec-0.12.1.1, haddock-library/src exposed-modules: Documentation.Haddock.Parser @@ -161,13 +163,15 @@ library other-modules: Data.Attoparsec Data.Attoparsec.ByteString + Data.Attoparsec.ByteString.Buffer Data.Attoparsec.ByteString.Char8 - Data.Attoparsec.Combinator - Data.Attoparsec.Number Data.Attoparsec.ByteString.FastSet Data.Attoparsec.ByteString.Internal + Data.Attoparsec.Combinator Data.Attoparsec.Internal + Data.Attoparsec.Internal.Fhthagn Data.Attoparsec.Internal.Types + Data.Attoparsec.Number Documentation.Haddock.Utf8 Documentation.Haddock.Parser.Util From git at git.haskell.org Wed Jul 8 08:29:39 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:29:39 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, fix-travis, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/ast-annotations-separate, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/landmine-param-family, wip/orf-new, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/remove-cabal-dep, wip/trac-9744: Update to attoparsec-0.12.1.1 (d8f1c1c) Message-ID: <20150708082939.75C573A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/landmine-param-family,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/remove-cabal-dep,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/d8f1c1cc4e8825f39ffc87fddfe6ff9c58f9ef8e >--------------------------------------------------------------- commit d8f1c1cc4e8825f39ffc87fddfe6ff9c58f9ef8e Author: Mateusz Kowalczyk Date: Fri Aug 8 01:41:34 2014 +0200 Update to attoparsec-0.12.1.1 There seems to be memory and speed improvement. >--------------------------------------------------------------- d8f1c1cc4e8825f39ffc87fddfe6ff9c58f9ef8e haddock-library/.ghci | 2 +- haddock-library/haddock-library.cabal | 11 +- .../vendor/attoparsec-0.10.4.0/Data/Attoparsec.hs | 18 - .../Data/Attoparsec/Internal.hs | 31 -- .../Data/Attoparsec/Internal/Types.hs | 227 ----------- .../vendor/attoparsec-0.12.1.1/Data/Attoparsec.hs | 23 ++ .../Data/Attoparsec/ByteString.hs | 82 ++-- .../Data/Attoparsec/ByteString/Buffer.hs | 151 +++++++ .../Data/Attoparsec/ByteString/Char8.hs | 194 +++------ .../Data/Attoparsec/ByteString/FastSet.hs | 4 +- .../Data/Attoparsec/ByteString/Internal.hs | 439 ++++++++++----------- .../Data/Attoparsec/Combinator.hs | 93 +++-- .../Data/Attoparsec/Internal.hs | 142 +++++++ .../Data/Attoparsec/Internal/Fhthagn.hs | 18 + .../Data/Attoparsec/Internal/Types.hs | 230 +++++++++++ .../Data/Attoparsec/Number.hs | 12 +- haddock-library/vendor/attoparsec-0.12.1.1/LICENSE | 30 ++ haddock.cabal | 16 +- 18 files changed, 989 insertions(+), 734 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 d8f1c1cc4e8825f39ffc87fddfe6ff9c58f9ef8e From git at git.haskell.org Wed Jul 8 08:29:41 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:29:41 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, fix-travis, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/ast-annotations-separate, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/landmine-param-family, wip/orf-new, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/remove-cabal-dep, wip/trac-9744: Fix forgotten src (f32ad30) Message-ID: <20150708082941.8261D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/landmine-param-family,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/remove-cabal-dep,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/f32ad30e9b8c5d4ee54c60c9c3b282fef7d297a5 >--------------------------------------------------------------- commit f32ad30e9b8c5d4ee54c60c9c3b282fef7d297a5 Author: Mateusz Kowalczyk Date: Fri Aug 8 18:24:02 2014 +0200 Fix forgotten src >--------------------------------------------------------------- f32ad30e9b8c5d4ee54c60c9c3b282fef7d297a5 haddock-library/haddock-library.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haddock-library/haddock-library.cabal b/haddock-library/haddock-library.cabal index 6ddb1c6..30db3e8 100644 --- a/haddock-library/haddock-library.cabal +++ b/haddock-library/haddock-library.cabal @@ -25,7 +25,7 @@ library bytestring, deepseq - hs-source-dirs: src, vendor/attoparsec-0.10.4.0 + hs-source-dirs: src, vendor/attoparsec-0.12.1.1 ghc-options: -funbox-strict-fields -Wall -fwarn-tabs -O2 exposed-modules: From git at git.haskell.org Wed Jul 8 08:29:43 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:29:43 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, fix-travis, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Bump down the version for master to 2.14.4 (5b81a9e) Message-ID: <20150708082943.8F01F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/5b81a9e53894d2ae591ca0c6c96199632d39eb06 >--------------------------------------------------------------- commit 5b81a9e53894d2ae591ca0c6c96199632d39eb06 Author: Mateusz Kowalczyk Date: Thu Aug 14 20:19:07 2014 +0100 Bump down the version for master to 2.14.4 >--------------------------------------------------------------- 5b81a9e53894d2ae591ca0c6c96199632d39eb06 CHANGES | 2 +- doc/haddock.xml | 2 +- haddock.cabal | 6 +++--- haddock.spec | 2 +- src/Haddock/InterfaceFile.hs | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CHANGES b/CHANGES index 3814d09..832b398 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,4 @@ -Changes in version 2.15.0 +Changes in version 2.14.4 * Always read in prologue files as UTF8 (#286 and Cabal #1721) diff --git a/doc/haddock.xml b/doc/haddock.xml index 39a947c..573f1e3 100644 --- a/doc/haddock.xml +++ b/doc/haddock.xml @@ -21,7 +21,7 @@ Simon Marlow, David Waern - This document describes Haddock version 2.15.0, a Haskell + This document describes Haddock version 2.14.4, a Haskell documentation tool. diff --git a/haddock.cabal b/haddock.cabal index ef64526..3082214 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -1,5 +1,5 @@ name: haddock -version: 2.15.0 +version: 2.14.4 synopsis: A documentation-generation tool for Haskell libraries description: Haddock is a documentation-generation tool for Haskell libraries @@ -83,7 +83,7 @@ executable haddock array, xhtml >= 3000.2 && < 3000.3, Cabal >= 1.10, - ghc == 7.9.*, + ghc == 7.8.*, bytestring other-modules: @@ -149,7 +149,7 @@ library array, xhtml >= 3000.2 && < 3000.3, Cabal >= 1.10, - ghc == 7.9.* + ghc == 7.8.* if flag(in-ghc-tree) cpp-options: -DIN_GHC_TREE diff --git a/haddock.spec b/haddock.spec index dd640f8..bdf9dcf 100644 --- a/haddock.spec +++ b/haddock.spec @@ -17,7 +17,7 @@ # version label of your release tarball. %define name haddock -%define version 2.15.0 +%define version 2.14.4 %define release 1 Name: %{name} diff --git a/src/Haddock/InterfaceFile.hs b/src/Haddock/InterfaceFile.hs index 4673f86..c13125e 100644 --- a/src/Haddock/InterfaceFile.hs +++ b/src/Haddock/InterfaceFile.hs @@ -76,7 +76,7 @@ binaryInterfaceMagic = 0xD0Cface -- (2) set `binaryInterfaceVersionCompatibility` to [binaryInterfaceVersion] -- binaryInterfaceVersion :: Word16 -#if __GLASGOW_HASKELL__ == 709 +#if __GLASGOW_HASKELL__ == 708 binaryInterfaceVersion = 25 binaryInterfaceVersionCompatibility :: [Word16] From git at git.haskell.org Wed Jul 8 08:29:45 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:29:45 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, fix-travis, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Revert "Track type signature change of lookupModuleInAllPackages" (13d022e) Message-ID: <20150708082945.9B01C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/13d022e89d1fbe81ec318f7cc3ceace980f85d11 >--------------------------------------------------------------- commit 13d022e89d1fbe81ec318f7cc3ceace980f85d11 Author: Mateusz Kowalczyk Date: Thu Aug 14 20:23:27 2014 +0100 Revert "Track type signature change of lookupModuleInAllPackages" This reverts commit d59fec2c9551b5662a3507c0011e32a09a9c118f. >--------------------------------------------------------------- 13d022e89d1fbe81ec318f7cc3ceace980f85d11 src/Haddock/Interface/Create.hs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Haddock/Interface/Create.hs b/src/Haddock/Interface/Create.hs index ad6a1e9..d211530 100644 --- a/src/Haddock/Interface/Create.hs +++ b/src/Haddock/Interface/Create.hs @@ -45,6 +45,7 @@ import Bag import RdrName import TcRnTypes import FastString (concatFS) +import UniqFM -- | Use a 'TypecheckedModule' to produce an 'Interface'. @@ -169,9 +170,11 @@ lookupModuleDyn :: lookupModuleDyn _ (Just pkgId) mdlName = Module.mkModule pkgId mdlName lookupModuleDyn dflags Nothing mdlName = - case Packages.lookupModuleInAllPackages dflags mdlName of - (m,_):_ -> m - [] -> Module.mkModule Module.mainPackageKey mdlName + flip Module.mkModule mdlName $ + case filter Packages.modConfExposed . eltsUFM $ + Packages.lookupModuleInAllPackages dflags mdlName of + m:_ -> Packages.packageConfigId (Packages.modConfPkg m) + [] -> Module.mainPackageKey ------------------------------------------------------------------------------- From git at git.haskell.org Wed Jul 8 08:29:47 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:29:47 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, fix-travis, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Revert "Track changes for module reexports." (c90796e) Message-ID: <20150708082947.A648D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/c90796ed7a6a625854d28bf55c71eeb36d298c55 >--------------------------------------------------------------- commit c90796ed7a6a625854d28bf55c71eeb36d298c55 Author: Mateusz Kowalczyk Date: Thu Aug 14 20:23:31 2014 +0100 Revert "Track changes for module reexports." This reverts commit b99b57c0df072d12b67816b45eca2a03cb1da96d. >--------------------------------------------------------------- c90796ed7a6a625854d28bf55c71eeb36d298c55 src/Haddock/Interface/Create.hs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Haddock/Interface/Create.hs b/src/Haddock/Interface/Create.hs index d211530..abc65f1 100644 --- a/src/Haddock/Interface/Create.hs +++ b/src/Haddock/Interface/Create.hs @@ -45,7 +45,6 @@ import Bag import RdrName import TcRnTypes import FastString (concatFS) -import UniqFM -- | Use a 'TypecheckedModule' to produce an 'Interface'. @@ -171,9 +170,9 @@ lookupModuleDyn _ (Just pkgId) mdlName = Module.mkModule pkgId mdlName lookupModuleDyn dflags Nothing mdlName = flip Module.mkModule mdlName $ - case filter Packages.modConfExposed . eltsUFM $ + case filter snd $ Packages.lookupModuleInAllPackages dflags mdlName of - m:_ -> Packages.packageConfigId (Packages.modConfPkg m) + (pkgId,_):_ -> Packages.packageConfigId pkgId [] -> Module.mainPackageKey From git at git.haskell.org Wed Jul 8 08:29:49 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:29:49 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, fix-travis, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Revert "Track GHC PackageId to PackageKey renaming." (9f37aff) Message-ID: <20150708082949.B7D3D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/9f37affe403f19faad0d9874f7d552f094d18af0 >--------------------------------------------------------------- commit 9f37affe403f19faad0d9874f7d552f094d18af0 Author: Mateusz Kowalczyk Date: Thu Aug 14 20:23:42 2014 +0100 Revert "Track GHC PackageId to PackageKey renaming." This reverts commit 8ac42d3327473939c013551750425cac191ff0fd. >--------------------------------------------------------------- 9f37affe403f19faad0d9874f7d552f094d18af0 src/Haddock.hs | 10 +++++----- src/Haddock/Backends/Xhtml.hs | 2 +- src/Haddock/Backends/Xhtml/Layout.hs | 2 +- src/Haddock/Backends/Xhtml/Types.hs | 2 +- src/Haddock/GhcUtils.hs | 14 +++++++------- src/Haddock/Interface/Create.hs | 10 +++++----- src/Haddock/InterfaceFile.hs | 12 ++++++------ src/Haddock/ModuleTree.hs | 6 +++--- src/Haddock/Types.hs | 2 +- 9 files changed, 30 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 9f37affe403f19faad0d9874f7d552f094d18af0 From git at git.haskell.org Wed Jul 8 08:29:51 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:29:51 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, fix-travis, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Revert "Adapt to new definition of HsDecls.TyFamEqn" (a9b29ef) Message-ID: <20150708082951.C46733A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/a9b29ef84569bf70056b01826687bc4b0a8c0386 >--------------------------------------------------------------- commit a9b29ef84569bf70056b01826687bc4b0a8c0386 Author: Mateusz Kowalczyk Date: Thu Aug 14 20:23:47 2014 +0100 Revert "Adapt to new definition of HsDecls.TyFamEqn" This reverts commit cb96b4f1ed0462b4a394b9fda6612c3bea9886bd. >--------------------------------------------------------------- a9b29ef84569bf70056b01826687bc4b0a8c0386 src/Haddock/Backends/Xhtml/Decl.hs | 4 ++-- src/Haddock/Convert.hs | 12 ++++++------ src/Haddock/GhcUtils.hs | 2 +- src/Haddock/Interface/Rename.hs | 24 +++++++----------------- 4 files changed, 16 insertions(+), 26 deletions(-) diff --git a/src/Haddock/Backends/Xhtml/Decl.hs b/src/Haddock/Backends/Xhtml/Decl.hs index 0429580..8884f69 100644 --- a/src/Haddock/Backends/Xhtml/Decl.hs +++ b/src/Haddock/Backends/Xhtml/Decl.hs @@ -280,8 +280,8 @@ ppTyFam summary associated links instances fixities loc doc decl splice unicode = ppInstances instances docname unicode qual -- Individual equation of a closed type family - ppTyFamEqn TyFamEqn { tfe_tycon = n, tfe_rhs = rhs - , tfe_pats = HsWB { hswb_cts = ts }} + ppTyFamEqn TyFamInstEqn { tfie_tycon = n, tfie_rhs = rhs + , tfie_pats = HsWB { hswb_cts = ts }} = ( ppAppNameTypes (unLoc n) [] (map unLoc ts) unicode qual <+> equals <+> ppType unicode qual (unLoc rhs) , Nothing, [] ) diff --git a/src/Haddock/Convert.hs b/src/Haddock/Convert.hs index dfb0f14..405bf20 100644 --- a/src/Haddock/Convert.hs +++ b/src/Haddock/Convert.hs @@ -64,7 +64,7 @@ tyThingToLHsDecl t = noLoc $ case t of extractFamilyDecl _ = error "tyThingToLHsDecl: impossible associated tycon" - atTyClDecls = [synifyTyCon Nothing at_tc | ATI at_tc _ <- classATItems cl] + atTyClDecls = [synifyTyCon Nothing at_tc | (at_tc, _) <- classATItems cl] atFamDecls = map extractFamilyDecl atTyClDecls in TyClD $ ClassDecl { tcdCtxt = synifyCtx (classSCTheta cl) @@ -107,11 +107,11 @@ synifyAxBranch tc (CoAxBranch { cab_tvs = tkvs, cab_lhs = args, cab_rhs = rhs }) typats = map (synifyType WithinType) args hs_rhs = synifyType WithinType rhs (kvs, tvs) = partition isKindVar tkvs - in TyFamEqn { tfe_tycon = name - , tfe_pats = HsWB { hswb_cts = typats - , hswb_kvs = map tyVarName kvs - , hswb_tvs = map tyVarName tvs } - , tfe_rhs = hs_rhs } + in TyFamInstEqn { tfie_tycon = name + , tfie_pats = HsWB { hswb_cts = typats + , hswb_kvs = map tyVarName kvs + , hswb_tvs = map tyVarName tvs } + , tfie_rhs = hs_rhs } synifyAxiom :: CoAxiom br -> HsDecl Name synifyAxiom ax@(CoAxiom { co_ax_tc = tc }) diff --git a/src/Haddock/GhcUtils.hs b/src/Haddock/GhcUtils.hs index 8ea5485..c06b34a 100644 --- a/src/Haddock/GhcUtils.hs +++ b/src/Haddock/GhcUtils.hs @@ -102,7 +102,7 @@ getInstLoc (TyFamInstD (TyFamInstDecl -- Since CoAxioms' Names refer to the whole line for type family instances -- in particular, we need to dig a bit deeper to pull out the entire -- equation. This does not happen for data family instances, for some reason. - { tfid_eqn = L _ (TyFamEqn { tfe_rhs = L l _ })})) = l + { tfid_eqn = L _ (TyFamInstEqn { tfie_rhs = L l _ })})) = l -- Useful when there is a signature with multiple names, e.g. -- foo, bar :: Types.. diff --git a/src/Haddock/Interface/Rename.hs b/src/Haddock/Interface/Rename.hs index a804f4a..2eb2cc0 100644 --- a/src/Haddock/Interface/Rename.hs +++ b/src/Haddock/Interface/Rename.hs @@ -323,7 +323,7 @@ renameTyClD d = case d of lfundeps' <- mapM renameLFunDep lfundeps lsigs' <- mapM renameLSig lsigs ats' <- mapM (renameLThing renameFamilyDecl) ats - at_defs' <- mapM renameLTyFamDefltEqn at_defs + at_defs' <- mapM (mapM renameTyFamInstD) at_defs -- we don't need the default methods or the already collected doc entities return (ClassDecl { tcdCtxt = lcontext', tcdLName = lname', tcdTyVars = ltyvars' , tcdFDs = lfundeps', tcdSigs = lsigs', tcdMeths= emptyBag @@ -351,7 +351,7 @@ renameFamilyInfo :: FamilyInfo Name -> RnM (FamilyInfo DocName) renameFamilyInfo DataFamily = return DataFamily renameFamilyInfo OpenTypeFamily = return OpenTypeFamily renameFamilyInfo (ClosedTypeFamily eqns) - = do { eqns' <- mapM renameLTyFamInstEqn eqns + = do { eqns' <- mapM (renameLThing renameTyFamInstEqn) eqns ; return $ ClosedTypeFamily eqns' } renameDataDefn :: HsDataDefn Name -> RnM (HsDataDefn DocName) @@ -456,27 +456,17 @@ renameClsInstD (ClsInstDecl { cid_overlap_mode = omode renameTyFamInstD :: TyFamInstDecl Name -> RnM (TyFamInstDecl DocName) renameTyFamInstD (TyFamInstDecl { tfid_eqn = eqn }) - = do { eqn' <- renameLTyFamInstEqn eqn + = do { eqn' <- renameLThing renameTyFamInstEqn eqn ; return (TyFamInstDecl { tfid_eqn = eqn' , tfid_fvs = placeHolderNames }) } -renameLTyFamInstEqn :: LTyFamInstEqn Name -> RnM (LTyFamInstEqn DocName) -renameLTyFamInstEqn (L loc (TyFamEqn { tfe_tycon = tc, tfe_pats = pats_w_bndrs, tfe_rhs = rhs })) +renameTyFamInstEqn :: TyFamInstEqn Name -> RnM (TyFamInstEqn DocName) +renameTyFamInstEqn (TyFamInstEqn { tfie_tycon = tc, tfie_pats = pats_w_bndrs, tfie_rhs = rhs }) = do { tc' <- renameL tc ; pats' <- mapM renameLType (hswb_cts pats_w_bndrs) ; rhs' <- renameLType rhs - ; return (L loc (TyFamEqn { tfe_tycon = tc' - , tfe_pats = pats_w_bndrs { hswb_cts = pats' } - , tfe_rhs = rhs' })) } - -renameLTyFamDefltEqn :: LTyFamDefltEqn Name -> RnM (LTyFamDefltEqn DocName) -renameLTyFamDefltEqn (L loc (TyFamEqn { tfe_tycon = tc, tfe_pats = tvs, tfe_rhs = rhs })) - = do { tc' <- renameL tc - ; tvs' <- renameLTyVarBndrs tvs - ; rhs' <- renameLType rhs - ; return (L loc (TyFamEqn { tfe_tycon = tc' - , tfe_pats = tvs' - , tfe_rhs = rhs' })) } + ; return (TyFamInstEqn { tfie_tycon = tc', tfie_pats = pats_w_bndrs { hswb_cts = pats' } + , tfie_rhs = rhs' }) } renameDataFamInstD :: DataFamInstDecl Name -> RnM (DataFamInstDecl DocName) renameDataFamInstD (DataFamInstDecl { dfid_tycon = tc, dfid_pats = pats_w_bndrs, dfid_defn = defn }) From git at git.haskell.org Wed Jul 8 08:29:53 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:29:53 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, fix-travis, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Revert "Propagate overloading-mode for instance declarations in haddock (#9242)" (3f71dfe) Message-ID: <20150708082953.CEFF43A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/3f71dfef212ef3911e544ecc20aae1e7fddc5352 >--------------------------------------------------------------- commit 3f71dfef212ef3911e544ecc20aae1e7fddc5352 Author: Mateusz Kowalczyk Date: Thu Aug 14 20:23:52 2014 +0100 Revert "Propagate overloading-mode for instance declarations in haddock (#9242)" This reverts commit 8d20ca8d5a9bee73252ff2035ec45f9c03d0820c. >--------------------------------------------------------------- 3f71dfef212ef3911e544ecc20aae1e7fddc5352 src/Haddock/Interface/Rename.hs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/Haddock/Interface/Rename.hs b/src/Haddock/Interface/Rename.hs index 2eb2cc0..748e021 100644 --- a/src/Haddock/Interface/Rename.hs +++ b/src/Haddock/Interface/Rename.hs @@ -442,15 +442,11 @@ renameInstD (DataFamInstD { dfid_inst = d }) = do return (DataFamInstD { dfid_inst = d' }) renameClsInstD :: ClsInstDecl Name -> RnM (ClsInstDecl DocName) -renameClsInstD (ClsInstDecl { cid_overlap_mode = omode - , cid_poly_ty =ltype, cid_tyfam_insts = lATs - , cid_datafam_insts = lADTs }) = do +renameClsInstD (ClsInstDecl { cid_poly_ty =ltype, cid_tyfam_insts = lATs, cid_datafam_insts = lADTs }) = do ltype' <- renameLType ltype lATs' <- mapM (mapM renameTyFamInstD) lATs lADTs' <- mapM (mapM renameDataFamInstD) lADTs - return (ClsInstDecl { cid_overlap_mode = omode - , cid_poly_ty = ltype', cid_binds = emptyBag - , cid_sigs = [] + return (ClsInstDecl { cid_poly_ty = ltype', cid_binds = emptyBag, cid_sigs = [] , cid_tyfam_insts = lATs', cid_datafam_insts = lADTs' }) From git at git.haskell.org Wed Jul 8 08:29:55 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:29:55 +0000 (UTC) Subject: [commit: haddock] 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot: Revert "Disambiguate ‘die’ in test runners." (574d3c1) Message-ID: <20150708082955.DAE5E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/574d3c13ff139e120e6a2601ea6cec676ab8ba16 >--------------------------------------------------------------- commit 574d3c13ff139e120e6a2601ea6cec676ab8ba16 Author: Mateusz Kowalczyk Date: Thu Aug 14 20:26:03 2014 +0100 Revert "Disambiguate ?die? in test runners." This reverts commit dba02d6df32534aac5d257f2d28596238d248942. >--------------------------------------------------------------- 574d3c13ff139e120e6a2601ea6cec676ab8ba16 html-test/run.lhs | 2 +- latex-test/run.lhs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/html-test/run.lhs b/html-test/run.lhs index a866436..153ab32 100755 --- a/html-test/run.lhs +++ b/html-test/run.lhs @@ -41,7 +41,7 @@ main = do test :: IO () test = do x <- doesFileExist haddockPath - unless x $ System.Exit.die "you need to run 'cabal build' successfully first" + unless x $ die "you need to run 'cabal build' successfully first" contents <- getDirectoryContents testDir args <- getArgs diff --git a/latex-test/run.lhs b/latex-test/run.lhs index c1d48d9..423dc6f 100755 --- a/latex-test/run.lhs +++ b/latex-test/run.lhs @@ -41,7 +41,7 @@ main = do test :: IO () test = do x <- doesFileExist haddockPath - unless x $ System.Exit.die "you need to run 'cabal build' successfully first" + unless x $ die "you need to run 'cabal build' successfully first" contents <- getDirectoryContents testDir From git at git.haskell.org Wed Jul 8 08:29:57 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:29:57 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, fix-travis, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Revert "Replace local `die` by new `System.Exit.die`" (6b00a11) Message-ID: <20150708082957.E53A03A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/6b00a11733a8ae02c11e57a75265abd2dc77ecb0 >--------------------------------------------------------------- commit 6b00a11733a8ae02c11e57a75265abd2dc77ecb0 Author: Mateusz Kowalczyk Date: Thu Aug 14 20:26:09 2014 +0100 Revert "Replace local `die` by new `System.Exit.die`" This reverts commit 08aa509ebac58bfb202ea79c7c41291ec280a1c5. >--------------------------------------------------------------- 6b00a11733a8ae02c11e57a75265abd2dc77ecb0 src/Haddock/Utils.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Haddock/Utils.hs b/src/Haddock/Utils.hs index 9ccca36..ee7bfd0 100644 --- a/src/Haddock/Utils.hs +++ b/src/Haddock/Utils.hs @@ -300,7 +300,11 @@ bye :: String -> IO a bye s = putStr s >> exitSuccess -dieMsg :: String -> IO () +die :: String -> IO a +die s = hPutStr stderr s >> exitWith (ExitFailure 1) + + +dieMsg :: String -> IO a dieMsg s = getProgramName >>= \prog -> die (prog ++ ": " ++ s) From git at git.haskell.org Wed Jul 8 08:29:59 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:29:59 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, fix-travis, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Merge branch 'reverts' (5c93cc3) Message-ID: <20150708082959.F320A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/5c93cc347773c7634321edd5f808d5b55b46301f >--------------------------------------------------------------- commit 5c93cc347773c7634321edd5f808d5b55b46301f Merge: 5b81a9e 6b00a11 Author: Mateusz Kowalczyk Date: Thu Aug 14 20:27:34 2014 +0100 Merge branch 'reverts' This reverts any changes that were made to have Haddock compile with 7.9. When 7.10 release comes, we can simply re-apply all the patches and any patches that occur on ghc-head branch from now on. This allows us to build master with 7.8.3 >--------------------------------------------------------------- 5c93cc347773c7634321edd5f808d5b55b46301f html-test/run.lhs | 2 +- latex-test/run.lhs | 2 +- src/Haddock.hs | 10 +++++----- src/Haddock/Backends/Xhtml.hs | 2 +- src/Haddock/Backends/Xhtml/Decl.hs | 4 ++-- src/Haddock/Backends/Xhtml/Layout.hs | 2 +- src/Haddock/Backends/Xhtml/Types.hs | 2 +- src/Haddock/Convert.hs | 12 ++++++------ src/Haddock/GhcUtils.hs | 16 ++++++++-------- src/Haddock/Interface/Create.hs | 16 +++++++++------- src/Haddock/Interface/Rename.hs | 32 +++++++++----------------------- src/Haddock/InterfaceFile.hs | 12 ++++++------ src/Haddock/ModuleTree.hs | 6 +++--- src/Haddock/Types.hs | 2 +- src/Haddock/Utils.hs | 6 +++++- 15 files changed, 59 insertions(+), 67 deletions(-) From git at git.haskell.org Wed Jul 8 08:30:02 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:30:02 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, fix-travis, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Fix #313 by doing some list munging. (08db4c8) Message-ID: <20150708083002.1B29F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/08db4c81ffac672a4a5a90291be70279e9a1f098 >--------------------------------------------------------------- commit 08db4c81ffac672a4a5a90291be70279e9a1f098 Author: Mateusz Kowalczyk Date: Mon Jul 28 14:31:03 2014 +0200 Fix #313 by doing some list munging. I get rid of the Monoid instance because we weren't satisfying the laws. Convenience of having <> didn't outweigh the shock-factor of having it behave badly. >--------------------------------------------------------------- 08db4c81ffac672a4a5a90291be70279e9a1f098 haddock-library/src/Documentation/Haddock/Doc.hs | 12 ++- .../src/Documentation/Haddock/Parser.hs | 26 +++---- .../test/Documentation/Haddock/ParserSpec.hs | 20 ++++- html-test/ref/{Bug308.html => Bug313.html} | 89 +++++++++++++--------- html-test/src/Bug313.hs | 37 +++++++++ src/Haddock/Doc.hs | 3 +- src/Haddock/Interface/Create.hs | 7 +- src/Haddock/Interface/LexParseRn.hs | 4 +- 8 files changed, 137 insertions(+), 61 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 08db4c81ffac672a4a5a90291be70279e9a1f098 From git at git.haskell.org Wed Jul 8 08:30:04 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:30:04 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, fix-travis, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Stop testing #188. (eba425b) Message-ID: <20150708083004.274AE3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/eba425b7872be52f8b83afd0b7a9803652ede70b >--------------------------------------------------------------- commit eba425b7872be52f8b83afd0b7a9803652ede70b Author: Mateusz Kowalczyk Date: Fri Aug 15 02:52:56 2014 +0100 Stop testing #188. Because the change is in GHC 7.9 and we now work against 7.8.3, this test no longer makes sense. We revert it until 7.10 becomes the standard version. If anything, there should be a test for this in GHC itself. >--------------------------------------------------------------- eba425b7872be52f8b83afd0b7a9803652ede70b html-test/ref/Bug188.html | 81 -------------------------------------------- html-test/ref/Operators.html | 16 ++++----- html-test/src/Bug188.hs | 7 ---- 3 files changed, 8 insertions(+), 96 deletions(-) diff --git a/html-test/ref/Bug188.html b/html-test/ref/Bug188.html deleted file mode 100644 index 3e9f4ee..0000000 --- a/html-test/ref/Bug188.html +++ /dev/null @@ -1,81 +0,0 @@ - -Bug188
                                              Safe HaskellSafe-Inferred

                                              Bug188

                                              Documentation

                                              class A a where

                                              Methods

                                              f, g, h, i :: a -> ()

                                              diff --git a/html-test/ref/Operators.html b/html-test/ref/Operators.html index bfecfb3..fac8c94 100644 --- a/html-test/ref/Operators.html +++ b/html-test/ref/Operators.html @@ -151,11 +151,11 @@ window.onload = function () {pageLoad();setSynopsis("mini_Operators.html");}; >(**>), (**<)(<**), (>**), (<**)(**<) :: a -> a -> ()

                                            (**>), (**<), (>**), (<**), (>**), (**<) :: a -> a -> () infixr 8 **>, >**infixl 8 **<, <**infixl 8 <**, **<

                                            Produced by Haddock version 2.15.0

                                            version 2.14.4

                      () From git at git.haskell.org Wed Jul 8 08:30:06 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:30:06 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, fix-travis, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Add #313 to CHANGES (1bc2028) Message-ID: <20150708083006.3601F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/1bc20282bd0d5d2640d52c25cf91f8363e3adb4e >--------------------------------------------------------------- commit 1bc20282bd0d5d2640d52c25cf91f8363e3adb4e Author: Mateusz Kowalczyk Date: Fri Aug 15 05:31:57 2014 +0100 Add #313 to CHANGES >--------------------------------------------------------------- 1bc20282bd0d5d2640d52c25cf91f8363e3adb4e CHANGES | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES b/CHANGES index 832b398..de15517 100644 --- a/CHANGES +++ b/CHANGES @@ -6,6 +6,8 @@ Changes in version 2.14.4 * parser: don't mangle append order for nested lists (pandoc #1346) + * parser: preserve list ordering in certain scenarios (#313) + Changes in version 2.14.3 * Fix parsing of identifiers with ^ or ? in them (#298) From git at git.haskell.org Wed Jul 8 08:30:08 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:30:08 +0000 (UTC) Subject: [commit: haddock] wip/landmine-param-family: Bring in PostRn instance (1f1f7d5) Message-ID: <20150708083008.3F83C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/landmine-param-family Link : http://git.haskell.org/haddock.git/commitdiff/1f1f7d51a5c27a696bbef69a01c3c256a7619d3d >--------------------------------------------------------------- commit 1f1f7d51a5c27a696bbef69a01c3c256a7619d3d Author: Alan Zimmerman Date: Sat Aug 16 12:12:46 2014 +0200 Bring in PostRn instance >--------------------------------------------------------------- 1f1f7d51a5c27a696bbef69a01c3c256a7619d3d src/Haddock/Interface/Rename.hs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Haddock/Interface/Rename.hs b/src/Haddock/Interface/Rename.hs index a804f4a..7344591 100644 --- a/src/Haddock/Interface/Rename.hs +++ b/src/Haddock/Interface/Rename.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE TypeFamilies #-} ---------------------------------------------------------------------------- -- | -- Module : Haddock.Interface.Rename @@ -20,6 +21,7 @@ import Haddock.Types import Bag (emptyBag) import GHC hiding (NoLink) import Name +import NameSet import Control.Applicative import Control.Monad hiding (mapM) @@ -453,6 +455,7 @@ renameClsInstD (ClsInstDecl { cid_overlap_mode = omode , cid_sigs = [] , cid_tyfam_insts = lATs', cid_datafam_insts = lADTs' }) +type instance PostRn DocName NameSet = NameSet renameTyFamInstD :: TyFamInstDecl Name -> RnM (TyFamInstDecl DocName) renameTyFamInstD (TyFamInstDecl { tfid_eqn = eqn }) From git at git.haskell.org Wed Jul 8 08:30:10 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:30:10 +0000 (UTC) Subject: [commit: haddock] wip/landmine-param-family: Provide PostTc DocName Kind instance (2a160df) Message-ID: <20150708083010.4DAF03A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/landmine-param-family Link : http://git.haskell.org/haddock.git/commitdiff/2a160df85dc1f3d035c16e2a346efe4b0b85715e >--------------------------------------------------------------- commit 2a160df85dc1f3d035c16e2a346efe4b0b85715e Author: Alan Zimmerman Date: Sat Aug 16 14:50:17 2014 +0200 Provide PostTc DocName Kind instance >--------------------------------------------------------------- 2a160df85dc1f3d035c16e2a346efe4b0b85715e src/Haddock/Interface/Rename.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Haddock/Interface/Rename.hs b/src/Haddock/Interface/Rename.hs index 7344591..87ba994 100644 --- a/src/Haddock/Interface/Rename.hs +++ b/src/Haddock/Interface/Rename.hs @@ -179,6 +179,8 @@ renameLKind = renameLType renameMaybeLKind :: Maybe (LHsKind Name) -> RnM (Maybe (LHsKind DocName)) renameMaybeLKind = traverse renameLKind +type instance PostTc DocName Kind = () + renameType :: HsType Name -> RnM (HsType DocName) renameType t = case t of HsForAllTy expl tyvars lcontext ltype -> do From git at git.haskell.org Wed Jul 8 08:30:12 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:30:12 +0000 (UTC) Subject: [commit: haddock] wip/landmine-param-family: Introduce PlaceHolder instead of () (e4089ee) Message-ID: <20150708083012.593E33A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/landmine-param-family Link : http://git.haskell.org/haddock.git/commitdiff/e4089ee9020cd07e38fbe69f868481aabaa039d3 >--------------------------------------------------------------- commit e4089ee9020cd07e38fbe69f868481aabaa039d3 Author: Alan Zimmerman Date: Sun Aug 17 14:54:39 2014 +0200 Introduce PlaceHolder instead of () >--------------------------------------------------------------- e4089ee9020cd07e38fbe69f868481aabaa039d3 src/Haddock/Interface/Rename.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Haddock/Interface/Rename.hs b/src/Haddock/Interface/Rename.hs index 87ba994..7f1b1ef 100644 --- a/src/Haddock/Interface/Rename.hs +++ b/src/Haddock/Interface/Rename.hs @@ -179,7 +179,7 @@ renameLKind = renameLType renameMaybeLKind :: Maybe (LHsKind Name) -> RnM (Maybe (LHsKind DocName)) renameMaybeLKind = traverse renameLKind -type instance PostTc DocName Kind = () +type instance PostTc DocName Kind = PlaceHolder renameType :: HsType Name -> RnM (HsType DocName) renameType t = case t of From git at git.haskell.org Wed Jul 8 08:30:14 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:30:14 +0000 (UTC) Subject: [commit: haddock] wip/landmine-param-family: Get rid of PlaceHolderNames class (87b2cba) Message-ID: <20150708083014.651E73A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/landmine-param-family Link : http://git.haskell.org/haddock.git/commitdiff/87b2cba0850d75b10617327acc3923995fc08399 >--------------------------------------------------------------- commit 87b2cba0850d75b10617327acc3923995fc08399 Author: Alan Zimmerman Date: Mon Aug 18 10:30:28 2014 +0200 Get rid of PlaceHolderNames class >--------------------------------------------------------------- 87b2cba0850d75b10617327acc3923995fc08399 src/Haddock/Convert.hs | 10 +++++----- src/Haddock/Interface/Rename.hs | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Haddock/Convert.hs b/src/Haddock/Convert.hs index dfb0f14..4830639 100644 --- a/src/Haddock/Convert.hs +++ b/src/Haddock/Convert.hs @@ -81,7 +81,7 @@ tyThingToLHsDecl t = noLoc $ case t of , tcdATs = atFamDecls , tcdATDefs = [] --ignore associated type defaults , tcdDocs = [] --we don't have any docs at this point - , tcdFVs = placeHolderNames } + , tcdFVs = placeHolderNamesTc } | otherwise -> TyClD (synifyTyCon Nothing tc) @@ -118,7 +118,7 @@ synifyAxiom ax@(CoAxiom { co_ax_tc = tc }) | isOpenSynFamilyTyCon tc , Just branch <- coAxiomSingleBranch_maybe ax = InstD (TyFamInstD (TyFamInstDecl { tfid_eqn = noLoc $ synifyAxBranch tc branch - , tfid_fvs = placeHolderNames })) + , tfid_fvs = placeHolderNamesTc })) | Just ax' <- isClosedSynFamilyTyCon_maybe tc , getUnique ax' == getUnique ax -- without the getUniques, type error @@ -148,7 +148,7 @@ synifyTyCon coax tc -- we have their kind accurately: , dd_cons = [] -- No constructors , dd_derivs = Nothing } - , tcdFVs = placeHolderNames } + , tcdFVs = placeHolderNamesTc } | isSynFamilyTyCon tc = case synTyConRhs_maybe tc of @@ -177,7 +177,7 @@ synifyTyCon coax tc SynDecl { tcdLName = synifyName tc , tcdTyVars = synifyTyVars (tyConTyVars tc) , tcdRhs = synifyType WithinType ty - , tcdFVs = placeHolderNames } + , tcdFVs = placeHolderNamesTc } _ -> error "synifyTyCon: impossible synTyCon" | otherwise = -- (closed) newtype and data @@ -217,7 +217,7 @@ synifyTyCon coax tc , dd_cons = cons , dd_derivs = alg_deriv } in DataDecl { tcdLName = name, tcdTyVars = tyvars, tcdDataDefn = defn - , tcdFVs = placeHolderNames } + , tcdFVs = placeHolderNamesTc } -- User beware: it is your responsibility to pass True (use_gadt_syntax) -- for any constructor that would be misrepresented by omitting its diff --git a/src/Haddock/Interface/Rename.hs b/src/Haddock/Interface/Rename.hs index 7f1b1ef..c6cea8d 100644 --- a/src/Haddock/Interface/Rename.hs +++ b/src/Haddock/Interface/Rename.hs @@ -307,17 +307,17 @@ renameTyClD d = case d of decl' <- renameFamilyDecl decl return (FamDecl { tcdFam = decl' }) - SynDecl { tcdLName = lname, tcdTyVars = tyvars, tcdRhs = rhs, tcdFVs = fvs } -> do + SynDecl { tcdLName = lname, tcdTyVars = tyvars, tcdRhs = rhs, tcdFVs = _fvs } -> do lname' <- renameL lname tyvars' <- renameLTyVarBndrs tyvars rhs' <- renameLType rhs - return (SynDecl { tcdLName = lname', tcdTyVars = tyvars', tcdRhs = rhs', tcdFVs = fvs }) + return (SynDecl { tcdLName = lname', tcdTyVars = tyvars', tcdRhs = rhs', tcdFVs = placeHolderNames }) - DataDecl { tcdLName = lname, tcdTyVars = tyvars, tcdDataDefn = defn, tcdFVs = fvs } -> do + DataDecl { tcdLName = lname, tcdTyVars = tyvars, tcdDataDefn = defn, tcdFVs = _fvs } -> do lname' <- renameL lname tyvars' <- renameLTyVarBndrs tyvars defn' <- renameDataDefn defn - return (DataDecl { tcdLName = lname', tcdTyVars = tyvars', tcdDataDefn = defn', tcdFVs = fvs }) + return (DataDecl { tcdLName = lname', tcdTyVars = tyvars', tcdDataDefn = defn', tcdFVs = placeHolderNames }) ClassDecl { tcdCtxt = lcontext, tcdLName = lname, tcdTyVars = ltyvars , tcdFDs = lfundeps, tcdSigs = lsigs, tcdATs = ats, tcdATDefs = at_defs } -> do @@ -457,7 +457,7 @@ renameClsInstD (ClsInstDecl { cid_overlap_mode = omode , cid_sigs = [] , cid_tyfam_insts = lATs', cid_datafam_insts = lADTs' }) -type instance PostRn DocName NameSet = NameSet +type instance PostRn DocName NameSet = PlaceHolder renameTyFamInstD :: TyFamInstDecl Name -> RnM (TyFamInstDecl DocName) renameTyFamInstD (TyFamInstDecl { tfid_eqn = eqn }) From git at git.haskell.org Wed Jul 8 08:30:16 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:30:16 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, fix-travis, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Fix warning (4f17193) Message-ID: <20150708083016.71B5F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,fix-travis,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/4f1719311a7f9187bf863be562eafb1a3757b1aa >--------------------------------------------------------------- commit 4f1719311a7f9187bf863be562eafb1a3757b1aa Author: Simon Hengel Date: Wed Aug 20 11:25:32 2014 +0800 Fix warning >--------------------------------------------------------------- 4f1719311a7f9187bf863be562eafb1a3757b1aa haddock-library/test/Documentation/Haddock/ParserSpec.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/haddock-library/test/Documentation/Haddock/ParserSpec.hs b/haddock-library/test/Documentation/Haddock/ParserSpec.hs index 7df9dab..4fea255 100644 --- a/haddock-library/test/Documentation/Haddock/ParserSpec.hs +++ b/haddock-library/test/Documentation/Haddock/ParserSpec.hs @@ -12,6 +12,7 @@ import Test.Hspec import Test.QuickCheck infixr 6 <> +(<>) :: Doc id -> Doc id -> Doc id (<>) = docAppend type Doc id = DocH () id From git at git.haskell.org Wed Jul 8 08:30:18 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:30:18 +0000 (UTC) Subject: [commit: haddock] fix-travis: Update travis-ci config (6983ac9) Message-ID: <20150708083018.802663A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : fix-travis Link : http://git.haskell.org/haddock.git/commitdiff/6983ac92979d78ef7832c863e08d0b01f18049aa >--------------------------------------------------------------- commit 6983ac92979d78ef7832c863e08d0b01f18049aa Author: Simon Hengel Date: Wed Aug 20 11:31:25 2014 +0800 Update travis-ci config >--------------------------------------------------------------- 6983ac92979d78ef7832c863e08d0b01f18049aa .travis.yml | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4561411..0d2de6e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,41 +1,16 @@ language: haskell -notifications: - email: - on_success: never - on_failure: change - env: - - GHCVER=7.4.1 - - GHCVER=7.4.2 - - GHCVER=7.6.3 - GHCVER=7.8.1 - GHCVER=7.8.2 - GHCVER=7.8.3 - - GHCVER=head before_install: - sudo add-apt-repository -y ppa:hvr/ghc - sudo apt-get update - sudo apt-get install ghc-$GHCVER - export PATH=/opt/ghc/$GHCVER/bin:$PATH - -install: - - case "$GHCVER" in - "head") (cd haddock-library/ && cabal install --enable-tests - && cd .. && cabal install --only-dependencies --enable-tests) ;; - *) - (cd haddock-library/ && cabal install --only-dependencies --enable-tests) ;; - - esac + - (cd haddock-library/ && cabal test --ghc-options=-Werror && cabal install) script: - # Yes, in case of HEAD we do end up building haddock-library twice - # but we want to see the test results. - - (cd haddock-library/ && cabal configure --enable-tests --ghc-options=-Werror - && cabal build && cabal test && cabal install && cabal install doctest - && doctest -isrc -ivendor/attoparsec-0.10.4.0 -optP-include -optPdist/build/autogen/cabal_macros.h src/Documentation/Haddock/Parser.hs) - - case "$GHCVER" in - "head") (cabal configure --enable-tests --ghc-options=-Werror && cabal build && cabal test) ;; - *) ;; - esac + - test --ghc-options=-Werror From git at git.haskell.org Wed Jul 8 08:30:20 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:30:20 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Fix travis builds (373f21c) Message-ID: <20150708083020.899A93A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/373f21c6a010c48c7ea5a1851b4c4a5c2a28bdaa >--------------------------------------------------------------- commit 373f21c6a010c48c7ea5a1851b4c4a5c2a28bdaa Author: Simon Hengel Date: Wed Aug 20 11:31:25 2014 +0800 Fix travis builds >--------------------------------------------------------------- 373f21c6a010c48c7ea5a1851b4c4a5c2a28bdaa .travis.yml | 35 ++++++++--------------------------- 1 file changed, 8 insertions(+), 27 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4561411..c1b958d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,41 +1,22 @@ language: haskell -notifications: - email: - on_success: never - on_failure: change - env: - - GHCVER=7.4.1 - - GHCVER=7.4.2 - - GHCVER=7.6.3 - GHCVER=7.8.1 - GHCVER=7.8.2 - GHCVER=7.8.3 - - GHCVER=head before_install: - sudo add-apt-repository -y ppa:hvr/ghc - sudo apt-get update - sudo apt-get install ghc-$GHCVER - export PATH=/opt/ghc/$GHCVER/bin:$PATH - -install: - - case "$GHCVER" in - "head") (cd haddock-library/ && cabal install --enable-tests - && cd .. && cabal install --only-dependencies --enable-tests) ;; - *) - (cd haddock-library/ && cabal install --only-dependencies --enable-tests) ;; - - esac + - cd haddock-library + - cabal install --only-dependencies --enable-tests + - cabal install doctest + - cabal configure --enable-tests --ghc-options=-Werror && cabal build && cabal test + - doctest -isrc -i$(echo vendor/attoparsec-*) -optP-include -optPdist/build/autogen/cabal_macros.h src/Documentation/Haddock/Parser.hs + - cabal install + - cd .. script: - # Yes, in case of HEAD we do end up building haddock-library twice - # but we want to see the test results. - - (cd haddock-library/ && cabal configure --enable-tests --ghc-options=-Werror - && cabal build && cabal test && cabal install && cabal install doctest - && doctest -isrc -ivendor/attoparsec-0.10.4.0 -optP-include -optPdist/build/autogen/cabal_macros.h src/Documentation/Haddock/Parser.hs) - - case "$GHCVER" in - "head") (cabal configure --enable-tests --ghc-options=-Werror && cabal build && cabal test) ;; - *) ;; - esac + - cabal configure --enable-tests --ghc-options=-Werror && cabal build && cabal test From git at git.haskell.org Wed Jul 8 08:30:22 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:30:22 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Require GHC 7.8.3 (2c3f2b4) Message-ID: <20150708083022.954BC3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/2c3f2b47fa5e66f5503b5418415e2fa75d134689 >--------------------------------------------------------------- commit 2c3f2b47fa5e66f5503b5418415e2fa75d134689 Author: Simon Hengel Date: Wed Aug 20 12:14:31 2014 +0800 Require GHC 7.8.3 >--------------------------------------------------------------- 2c3f2b47fa5e66f5503b5418415e2fa75d134689 .travis.yml | 2 -- haddock.cabal | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index c1b958d..338d394 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,6 @@ language: haskell env: - - GHCVER=7.8.1 - - GHCVER=7.8.2 - GHCVER=7.8.3 before_install: diff --git a/haddock.cabal b/haddock.cabal index 3082214..7e3fa0e 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -83,7 +83,7 @@ executable haddock array, xhtml >= 3000.2 && < 3000.3, Cabal >= 1.10, - ghc == 7.8.*, + ghc == 7.8.3, bytestring other-modules: @@ -149,7 +149,7 @@ library array, xhtml >= 3000.2 && < 3000.3, Cabal >= 1.10, - ghc == 7.8.* + ghc == 7.8.3 if flag(in-ghc-tree) cpp-options: -DIN_GHC_TREE From git at git.haskell.org Wed Jul 8 08:30:24 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:30:24 +0000 (UTC) Subject: [commit: haddock] wip/landmine-param-family: Need a PlaceHolder for PostTc DocName Coercion (3362e23) Message-ID: <20150708083024.A048C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/landmine-param-family Link : http://git.haskell.org/haddock.git/commitdiff/3362e23040506ad44ee7a383585ed455f1aecdd0 >--------------------------------------------------------------- commit 3362e23040506ad44ee7a383585ed455f1aecdd0 Author: Alan Zimmerman Date: Thu Aug 21 23:44:37 2014 +0200 Need a PlaceHolder for PostTc DocName Coercion >--------------------------------------------------------------- 3362e23040506ad44ee7a383585ed455f1aecdd0 src/Haddock/Interface/Rename.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Haddock/Interface/Rename.hs b/src/Haddock/Interface/Rename.hs index c6cea8d..24e7412 100644 --- a/src/Haddock/Interface/Rename.hs +++ b/src/Haddock/Interface/Rename.hs @@ -22,6 +22,7 @@ import Bag (emptyBag) import GHC hiding (NoLink) import Name import NameSet +import Coercion import Control.Applicative import Control.Monad hiding (mapM) @@ -180,6 +181,7 @@ renameMaybeLKind :: Maybe (LHsKind Name) -> RnM (Maybe (LHsKind DocName)) renameMaybeLKind = traverse renameLKind type instance PostTc DocName Kind = PlaceHolder +type instance PostTc DocName Coercion = PlaceHolder renameType :: HsType Name -> RnM (HsType DocName) renameType t = case t of From git at git.haskell.org Wed Jul 8 08:30:26 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:30:26 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Move Haddock API to a separate package (e992520) Message-ID: <20150708083026.B9EBD3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/e99252026ad1b50215b86ffe30038351ca486bfa >--------------------------------------------------------------- commit e99252026ad1b50215b86ffe30038351ca486bfa Author: Simon Hengel Date: Fri Aug 22 12:14:16 2014 +0800 Move Haddock API to a separate package >--------------------------------------------------------------- e99252026ad1b50215b86ffe30038351ca486bfa .gitignore | 3 +- .travis.yml | 1 + LICENSE | 0 {haddock-library => haddock-api}/LICENSE | 0 Setup.lhs => haddock-api/Setup.lhs | 0 haddock-api/haddock-api.cabal | 94 +++++++++++++++++ .../resources}/html/Classic.theme/haskell_icon.gif | Bin .../resources}/html/Classic.theme/minus.gif | Bin .../resources}/html/Classic.theme/plus.gif | Bin .../resources}/html/Classic.theme/xhaddock.css | 0 .../resources}/html/Ocean.std-theme/hslogo-16.png | Bin .../resources}/html/Ocean.std-theme/minus.gif | Bin .../resources}/html/Ocean.std-theme/ocean.css | 0 .../resources}/html/Ocean.std-theme/plus.gif | Bin .../resources}/html/Ocean.std-theme/synopsis.png | Bin .../resources}/html/frames.html | 0 .../resources}/html/haddock-util.js | 0 .../resources}/latex/haddock.sty | 0 haddock-api/src | 1 + haddock.cabal | 116 +-------------------- src/Haddock.hs | 3 +- src/Haddock/Version.hs | 9 +- 22 files changed, 110 insertions(+), 117 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 e99252026ad1b50215b86ffe30038351ca486bfa From git at git.haskell.org Wed Jul 8 08:30:28 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:30:28 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Bump version to 2.15.0 and add version constraints (4dc4d3c) Message-ID: <20150708083028.C49843A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/4dc4d3cfa18d795f9b2bb7c5a3ac60ce29d8f279 >--------------------------------------------------------------- commit 4dc4d3cfa18d795f9b2bb7c5a3ac60ce29d8f279 Author: Simon Hengel Date: Fri Aug 22 14:57:38 2014 +0800 Bump version to 2.15.0 and add version constraints >--------------------------------------------------------------- 4dc4d3cfa18d795f9b2bb7c5a3ac60ce29d8f279 haddock-api/haddock-api.cabal | 4 ++-- haddock.cabal | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/haddock-api/haddock-api.cabal b/haddock-api/haddock-api.cabal index c40edb1..71bf11f 100644 --- a/haddock-api/haddock-api.cabal +++ b/haddock-api/haddock-api.cabal @@ -1,5 +1,5 @@ name: haddock-api -version: 2.14.4 +version: 2.15.0 synopsis: A documentation-generation tool for Haskell libraries description: Haddock is a documentation-generation tool for Haskell libraries @@ -48,7 +48,7 @@ library , ghc == 7.8.3 , ghc-paths - , haddock-library + , haddock-library == 1.1.0.* hs-source-dirs: src diff --git a/haddock.cabal b/haddock.cabal index 57f6d15..9939a35 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -1,5 +1,5 @@ name: haddock -version: 2.14.4 +version: 2.15.0 synopsis: A documentation-generation tool for Haskell libraries description: Haddock is a documentation-generation tool for Haskell libraries @@ -110,7 +110,7 @@ executable haddock Haddock.GhcUtils Haddock.Convert else - build-depends: haddock-api, haddock-library + build-depends: haddock-api == 2.15.0 test-suite html-test type: exitcode-stdio-1.0 From git at git.haskell.org Wed Jul 8 08:30:30 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:30:30 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Add deprecated compatibility module (259b2a9) Message-ID: <20150708083030.D42643A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/259b2a9d821716a4e0ad5a1ea595576bac077daa >--------------------------------------------------------------- commit 259b2a9d821716a4e0ad5a1ea595576bac077daa Author: Simon Hengel Date: Fri Aug 22 15:18:06 2014 +0800 Add deprecated compatibility module >--------------------------------------------------------------- 259b2a9d821716a4e0ad5a1ea595576bac077daa compat/Documentation/Haddock.hs | 5 +++++ haddock.cabal | 15 +++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/compat/Documentation/Haddock.hs b/compat/Documentation/Haddock.hs new file mode 100644 index 0000000..4130cfb --- /dev/null +++ b/compat/Documentation/Haddock.hs @@ -0,0 +1,5 @@ +{-# LANGUAGE PackageImports #-} +module Documentation.Haddock {-# DEPRECATED "Use @Documentation.Haddock@ from package instead!" #-} ( + module Documentation.Haddock +) where +import "haddock-api" Documentation.Haddock diff --git a/haddock.cabal b/haddock.cabal index 9939a35..5932b12 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -40,6 +40,21 @@ flag in-ghc-tree default: False manual: True +-- This package re-exports the haddock-api library for compatibility. +-- The library section will be removed in version 2.16.0. +library + exposed: False + default-language: Haskell2010 + hs-source-dirs: compat + ghc-options: -Wall + build-depends: + -- NOTE: Don't bump base dependency! Remove library section instead! + base >= 4.3 && < 4.8 + , haddock-api + exposed-modules: Documentation.Haddock + if flag(in-ghc-tree) + buildable: False + executable haddock default-language: Haskell2010 main-is: Main.hs From git at git.haskell.org Wed Jul 8 08:30:32 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:30:32 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: export things to allow customizing how the Ghc session is run (a18e080) Message-ID: <20150708083032.DF7123A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/a18e080534a2778f37cb8ff9d501959fe6cc7acd >--------------------------------------------------------------- commit a18e080534a2778f37cb8ff9d501959fe6cc7acd Author: Luite Stegeman Date: Wed Aug 20 05:42:45 2014 +0200 export things to allow customizing how the Ghc session is run >--------------------------------------------------------------- a18e080534a2778f37cb8ff9d501959fe6cc7acd src/Documentation/Haddock.hs | 8 +++++++- src/Haddock.hs | 29 +++++++++++++++++++---------- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/src/Documentation/Haddock.hs b/src/Documentation/Haddock.hs index 655a972..1ff5cf7 100644 --- a/src/Documentation/Haddock.hs +++ b/src/Documentation/Haddock.hs @@ -57,8 +57,14 @@ module Documentation.Haddock ( Flag(..), DocOption(..), + -- * Error handling + HaddockException(..), + -- * Program entry point haddock, + haddockWithGhc, + getGhcDirs, + withGhc ) where @@ -79,5 +85,5 @@ createInterfaces -> [String] -- ^ File or module names -> IO [Interface] -- ^ Resulting list of interfaces createInterfaces flags modules = do - (_, ifaces, _) <- withGhc' flags (readPackagesAndProcessModules flags modules) + (_, ifaces, _) <- withGhc flags (readPackagesAndProcessModules flags modules) return ifaces diff --git a/src/Haddock.hs b/src/Haddock.hs index ad78c50..0cff5bd 100644 --- a/src/Haddock.hs +++ b/src/Haddock.hs @@ -1,5 +1,5 @@ {-# OPTIONS_GHC -Wwarn #-} -{-# LANGUAGE CPP, ScopedTypeVariables #-} +{-# LANGUAGE CPP, ScopedTypeVariables, Rank2Types #-} {-# LANGUAGE LambdaCase #-} ----------------------------------------------------------------------------- -- | @@ -17,7 +17,13 @@ -- -- Program entry point and top-level code. ----------------------------------------------------------------------------- -module Haddock (haddock, readPackagesAndProcessModules, withGhc') where +module Haddock ( + haddock, + haddockWithGhc, + getGhcDirs, + readPackagesAndProcessModules, + withGhc +) where import Haddock.Backends.Xhtml import Haddock.Backends.Xhtml.Themes (getThemes) @@ -128,7 +134,10 @@ handleGhcExceptions = -- -- > main = getArgs >>= haddock haddock :: [String] -> IO () -haddock args = handleTopExceptions $ do +haddock args = haddockWithGhc withGhc args + +haddockWithGhc :: (forall a. [Flag] -> Ghc a -> IO a) -> [String] -> IO () +haddockWithGhc ghc args = handleTopExceptions $ do -- Parse command-line flags and handle some of them initially. -- TODO: unify all of this (and some of what's in the 'render' function), @@ -139,7 +148,7 @@ haddock args = handleTopExceptions $ do qual <- case qualification flags of {Left msg -> throwE msg; Right q -> return q} -- inject dynamic-too into flags before we proceed - flags' <- withGhc' flags $ do + flags' <- ghc flags $ do df <- getDynFlags case lookup "GHC Dynamic" (compilerInfo df) of Just "YES" -> return $ Flag_OptGhc "-dynamic-too" : flags @@ -149,7 +158,7 @@ haddock args = handleTopExceptions $ do forM_ (warnings args) $ \warning -> do hPutStrLn stderr warning - withGhc' flags' $ do + ghc flags' $ do dflags <- getDynFlags @@ -183,8 +192,8 @@ warnings = map format . filter (isPrefixOf "-optghc") format arg = concat ["Warning: `", arg, "' means `-o ", drop 2 arg, "', did you mean `-", arg, "'?"] -withGhc' :: [Flag] -> Ghc a -> IO a -withGhc' flags action = do +withGhc :: [Flag] -> Ghc a -> IO a +withGhc flags action = do libDir <- fmap snd (getGhcDirs flags) -- Catches all GHC source errors, then prints and re-throws them. @@ -192,7 +201,7 @@ withGhc' flags action = do printException err liftIO exitFailure - withGhc libDir (ghcFlags flags) (\_ -> handleSrcErrors action) + withGhc' libDir (ghcFlags flags) (\_ -> handleSrcErrors action) readPackagesAndProcessModules :: [Flag] -> [String] @@ -313,8 +322,8 @@ readInterfaceFiles name_cache_accessor pairs = do -- | Start a GHC session with the -haddock flag set. Also turn off -- compilation and linking. Then run the given 'Ghc' action. -withGhc :: String -> [String] -> (DynFlags -> Ghc a) -> IO a -withGhc libDir flags ghcActs = runGhc (Just libDir) $ do +withGhc' :: String -> [String] -> (DynFlags -> Ghc a) -> IO a +withGhc' libDir flags ghcActs = runGhc (Just libDir) $ do dynflags <- getSessionDynFlags dynflags' <- parseGhcFlags (gopt_set dynflags Opt_Haddock) { hscTarget = HscNothing, From git at git.haskell.org Wed Jul 8 08:30:34 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:30:34 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: ghc 7.8.2 compatibility (61c5729) Message-ID: <20150708083034.EB5313A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/61c5729cb91ea66aa55bf0941717e526e7fde68d >--------------------------------------------------------------- commit 61c5729cb91ea66aa55bf0941717e526e7fde68d Author: Luite Stegeman Date: Fri Aug 22 20:11:16 2014 +0200 ghc 7.8.2 compatibility >--------------------------------------------------------------- 61c5729cb91ea66aa55bf0941717e526e7fde68d .travis.yml | 1 + haddock-api/haddock-api.cabal | 2 +- src/Haddock/Convert.hs | 11 ++++++++++- src/Haddock/Interface/Create.hs | 10 +++++++++- 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9872092..1b2fb90 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,7 @@ language: haskell env: + - GHCVER=7.8.2 - GHCVER=7.8.3 before_install: diff --git a/haddock-api/haddock-api.cabal b/haddock-api/haddock-api.cabal index 71bf11f..171412d 100644 --- a/haddock-api/haddock-api.cabal +++ b/haddock-api/haddock-api.cabal @@ -45,7 +45,7 @@ library , array , xhtml >= 3000.2 && < 3000.3 , Cabal >= 1.10 - , ghc == 7.8.3 + , ghc >= 7.8.2 && < 7.8.4 , ghc-paths , haddock-library == 1.1.0.* diff --git a/src/Haddock/Convert.hs b/src/Haddock/Convert.hs index 405bf20..73ff3f1 100644 --- a/src/Haddock/Convert.hs +++ b/src/Haddock/Convert.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE PatternGuards #-} +{-# LANGUAGE CPP, PatternGuards #-} ----------------------------------------------------------------------------- -- | -- Module : Haddock.Convert @@ -94,10 +94,19 @@ tyThingToLHsDecl t = noLoc $ case t of (synifyType ImplicitizeForAll (dataConUserType dc))) AConLike (PatSynCon ps) -> +#if MIN_VERSION_ghc(7,8,3) let (_, _, req_theta, prov_theta, _, res_ty) = patSynSig ps +#else + let (_, _, (req_theta, prov_theta)) = patSynSig ps +#endif in SigD $ PatSynSig (synifyName ps) +#if MIN_VERSION_ghc(7,8,3) (fmap (synifyType WithinType) (patSynTyDetails ps)) (synifyType WithinType res_ty) +#else + (fmap (synifyType WithinType) (patSynTyDetails ps)) + (synifyType WithinType (patSynType ps)) +#endif (synifyCtx req_theta) (synifyCtx prov_theta) diff --git a/src/Haddock/Interface/Create.hs b/src/Haddock/Interface/Create.hs index cf7ed84..b66773a 100644 --- a/src/Haddock/Interface/Create.hs +++ b/src/Haddock/Interface/Create.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE TupleSections, BangPatterns, LambdaCase #-} +{-# LANGUAGE CPP, TupleSections, BangPatterns, LambdaCase #-} {-# OPTIONS_GHC -Wwarn #-} ----------------------------------------------------------------------------- -- | @@ -366,7 +366,11 @@ classDecls class_ = filterDecls . collectDocs . sortByLoc $ decls where decls = docs ++ defs ++ sigs ++ ats docs = mkDecls tcdDocs DocD class_ +#if MIN_VERSION_ghc(7,8,3) defs = mkDecls (bagToList . tcdMeths) ValD class_ +#else + defs = mkDecls (map snd . bagToList . tcdMeths) ValD class_ +#endif sigs = mkDecls tcdSigs SigD class_ ats = mkDecls tcdATs (TyClD . FamDecl) class_ @@ -392,7 +396,11 @@ ungroup group_ = mkDecls hs_docs DocD group_ ++ mkDecls hs_instds InstD group_ ++ mkDecls (typesigs . hs_valds) SigD group_ ++ +#if MIN_VERSION_ghc(7,8,3) mkDecls (valbinds . hs_valds) ValD group_ +#else + mkDecls (map snd . valbinds . hs_valds) ValD group_ +#endif where typesigs (ValBindsOut _ sigs) = filter isVanillaLSig sigs typesigs _ = error "expected ValBindsOut" From git at git.haskell.org Wed Jul 8 08:30:37 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:30:37 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: install dependencies for haddock-api on travis (92e50db) Message-ID: <20150708083037.022653A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/92e50dba7b099f24cc357de71aaa7fe06bd061b1 >--------------------------------------------------------------- commit 92e50dba7b099f24cc357de71aaa7fe06bd061b1 Author: Luite Stegeman Date: Fri Aug 22 22:08:58 2014 +0200 install dependencies for haddock-api on travis >--------------------------------------------------------------- 92e50dba7b099f24cc357de71aaa7fe06bd061b1 .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 1b2fb90..ce6d680 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,7 @@ before_install: - doctest -isrc -i$(echo vendor/attoparsec-*) -optP-include -optPdist/build/autogen/cabal_macros.h src/Documentation/Haddock/Parser.hs - cabal install - cd .. - - (cd haddock-api/ && cabal configure --enable-tests --ghc-options=-Werror && cabal build && cabal test && cabal install) + - (cd haddock-api/ && cabal install --only-dependencies --enable-tests && cabal configure --enable-tests --ghc-options=-Werror && cabal build && cabal test && cabal install) script: - cabal configure --enable-tests --ghc-options=-Werror && cabal build && cabal test From git at git.haskell.org Wed Jul 8 08:30:39 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:30:39 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Move sources under haddock-api/src (5d41d43) Message-ID: <20150708083039.164CF3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/5d41d4396425fc5c2e9b90d3e1e0baa5dc1ac224 >--------------------------------------------------------------- commit 5d41d4396425fc5c2e9b90d3e1e0baa5dc1ac224 Author: Mateusz Kowalczyk Date: Sat Aug 23 10:09:34 2014 +0100 Move sources under haddock-api/src >--------------------------------------------------------------- 5d41d4396425fc5c2e9b90d3e1e0baa5dc1ac224 .ghci | 2 +- haddock-api/.ghci | 1 + haddock-api/src | 1 - {src => haddock-api/src}/Documentation/Haddock.hs | 0 {src => haddock-api/src}/Haddock.hs | 0 {src => haddock-api/src}/Haddock/Backends/HaddockDB.hs | 0 {src => haddock-api/src}/Haddock/Backends/Hoogle.hs | 0 {src => haddock-api/src}/Haddock/Backends/LaTeX.hs | 0 {src => haddock-api/src}/Haddock/Backends/Xhtml.hs | 0 {src => haddock-api/src}/Haddock/Backends/Xhtml/Decl.hs | 0 {src => haddock-api/src}/Haddock/Backends/Xhtml/DocMarkup.hs | 0 {src => haddock-api/src}/Haddock/Backends/Xhtml/Layout.hs | 0 {src => haddock-api/src}/Haddock/Backends/Xhtml/Names.hs | 0 {src => haddock-api/src}/Haddock/Backends/Xhtml/Themes.hs | 0 {src => haddock-api/src}/Haddock/Backends/Xhtml/Types.hs | 0 {src => haddock-api/src}/Haddock/Backends/Xhtml/Utils.hs | 0 {src => haddock-api/src}/Haddock/Convert.hs | 0 {src => haddock-api/src}/Haddock/Doc.hs | 0 {src => haddock-api/src}/Haddock/GhcUtils.hs | 0 {src => haddock-api/src}/Haddock/Interface.hs | 0 {src => haddock-api/src}/Haddock/Interface/AttachInstances.hs | 0 {src => haddock-api/src}/Haddock/Interface/Create.hs | 0 {src => haddock-api/src}/Haddock/Interface/LexParseRn.hs | 0 {src => haddock-api/src}/Haddock/Interface/ParseModuleHeader.hs | 0 {src => haddock-api/src}/Haddock/Interface/Rename.hs | 0 {src => haddock-api/src}/Haddock/InterfaceFile.hs | 0 {src => haddock-api/src}/Haddock/ModuleTree.hs | 0 {src => haddock-api/src}/Haddock/Options.hs | 0 {src => haddock-api/src}/Haddock/Parser.hs | 0 {src => haddock-api/src}/Haddock/Types.hs | 0 {src => haddock-api/src}/Haddock/Utils.hs | 0 {src => haddock-api/src}/Haddock/Version.hs | 0 {src => haddock-api/src}/haddock.sh | 0 haddock.cabal | 2 +- 34 files changed, 3 insertions(+), 3 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 5d41d4396425fc5c2e9b90d3e1e0baa5dc1ac224 From git at git.haskell.org Wed Jul 8 08:30:41 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:30:41 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, clean, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Remove compat stuff (fefef1c) Message-ID: <20150708083041.2145D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,clean,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/fefef1c49075acc4390db822fad7e351c777e847 >--------------------------------------------------------------- commit fefef1c49075acc4390db822fad7e351c777e847 Author: Mateusz Kowalczyk Date: Sat Aug 23 10:10:48 2014 +0100 Remove compat stuff >--------------------------------------------------------------- fefef1c49075acc4390db822fad7e351c777e847 compat/Documentation/Haddock.hs | 5 ----- haddock.cabal | 15 --------------- 2 files changed, 20 deletions(-) diff --git a/compat/Documentation/Haddock.hs b/compat/Documentation/Haddock.hs deleted file mode 100644 index 4130cfb..0000000 --- a/compat/Documentation/Haddock.hs +++ /dev/null @@ -1,5 +0,0 @@ -{-# LANGUAGE PackageImports #-} -module Documentation.Haddock {-# DEPRECATED "Use @Documentation.Haddock@ from package instead!" #-} ( - module Documentation.Haddock -) where -import "haddock-api" Documentation.Haddock diff --git a/haddock.cabal b/haddock.cabal index a31deb3..eca656d 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -40,21 +40,6 @@ flag in-ghc-tree default: False manual: True --- This package re-exports the haddock-api library for compatibility. --- The library section will be removed in version 2.16.0. -library - exposed: False - default-language: Haskell2010 - hs-source-dirs: compat - ghc-options: -Wall - build-depends: - -- NOTE: Don't bump base dependency! Remove library section instead! - base >= 4.3 && < 4.8 - , haddock-api - exposed-modules: Documentation.Haddock - if flag(in-ghc-tree) - buildable: False - executable haddock default-language: Haskell2010 main-is: Main.hs From git at git.haskell.org Wed Jul 8 08:30:43 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:30:43 +0000 (UTC) Subject: [commit: haddock] wip/landmine-param-family: Put all the PostRn/PostTc derivations in the same place (cc52fea) Message-ID: <20150708083043.2D2023A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/landmine-param-family Link : http://git.haskell.org/haddock.git/commitdiff/cc52feaba589c16a6eeb3a60fbb5d35531bbee03 >--------------------------------------------------------------- commit cc52feaba589c16a6eeb3a60fbb5d35531bbee03 Author: Alan Zimmerman Date: Sat Aug 23 16:58:32 2014 +0200 Put all the PostRn/PostTc derivations in the same place >--------------------------------------------------------------- cc52feaba589c16a6eeb3a60fbb5d35531bbee03 src/Haddock/Interface/Rename.hs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Haddock/Interface/Rename.hs b/src/Haddock/Interface/Rename.hs index 24e7412..1e3d011 100644 --- a/src/Haddock/Interface/Rename.hs +++ b/src/Haddock/Interface/Rename.hs @@ -180,8 +180,6 @@ renameLKind = renameLType renameMaybeLKind :: Maybe (LHsKind Name) -> RnM (Maybe (LHsKind DocName)) renameMaybeLKind = traverse renameLKind -type instance PostTc DocName Kind = PlaceHolder -type instance PostTc DocName Coercion = PlaceHolder renameType :: HsType Name -> RnM (HsType DocName) renameType t = case t of @@ -459,7 +457,15 @@ renameClsInstD (ClsInstDecl { cid_overlap_mode = omode , cid_sigs = [] , cid_tyfam_insts = lATs', cid_datafam_insts = lADTs' }) + type instance PostRn DocName NameSet = PlaceHolder +type instance PostRn DocName Fixity = PlaceHolder +type instance PostRn DocName Bool = PlaceHolder +type instance PostRn DocName [Name] = PlaceHolder + +type instance PostTc DocName Kind = PlaceHolder +type instance PostTc DocName Type = PlaceHolder +type instance PostTc DocName Coercion = PlaceHolder renameTyFamInstD :: TyFamInstDecl Name -> RnM (TyFamInstDecl DocName) renameTyFamInstD (TyFamInstDecl { tfid_eqn = eqn }) From git at git.haskell.org Wed Jul 8 08:30:45 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:30:45 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Fix extra whitespace on signatures and update all test cases (26a44b9) Message-ID: <20150708083045.3DD7A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/26a44b9f3f539e93f499eea4eda6a354f46b20da >--------------------------------------------------------------- commit 26a44b9f3f539e93f499eea4eda6a354f46b20da Author: Niklas Haas Date: Sun Aug 24 08:14:10 2014 +0200 Fix extra whitespace on signatures and update all test cases This was long overdue, now running ./accept.lhs on a clean test from master will not generate a bunch of changes. >--------------------------------------------------------------- 26a44b9f3f539e93f499eea4eda6a354f46b20da haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | 4 +- html-test/ref/Bold.html | 12 ++--- html-test/ref/Bug298.html | 16 +++---- html-test/ref/Bug313.html | 8 ++-- html-test/ref/Bug8.html | 12 ++--- html-test/ref/Extensions.html | 4 +- html-test/ref/ImplicitParams.html | 2 +- html-test/ref/Nesting.html | 28 +++++------ html-test/ref/NonGreedy.html | 4 +- html-test/ref/Operators.html | 14 +++--- html-test/ref/TH2.html | 2 +- html-test/ref/Test.html | 8 ++-- html-test/ref/Ticket112.html | 4 +- html-test/ref/TypeOperators.html | 2 +- html-test/ref/mini_A.html | 4 +- html-test/ref/mini_AdvanceTypes.html | 2 +- html-test/ref/mini_B.html | 2 +- html-test/ref/mini_Bug1.html | 2 +- html-test/ref/mini_Bug6.html | 10 ++-- html-test/ref/mini_Bug7.html | 2 +- html-test/ref/mini_Bug8.html | 2 +- html-test/ref/mini_BugDeprecated.html | 8 ++-- html-test/ref/mini_DeprecatedData.html | 4 +- html-test/ref/mini_DeprecatedNewtype.html | 4 +- html-test/ref/mini_DeprecatedRecord.html | 2 +- html-test/ref/mini_DeprecatedTypeSynonym.html | 4 +- html-test/ref/mini_HiddenInstances.html | 2 +- html-test/ref/mini_HiddenInstancesB.html | 2 +- html-test/ref/mini_QuasiExpr.html | 4 +- html-test/ref/mini_Test.html | 6 +-- html-test/ref/mini_Ticket253_2.html | 2 +- html-test/ref/mini_TypeFamilies.html | 64 +++++++++++++++++++++++--- html-test/ref/mini_TypeOperators.html | 36 +++++++++++++-- html-test/ref/ocean.css | 20 ++++++-- 34 files changed, 197 insertions(+), 105 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 26a44b9f3f539e93f499eea4eda6a354f46b20da From git at git.haskell.org Wed Jul 8 08:30:47 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:30:47 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Omit unnecessary foralls and fix #315 (fb2a6bf) Message-ID: <20150708083047.4C08C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/fb2a6bf0a53fb243dfe3f769c340236ab73763a9 >--------------------------------------------------------------- commit fb2a6bf0a53fb243dfe3f769c340236ab73763a9 Author: Niklas Haas Date: Thu Aug 21 21:09:51 2014 +0200 Omit unnecessary foralls and fix #315 This also fixes #86. >--------------------------------------------------------------- fb2a6bf0a53fb243dfe3f769c340236ab73763a9 haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | 41 +++++---- html-test/ref/FunArgs.html | 120 ++++++++++++++++++++++++- html-test/src/FunArgs.hs | 23 ++++- 3 files changed, 159 insertions(+), 25 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 fb2a6bf0a53fb243dfe3f769c340236ab73763a9 From git at git.haskell.org Wed Jul 8 08:30:49 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:30:49 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Update CHANGES (fe15219) Message-ID: <20150708083049.58BFD3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/fe15219565c9fd4e5ed919a1987021438911c197 >--------------------------------------------------------------- commit fe15219565c9fd4e5ed919a1987021438911c197 Author: Mateusz Kowalczyk Date: Sun Aug 24 15:06:46 2014 +0100 Update CHANGES >--------------------------------------------------------------- fe15219565c9fd4e5ed919a1987021438911c197 CHANGES | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index de15517..7214e48 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,4 @@ -Changes in version 2.14.4 +Changes in version 2.15.0 * Always read in prologue files as UTF8 (#286 and Cabal #1721) @@ -8,6 +8,23 @@ Changes in version 2.14.4 * parser: preserve list ordering in certain scenarios (#313) + * parser: update the attoparsec version used internally giving slight + parsing performance boost. + + * Move development to be against latest GHC release and not GHC HEAD. + + * Further split up the package to separate the executable from the + library, necessary by things like GHCJS. We now have + ?haddock-library? which are the parts that don't use GHC API, + ?haddock-api? which are (some of) the parts that do use GHC API and + ?haddock? which merely provides the executable. + + * Export few extra functions in the API. + + * Add compatibility with GHC 7.8.2. + + * Omit unnecessary ?forall?s (#315 and #86) + Changes in version 2.14.3 * Fix parsing of identifiers with ^ or ? in them (#298) From git at git.haskell.org Wed Jul 8 08:30:51 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:30:51 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Delete few unused/irrelevant/badly-place files. (be7b100) Message-ID: <20150708083051.65E4D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/be7b1003893947c96dfa50b1bbd5281541f81949 >--------------------------------------------------------------- commit be7b1003893947c96dfa50b1bbd5281541f81949 Author: Mateusz Kowalczyk Date: Sun Aug 24 15:14:23 2014 +0100 Delete few unused/irrelevant/badly-place files. >--------------------------------------------------------------- be7b1003893947c96dfa50b1bbd5281541f81949 .authorspellings | 10 ------- CHANGES | 3 +++ haddock.spec | 81 -------------------------------------------------------- haskell.vim | 68 ----------------------------------------------- hcar.tex | 65 --------------------------------------------- make-sdist.sh | 2 +- 6 files changed, 4 insertions(+), 225 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 be7b1003893947c96dfa50b1bbd5281541f81949 From git at git.haskell.org Wed Jul 8 08:30:53 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:30:53 +0000 (UTC) Subject: [commit: haddock] wip/landmine-param-family: Sort out placeholder for HsWB (f5ff539) Message-ID: <20150708083053.74F433A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/landmine-param-family Link : http://git.haskell.org/haddock.git/commitdiff/f5ff5394e00deb809b9b7a35cf6c6da1a079b6b3 >--------------------------------------------------------------- commit f5ff5394e00deb809b9b7a35cf6c6da1a079b6b3 Author: Alan Zimmerman Date: Mon Aug 25 13:27:11 2014 +0200 Sort out placeholder for HsWB >--------------------------------------------------------------- f5ff5394e00deb809b9b7a35cf6c6da1a079b6b3 src/Haddock/Interface/Rename.hs | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/Haddock/Interface/Rename.hs b/src/Haddock/Interface/Rename.hs index 1e3d011..dd2bd73 100644 --- a/src/Haddock/Interface/Rename.hs +++ b/src/Haddock/Interface/Rename.hs @@ -458,15 +458,6 @@ renameClsInstD (ClsInstDecl { cid_overlap_mode = omode , cid_tyfam_insts = lATs', cid_datafam_insts = lADTs' }) -type instance PostRn DocName NameSet = PlaceHolder -type instance PostRn DocName Fixity = PlaceHolder -type instance PostRn DocName Bool = PlaceHolder -type instance PostRn DocName [Name] = PlaceHolder - -type instance PostTc DocName Kind = PlaceHolder -type instance PostTc DocName Type = PlaceHolder -type instance PostTc DocName Coercion = PlaceHolder - renameTyFamInstD :: TyFamInstDecl Name -> RnM (TyFamInstDecl DocName) renameTyFamInstD (TyFamInstDecl { tfid_eqn = eqn }) = do { eqn' <- renameLTyFamInstEqn eqn @@ -479,7 +470,7 @@ renameLTyFamInstEqn (L loc (TyFamEqn { tfe_tycon = tc, tfe_pats = pats_w_bndrs, ; pats' <- mapM renameLType (hswb_cts pats_w_bndrs) ; rhs' <- renameLType rhs ; return (L loc (TyFamEqn { tfe_tycon = tc' - , tfe_pats = pats_w_bndrs { hswb_cts = pats' } + , tfe_pats = HsWB pats' PlaceHolder PlaceHolder , tfe_rhs = rhs' })) } renameLTyFamDefltEqn :: LTyFamDefltEqn Name -> RnM (LTyFamDefltEqn DocName) @@ -496,7 +487,9 @@ renameDataFamInstD (DataFamInstDecl { dfid_tycon = tc, dfid_pats = pats_w_bndrs, = do { tc' <- renameL tc ; pats' <- mapM renameLType (hswb_cts pats_w_bndrs) ; defn' <- renameDataDefn defn - ; return (DataFamInstDecl { dfid_tycon = tc', dfid_pats = pats_w_bndrs { hswb_cts = pats' } + ; return (DataFamInstDecl { dfid_tycon = tc' + , dfid_pats + = HsWB pats' PlaceHolder PlaceHolder , dfid_defn = defn', dfid_fvs = placeHolderNames }) } renameExportItem :: ExportItem Name -> RnM (ExportItem DocName) @@ -531,3 +524,12 @@ renameSub (n,doc) = do n' <- rename n doc' <- renameDocForDecl doc return (n', doc') + +type instance PostRn DocName NameSet = PlaceHolder +type instance PostRn DocName Fixity = PlaceHolder +type instance PostRn DocName Bool = PlaceHolder +type instance PostRn DocName [Name] = PlaceHolder + +type instance PostTc DocName Kind = PlaceHolder +type instance PostTc DocName Type = PlaceHolder +type instance PostTc DocName Coercion = PlaceHolder From git at git.haskell.org Wed Jul 8 08:30:55 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:30:55 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, wip/10268, wip/10313, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/ast-annotations-separate, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/orf-new, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/remove-cabal-dep, wip/trac-9744: Changes due to ghc api changes in package representation (b2a807d) Message-ID: <20150708083055.8253D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,wip/10268,wip/10313,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/remove-cabal-dep,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/b2a807da55d197c648fd2df1f156f9862711d92b >--------------------------------------------------------------- commit b2a807da55d197c648fd2df1f156f9862711d92b Author: Duncan Coutts Date: Wed Aug 27 13:49:31 2014 +0100 Changes due to ghc api changes in package representation Also fix a bug with finding the package name and version given a module. This had become wrong due to the package key changes (it was very hacky in the first place). We now look up the package key in the package db to get the package info properly. >--------------------------------------------------------------- b2a807da55d197c648fd2df1f156f9862711d92b src/Haddock.hs | 13 ++++++++----- src/Haddock/Backends/Hoogle.hs | 6 ++++-- src/Haddock/GhcUtils.hs | 25 +++++-------------------- 3 files changed, 17 insertions(+), 27 deletions(-) diff --git a/src/Haddock.hs b/src/Haddock.hs index 024b109..bed4762 100644 --- a/src/Haddock.hs +++ b/src/Haddock.hs @@ -42,7 +42,6 @@ import Data.IORef import qualified Data.Map as Map import System.IO import System.Exit -import System.Directory #if defined(mingw32_HOST_OS) import Foreign @@ -63,6 +62,8 @@ import DynFlags hiding (verbosity) import StaticFlags (discardStaticFlags) import Panic (handleGhcException) import Module +import PackageConfig +import FastString -------------------------------------------------------------------------------- -- * Exception handling @@ -242,7 +243,7 @@ render dflags flags qual ifaces installedIfaces srcMap = do pkgMod = ifaceMod (head ifaces) pkgKey = modulePackageKey pkgMod pkgStr = Just (packageKeyString pkgKey) - (pkgName,pkgVer) = modulePackageInfo pkgMod + (pkgName,pkgVer) = modulePackageInfo dflags pkgMod (srcBase, srcModule, srcEntity, srcLEntity) = sourceUrls flags srcMap' = maybe srcMap (\path -> Map.insert pkgKey path srcMap) srcEntity @@ -276,14 +277,16 @@ render dflags flags qual ifaces installedIfaces srcMap = do copyHtmlBits odir libDir themes when (Flag_Hoogle `elem` flags) $ do - let pkgName2 = if pkgName == "main" && title /= [] then title else pkgName - ppHoogle dflags pkgName2 pkgVer title prologue visibleIfaces odir + let pkgNameStr | unpackFS pkgNameFS == "main" && title /= [] + = title + | otherwise = unpackFS pkgNameFS + where PackageName pkgNameFS = pkgName + ppHoogle dflags pkgNameStr pkgVer title prologue visibleIfaces odir when (Flag_LaTeX `elem` flags) $ do ppLaTeX title pkgStr visibleIfaces odir prologue opt_latex_style libDir - ------------------------------------------------------------------------------- -- * Reading and dumping interface files ------------------------------------------------------------------------------- diff --git a/src/Haddock/Backends/Hoogle.hs b/src/Haddock/Backends/Hoogle.hs index 628e1cd..1314529 100644 --- a/src/Haddock/Backends/Hoogle.hs +++ b/src/Haddock/Backends/Hoogle.hs @@ -25,6 +25,7 @@ import Outputable import Data.Char import Data.List import Data.Maybe +import Data.Version import System.FilePath import System.IO @@ -34,13 +35,14 @@ prefix = ["-- Hoogle documentation, generated by Haddock" ,""] -ppHoogle :: DynFlags -> String -> String -> String -> Maybe (Doc RdrName) -> [Interface] -> FilePath -> IO () +ppHoogle :: DynFlags -> String -> Version -> String -> Maybe (Doc RdrName) -> [Interface] -> FilePath -> IO () ppHoogle dflags package version synopsis prologue ifaces odir = do let filename = package ++ ".txt" contents = prefix ++ docWith dflags (drop 2 $ dropWhile (/= ':') synopsis) prologue ++ ["@package " ++ package] ++ - ["@version " ++ version | version /= ""] ++ + ["@version " ++ showVersion version + | not (null (versionBranch version)) ] ++ concat [ppModule dflags i | i <- ifaces, OptHide `notElem` ifaceOptions i] h <- openFile (odir filename) WriteMode hSetEncoding h utf8 diff --git a/src/Haddock/GhcUtils.hs b/src/Haddock/GhcUtils.hs index 33d9213..2c7b79a 100644 --- a/src/Haddock/GhcUtils.hs +++ b/src/Haddock/GhcUtils.hs @@ -22,8 +22,6 @@ import Control.Arrow import Data.Foldable hiding (concatMap) import Data.Function import Data.Traversable -import Distribution.Compat.ReadP -import Distribution.Text import Exception import Outputable @@ -43,24 +41,11 @@ moduleString = moduleNameString . moduleName -- return the (name,version) of the package -modulePackageInfo :: Module -> (String, [Char]) -modulePackageInfo modu = case unpackPackageKey pkg of - Nothing -> (packageKeyString pkg, "") - Just x -> (display $ pkgName x, showVersion (pkgVersion x)) - where pkg = modulePackageKey modu - - --- This was removed from GHC 6.11 --- XXX we shouldn't be using it, probably - --- | Try and interpret a GHC 'PackageKey' as a cabal 'PackageIdentifer'. Returns @Nothing@ if --- we could not parse it as such an object. -unpackPackageKey :: PackageKey -> Maybe PackageIdentifier -unpackPackageKey p - = case [ pid | (pid,"") <- readP_to_S parse str ] of - [] -> Nothing - (pid:_) -> Just pid - where str = packageKeyString p +modulePackageInfo :: DynFlags -> Module -> (PackageName, Version) +modulePackageInfo dflags modu = + (packageName pkg, packageVersion pkg) + where + pkg = getPackageDetails dflags (modulePackageKey modu) lookupLoadedHomeModuleGRE :: GhcMonad m => ModuleName -> m (Maybe GlobalRdrEnv) From git at git.haskell.org Wed Jul 8 08:30:57 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:30:57 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, wip/10268, wip/10313, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/ast-annotations-separate, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/orf-new, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/trac-9744: Import Data.Word w/o import-list (eee52f6) Message-ID: <20150708083057.91B553A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,wip/10268,wip/10313,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/eee52f697233f99e23c1d8183511229fb93e3f3e >--------------------------------------------------------------- commit eee52f697233f99e23c1d8183511229fb93e3f3e Author: Herbert Valerio Riedel Date: Sun Aug 31 11:23:53 2014 +0200 Import Data.Word w/o import-list This is needed to keep the compilation warning free (and thus pass GHC's ./validate) regardless of whether Word is re-exported from Prelude or not See https://ghc.haskell.org/trac/ghc/ticket/9531 for more details >--------------------------------------------------------------- eee52f697233f99e23c1d8183511229fb93e3f3e .../vendor/attoparsec-0.12.1.1/Data/Attoparsec/ByteString/Char8.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haddock-library/vendor/attoparsec-0.12.1.1/Data/Attoparsec/ByteString/Char8.hs b/haddock-library/vendor/attoparsec-0.12.1.1/Data/Attoparsec/ByteString/Char8.hs index eda8fd8..576dded 100644 --- a/haddock-library/vendor/attoparsec-0.12.1.1/Data/Attoparsec/ByteString/Char8.hs +++ b/haddock-library/vendor/attoparsec-0.12.1.1/Data/Attoparsec/ByteString/Char8.hs @@ -129,7 +129,7 @@ import Data.Bits (Bits, (.|.), shiftL) import Data.ByteString.Internal (c2w, w2c) import Data.Int (Int8, Int16, Int32, Int64) import Data.String (IsString(..)) -import Data.Word (Word8, Word16, Word32, Word64, Word) +import Data.Word import Prelude hiding (takeWhile) import qualified Data.Attoparsec.ByteString as A import qualified Data.Attoparsec.ByteString.Internal as I From git at git.haskell.org Wed Jul 8 08:30:59 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:30:59 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Bump version in doc (0c40edf) Message-ID: <20150708083059.A18F33A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/0c40edfc264a752323b4a23599ae750e6b198f8a >--------------------------------------------------------------- commit 0c40edfc264a752323b4a23599ae750e6b198f8a Author: Mateusz Kowalczyk Date: Sun Aug 31 12:54:43 2014 +0100 Bump version in doc >--------------------------------------------------------------- 0c40edfc264a752323b4a23599ae750e6b198f8a doc/haddock.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/haddock.xml b/doc/haddock.xml index 573f1e3..39a947c 100644 --- a/doc/haddock.xml +++ b/doc/haddock.xml @@ -21,7 +21,7 @@ Simon Marlow, David Waern - This document describes Haddock version 2.14.4, a Haskell + This document describes Haddock version 2.15.0, a Haskell documentation tool. From git at git.haskell.org Wed Jul 8 08:31:01 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:31:01 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Bump haddock-library version (b20c3ac) Message-ID: <20150708083101.AF7F63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/b20c3ac8fad5b145b38a19ce585afd35a0960a6c >--------------------------------------------------------------- commit b20c3ac8fad5b145b38a19ce585afd35a0960a6c Author: Mateusz Kowalczyk Date: Sun Aug 31 13:01:23 2014 +0100 Bump haddock-library version >--------------------------------------------------------------- b20c3ac8fad5b145b38a19ce585afd35a0960a6c haddock-api/haddock-api.cabal | 2 +- haddock-library/haddock-library.cabal | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/haddock-api/haddock-api.cabal b/haddock-api/haddock-api.cabal index 171412d..028ef5b 100644 --- a/haddock-api/haddock-api.cabal +++ b/haddock-api/haddock-api.cabal @@ -48,7 +48,7 @@ library , ghc >= 7.8.2 && < 7.8.4 , ghc-paths - , haddock-library == 1.1.0.* + , haddock-library == 1.1.1.* hs-source-dirs: src diff --git a/haddock-library/haddock-library.cabal b/haddock-library/haddock-library.cabal index 30db3e8..358266b 100644 --- a/haddock-library/haddock-library.cabal +++ b/haddock-library/haddock-library.cabal @@ -1,5 +1,5 @@ name: haddock-library -version: 1.1.0 +version: 1.1.1 synopsis: Library exposing some functionality of Haddock. description: Haddock is a documentation-generation tool for Haskell libraries. These modules expose some functionality of it From git at git.haskell.org Wed Jul 8 08:31:03 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:31:03 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, T6018-injective-type-families, adamse-D1033, ghc-head, master, metainfo, v2.15, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Remove references to deleted files (9452954) Message-ID: <20150708083103.BD6D53A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,T6018-injective-type-families,adamse-D1033,ghc-head,master,metainfo,v2.15,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/945295444b7b2583d98d145ca9b5711d7f13b322 >--------------------------------------------------------------- commit 945295444b7b2583d98d145ca9b5711d7f13b322 Author: Mateusz Kowalczyk Date: Sun Aug 31 13:05:25 2014 +0100 Remove references to deleted files >--------------------------------------------------------------- 945295444b7b2583d98d145ca9b5711d7f13b322 haddock.cabal | 2 -- 1 file changed, 2 deletions(-) diff --git a/haddock.cabal b/haddock.cabal index eca656d..bb14ee6 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -26,8 +26,6 @@ extra-source-files: doc/docbook-xml.mk doc/fptools.css doc/haddock.xml - haddock.spec - haskell.vim haddock-api/src/haddock.sh html-test/src/*.hs html-test/ref/*.html From git at git.haskell.org Wed Jul 8 08:31:05 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:31:05 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, metainfo, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Make the doc parser not complain (215e040) Message-ID: <20150708083105.CA2953A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,metainfo,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/215e04020d6cff0c31f452d46b85300fe4986629 >--------------------------------------------------------------- commit 215e04020d6cff0c31f452d46b85300fe4986629 Author: Mateusz Kowalczyk Date: Sun Aug 31 14:18:44 2014 +0100 Make the doc parser not complain >--------------------------------------------------------------- 215e04020d6cff0c31f452d46b85300fe4986629 doc/haddock.xml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/doc/haddock.xml b/doc/haddock.xml index 39a947c..51cbd27 100644 --- a/doc/haddock.xml +++ b/doc/haddock.xml @@ -1,6 +1,14 @@ + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ + + + + + + + +] > From git at git.haskell.org Wed Jul 8 08:31:07 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:31:07 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, metainfo, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: CONTRIBUTING file for issues (94895ae) Message-ID: <20150708083107.DDF063A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,metainfo,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/94895ae25ecbf4cfc50ce11870bbf1243bcfd621 >--------------------------------------------------------------- commit 94895ae25ecbf4cfc50ce11870bbf1243bcfd621 Author: Mateusz Kowalczyk Date: Wed Sep 3 03:33:15 2014 +0100 CONTRIBUTING file for issues >--------------------------------------------------------------- 94895ae25ecbf4cfc50ce11870bbf1243bcfd621 CONTRIBUTING | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/CONTRIBUTING b/CONTRIBUTING new file mode 100644 index 0000000..45f7478 --- /dev/null +++ b/CONTRIBUTING @@ -0,0 +1,17 @@ +If you're filing an issue, here are the things which will help us a lot: + +* State your GHC version. + +* State your platform, OS and distribution if applicable. + +* State your cabal version if applicable. + +* Tell us how to replicate the problem. If we can't replicate it, we + can't fix it. + +* If the problem involves running Haddock on some source, please + include the sample on which we can replicate, the smaller/cleaner + the better. Include some images if you think it will help us. + +* Include any other info you think might be relevant (sandbox? unusual + setup?). From git at git.haskell.org Wed Jul 8 08:31:09 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:31:09 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, metainfo, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Mention --print-missing-docs (b13adf2) Message-ID: <20150708083109.EDB483A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,metainfo,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/b13adf2f4f07724260369f7cbe1394daca26ea56 >--------------------------------------------------------------- commit b13adf2f4f07724260369f7cbe1394daca26ea56 Author: Mateusz Kowalczyk Date: Thu Sep 4 00:46:59 2014 +0100 Mention --print-missing-docs >--------------------------------------------------------------- b13adf2f4f07724260369f7cbe1394daca26ea56 doc/haddock.xml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/doc/haddock.xml b/doc/haddock.xml index 51cbd27..0397051 100644 --- a/doc/haddock.xml +++ b/doc/haddock.xml @@ -1041,6 +1041,18 @@ $ pdflatex package.tex + + + + + + + + + Print extra information about any undocumented entities. + + +
                      From git at git.haskell.org Wed Jul 8 08:31:12 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:31:12 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, wip/10268, wip/10313, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/ast-annotations-separate, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/orf-new, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/trac-9744: Follow changes to TypeAnnot in GHC HEAD (aacaa91) Message-ID: <20150708083112.078103A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,wip/10268,wip/10313,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/aacaa91951b16f22e3ad54412974b81c32230a8c >--------------------------------------------------------------- commit aacaa91951b16f22e3ad54412974b81c32230a8c Author: Alan Zimmerman Date: Fri Sep 5 18:13:24 2014 -0500 Follow changes to TypeAnnot in GHC HEAD Signed-off-by: Austin Seipp >--------------------------------------------------------------- aacaa91951b16f22e3ad54412974b81c32230a8c src/Haddock/Convert.hs | 10 +++++----- src/Haddock/Interface/Rename.hs | 27 +++++++++++++++++++++------ 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/src/Haddock/Convert.hs b/src/Haddock/Convert.hs index dfb0f14..4830639 100644 --- a/src/Haddock/Convert.hs +++ b/src/Haddock/Convert.hs @@ -81,7 +81,7 @@ tyThingToLHsDecl t = noLoc $ case t of , tcdATs = atFamDecls , tcdATDefs = [] --ignore associated type defaults , tcdDocs = [] --we don't have any docs at this point - , tcdFVs = placeHolderNames } + , tcdFVs = placeHolderNamesTc } | otherwise -> TyClD (synifyTyCon Nothing tc) @@ -118,7 +118,7 @@ synifyAxiom ax@(CoAxiom { co_ax_tc = tc }) | isOpenSynFamilyTyCon tc , Just branch <- coAxiomSingleBranch_maybe ax = InstD (TyFamInstD (TyFamInstDecl { tfid_eqn = noLoc $ synifyAxBranch tc branch - , tfid_fvs = placeHolderNames })) + , tfid_fvs = placeHolderNamesTc })) | Just ax' <- isClosedSynFamilyTyCon_maybe tc , getUnique ax' == getUnique ax -- without the getUniques, type error @@ -148,7 +148,7 @@ synifyTyCon coax tc -- we have their kind accurately: , dd_cons = [] -- No constructors , dd_derivs = Nothing } - , tcdFVs = placeHolderNames } + , tcdFVs = placeHolderNamesTc } | isSynFamilyTyCon tc = case synTyConRhs_maybe tc of @@ -177,7 +177,7 @@ synifyTyCon coax tc SynDecl { tcdLName = synifyName tc , tcdTyVars = synifyTyVars (tyConTyVars tc) , tcdRhs = synifyType WithinType ty - , tcdFVs = placeHolderNames } + , tcdFVs = placeHolderNamesTc } _ -> error "synifyTyCon: impossible synTyCon" | otherwise = -- (closed) newtype and data @@ -217,7 +217,7 @@ synifyTyCon coax tc , dd_cons = cons , dd_derivs = alg_deriv } in DataDecl { tcdLName = name, tcdTyVars = tyvars, tcdDataDefn = defn - , tcdFVs = placeHolderNames } + , tcdFVs = placeHolderNamesTc } -- User beware: it is your responsibility to pass True (use_gadt_syntax) -- for any constructor that would be misrepresented by omitting its diff --git a/src/Haddock/Interface/Rename.hs b/src/Haddock/Interface/Rename.hs index a804f4a..dd2bd73 100644 --- a/src/Haddock/Interface/Rename.hs +++ b/src/Haddock/Interface/Rename.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE TypeFamilies #-} ---------------------------------------------------------------------------- -- | -- Module : Haddock.Interface.Rename @@ -20,6 +21,8 @@ import Haddock.Types import Bag (emptyBag) import GHC hiding (NoLink) import Name +import NameSet +import Coercion import Control.Applicative import Control.Monad hiding (mapM) @@ -177,6 +180,7 @@ renameLKind = renameLType renameMaybeLKind :: Maybe (LHsKind Name) -> RnM (Maybe (LHsKind DocName)) renameMaybeLKind = traverse renameLKind + renameType :: HsType Name -> RnM (HsType DocName) renameType t = case t of HsForAllTy expl tyvars lcontext ltype -> do @@ -303,17 +307,17 @@ renameTyClD d = case d of decl' <- renameFamilyDecl decl return (FamDecl { tcdFam = decl' }) - SynDecl { tcdLName = lname, tcdTyVars = tyvars, tcdRhs = rhs, tcdFVs = fvs } -> do + SynDecl { tcdLName = lname, tcdTyVars = tyvars, tcdRhs = rhs, tcdFVs = _fvs } -> do lname' <- renameL lname tyvars' <- renameLTyVarBndrs tyvars rhs' <- renameLType rhs - return (SynDecl { tcdLName = lname', tcdTyVars = tyvars', tcdRhs = rhs', tcdFVs = fvs }) + return (SynDecl { tcdLName = lname', tcdTyVars = tyvars', tcdRhs = rhs', tcdFVs = placeHolderNames }) - DataDecl { tcdLName = lname, tcdTyVars = tyvars, tcdDataDefn = defn, tcdFVs = fvs } -> do + DataDecl { tcdLName = lname, tcdTyVars = tyvars, tcdDataDefn = defn, tcdFVs = _fvs } -> do lname' <- renameL lname tyvars' <- renameLTyVarBndrs tyvars defn' <- renameDataDefn defn - return (DataDecl { tcdLName = lname', tcdTyVars = tyvars', tcdDataDefn = defn', tcdFVs = fvs }) + return (DataDecl { tcdLName = lname', tcdTyVars = tyvars', tcdDataDefn = defn', tcdFVs = placeHolderNames }) ClassDecl { tcdCtxt = lcontext, tcdLName = lname, tcdTyVars = ltyvars , tcdFDs = lfundeps, tcdSigs = lsigs, tcdATs = ats, tcdATDefs = at_defs } -> do @@ -466,7 +470,7 @@ renameLTyFamInstEqn (L loc (TyFamEqn { tfe_tycon = tc, tfe_pats = pats_w_bndrs, ; pats' <- mapM renameLType (hswb_cts pats_w_bndrs) ; rhs' <- renameLType rhs ; return (L loc (TyFamEqn { tfe_tycon = tc' - , tfe_pats = pats_w_bndrs { hswb_cts = pats' } + , tfe_pats = HsWB pats' PlaceHolder PlaceHolder , tfe_rhs = rhs' })) } renameLTyFamDefltEqn :: LTyFamDefltEqn Name -> RnM (LTyFamDefltEqn DocName) @@ -483,7 +487,9 @@ renameDataFamInstD (DataFamInstDecl { dfid_tycon = tc, dfid_pats = pats_w_bndrs, = do { tc' <- renameL tc ; pats' <- mapM renameLType (hswb_cts pats_w_bndrs) ; defn' <- renameDataDefn defn - ; return (DataFamInstDecl { dfid_tycon = tc', dfid_pats = pats_w_bndrs { hswb_cts = pats' } + ; return (DataFamInstDecl { dfid_tycon = tc' + , dfid_pats + = HsWB pats' PlaceHolder PlaceHolder , dfid_defn = defn', dfid_fvs = placeHolderNames }) } renameExportItem :: ExportItem Name -> RnM (ExportItem DocName) @@ -518,3 +524,12 @@ renameSub (n,doc) = do n' <- rename n doc' <- renameDocForDecl doc return (n', doc') + +type instance PostRn DocName NameSet = PlaceHolder +type instance PostRn DocName Fixity = PlaceHolder +type instance PostRn DocName Bool = PlaceHolder +type instance PostRn DocName [Name] = PlaceHolder + +type instance PostTc DocName Kind = PlaceHolder +type instance PostTc DocName Type = PlaceHolder +type instance PostTc DocName Coercion = PlaceHolder From git at git.haskell.org Wed Jul 8 08:31:14 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:31:14 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, wip/10268, wip/10313, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/ast-annotations-separate, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/orf-new, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/trac-9744: Fix import of 'empty' due to AMP. (0cc5bc8) Message-ID: <20150708083114.156B83A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,wip/10268,wip/10313,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/0cc5bc85e9fca92ab712b68a2ba2c0dd9d3d79f4 >--------------------------------------------------------------- commit 0cc5bc85e9fca92ab712b68a2ba2c0dd9d3d79f4 Author: Austin Seipp Date: Tue Sep 9 01:03:27 2014 -0500 Fix import of 'empty' due to AMP. Signed-off-by: Austin Seipp >--------------------------------------------------------------- 0cc5bc85e9fca92ab712b68a2ba2c0dd9d3d79f4 src/Haddock/Backends/LaTeX.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Haddock/Backends/LaTeX.hs b/src/Haddock/Backends/LaTeX.hs index 7b72c03..eca2207 100644 --- a/src/Haddock/Backends/LaTeX.hs +++ b/src/Haddock/Backends/LaTeX.hs @@ -31,7 +31,7 @@ import qualified Data.Map as Map import System.Directory import System.FilePath import Data.Char -import Control.Monad +import Control.Monad hiding (empty) import Data.Maybe import Data.List From git at git.haskell.org Wed Jul 8 08:31:16 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:31:16 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, wip/10268, wip/10313, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/ast-annotations-separate, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/orf-new, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/trac-9744: Bump `base` constraint for AMP (c3a7d47) Message-ID: <20150708083116.212E03A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,wip/10268,wip/10313,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/c3a7d4701ee64f6c29b95a6bed519f6c16b9bffd >--------------------------------------------------------------- commit c3a7d4701ee64f6c29b95a6bed519f6c16b9bffd Author: Herbert Valerio Riedel Date: Tue Sep 9 17:35:20 2014 +0200 Bump `base` constraint for AMP >--------------------------------------------------------------- c3a7d4701ee64f6c29b95a6bed519f6c16b9bffd haddock.cabal | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/haddock.cabal b/haddock.cabal index ef64526..01ab35d 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -71,7 +71,7 @@ executable haddock ghc-options: -funbox-strict-fields -Wall -fwarn-tabs -O2 build-depends: - base >= 4.3 && < 4.8 + base >= 4.3 && < 4.9 if flag(in-ghc-tree) hs-source-dirs: src, haddock-library/vendor/attoparsec-0.12.1.1, haddock-library/src cpp-options: -DIN_GHC_TREE @@ -140,7 +140,7 @@ library default-language: Haskell2010 build-depends: - base >= 4.3 && < 4.8, + base >= 4.3 && < 4.9, bytestring, filepath, directory, From git at git.haskell.org Wed Jul 8 08:31:18 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:31:18 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, metainfo, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Delete stale ANNOUNCE (acbc217) Message-ID: <20150708083118.2CFF23A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,metainfo,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/acbc217bf9d505305c8fd424d52c9359fc07269d >--------------------------------------------------------------- commit acbc217bf9d505305c8fd424d52c9359fc07269d Author: Mateusz Kowalczyk Date: Fri Sep 12 19:18:32 2014 +0100 Delete stale ANNOUNCE >--------------------------------------------------------------- acbc217bf9d505305c8fd424d52c9359fc07269d ANNOUNCE | 60 ------------------------------------------------------------ 1 file changed, 60 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE deleted file mode 100644 index 8069437..0000000 --- a/ANNOUNCE +++ /dev/null @@ -1,60 +0,0 @@ --------------------------------------------- --- Haddock 2.13.1 --------------------------------------------- - -A new versions of Haddock has been uploaded to Hackage. - --------------------------------------------- --- Changes in version 2.13.1 --------------------------------------------- - - * Hide instances that are "internal" to a module - - * Add support for properties in documentation - - * Fix a bug with spurious superclass constraints - - * Fix and extend the Haddock API - --------------------------------------------- --- Links --------------------------------------------- - -Homepage: - http://www.haskell.org/haddock - -Hackage page: - http://hackage.haskell.org/package/haddock - -Bugtracker and wiki: - http://trac.haskell.org/haddock - -Mailing list: - haddock at projects.haskell.org - -Code repository: - http://darcs.haskell.org/haddock.git - --------------------------------------------- --- Contributors --------------------------------------------- - -The following people contributed patches to this release: - -Kazu Yamamoto -Roman Cheplyaka -David Waern -Simon Hengel - --------------------------------------------- --- Get Involved --------------------------------------------- - -We would be very happy to get more contributors. To get involved, start by -grabbing the code: - - http://darcs.haskell.org/haddock.git - -Then take a look at the bug and feature tracker for things to work on: - - http://trac.haskell.org/haddock From git at git.haskell.org Wed Jul 8 08:31:20 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:31:20 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, wip/10268, wip/10313, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/ast-annotations-separate, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/orf-new, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/trac-9744: Followup changes to addition of -fwarn-context-quantification (GHC Trac #4426) (4023817) Message-ID: <20150708083120.3C6533A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,wip/10268,wip/10313,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/4023817d7c0e46db012ba2eea28022626841ca9b >--------------------------------------------------------------- commit 4023817d7c0e46db012ba2eea28022626841ca9b Author: Krzysztof Gogolewski Date: Sun Sep 14 14:08:35 2014 +0200 Followup changes to addition of -fwarn-context-quantification (GHC Trac #4426) >--------------------------------------------------------------- 4023817d7c0e46db012ba2eea28022626841ca9b src/Haddock/Backends/Hoogle.hs | 1 + src/Haddock/Backends/LaTeX.hs | 5 ++++- src/Haddock/Backends/Xhtml/Decl.hs | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Haddock/Backends/Hoogle.hs b/src/Haddock/Backends/Hoogle.hs index 1314529..4535ce5 100644 --- a/src/Haddock/Backends/Hoogle.hs +++ b/src/Haddock/Backends/Hoogle.hs @@ -134,6 +134,7 @@ ppSig dflags (TypeSig names sig) prettyNames = intercalate ", " $ map (out dflags) names typ = case unL sig of HsForAllTy Explicit a b c -> HsForAllTy Implicit a b c + HsForAllTy Qualified a b c -> HsForAllTy Implicit a b c x -> x ppSig _ _ = [] diff --git a/src/Haddock/Backends/LaTeX.hs b/src/Haddock/Backends/LaTeX.hs index eca2207..014f335 100644 --- a/src/Haddock/Backends/LaTeX.hs +++ b/src/Haddock/Backends/LaTeX.hs @@ -402,6 +402,8 @@ ppTypeOrFunSig _ _ typ (doc, argDocs) (pref1, pref2, sep0) ppLContextNoArrow lctxt unicode) <+> nl $$ do_largs n (darrow unicode) ltype + do_args n leader (HsForAllTy Qualified a lctxt ltype) + = do_args n leader (HsForAllTy Implicit a lctxt ltype) do_args n leader (HsForAllTy Implicit _ lctxt ltype) | not (null (unLoc lctxt)) = decltt leader <-> decltt (ppLContextNoArrow lctxt unicode) <+> nl $$ @@ -621,6 +623,7 @@ ppConstrHdr forall tvs ctxt unicode where ppForall = case forall of Explicit -> forallSymbol unicode <+> hsep (map ppName tvs) <+> text ". " + Qualified -> empty Implicit -> empty @@ -871,7 +874,7 @@ ppForAll expl tvs cxt unicode | otherwise = ppLContext cxt unicode where show_forall = not (null (hsQTvBndrs tvs)) && is_explicit - is_explicit = case expl of {Explicit -> True; Implicit -> False} + is_explicit = case expl of {Explicit -> True; Implicit -> False; Qualified -> False} forall_part = hsep (forallSymbol unicode : ppTyVars tvs) <> dot diff --git a/src/Haddock/Backends/Xhtml/Decl.hs b/src/Haddock/Backends/Xhtml/Decl.hs index 0429580..829c666 100644 --- a/src/Haddock/Backends/Xhtml/Decl.hs +++ b/src/Haddock/Backends/Xhtml/Decl.hs @@ -650,6 +650,7 @@ ppConstrHdr forall_ tvs ctxt unicode qual where ppForall = case forall_ of Explicit -> forallSymbol unicode <+> hsep (map (ppName Prefix) tvs) <+> toHtml ". " + Qualified -> noHtml Implicit -> noHtml @@ -812,7 +813,7 @@ ppForAll expl tvs cxt unicode qual | otherwise = ppLContext cxt unicode qual where show_forall = not (null (hsQTvBndrs tvs)) && is_explicit - is_explicit = case expl of {Explicit -> True; Implicit -> False} + is_explicit = case expl of {Explicit -> True; Implicit -> False; Qualified -> False} forall_part = hsep (forallSymbol unicode : ppTyVars tvs) +++ dot From git at git.haskell.org Wed Jul 8 08:31:22 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:31:22 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, wip/10268, wip/10313, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/ast-annotations-separate, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/orf-new, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/trac-9744: Properly render package ID (not package key) in index, fixes #329. (ee47a1a) Message-ID: <20150708083122.471FA3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,wip/10268,wip/10313,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/ee47a1ab37699db0573c9cf0aa6461e1f8865197 >--------------------------------------------------------------- commit ee47a1ab37699db0573c9cf0aa6461e1f8865197 Author: Edward Z. Yang Date: Thu Sep 18 13:38:11 2014 -0700 Properly render package ID (not package key) in index, fixes #329. Signed-off-by: Edward Z. Yang >--------------------------------------------------------------- ee47a1ab37699db0573c9cf0aa6461e1f8865197 src/Haddock.hs | 4 ++-- src/Haddock/Backends/Xhtml.hs | 14 ++++++++------ src/Haddock/ModuleTree.hs | 13 ++++++++----- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/src/Haddock.hs b/src/Haddock.hs index bed4762..980926c 100644 --- a/src/Haddock.hs +++ b/src/Haddock.hs @@ -262,14 +262,14 @@ render dflags flags qual ifaces installedIfaces srcMap = do copyHtmlBits odir libDir themes when (Flag_GenContents `elem` flags) $ do - ppHtmlContents odir title pkgStr + ppHtmlContents dflags odir title pkgStr themes opt_index_url sourceUrls' opt_wiki_urls allVisibleIfaces True prologue pretty (makeContentsQual qual) copyHtmlBits odir libDir themes when (Flag_Html `elem` flags) $ do - ppHtml title pkgStr visibleIfaces odir + ppHtml dflags title pkgStr visibleIfaces odir prologue themes sourceUrls' opt_wiki_urls opt_contents_url opt_index_url unicode qual diff --git a/src/Haddock/Backends/Xhtml.hs b/src/Haddock/Backends/Xhtml.hs index 192c708..b6a1190 100644 --- a/src/Haddock/Backends/Xhtml.hs +++ b/src/Haddock/Backends/Xhtml.hs @@ -60,7 +60,8 @@ import Module -------------------------------------------------------------------------------- -ppHtml :: String +ppHtml :: DynFlags + -> String -- ^ Title -> Maybe String -- ^ Package -> [Interface] -> FilePath -- ^ Destination directory @@ -75,7 +76,7 @@ ppHtml :: String -> Bool -- ^ Output pretty html (newlines and indenting) -> IO () -ppHtml doctitle maybe_package ifaces odir prologue +ppHtml dflags doctitle maybe_package ifaces odir prologue themes maybe_source_url maybe_wiki_url maybe_contents_url maybe_index_url unicode qual debug = do @@ -84,7 +85,7 @@ ppHtml doctitle maybe_package ifaces odir prologue visible i = OptHide `notElem` ifaceOptions i when (isNothing maybe_contents_url) $ - ppHtmlContents odir doctitle maybe_package + ppHtmlContents dflags odir doctitle maybe_package themes maybe_index_url maybe_source_url maybe_wiki_url (map toInstalledIface visible_ifaces) False -- we don't want to display the packages in a single-package contents @@ -239,7 +240,8 @@ moduleInfo iface = ppHtmlContents - :: FilePath + :: DynFlags + -> FilePath -> String -> Maybe String -> Themes @@ -250,10 +252,10 @@ ppHtmlContents -> Bool -> Qualification -- ^ How to qualify names -> IO () -ppHtmlContents odir doctitle _maybe_package +ppHtmlContents dflags odir doctitle _maybe_package themes maybe_index_url maybe_source_url maybe_wiki_url ifaces showPkgs prologue debug qual = do - let tree = mkModuleTree showPkgs + let tree = mkModuleTree dflags showPkgs [(instMod iface, toInstalledDescription iface) | iface <- ifaces] html = headHtml doctitle Nothing themes +++ diff --git a/src/Haddock/ModuleTree.hs b/src/Haddock/ModuleTree.hs index 28c5c06..cb92668 100644 --- a/src/Haddock/ModuleTree.hs +++ b/src/Haddock/ModuleTree.hs @@ -15,18 +15,21 @@ module Haddock.ModuleTree ( ModuleTree(..), mkModuleTree ) where import Haddock.Types ( Doc ) import GHC ( Name ) -import Module ( Module, moduleNameString, moduleName, modulePackageKey, - packageKeyString ) +import Module ( Module, moduleNameString, moduleName, modulePackageKey ) +import DynFlags ( DynFlags ) +import Packages ( lookupPackage ) +import PackageConfig ( sourcePackageIdString ) data ModuleTree = Node String Bool (Maybe String) (Maybe (Doc Name)) [ModuleTree] -mkModuleTree :: Bool -> [(Module, Maybe (Doc Name))] -> [ModuleTree] -mkModuleTree showPkgs mods = +mkModuleTree :: DynFlags -> Bool -> [(Module, Maybe (Doc Name))] -> [ModuleTree] +mkModuleTree dflags showPkgs mods = foldr fn [] [ (splitModule mdl, modPkg mdl, short) | (mdl, short) <- mods ] where - modPkg mod_ | showPkgs = Just (packageKeyString (modulePackageKey mod_)) + modPkg mod_ | showPkgs = fmap sourcePackageIdString + (lookupPackage dflags (modulePackageKey mod_)) | otherwise = Nothing fn (mod_,pkg,short) = addToTrees mod_ pkg short From git at git.haskell.org Wed Jul 8 08:31:24 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:31:24 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, wip/10268, wip/10313, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/ast-annotations-separate, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/orf-new, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/trac-9744: Disambiguate string-literals (3f57c24) Message-ID: <20150708083124.543673A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,wip/10268,wip/10313,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/3f57c2423252731487f66f503b5119c3becf4673 >--------------------------------------------------------------- commit 3f57c2423252731487f66f503b5119c3becf4673 Author: Herbert Valerio Riedel Date: Thu Sep 18 23:57:37 2014 +0200 Disambiguate string-literals GHC fails type-inference with `OverloadedStrings` + `Data.Foldable.elem` otherwise. >--------------------------------------------------------------- 3f57c2423252731487f66f503b5119c3becf4673 haddock-library/src/Documentation/Haddock/Parser.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/haddock-library/src/Documentation/Haddock/Parser.hs b/haddock-library/src/Documentation/Haddock/Parser.hs index 68d9ece..e8bc276 100644 --- a/haddock-library/src/Documentation/Haddock/Parser.hs +++ b/haddock-library/src/Documentation/Haddock/Parser.hs @@ -199,7 +199,7 @@ moduleName = DocModule <$> (char '"' *> modid <* char '"') -- accept {small | large | digit | ' } here. But as we can't -- match on unicode characters, this is currently not possible. -- Note that we allow ?#? to suport anchors. - <*> (decodeUtf8 <$> takeWhile (`notElem` " .&[{}(=*)+]!|@/;,^?\"\n")) + <*> (decodeUtf8 <$> takeWhile (`notElem` (" .&[{}(=*)+]!|@/;,^?\"\n"::String))) -- | Picture parser, surrounded by \<\< and \>\>. It's possible to specify -- a title for the picture. @@ -271,7 +271,7 @@ innerList item = do -- | Parses definition lists. definitionList :: Parser [(DocH mod Identifier, DocH mod Identifier)] definitionList = do - label <- "[" *> (parseStringBS <$> takeWhile1 (`notElem` "]\n")) <* "]" + label <- "[" *> (parseStringBS <$> takeWhile1 (`notElem` ("]\n"::String))) <* "]" c <- takeLine (cs, items) <- more definitionList let contents = parseString . dropNLs . unlines $ c : cs @@ -456,7 +456,7 @@ autoUrl = mkLink <$> url url = mappend <$> ("http://" <|> "https://" <|> "ftp://") <*> takeWhile1 (not . isSpace) mkLink :: BS.ByteString -> DocH mod a mkLink s = case unsnoc s of - Just (xs, x) | x `elem` ",.!?" -> DocHyperlink (Hyperlink (decodeUtf8 xs) Nothing) <> DocString [x] + Just (xs, x) | x `elem` (",.!?"::String) -> DocHyperlink (Hyperlink (decodeUtf8 xs) Nothing) <> DocString [x] _ -> DocHyperlink (Hyperlink (decodeUtf8 s) Nothing) -- | Parses strings between identifier delimiters. Consumes all input that it @@ -473,7 +473,7 @@ parseValid = do <|> return vs _ -> fail "outofvalid" where - idChar = satisfy (`elem` "_.!#$%&*+/<=>?@\\|-~:^") + idChar = satisfy (`elem` ("_.!#$%&*+/<=>?@\\|-~:^"::String)) <|> digit <|> letter_ascii -- | Parses UTF8 strings from ByteString streams. From git at git.haskell.org Wed Jul 8 08:31:26 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:31:26 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, wip/10268, wip/10313, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/ast-annotations-separate, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/orf-new, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/trac-9744: Revert "Followup changes to addition of -fwarn-context-quantification" (db14fd8) Message-ID: <20150708083126.615303A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,wip/10268,wip/10313,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/db14fd8ab4fab43694139bc203808b814eafb2dc >--------------------------------------------------------------- commit db14fd8ab4fab43694139bc203808b814eafb2dc Author: Herbert Valerio Riedel Date: Fri Sep 19 00:10:36 2014 +0200 Revert "Followup changes to addition of -fwarn-context-quantification" This reverts commit 4023817d7c0e46db012ba2eea28022626841ca9b temporarily as the respective feature hasn't landed in GHC HEAD yet, but this commit blocks later commits from being referenced in GHC HEAD. >--------------------------------------------------------------- db14fd8ab4fab43694139bc203808b814eafb2dc src/Haddock/Backends/Hoogle.hs | 1 - src/Haddock/Backends/LaTeX.hs | 5 +---- src/Haddock/Backends/Xhtml/Decl.hs | 3 +-- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/Haddock/Backends/Hoogle.hs b/src/Haddock/Backends/Hoogle.hs index 4535ce5..1314529 100644 --- a/src/Haddock/Backends/Hoogle.hs +++ b/src/Haddock/Backends/Hoogle.hs @@ -134,7 +134,6 @@ ppSig dflags (TypeSig names sig) prettyNames = intercalate ", " $ map (out dflags) names typ = case unL sig of HsForAllTy Explicit a b c -> HsForAllTy Implicit a b c - HsForAllTy Qualified a b c -> HsForAllTy Implicit a b c x -> x ppSig _ _ = [] diff --git a/src/Haddock/Backends/LaTeX.hs b/src/Haddock/Backends/LaTeX.hs index 014f335..eca2207 100644 --- a/src/Haddock/Backends/LaTeX.hs +++ b/src/Haddock/Backends/LaTeX.hs @@ -402,8 +402,6 @@ ppTypeOrFunSig _ _ typ (doc, argDocs) (pref1, pref2, sep0) ppLContextNoArrow lctxt unicode) <+> nl $$ do_largs n (darrow unicode) ltype - do_args n leader (HsForAllTy Qualified a lctxt ltype) - = do_args n leader (HsForAllTy Implicit a lctxt ltype) do_args n leader (HsForAllTy Implicit _ lctxt ltype) | not (null (unLoc lctxt)) = decltt leader <-> decltt (ppLContextNoArrow lctxt unicode) <+> nl $$ @@ -623,7 +621,6 @@ ppConstrHdr forall tvs ctxt unicode where ppForall = case forall of Explicit -> forallSymbol unicode <+> hsep (map ppName tvs) <+> text ". " - Qualified -> empty Implicit -> empty @@ -874,7 +871,7 @@ ppForAll expl tvs cxt unicode | otherwise = ppLContext cxt unicode where show_forall = not (null (hsQTvBndrs tvs)) && is_explicit - is_explicit = case expl of {Explicit -> True; Implicit -> False; Qualified -> False} + is_explicit = case expl of {Explicit -> True; Implicit -> False} forall_part = hsep (forallSymbol unicode : ppTyVars tvs) <> dot diff --git a/src/Haddock/Backends/Xhtml/Decl.hs b/src/Haddock/Backends/Xhtml/Decl.hs index 829c666..0429580 100644 --- a/src/Haddock/Backends/Xhtml/Decl.hs +++ b/src/Haddock/Backends/Xhtml/Decl.hs @@ -650,7 +650,6 @@ ppConstrHdr forall_ tvs ctxt unicode qual where ppForall = case forall_ of Explicit -> forallSymbol unicode <+> hsep (map (ppName Prefix) tvs) <+> toHtml ". " - Qualified -> noHtml Implicit -> noHtml @@ -813,7 +812,7 @@ ppForAll expl tvs cxt unicode qual | otherwise = ppLContext cxt unicode qual where show_forall = not (null (hsQTvBndrs tvs)) && is_explicit - is_explicit = case expl of {Explicit -> True; Implicit -> False; Qualified -> False} + is_explicit = case expl of {Explicit -> True; Implicit -> False} forall_part = hsep (forallSymbol unicode : ppTyVars tvs) +++ dot From git at git.haskell.org Wed Jul 8 08:31:28 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:31:28 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, wip/10268, wip/10313, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/ast-annotations-separate, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/orf-new, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/trac-9744: Revert "Revert "Followup changes to addition of -fwarn-context-quantification"" (12dc730) Message-ID: <20150708083128.6F01A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,wip/10268,wip/10313,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/12dc730e62236e15f1194ddc8260affc24928bd1 >--------------------------------------------------------------- commit 12dc730e62236e15f1194ddc8260affc24928bd1 Author: Edward Z. Yang Date: Thu Sep 18 15:32:15 2014 -0700 Revert "Revert "Followup changes to addition of -fwarn-context-quantification"" This reverts commit db14fd8ab4fab43694139bc203808b814eafb2dc. It's in HEAD now. >--------------------------------------------------------------- 12dc730e62236e15f1194ddc8260affc24928bd1 src/Haddock/Backends/Hoogle.hs | 1 + src/Haddock/Backends/LaTeX.hs | 5 ++++- src/Haddock/Backends/Xhtml/Decl.hs | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Haddock/Backends/Hoogle.hs b/src/Haddock/Backends/Hoogle.hs index 1314529..4535ce5 100644 --- a/src/Haddock/Backends/Hoogle.hs +++ b/src/Haddock/Backends/Hoogle.hs @@ -134,6 +134,7 @@ ppSig dflags (TypeSig names sig) prettyNames = intercalate ", " $ map (out dflags) names typ = case unL sig of HsForAllTy Explicit a b c -> HsForAllTy Implicit a b c + HsForAllTy Qualified a b c -> HsForAllTy Implicit a b c x -> x ppSig _ _ = [] diff --git a/src/Haddock/Backends/LaTeX.hs b/src/Haddock/Backends/LaTeX.hs index eca2207..014f335 100644 --- a/src/Haddock/Backends/LaTeX.hs +++ b/src/Haddock/Backends/LaTeX.hs @@ -402,6 +402,8 @@ ppTypeOrFunSig _ _ typ (doc, argDocs) (pref1, pref2, sep0) ppLContextNoArrow lctxt unicode) <+> nl $$ do_largs n (darrow unicode) ltype + do_args n leader (HsForAllTy Qualified a lctxt ltype) + = do_args n leader (HsForAllTy Implicit a lctxt ltype) do_args n leader (HsForAllTy Implicit _ lctxt ltype) | not (null (unLoc lctxt)) = decltt leader <-> decltt (ppLContextNoArrow lctxt unicode) <+> nl $$ @@ -621,6 +623,7 @@ ppConstrHdr forall tvs ctxt unicode where ppForall = case forall of Explicit -> forallSymbol unicode <+> hsep (map ppName tvs) <+> text ". " + Qualified -> empty Implicit -> empty @@ -871,7 +874,7 @@ ppForAll expl tvs cxt unicode | otherwise = ppLContext cxt unicode where show_forall = not (null (hsQTvBndrs tvs)) && is_explicit - is_explicit = case expl of {Explicit -> True; Implicit -> False} + is_explicit = case expl of {Explicit -> True; Implicit -> False; Qualified -> False} forall_part = hsep (forallSymbol unicode : ppTyVars tvs) <> dot diff --git a/src/Haddock/Backends/Xhtml/Decl.hs b/src/Haddock/Backends/Xhtml/Decl.hs index 0429580..829c666 100644 --- a/src/Haddock/Backends/Xhtml/Decl.hs +++ b/src/Haddock/Backends/Xhtml/Decl.hs @@ -650,6 +650,7 @@ ppConstrHdr forall_ tvs ctxt unicode qual where ppForall = case forall_ of Explicit -> forallSymbol unicode <+> hsep (map (ppName Prefix) tvs) <+> toHtml ". " + Qualified -> noHtml Implicit -> noHtml @@ -812,7 +813,7 @@ ppForAll expl tvs cxt unicode qual | otherwise = ppLContext cxt unicode qual where show_forall = not (null (hsQTvBndrs tvs)) && is_explicit - is_explicit = case expl of {Explicit -> True; Implicit -> False} + is_explicit = case expl of {Explicit -> True; Implicit -> False; Qualified -> False} forall_part = hsep (forallSymbol unicode : ppTyVars tvs) +++ dot From git at git.haskell.org Wed Jul 8 08:31:30 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:31:30 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, wip/10268, wip/10313, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/ast-annotations-separate, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/orf-new, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/trac-9744: Revert "Fix import of 'empty' due to AMP." (a65d213) Message-ID: <20150708083130.7ACF83A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,wip/10268,wip/10313,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/ast-annotations-separate,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/a65d2131647e010608d2a1956116a0012946838f >--------------------------------------------------------------- commit a65d2131647e010608d2a1956116a0012946838f Author: Herbert Valerio Riedel Date: Fri Sep 26 19:18:28 2014 +0200 Revert "Fix import of 'empty' due to AMP." This reverts commit 0cc5bc85e9fca92ab712b68a2ba2c0dd9d3d79f4 since it turns out we don't need to re-export `empty` from Control.Monad after all. >--------------------------------------------------------------- a65d2131647e010608d2a1956116a0012946838f src/Haddock/Backends/LaTeX.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Haddock/Backends/LaTeX.hs b/src/Haddock/Backends/LaTeX.hs index 014f335..06a24b4 100644 --- a/src/Haddock/Backends/LaTeX.hs +++ b/src/Haddock/Backends/LaTeX.hs @@ -31,7 +31,7 @@ import qualified Data.Map as Map import System.Directory import System.FilePath import Data.Char -import Control.Monad hiding (empty) +import Control.Monad import Data.Maybe import Data.List From git at git.haskell.org Wed Jul 8 08:31:32 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:31:32 +0000 (UTC) Subject: [commit: haddock] wip/ast-annotations-separate: Working in HsCommaList in hsSyn (3808449) Message-ID: <20150708083132.8AA9B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/ast-annotations-separate Link : http://git.haskell.org/haddock.git/commitdiff/38084498e163782db82121d8771620091054876a >--------------------------------------------------------------- commit 38084498e163782db82121d8771620091054876a Author: Alan Zimmerman Date: Tue Oct 7 23:40:17 2014 +0200 Working in HsCommaList in hsSyn >--------------------------------------------------------------- 38084498e163782db82121d8771620091054876a src/Haddock/Backends/Hoogle.hs | 6 +++--- src/Haddock/Backends/LaTeX.hs | 8 ++++---- src/Haddock/Backends/Xhtml.hs | 2 +- src/Haddock/Backends/Xhtml/Decl.hs | 13 +++++++------ src/Haddock/Convert.hs | 4 ++-- src/Haddock/GhcUtils.hs | 8 ++++---- src/Haddock/Interface/Create.hs | 6 +++--- src/Haddock/Interface/Rename.hs | 4 ++-- 8 files changed, 26 insertions(+), 25 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 38084498e163782db82121d8771620091054876a From git at git.haskell.org Wed Jul 8 08:31:34 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:31:34 +0000 (UTC) Subject: [commit: haddock] wip/ast-annotations-separate: Track changes to hsSyn (691b6de) Message-ID: <20150708083134.977FB3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/ast-annotations-separate Link : http://git.haskell.org/haddock.git/commitdiff/691b6de6004e3725ebae5847108a63834c6abe34 >--------------------------------------------------------------- commit 691b6de6004e3725ebae5847108a63834c6abe34 Author: Alan Zimmerman Date: Wed Oct 8 23:30:06 2014 +0200 Track changes to hsSyn >--------------------------------------------------------------- 691b6de6004e3725ebae5847108a63834c6abe34 src/Haddock/Backends/Xhtml/Decl.hs | 2 +- src/Haddock/Convert.hs | 2 +- src/Haddock/Interface/Create.hs | 4 ++-- src/Haddock/Interface/Rename.hs | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Haddock/Backends/Xhtml/Decl.hs b/src/Haddock/Backends/Xhtml/Decl.hs index 304eae8..7d7f9cf 100644 --- a/src/Haddock/Backends/Xhtml/Decl.hs +++ b/src/Haddock/Backends/Xhtml/Decl.hs @@ -275,7 +275,7 @@ ppTyFam summary associated links instances fixities loc doc decl splice unicode instancesBit | FamilyDecl { fdInfo = ClosedTypeFamily eqns } <- decl , not summary - = subEquations qual $ map (ppTyFamEqn . unLoc) eqns + = subEquations qual $ map (ppTyFamEqn . unLoc) (fromCL eqns) | otherwise = ppInstances instances docname unicode qual diff --git a/src/Haddock/Convert.hs b/src/Haddock/Convert.hs index 839cfb2..7e4897d 100644 --- a/src/Haddock/Convert.hs +++ b/src/Haddock/Convert.hs @@ -156,7 +156,7 @@ synifyTyCon coax tc let info = case rhs of OpenSynFamilyTyCon -> OpenTypeFamily ClosedSynFamilyTyCon (CoAxiom { co_ax_branches = branches }) -> - ClosedTypeFamily (brListMap (noLoc . synifyAxBranch tc) branches) + ClosedTypeFamily (toCL $ brListMap (noLoc . synifyAxBranch tc) branches) _ -> error "synifyTyCon: type/data family confusion" in FamDecl (FamilyDecl { fdInfo = info , fdLName = synifyName tc diff --git a/src/Haddock/Interface/Create.hs b/src/Haddock/Interface/Create.hs index 738f1c9..03b8662 100644 --- a/src/Haddock/Interface/Create.hs +++ b/src/Haddock/Interface/Create.hs @@ -711,8 +711,8 @@ fullModuleContents dflags warnings gre (docMap, argMap, subMap, declMap, instMap expandSig = foldr f [] where f :: LHsDecl name -> [LHsDecl name] -> [LHsDecl name] - f (L l (SigD (TypeSig names t))) xs = foldr (\n acc -> L l (SigD (TypeSig (unitCL n) t)) : acc) xs $ fromCL names - f (L l (SigD (GenericSig names t))) xs = foldr (\n acc -> L l (SigD (GenericSig (unitCL n) t)) : acc) xs $ fromCL names + f (L l (SigD (TypeSig names t))) xs = foldr (\n acc -> L l (SigD (TypeSig (unitCL n) t)) : acc) xs names + f (L l (SigD (GenericSig names t))) xs = foldr (\n acc -> L l (SigD (GenericSig (unitCL n) t)) : acc) xs names f x xs = x : xs mkExportItem :: LHsDecl Name -> ErrMsgGhc (Maybe (ExportItem Name)) diff --git a/src/Haddock/Interface/Rename.hs b/src/Haddock/Interface/Rename.hs index 0d2e15a..dd2bd73 100644 --- a/src/Haddock/Interface/Rename.hs +++ b/src/Haddock/Interface/Rename.hs @@ -403,9 +403,9 @@ renameConDeclFieldField (ConDeclField name t doc) = do renameSig :: Sig Name -> RnM (Sig DocName) renameSig sig = case sig of TypeSig lnames ltype -> do - lnames' <- mapM renameL $ fromCL lnames + lnames' <- mapM renameL lnames ltype' <- renameLType ltype - return (TypeSig (toCL lnames') ltype') + return (TypeSig lnames' ltype') PatSynSig lname args ltype lreq lprov -> do lname' <- renameL lname args' <- case args of From git at git.haskell.org Wed Jul 8 08:31:36 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:31:36 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, metainfo, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Fix improper lazy IO use (9680079) Message-ID: <20150708083136.A33F43A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,metainfo,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/968007937c3e108150a109c12163bbeff978629a >--------------------------------------------------------------- commit 968007937c3e108150a109c12163bbeff978629a Author: treeowl Date: Thu Oct 9 20:07:36 2014 -0400 Fix improper lazy IO use Make `getPrologue` force `parseParas dflags str` before returning. Without this, it will attempt to read from the file after it is closed, with unspecified and generally bad results. >--------------------------------------------------------------- 968007937c3e108150a109c12163bbeff978629a haddock-api/src/Haddock.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haddock-api/src/Haddock.hs b/haddock-api/src/Haddock.hs index 0cff5bd..631f813 100644 --- a/haddock-api/src/Haddock.hs +++ b/haddock-api/src/Haddock.hs @@ -456,7 +456,7 @@ getPrologue dflags flags = [filename] -> withFile filename ReadMode $ \h -> do hSetEncoding h utf8 str <- hGetContents h - return . Just $ parseParas dflags str + return . Just $! parseParas dflags str _ -> throwE "multiple -p/--prologue options" From git at git.haskell.org Wed Jul 8 08:31:38 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:31:38 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, wip/10268, wip/10313, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/orf-new, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/trac-9744: Fix use-after-close lazy IO bug (2f639ff) Message-ID: <20150708083138.B028E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,wip/10268,wip/10313,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/orf-new,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/2f639ffe09dd24d8648363b567de2d7caa39db99 >--------------------------------------------------------------- commit 2f639ffe09dd24d8648363b567de2d7caa39db99 Author: Edward Z. Yang Date: Thu Oct 9 21:38:11 2014 -0700 Fix use-after-close lazy IO bug Make `getPrologue` force `parseParas dflags str` before returning. Without this, it will attempt to read from the file after it is closed, with unspecified and generally bad results. Signed-off-by: David Feuer Signed-off-by: Edward Z. Yang >--------------------------------------------------------------- 2f639ffe09dd24d8648363b567de2d7caa39db99 src/Haddock.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Haddock.hs b/src/Haddock.hs index 980926c..c0a6714 100644 --- a/src/Haddock.hs +++ b/src/Haddock.hs @@ -451,7 +451,7 @@ getPrologue dflags flags = [filename] -> withFile filename ReadMode $ \h -> do hSetEncoding h utf8 str <- hGetContents h - return . Just $ parseParas dflags str + return . Just $! parseParas dflags str _ -> throwE "multiple -p/--prologue options" From git at git.haskell.org Wed Jul 8 08:31:40 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:31:40 +0000 (UTC) Subject: [commit: haddock] wip/ast-annotations-separate: Backing out HsCommaList (59a5f09) Message-ID: <20150708083140.BE8023A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/ast-annotations-separate Link : http://git.haskell.org/haddock.git/commitdiff/59a5f09e5380849f96710dbf4894ad2e48b57971 >--------------------------------------------------------------- commit 59a5f09e5380849f96710dbf4894ad2e48b57971 Author: Alan Zimmerman Date: Sun Oct 12 22:39:42 2014 +0200 Backing out HsCommaList >--------------------------------------------------------------- 59a5f09e5380849f96710dbf4894ad2e48b57971 src/Haddock/Backends/Hoogle.hs | 6 +++--- src/Haddock/Backends/LaTeX.hs | 8 ++++---- src/Haddock/Backends/Xhtml.hs | 2 +- src/Haddock/Backends/Xhtml/Decl.hs | 14 +++++++------- src/Haddock/Convert.hs | 11 ++++++----- src/Haddock/GhcUtils.hs | 8 ++++---- src/Haddock/Interface/Create.hs | 12 +++++++----- src/Haddock/Interface/Rename.hs | 6 ++++-- 8 files changed, 36 insertions(+), 31 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 59a5f09e5380849f96710dbf4894ad2e48b57971 From git at git.haskell.org Wed Jul 8 08:31:42 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:31:42 +0000 (UTC) Subject: [commit: haddock] wip/ast-annotations-separate: Warnings and deprecations are now located (d25ca57) Message-ID: <20150708083142.CAB893A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/ast-annotations-separate Link : http://git.haskell.org/haddock.git/commitdiff/d25ca573e4cfbcda8de9629dc535127b40d77def >--------------------------------------------------------------- commit d25ca573e4cfbcda8de9629dc535127b40d77def Author: Alan Zimmerman Date: Mon Oct 13 23:35:31 2014 +0200 Warnings and deprecations are now located >--------------------------------------------------------------- d25ca573e4cfbcda8de9629dc535127b40d77def src/Haddock/Interface/Create.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Haddock/Interface/Create.hs b/src/Haddock/Interface/Create.hs index 3b29aba..35698b4 100644 --- a/src/Haddock/Interface/Create.hs +++ b/src/Haddock/Interface/Create.hs @@ -194,8 +194,8 @@ moduleWarning dflags gre (WarnAll w) = Just $ parseWarning dflags gre w parseWarning :: DynFlags -> GlobalRdrEnv -> WarningTxt -> Doc Name parseWarning dflags gre w = force $ case w of - DeprecatedTxt msg -> format "Deprecated: " (concatFS msg) - WarningTxt msg -> format "Warning: " (concatFS msg) + DeprecatedTxt msg -> format "Deprecated: " (concatFS $ map unLoc msg) + WarningTxt msg -> format "Warning: " (concatFS $ map unLoc msg) where format x xs = DocWarning . DocParagraph . DocAppend (DocString x) . processDocString dflags gre $ HsDocString xs From git at git.haskell.org Wed Jul 8 08:31:44 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:31:44 +0000 (UTC) Subject: [commit: haddock] wip/ast-annotations-separate: Make data constructors in HsDataDefn [Located [LConDecl name]] (099015e) Message-ID: <20150708083144.DBCD63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/ast-annotations-separate Link : http://git.haskell.org/haddock.git/commitdiff/099015efaa2f6df09fc559d8d2d2fc2c687a2186 >--------------------------------------------------------------- commit 099015efaa2f6df09fc559d8d2d2fc2c687a2186 Author: Alan Zimmerman Date: Tue Oct 14 22:08:38 2014 +0200 Make data constructors in HsDataDefn [Located [LConDecl name]] >--------------------------------------------------------------- 099015efaa2f6df09fc559d8d2d2fc2c687a2186 src/Haddock/Backends/Hoogle.hs | 2 +- src/Haddock/Backends/LaTeX.hs | 4 ++-- src/Haddock/Backends/Xhtml/Decl.hs | 4 ++-- src/Haddock/Convert.hs | 2 +- src/Haddock/GhcUtils.hs | 4 ++-- src/Haddock/Interface/Create.hs | 8 ++++---- src/Haddock/Interface/Rename.hs | 4 ++-- src/Haddock/Utils.hs | 6 +++--- 8 files changed, 17 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 099015efaa2f6df09fc559d8d2d2fc2c687a2186 From git at git.haskell.org Wed Jul 8 08:31:46 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:31:46 +0000 (UTC) Subject: [commit: haddock] wip/ast-annotations-separate: Replace [ConDeclField RdrName] with [Located [ConDeclField RdrName]] (465ace6) Message-ID: <20150708083146.ECC7A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/ast-annotations-separate Link : http://git.haskell.org/haddock.git/commitdiff/465ace628b8c49caead87da6cddea7b8030522de >--------------------------------------------------------------- commit 465ace628b8c49caead87da6cddea7b8030522de Author: Alan Zimmerman Date: Wed Oct 15 11:51:48 2014 +0200 Replace [ConDeclField RdrName] with [Located [ConDeclField RdrName]] >--------------------------------------------------------------- 465ace628b8c49caead87da6cddea7b8030522de src/Haddock/Backends/Hoogle.hs | 4 ++-- src/Haddock/Backends/LaTeX.hs | 2 +- src/Haddock/Backends/Xhtml/Decl.hs | 4 ++-- src/Haddock/Convert.hs | 2 +- src/Haddock/GhcUtils.hs | 2 +- src/Haddock/Interface/Create.hs | 6 +++--- src/Haddock/Interface/Rename.hs | 7 +++++-- src/Haddock/Utils.hs | 4 ++-- 8 files changed, 17 insertions(+), 14 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 465ace628b8c49caead87da6cddea7b8030522de From git at git.haskell.org Wed Jul 8 08:31:49 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:31:49 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, wip/10268, wip/10313, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/trac-9744: Add an .arcconfig file. (c72175b) Message-ID: <20150708083149.06EBF3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,wip/10268,wip/10313,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/c72175b89bfe2759b7f8d5519fda25ed8bfd27a5 >--------------------------------------------------------------- commit c72175b89bfe2759b7f8d5519fda25ed8bfd27a5 Author: Austin Seipp Date: Mon Oct 20 20:05:27 2014 -0500 Add an .arcconfig file. Signed-off-by: Austin Seipp >--------------------------------------------------------------- c72175b89bfe2759b7f8d5519fda25ed8bfd27a5 .arcconfig | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.arcconfig b/.arcconfig new file mode 100644 index 0000000..0693c58 --- /dev/null +++ b/.arcconfig @@ -0,0 +1,5 @@ +{ + "project.name" : "haddock", + "repository.callsign" : "HADDOCK", + "phabricator.uri" : "https://phabricator.haskell.org" +} From git at git.haskell.org Wed Jul 8 08:31:51 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:31:51 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, wip/10268, wip/10313, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/trac-9744: Add .arclint file. (c3f27a9) Message-ID: <20150708083151.157FE3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,wip/10268,wip/10313,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/c3f27a96bd2a1ec14f441c72a2df95c16c2c5408 >--------------------------------------------------------------- commit c3f27a96bd2a1ec14f441c72a2df95c16c2c5408 Author: Austin Seipp Date: Mon Oct 20 20:07:01 2014 -0500 Add .arclint file. Signed-off-by: Austin Seipp >--------------------------------------------------------------- c3f27a96bd2a1ec14f441c72a2df95c16c2c5408 .arclint | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.arclint b/.arclint new file mode 100644 index 0000000..01f217d --- /dev/null +++ b/.arclint @@ -0,0 +1,24 @@ +{ + "linters": { + "filename": { + "type": "filename" + }, + "generated": { + "type": "generated" + }, + "merge-conflict": { + "type": "merge-conflict" + }, + "nolint": { + "type": "nolint" + }, + "haskell": { + "type": "text", + "include": ["(\\.(l?hs(-boot)?|x|y\\.pp)(\\.in)?$)"], + "severity": { + "5": "disabled", + "2": "warning" + } + } + } +} From git at git.haskell.org Wed Jul 8 08:31:53 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:31:53 +0000 (UTC) Subject: [commit: haddock] wip/orf-new: Implement OverloadedRecordFields extension (b0e3edf) Message-ID: <20150708083153.3485A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/orf-new Link : http://git.haskell.org/haddock.git/commitdiff/b0e3edfc12754e264846f5863351755c3436ddb5 >--------------------------------------------------------------- commit b0e3edfc12754e264846f5863351755c3436ddb5 Author: Adam Gundry Date: Tue Oct 21 09:56:40 2014 +0100 Implement OverloadedRecordFields extension See the wiki for more information: https://ghc.haskell.org/trac/ghc/wiki/Records/OverloadedRecordFields >--------------------------------------------------------------- b0e3edfc12754e264846f5863351755c3436ddb5 .../ref/{Bug6.html => OverloadedRecordFields.html} | 258 ++++++++------------- html-test/src/OverloadedRecordFields.hs | 26 +++ src/Haddock/Backends/Hoogle.hs | 2 +- src/Haddock/Backends/LaTeX.hs | 37 +-- src/Haddock/Backends/Xhtml.hs | 3 +- src/Haddock/Backends/Xhtml/Decl.hs | 21 +- src/Haddock/Backends/Xhtml/Names.hs | 9 +- src/Haddock/Convert.hs | 6 +- src/Haddock/GhcUtils.hs | 8 - src/Haddock/Interface/Create.hs | 24 +- src/Haddock/Interface/LexParseRn.hs | 45 ++-- src/Haddock/Interface/Rename.hs | 8 +- src/Haddock/InterfaceFile.hs | 8 +- src/Haddock/Types.hs | 14 ++ src/Haddock/Utils.hs | 4 +- 15 files changed, 244 insertions(+), 229 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 b0e3edfc12754e264846f5863351755c3436ddb5 From git at git.haskell.org Wed Jul 8 08:31:55 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:31:55 +0000 (UTC) Subject: [commit: haddock] wip/ast-annotations-separate: Make name in IEVar located for pattern annotations (54f89f9) Message-ID: <20150708083155.3FDAC3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/ast-annotations-separate Link : http://git.haskell.org/haddock.git/commitdiff/54f89f9d9e69ca5da91e6507c58dddae75281b26 >--------------------------------------------------------------- commit 54f89f9d9e69ca5da91e6507c58dddae75281b26 Author: Alan Zimmerman Date: Mon Oct 27 16:40:20 2014 +0200 Make name in IEVar located for pattern annotations >--------------------------------------------------------------- 54f89f9d9e69ca5da91e6507c58dddae75281b26 src/Haddock/Interface/Create.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Haddock/Interface/Create.hs b/src/Haddock/Interface/Create.hs index 1eeeae1..527ef3a 100644 --- a/src/Haddock/Interface/Create.hs +++ b/src/Haddock/Interface/Create.hs @@ -490,7 +490,7 @@ mkExportItems Nothing -> fullModuleContents dflags warnings gre maps fixMap splices decls Just exports -> liftM concat $ mapM lookupExport exports where - lookupExport (IEVar x) = declWith x + lookupExport (IEVar (L _ x)) = declWith x lookupExport (IEThingAbs t) = declWith t lookupExport (IEThingAll t) = declWith t lookupExport (IEThingWith t _) = declWith t From git at git.haskell.org Wed Jul 8 08:31:57 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:31:57 +0000 (UTC) Subject: [commit: haddock] wip/ast-annotations-separate: More locations for annotations (6587e1f) Message-ID: <20150708083157.4B4B03A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/ast-annotations-separate Link : http://git.haskell.org/haddock.git/commitdiff/6587e1fb61d0e485ca634497f55cc81975148115 >--------------------------------------------------------------- commit 6587e1fb61d0e485ca634497f55cc81975148115 Author: Alan Zimmerman Date: Mon Oct 27 22:39:21 2014 +0200 More locations for annotations >--------------------------------------------------------------- 6587e1fb61d0e485ca634497f55cc81975148115 src/Haddock/Interface/Create.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Haddock/Interface/Create.hs b/src/Haddock/Interface/Create.hs index 527ef3a..8b39280 100644 --- a/src/Haddock/Interface/Create.hs +++ b/src/Haddock/Interface/Create.hs @@ -490,10 +490,10 @@ mkExportItems Nothing -> fullModuleContents dflags warnings gre maps fixMap splices decls Just exports -> liftM concat $ mapM lookupExport exports where - lookupExport (IEVar (L _ x)) = declWith x - lookupExport (IEThingAbs t) = declWith t - lookupExport (IEThingAll t) = declWith t - lookupExport (IEThingWith t _) = declWith t + lookupExport (IEVar (L _ x)) = declWith x + lookupExport (IEThingAbs t) = declWith t + lookupExport (IEThingAll (L _ t)) = declWith t + lookupExport (IEThingWith (L _ t) _) = declWith t lookupExport (IEModuleContents m) = moduleExports thisMod m dflags warnings gre exportedNames decls modMap instIfaceMap maps fixMap splices lookupExport (IEGroup lev docStr) = return $ From git at git.haskell.org Wed Jul 8 08:31:59 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:31:59 +0000 (UTC) Subject: [commit: haddock] wip/ast-annotations-separate: Make IEModuleContents have Located ModuleName (b31be07) Message-ID: <20150708083159.566563A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/ast-annotations-separate Link : http://git.haskell.org/haddock.git/commitdiff/b31be07d250cd006d0654efe2e16f82274c9acb6 >--------------------------------------------------------------- commit b31be07d250cd006d0654efe2e16f82274c9acb6 Author: Alan Zimmerman Date: Tue Oct 28 22:52:33 2014 +0200 Make IEModuleContents have Located ModuleName >--------------------------------------------------------------- b31be07d250cd006d0654efe2e16f82274c9acb6 src/Haddock/Interface/Create.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Haddock/Interface/Create.hs b/src/Haddock/Interface/Create.hs index 8b39280..653da6d 100644 --- a/src/Haddock/Interface/Create.hs +++ b/src/Haddock/Interface/Create.hs @@ -494,7 +494,7 @@ mkExportItems lookupExport (IEThingAbs t) = declWith t lookupExport (IEThingAll (L _ t)) = declWith t lookupExport (IEThingWith (L _ t) _) = declWith t - lookupExport (IEModuleContents m) = + lookupExport (IEModuleContents (L _ m)) = moduleExports thisMod m dflags warnings gre exportedNames decls modMap instIfaceMap maps fixMap splices lookupExport (IEGroup lev docStr) = return $ return . ExportGroup lev "" $ processDocString dflags gre docStr From git at git.haskell.org Wed Jul 8 08:32:01 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:32:01 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, metainfo, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Experimental support for collapsable headers (e2ed3b9) Message-ID: <20150708083201.749EF3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,metainfo,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/e2ed3b9d8dfab09f1b1861dbc8e74f08e137ebcc >--------------------------------------------------------------- commit e2ed3b9d8dfab09f1b1861dbc8e74f08e137ebcc Author: Mateusz Kowalczyk Date: Tue Oct 28 21:57:49 2014 +0000 Experimental support for collapsable headers Closes #335 >--------------------------------------------------------------- e2ed3b9d8dfab09f1b1861dbc8e74f08e137ebcc CHANGES | 4 + doc/haddock.xml | 23 ++++- haddock-api/haddock-api.cabal | 2 +- haddock-api/src/Haddock/Backends/Xhtml.hs | 17 ++-- haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | 14 +-- .../src/Haddock/Backends/Xhtml/DocMarkup.hs | 106 +++++++++++++++++++-- haddock-api/src/Haddock/Backends/Xhtml/Layout.hs | 9 +- haddock.cabal | 4 +- html-test/ref/{Bug308.html => Bug335.html} | 68 +++++++------ html-test/src/Bug335.hs | 26 +++++ 10 files changed, 212 insertions(+), 61 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 e2ed3b9d8dfab09f1b1861dbc8e74f08e137ebcc From git at git.haskell.org Wed Jul 8 08:32:03 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:32:03 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, wip/10268, wip/10313, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/trac-9744: Experimental support for collapsable headers (3fb325a) Message-ID: <20150708083203.82A113A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,wip/10268,wip/10313,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/3fb325a2ca6b6397905116024922d079447a2e08 >--------------------------------------------------------------- commit 3fb325a2ca6b6397905116024922d079447a2e08 Author: Mateusz Kowalczyk Date: Tue Oct 28 21:57:49 2014 +0000 Experimental support for collapsable headers (cherry picked from commit e2ed3b9d8dfab09f1b1861dbc8e74f08e137ebcc) >--------------------------------------------------------------- 3fb325a2ca6b6397905116024922d079447a2e08 src/Haddock/Backends/Xhtml.hs | 17 +++-- src/Haddock/Backends/Xhtml/Decl.hs | 14 +++-- src/Haddock/Backends/Xhtml/DocMarkup.hs | 106 +++++++++++++++++++++++++++++--- src/Haddock/Backends/Xhtml/Layout.hs | 9 +-- 4 files changed, 117 insertions(+), 29 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 3fb325a2ca6b6397905116024922d079447a2e08 From git at git.haskell.org Wed Jul 8 08:32:05 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:32:05 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, wip/10268, wip/10313, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/trac-9744: Collapse user-defined section by default (re #335) (3937a98) Message-ID: <20150708083205.8D6603A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,wip/10268,wip/10313,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/3937a98afe1bf1a215fd9115051af388e45b7299 >--------------------------------------------------------------- commit 3937a98afe1bf1a215fd9115051af388e45b7299 Author: Herbert Valerio Riedel Date: Fri Oct 31 11:08:02 2014 +0100 Collapse user-defined section by default (re #335) >--------------------------------------------------------------- 3937a98afe1bf1a215fd9115051af388e45b7299 src/Haddock/Backends/Xhtml/DocMarkup.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Haddock/Backends/Xhtml/DocMarkup.hs b/src/Haddock/Backends/Xhtml/DocMarkup.hs index 741e97e..a1f56ad 100644 --- a/src/Haddock/Backends/Xhtml/DocMarkup.hs +++ b/src/Haddock/Backends/Xhtml/DocMarkup.hs @@ -150,8 +150,8 @@ hackMarkup fmt h = case h of UntouchedDoc d -> markup fmt d CollapsingHeader (Header lvl titl) par n nm -> let id_ = makeAnchorId $ "ch:" ++ fromMaybe "noid:" nm ++ show n - col' = collapseControl id_ True "caption" - instTable = (thediv ! collapseSection id_ True [] <<) + col' = collapseControl id_ False "caption" + instTable = (thediv ! collapseSection id_ False [] <<) lvs = zip [1 .. ] [h1, h2, h3, h4, h5, h6] getHeader = fromMaybe caption (lookup lvl lvs) subCation = getHeader ! col' << markup fmt titl From git at git.haskell.org Wed Jul 8 08:32:07 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:32:07 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, wip/10268, wip/10313, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/trac-9744: reflect ForeignType constructore removal (5a79e5b) Message-ID: <20150708083207.9AA523A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,wip/10268,wip/10313,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/5a79e5b25a1e628f7d1d9f4bf97ccd9e30242c6a >--------------------------------------------------------------- commit 5a79e5b25a1e628f7d1d9f4bf97ccd9e30242c6a Author: Yuras Shumovich Date: Fri Oct 31 16:11:04 2014 -0500 reflect ForeignType constructore removal Reviewers: austin Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D358 >--------------------------------------------------------------- 5a79e5b25a1e628f7d1d9f4bf97ccd9e30242c6a src/Haddock/Interface/Rename.hs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/Haddock/Interface/Rename.hs b/src/Haddock/Interface/Rename.hs index dd2bd73..dca93cc 100644 --- a/src/Haddock/Interface/Rename.hs +++ b/src/Haddock/Interface/Rename.hs @@ -298,10 +298,6 @@ renameLThing fn (L loc x) = return . L loc =<< fn x renameTyClD :: TyClDecl Name -> RnM (TyClDecl DocName) renameTyClD d = case d of - ForeignType lname b -> do - lname' <- renameL lname - return (ForeignType lname' b) - -- TyFamily flav lname ltyvars kind tckind -> do FamDecl { tcdFam = decl } -> do decl' <- renameFamilyDecl decl From git at git.haskell.org Wed Jul 8 08:32:09 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:32:09 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, wip/10268, wip/10313, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/ast-prepare-annotations, wip/ast-prepare-annotations-final, wip/ast-prepare-annotations-final2, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/orf-reboot, wip/pattern-synonyms, wip/rae, wip/trac-9744: Remove overlapping pattern match (199936a) Message-ID: <20150708083209.A87293A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,wip/10268,wip/10313,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/ast-prepare-annotations,wip/ast-prepare-annotations-final,wip/ast-prepare-annotations-final2,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/orf-reboot,wip/pattern-synonyms,wip/rae,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/199936af5bb902c81f822b2dc57308dc25e18cfc >--------------------------------------------------------------- commit 199936af5bb902c81f822b2dc57308dc25e18cfc Author: Austin Seipp Date: Fri Oct 31 19:33:53 2014 -0500 Remove overlapping pattern match Signed-off-by: Austin Seipp >--------------------------------------------------------------- 199936af5bb902c81f822b2dc57308dc25e18cfc src/Haddock/Backends/Xhtml.hs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Haddock/Backends/Xhtml.hs b/src/Haddock/Backends/Xhtml.hs index 3838287..85d2652 100644 --- a/src/Haddock/Backends/Xhtml.hs +++ b/src/Haddock/Backends/Xhtml.hs @@ -587,7 +587,6 @@ processForMiniSynopsis mdl unicode qual ExportDecl { expItemDecl = L _loc decl0 (DataDecl{}) -> [keyword "data" <+> b] (SynDecl{}) -> [keyword "type" <+> b] (ClassDecl {}) -> [keyword "class" <+> b] - _ -> [] SigD (TypeSig lnames (L _ _)) -> map (ppNameMini Prefix mdl . nameOccName . getName . unLoc) lnames _ -> [] From git at git.haskell.org Wed Jul 8 08:32:11 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:32:11 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, metainfo, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Remove -fobject-code from .ghci (36ad2fd) Message-ID: <20150708083211.B3F773A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,metainfo,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/36ad2fd75a4bb559b32b8baa088b6146f8f70c2d >--------------------------------------------------------------- commit 36ad2fd75a4bb559b32b8baa088b6146f8f70c2d Author: Simon Hengel Date: Sun Nov 2 07:25:30 2014 +0800 Remove -fobject-code from .ghci (this slows down reloads on modifications) >--------------------------------------------------------------- 36ad2fd75a4bb559b32b8baa088b6146f8f70c2d haddock-library/.ghci | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haddock-library/.ghci b/haddock-library/.ghci index f0bc910..78950a5 100644 --- a/haddock-library/.ghci +++ b/haddock-library/.ghci @@ -1 +1 @@ -:set -isrc -ivendor/attoparsec-0.12.1.1 -itest -idist/build -idist/build/autogen -optP-include -optPdist/build/autogen/cabal_macros.h -fobject-code +:set -isrc -ivendor/attoparsec-0.12.1.1 -itest -idist/build -idist/build/autogen -optP-include -optPdist/build/autogen/cabal_macros.h From git at git.haskell.org Wed Jul 8 08:32:13 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:32:13 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, metainfo, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Get rid of StandaloneDeriving (2f6362e) Message-ID: <20150708083213.C01553A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,metainfo,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/2f6362ed4b6c16bdd5d01be19876507eeaf918bd >--------------------------------------------------------------- commit 2f6362ed4b6c16bdd5d01be19876507eeaf918bd Author: Simon Hengel Date: Sun Nov 2 09:28:17 2014 +0800 Get rid of StandaloneDeriving >--------------------------------------------------------------- 2f6362ed4b6c16bdd5d01be19876507eeaf918bd haddock-library/src/Documentation/Haddock/Types.hs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/haddock-library/src/Documentation/Haddock/Types.hs b/haddock-library/src/Documentation/Haddock/Types.hs index b3118cc..9a64fb6 100644 --- a/haddock-library/src/Documentation/Haddock/Types.hs +++ b/haddock-library/src/Documentation/Haddock/Types.hs @@ -1,5 +1,4 @@ -{-# LANGUAGE DeriveDataTypeable, DeriveFunctor, DeriveFoldable #-} -{-# LANGUAGE DeriveTraversable, StandaloneDeriving #-} +{-# LANGUAGE DeriveFunctor, DeriveFoldable, DeriveTraversable #-} -- | -- Module : Documentation.Haddock.Types @@ -24,12 +23,6 @@ instance Foldable Header where instance Traversable Header where traverse f (Header l a) = Header l `fmap` f a - -deriving instance Show a => Show (Header a) -deriving instance (Show a, Show b) => Show (DocH a b) -deriving instance Eq a => Eq (Header a) -deriving instance (Eq a, Eq b) => Eq (DocH a b) - data Hyperlink = Hyperlink { hyperlinkUrl :: String , hyperlinkLabel :: Maybe String @@ -44,7 +37,7 @@ data Picture = Picture data Header id = Header { headerLevel :: Int , headerTitle :: id - } deriving Functor + } deriving (Eq, Show, Functor) data Example = Example { exampleExpression :: String @@ -73,4 +66,4 @@ data DocH mod id | DocProperty String | DocExamples [Example] | DocHeader (Header (DocH mod id)) - deriving (Functor, Foldable, Traversable) + deriving (Eq, Show, Functor, Foldable, Traversable) From git at git.haskell.org Wed Jul 8 08:32:15 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:32:15 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, metainfo, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Derive more instances (1c5f4fe) Message-ID: <20150708083215.CCEA43A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,metainfo,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/1c5f4fe3c4e3ef73481855a51af73d8995450e30 >--------------------------------------------------------------- commit 1c5f4fe3c4e3ef73481855a51af73d8995450e30 Author: Simon Hengel Date: Sun Nov 2 09:30:38 2014 +0800 Derive more instances >--------------------------------------------------------------- 1c5f4fe3c4e3ef73481855a51af73d8995450e30 haddock-library/src/Documentation/Haddock/Types.hs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/haddock-library/src/Documentation/Haddock/Types.hs b/haddock-library/src/Documentation/Haddock/Types.hs index 9a64fb6..b2d28be 100644 --- a/haddock-library/src/Documentation/Haddock/Types.hs +++ b/haddock-library/src/Documentation/Haddock/Types.hs @@ -17,18 +17,11 @@ module Documentation.Haddock.Types where import Data.Foldable import Data.Traversable -instance Foldable Header where - foldMap f (Header _ a) = f a - -instance Traversable Header where - traverse f (Header l a) = Header l `fmap` f a - data Hyperlink = Hyperlink { hyperlinkUrl :: String , hyperlinkLabel :: Maybe String } deriving (Eq, Show) - data Picture = Picture { pictureUri :: String , pictureTitle :: Maybe String @@ -37,7 +30,7 @@ data Picture = Picture data Header id = Header { headerLevel :: Int , headerTitle :: id - } deriving (Eq, Show, Functor) + } deriving (Eq, Show, Functor, Foldable, Traversable) data Example = Example { exampleExpression :: String From git at git.haskell.org Wed Jul 8 08:32:17 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:32:17 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, metainfo, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Remove unused language extensions (09f97fd) Message-ID: <20150708083217.D93543A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,metainfo,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/09f97fd55feb2220622773117f462496cf48d79c >--------------------------------------------------------------- commit 09f97fd55feb2220622773117f462496cf48d79c Author: Simon Hengel Date: Sun Nov 2 09:12:56 2014 +0800 Remove unused language extensions >--------------------------------------------------------------- 09f97fd55feb2220622773117f462496cf48d79c haddock-library/src/Documentation/Haddock/Parser.hs | 4 ---- haddock-library/test/Documentation/Haddock/ParserSpec.hs | 1 - 2 files changed, 5 deletions(-) diff --git a/haddock-library/src/Documentation/Haddock/Parser.hs b/haddock-library/src/Documentation/Haddock/Parser.hs index ab3f362..110a0de 100644 --- a/haddock-library/src/Documentation/Haddock/Parser.hs +++ b/haddock-library/src/Documentation/Haddock/Parser.hs @@ -1,8 +1,4 @@ {-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE StandaloneDeriving #-} -{-# LANGUAGE FlexibleInstances #-} -{-# LANGUAGE UndecidableInstances #-} -{-# LANGUAGE IncoherentInstances #-} -- | -- Module : Documentation.Haddock.Parser -- Copyright : (c) Mateusz Kowalczyk 2013-2014, diff --git a/haddock-library/test/Documentation/Haddock/ParserSpec.hs b/haddock-library/test/Documentation/Haddock/ParserSpec.hs index 4fea255..9ef0e2d 100644 --- a/haddock-library/test/Documentation/Haddock/ParserSpec.hs +++ b/haddock-library/test/Documentation/Haddock/ParserSpec.hs @@ -1,5 +1,4 @@ {-# LANGUAGE OverloadedStrings, FlexibleInstances #-} -{-# LANGUAGE IncoherentInstances, UndecidableInstances #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Documentation.Haddock.ParserSpec (main, spec) where From git at git.haskell.org Wed Jul 8 08:32:19 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:32:19 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, metainfo, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: parser: Try to parse definition lists right before text paragraphs (09323ec) Message-ID: <20150708083219.E4FA63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,metainfo,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/09323ec10f4213461cfc2712f3075673f681a3e2 >--------------------------------------------------------------- commit 09323ec10f4213461cfc2712f3075673f681a3e2 Author: Simon Hengel Date: Sun Nov 2 07:48:18 2014 +0800 parser: Try to parse definition lists right before text paragraphs >--------------------------------------------------------------- 09323ec10f4213461cfc2712f3075673f681a3e2 haddock-library/src/Documentation/Haddock/Parser.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haddock-library/src/Documentation/Haddock/Parser.hs b/haddock-library/src/Documentation/Haddock/Parser.hs index 94750ad..6aa6ad1 100644 --- a/haddock-library/src/Documentation/Haddock/Parser.hs +++ b/haddock-library/src/Documentation/Haddock/Parser.hs @@ -213,11 +213,11 @@ paragraph :: Parser (DocH mod Identifier) paragraph = examples <|> skipSpace *> ( unorderedList <|> orderedList - <|> definitionList <|> birdtracks <|> codeblock <|> property <|> header + <|> definitionList <|> textParagraph ) From git at git.haskell.org Wed Jul 8 08:32:21 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:32:21 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, metainfo, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Minor refactoring (ae2900c) Message-ID: <20150708083221.F27B13A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,metainfo,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/ae2900cf4f75096ed269523f8835a1cc6caa0053 >--------------------------------------------------------------- commit ae2900cf4f75096ed269523f8835a1cc6caa0053 Author: Simon Hengel Date: Sun Nov 2 07:32:54 2014 +0800 Minor refactoring >--------------------------------------------------------------- ae2900cf4f75096ed269523f8835a1cc6caa0053 .../src/Documentation/Haddock/Parser.hs | 50 ++++++++++++---------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/haddock-library/src/Documentation/Haddock/Parser.hs b/haddock-library/src/Documentation/Haddock/Parser.hs index 110a0de..94750ad 100644 --- a/haddock-library/src/Documentation/Haddock/Parser.hs +++ b/haddock-library/src/Documentation/Haddock/Parser.hs @@ -210,9 +210,16 @@ picture = DocPic . makeLabeled Picture . decodeUtf8 -- | Paragraph parser, called by 'parseParas'. paragraph :: Parser (DocH mod Identifier) -paragraph = examples <|> skipSpace *> (list <|> birdtracks <|> codeblock - <|> property <|> header - <|> textParagraph) +paragraph = examples <|> skipSpace *> ( + unorderedList + <|> orderedList + <|> definitionList + <|> birdtracks + <|> codeblock + <|> property + <|> header + <|> textParagraph + ) -- | Headers inside the comment denoted with @=@ signs, up to 6 levels -- deep. @@ -233,20 +240,17 @@ header = do textParagraph :: Parser (DocH mod Identifier) textParagraph = docParagraph . parseString . intercalate "\n" <$> many1 nonEmptyLine --- | List parser, called by 'paragraph'. -list :: Parser (DocH mod Identifier) -list = DocUnorderedList <$> unorderedList - <|> DocOrderedList <$> orderedList - <|> DocDefList <$> definitionList - -- | Parses unordered (bullet) lists. -unorderedList :: Parser [DocH mod Identifier] -unorderedList = ("*" <|> "-") *> innerList unorderedList +unorderedList :: Parser (DocH mod Identifier) +unorderedList = DocUnorderedList <$> p + where + p = ("*" <|> "-") *> innerList p -- | Parses ordered lists (numbered or dashed). -orderedList :: Parser [DocH mod Identifier] -orderedList = (paren <|> dot) *> innerList orderedList +orderedList :: Parser (DocH mod Identifier) +orderedList = DocOrderedList <$> p where + p = (paren <|> dot) *> innerList p dot = (decimal :: Parser Int) <* "." paren = "(" *> decimal <* ")" @@ -265,15 +269,17 @@ innerList item = do Right i -> contents : i -- | Parses definition lists. -definitionList :: Parser [(DocH mod Identifier, DocH mod Identifier)] -definitionList = do - label <- "[" *> (parseStringBS <$> takeWhile1 (`notElem` "]\n")) <* "]" - c <- takeLine - (cs, items) <- more definitionList - let contents = parseString . dropNLs . unlines $ c : cs - return $ case items of - Left p -> [(label, contents `docAppend` p)] - Right i -> (label, contents) : i +definitionList :: Parser (DocH mod Identifier) +definitionList = DocDefList <$> p + where + p = do + label <- "[" *> (parseStringBS <$> takeWhile1 (`notElem` "]\n")) <* "]" + c <- takeLine + (cs, items) <- more p + let contents = parseString . dropNLs . unlines $ c : cs + return $ case items of + Left x -> [(label, contents `docAppend` x)] + Right i -> (label, contents) : i -- | Drops all trailing newlines. dropNLs :: String -> String From git at git.haskell.org Wed Jul 8 08:32:24 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:32:24 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, metainfo, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Add support for markdown links (closes #336) (77ed6a6) Message-ID: <20150708083224.0B2D83A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,metainfo,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/77ed6a63df3d2653401f1869f116c8854021a71e >--------------------------------------------------------------- commit 77ed6a63df3d2653401f1869f116c8854021a71e Author: Simon Hengel Date: Sun Nov 2 10:13:00 2014 +0800 Add support for markdown links (closes #336) >--------------------------------------------------------------- 77ed6a63df3d2653401f1869f116c8854021a71e .../src/Documentation/Haddock/Parser.hs | 22 ++++++++++-- .../src/Documentation/Haddock/Parser/Util.hs | 18 +++++----- .../test/Documentation/Haddock/ParserSpec.hs | 39 ++++++++++++++++++++++ 3 files changed, 69 insertions(+), 10 deletions(-) diff --git a/haddock-library/src/Documentation/Haddock/Parser.hs b/haddock-library/src/Documentation/Haddock/Parser.hs index 6aa6ad1..e53597e 100644 --- a/haddock-library/src/Documentation/Haddock/Parser.hs +++ b/haddock-library/src/Documentation/Haddock/Parser.hs @@ -20,7 +20,7 @@ module Documentation.Haddock.Parser ( parseString, parseParas import Control.Applicative import Control.Arrow (first) -import Control.Monad (void, mfilter) +import Control.Monad import Data.Attoparsec.ByteString.Char8 hiding (parse, take, endOfLine) import qualified Data.ByteString.Char8 as BS import Data.Char (chr, isAsciiUpper) @@ -444,11 +444,29 @@ codeblock = | isNewline && isSpace c = Just isNewline | otherwise = Just $ c == '\n' --- | Parses links that were specifically marked as such. hyperlink :: Parser (DocH mod a) hyperlink = DocHyperlink . makeLabeled Hyperlink . decodeUtf8 <$> disallowNewline ("<" *> takeUntil ">") <|> autoUrl + <|> markdownLink + +markdownLink :: Parser (DocH mod a) +markdownLink = DocHyperlink <$> (flip Hyperlink <$> label <*> (whitespace *> url)) + where + label :: Parser (Maybe String) + label = Just . strip . decode <$> ("[" *> takeUntil "]") + + whitespace :: Parser () + whitespace = skipHorizontalSpace <* optional ("\n" *> skipHorizontalSpace) + + url :: Parser String + url = rejectWhitespace (decode <$> ("(" *> takeUntil ")")) + + rejectWhitespace :: MonadPlus m => m String -> m String + rejectWhitespace = mfilter (all (not . isSpace)) + + decode :: BS.ByteString -> String + decode = removeEscapes . decodeUtf8 -- | Looks for URL-like things to automatically hyperlink even if they -- weren't marked as links. diff --git a/haddock-library/src/Documentation/Haddock/Parser/Util.hs b/haddock-library/src/Documentation/Haddock/Parser/Util.hs index ef2af14..eff7dfc 100644 --- a/haddock-library/src/Documentation/Haddock/Parser/Util.hs +++ b/haddock-library/src/Documentation/Haddock/Parser/Util.hs @@ -14,6 +14,7 @@ module Documentation.Haddock.Parser.Util ( unsnoc , strip , takeUntil +, removeEscapes , makeLabeled , takeHorizontalSpace , skipHorizontalSpace @@ -49,14 +50,15 @@ makeLabeled :: (String -> Maybe String -> a) -> String -> a makeLabeled f input = case break isSpace $ removeEscapes $ strip input of (uri, "") -> f uri Nothing (uri, label) -> f uri (Just $ dropWhile isSpace label) - where - -- As we don't parse these any further, we don't do any processing to the - -- string so we at least remove escape character here. Perhaps we should - -- actually be parsing the label at the very least? - removeEscapes "" = "" - removeEscapes ('\\':'\\':xs) = '\\' : removeEscapes xs - removeEscapes ('\\':xs) = removeEscapes xs - removeEscapes (x:xs) = x : removeEscapes xs + +-- | Remove escapes from given string. +-- +-- Only do this if you do not process (read: parse) the input any further. +removeEscapes :: String -> String +removeEscapes "" = "" +removeEscapes ('\\':'\\':xs) = '\\' : removeEscapes xs +removeEscapes ('\\':xs) = removeEscapes xs +removeEscapes (x:xs) = x : removeEscapes xs takeUntil :: ByteString -> Parser ByteString takeUntil end_ = dropEnd <$> requireEnd (scan (False, end) p) >>= gotSome diff --git a/haddock-library/test/Documentation/Haddock/ParserSpec.hs b/haddock-library/test/Documentation/Haddock/ParserSpec.hs index 9ef0e2d..cb417cf 100644 --- a/haddock-library/test/Documentation/Haddock/ParserSpec.hs +++ b/haddock-library/test/Documentation/Haddock/ParserSpec.hs @@ -114,6 +114,45 @@ spec = do it "doesn't allow for multi-line link tags" $ do "" `shouldParseTo` "" + context "when parsing markdown links" $ do + it "parses a simple link" $ do + "[some label](url)" `shouldParseTo` + hyperlink "url" "some label" + + it "allows whitespace between label and URL" $ do + "[some label] \t (url)" `shouldParseTo` + hyperlink "url" "some label" + + it "allows newlines in label" $ do + "[some\n\nlabel](url)" `shouldParseTo` + hyperlink "url" "some\n\nlabel" + + it "allows escaping in label" $ do + "[some\\] label](url)" `shouldParseTo` + hyperlink "url" "some] label" + + it "strips leading and trailing whitespace from label" $ do + "[ some label ](url)" `shouldParseTo` + hyperlink "url" "some label" + + it "rejects whitespace in URL" $ do + "[some label]( url)" `shouldParseTo` + "[some label]( url)" + + context "when URL is on a separate line" $ do + it "allows URL to be on a separate line" $ do + "[some label]\n(url)" `shouldParseTo` + hyperlink "url" "some label" + + it "allows leading whitespace" $ do + "[some label]\n \t (url)" `shouldParseTo` + hyperlink "url" "some label" + + it "rejects additional newlines" $ do + "[some label]\n\n(url)" `shouldParseTo` + "[some label]\n\n(url)" + + context "when autolinking URLs" $ do it "autolinks HTTP URLs" $ do "http://example.com/" `shouldParseTo` hyperlink "http://example.com/" Nothing From git at git.haskell.org Wed Jul 8 08:32:26 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:32:26 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, metainfo, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Allow markdown links at the beginning of a paragraph (58a5683) Message-ID: <20150708083226.17B053A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,metainfo,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/58a5683d1ce759f80ca7eb3b35663b717ae2abd5 >--------------------------------------------------------------- commit 58a5683d1ce759f80ca7eb3b35663b717ae2abd5 Author: Simon Hengel Date: Sun Nov 2 12:07:24 2014 +0800 Allow markdown links at the beginning of a paragraph >--------------------------------------------------------------- 58a5683d1ce759f80ca7eb3b35663b717ae2abd5 .../src/Documentation/Haddock/Parser.hs | 20 ++++++++++++++-- .../test/Documentation/Haddock/ParserSpec.hs | 28 +++++++++++++++++++--- 2 files changed, 43 insertions(+), 5 deletions(-) diff --git a/haddock-library/src/Documentation/Haddock/Parser.hs b/haddock-library/src/Documentation/Haddock/Parser.hs index e53597e..f1fd5dd 100644 --- a/haddock-library/src/Documentation/Haddock/Parser.hs +++ b/haddock-library/src/Documentation/Haddock/Parser.hs @@ -1,4 +1,5 @@ {-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE ViewPatterns #-} -- | -- Module : Documentation.Haddock.Parser -- Copyright : (c) Mateusz Kowalczyk 2013-2014, @@ -217,8 +218,9 @@ paragraph = examples <|> skipSpace *> ( <|> codeblock <|> property <|> header + <|> textParagraphThatStartsWithMarkdownLink <|> definitionList - <|> textParagraph + <|> docParagraph <$> textParagraph ) -- | Headers inside the comment denoted with @=@ signs, up to 6 levels @@ -238,7 +240,21 @@ header = do return $ DocHeader (Header (length delim) line) `docAppend` rest textParagraph :: Parser (DocH mod Identifier) -textParagraph = docParagraph . parseString . intercalate "\n" <$> many1 nonEmptyLine +textParagraph = parseString . intercalate "\n" <$> many1 nonEmptyLine + +textParagraphThatStartsWithMarkdownLink :: Parser (DocH mod Identifier) +textParagraphThatStartsWithMarkdownLink = docParagraph <$> (docAppend <$> markdownLink <*> optionalTextParagraph) + where + optionalTextParagraph :: Parser (DocH mod Identifier) + optionalTextParagraph = (docAppend <$> whitespace <*> textParagraph) <|> pure DocEmpty + + whitespace :: Parser (DocH mod a) + whitespace = DocString <$> (f <$> takeHorizontalSpace <*> optional "\n") + where + f :: BS.ByteString -> Maybe BS.ByteString -> String + f xs (fromMaybe "" -> x) + | BS.null (xs <> x) = "" + | otherwise = " " -- | Parses unordered (bullet) lists. unorderedList :: Parser (DocH mod Identifier) diff --git a/haddock-library/test/Documentation/Haddock/ParserSpec.hs b/haddock-library/test/Documentation/Haddock/ParserSpec.hs index cb417cf..6d152ee 100644 --- a/haddock-library/test/Documentation/Haddock/ParserSpec.hs +++ b/haddock-library/test/Documentation/Haddock/ParserSpec.hs @@ -28,6 +28,9 @@ parseParas = Parse.toRegular . Parse.parseParas parseString :: String -> Doc String parseString = Parse.toRegular . Parse.parseString +hyperlink :: String -> Maybe String -> Doc String +hyperlink url = DocHyperlink . Hyperlink url + main :: IO () main = hspec spec @@ -83,9 +86,6 @@ spec = do "don't use apostrophe's in the wrong place's" context "when parsing URLs" $ do - let hyperlink :: String -> Maybe String -> Doc String - hyperlink url = DocHyperlink . Hyperlink url - it "parses a URL" $ do "" `shouldParseTo` hyperlink "http://example.com/" Nothing @@ -387,6 +387,28 @@ spec = do it "turns it into a code block" $ do "@foo@" `shouldParseTo` DocCodeBlock "foo" + context "when a paragraph starts with a markdown link" $ do + it "correctly parses it as a text paragraph (not a definition list)" $ do + "[label](url)" `shouldParseTo` + DocParagraph (hyperlink "url" "label") + + it "can be followed by an other paragraph" $ do + "[label](url)\n\nfoobar" `shouldParseTo` + DocParagraph (hyperlink "url" "label") <> DocParagraph "foobar" + + context "when paragraph contains additional text" $ do + it "accepts more text after the link" $ do + "[label](url) foo bar baz" `shouldParseTo` + DocParagraph (hyperlink "url" "label" <> " foo bar baz") + + it "accepts a newline right after the markdown link" $ do + "[label](url)\nfoo bar baz" `shouldParseTo` + DocParagraph (hyperlink "url" "label" <> " foo bar baz") + + it "can be followed by an other paragraph" $ do + "[label](url)foo\n\nbar" `shouldParseTo` + DocParagraph (hyperlink "url" "label" <> "foo") <> DocParagraph "bar" + context "when parsing birdtracks" $ do it "parses them as a code block" $ do unlines [ From git at git.haskell.org Wed Jul 8 08:32:28 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:32:28 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, metainfo, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Add support for markdown images (af85d14) Message-ID: <20150708083228.2375C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,metainfo,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/af85d14f001cf4c2976ee659ec04101d6b054a4d >--------------------------------------------------------------- commit af85d14f001cf4c2976ee659ec04101d6b054a4d Author: Simon Hengel Date: Sun Nov 2 13:54:19 2014 +0800 Add support for markdown images >--------------------------------------------------------------- af85d14f001cf4c2976ee659ec04101d6b054a4d CHANGES | 2 ++ doc/haddock.xml | 19 +++++++++-------- .../src/Documentation/Haddock/Parser.hs | 12 +++++++++-- .../test/Documentation/Haddock/ParserSpec.hs | 24 ++++++++++------------ 4 files changed, 34 insertions(+), 23 deletions(-) diff --git a/CHANGES b/CHANGES index 009d63f..4bfe492 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,8 @@ Changes in version 2.15.1 * Experimental collapsible header support (#335) + * Add support for markdown links and images + Changes in version 2.15.0 * Always read in prologue files as UTF8 (#286 and Cabal #1721) diff --git a/doc/haddock.xml b/doc/haddock.xml index 1fece5b..ee77ede 100644 --- a/doc/haddock.xml +++ b/doc/haddock.xml @@ -2118,17 +2118,20 @@ This belongs to the list above!
                      Images + + Haddock supports Markdown syntax for inline images. This resembles + the syntax for links, but starts with an exclamation mark. An + example looks like this: + - An image can be included in a documentation comment by - surrounding it in double angle brackets: - <<...>>. If the output format supports - it, the image will be rendered inside the documentation. - - Title text can be included using an optional label: -<<pathtoimage.png title>> +![image description](pathtoimage.png) - + + If the output format supports it, the image will be rendered inside + the documentation. The image description is used as relpacement text + and/or image title. +
                      diff --git a/haddock-library/src/Documentation/Haddock/Parser.hs b/haddock-library/src/Documentation/Haddock/Parser.hs index f1fd5dd..ff03c7b 100644 --- a/haddock-library/src/Documentation/Haddock/Parser.hs +++ b/haddock-library/src/Documentation/Haddock/Parser.hs @@ -102,7 +102,7 @@ parseStringBS = parse p where p :: Parser (DocH mod Identifier) p = docConcat <$> many (monospace <|> anchor <|> identifier <|> moduleName - <|> picture <|> hyperlink <|> bold + <|> picture <|> markdownImage <|> hyperlink <|> bold <|> emphasis <|> encodedChar <|> string' <|> skipSpecialChar) @@ -209,6 +209,11 @@ picture :: Parser (DocH mod a) picture = DocPic . makeLabeled Picture . decodeUtf8 <$> disallowNewline ("<<" *> takeUntil ">>") +markdownImage :: Parser (DocH mod a) +markdownImage = fromHyperlink <$> ("!" *> linkParser) + where + fromHyperlink (Hyperlink url label) = DocPic (Picture url label) + -- | Paragraph parser, called by 'parseParas'. paragraph :: Parser (DocH mod Identifier) paragraph = examples <|> skipSpace *> ( @@ -467,7 +472,10 @@ hyperlink = DocHyperlink . makeLabeled Hyperlink . decodeUtf8 <|> markdownLink markdownLink :: Parser (DocH mod a) -markdownLink = DocHyperlink <$> (flip Hyperlink <$> label <*> (whitespace *> url)) +markdownLink = DocHyperlink <$> linkParser + +linkParser :: Parser Hyperlink +linkParser = flip Hyperlink <$> label <*> (whitespace *> url) where label :: Parser (Maybe String) label = Just . strip . decode <$> ("[" *> takeUntil "]") diff --git a/haddock-library/test/Documentation/Haddock/ParserSpec.hs b/haddock-library/test/Documentation/Haddock/ParserSpec.hs index 6d152ee..4373234 100644 --- a/haddock-library/test/Documentation/Haddock/ParserSpec.hs +++ b/haddock-library/test/Documentation/Haddock/ParserSpec.hs @@ -183,24 +183,22 @@ spec = do "foo https://example.com/example bar" `shouldParseTo` "foo " <> hyperlink "https://example.com/example" Nothing <> " bar" - context "when parsing pictures" $ do - let picture :: String -> Maybe String -> Doc String - picture uri = DocPic . Picture uri + context "when parsing images" $ do + let image :: String -> Maybe String -> Doc String + image uri = DocPic . Picture uri - it "parses a simple picture" $ do - "<>" `shouldParseTo` picture "baz" Nothing + it "accepts markdown syntax for images" $ do + "![label](url)" `shouldParseTo` image "url" "label" - it "parses a picture with a title" $ do - "<>" `shouldParseTo` picture "b" (Just "a z") + it "accepts Unicode" $ do + "![??????](url)" `shouldParseTo` image "url" "??????" - it "parses a picture with unicode" $ do - "<>" `shouldParseTo` picture "??????" Nothing + it "supports deprecated picture syntax" $ do + "<>" `shouldParseTo` image "baz" Nothing - it "allows for escaping of the closing tags" $ do - "<>z>>" `shouldParseTo` picture "ba>>z" Nothing + it "supports title for deprecated picture syntax" $ do + "<>" `shouldParseTo` image "b" "a z" - it "doesn't allow for multi-line picture tags" $ do - "<>" `shouldParseTo` "<>" context "when parsing anchors" $ do it "parses a single word anchor" $ do From git at git.haskell.org Wed Jul 8 08:32:30 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:32:30 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, metainfo, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Update documentation (d1f0e6e) Message-ID: <20150708083230.30D3E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,metainfo,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/d1f0e6ed1e271eb165abdecf7a5eae4f5c573ade >--------------------------------------------------------------- commit d1f0e6ed1e271eb165abdecf7a5eae4f5c573ade Author: Simon Hengel Date: Sun Nov 2 13:10:58 2014 +0800 Update documentation >--------------------------------------------------------------- d1f0e6ed1e271eb165abdecf7a5eae4f5c573ade doc/haddock.xml | 44 ++++++++++++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 12 deletions(-) diff --git a/doc/haddock.xml b/doc/haddock.xml index 662aafd..1fece5b 100644 --- a/doc/haddock.xml +++ b/doc/haddock.xml @@ -2078,22 +2078,42 @@ This belongs to the list above!
                      URLs - A URL can be included in a documentation comment by - surrounding it in angle brackets: - <...>. If the output format supports - it, the URL will be turned into a hyperlink when - rendered. + + A URL can be included in a documentation comment by surrounding it in + angle brackets, for example: + - The URL can be followed by an optional label: -<http://example.com label> +<http://example.com> - The label is then used as a descriptive text for the hyperlink, if the - output format supports it. - If Haddock sees something that looks like a URL (such as something starting with - http:// or ssh://) where the URL markup is valid, - it will automatically make it a hyperlink. + + If the output format supports it, the URL will be turned into a + hyperlink when rendered. + + + If Haddock sees something that looks like a URL (such as something starting with + http:// or ssh://) where the URL markup is valid, + it will automatically make it a hyperlink. +
                      + +
                      + Links + + + Haddock supports Markdown syntax for inline links. A link consists + of a link text and a URL. The link text is enclosed in square + brackets and followed by the URL enclosed in regular parentheses, for + example: + + + +[some link](http://example.com) + + + The link text is used as a descriptive text for the URL, if the + output format supports it. +
                      From git at git.haskell.org Wed Jul 8 08:32:32 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:32:32 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, metainfo, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Allow an optional colon after the closing bracket of definition lists (122fe6e) Message-ID: <20150708083232.3BCDF3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,metainfo,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/122fe6edaeae55e77d606e6d57aa1904bbfb55c4 >--------------------------------------------------------------- commit 122fe6edaeae55e77d606e6d57aa1904bbfb55c4 Author: Simon Hengel Date: Sun Nov 2 12:19:38 2014 +0800 Allow an optional colon after the closing bracket of definition lists This is to disambiguate them from markdown links and will be require with a future release. >--------------------------------------------------------------- 122fe6edaeae55e77d606e6d57aa1904bbfb55c4 CHANGES | 4 +++ doc/haddock.xml | 13 +++---- .../src/Documentation/Haddock/Parser.hs | 2 +- .../test/Documentation/Haddock/ParserSpec.hs | 42 ++++++++++++++-------- 4 files changed, 36 insertions(+), 25 deletions(-) diff --git a/CHANGES b/CHANGES index 4bfe492..352a739 100644 --- a/CHANGES +++ b/CHANGES @@ -4,6 +4,10 @@ Changes in version 2.15.1 * Add support for markdown links and images + * Allow an optional colon after the closing bracket of definition lists. + This is to disambiguate them from markdown links and will be require with a + future release. + Changes in version 2.15.0 * Always read in prologue files as UTF8 (#286 and Cabal #1721) diff --git a/doc/haddock.xml b/doc/haddock.xml index ee77ede..618e19f 100644 --- a/doc/haddock.xml +++ b/doc/haddock.xml @@ -2038,9 +2038,9 @@ This belongs to the list above! -- | This is a definition list: -- --- [@foo@] The description of @foo at . +-- [@foo@]: The description of @foo at . -- --- [@bar@] The description of @bar at . +-- [@bar@]: The description of @bar at . To produce output something like this: @@ -2061,13 +2061,8 @@ This belongs to the list above! Each paragraph should be preceded by the - “definition term” enclosed in square brackets. - The square bracket characters have no special meaning outside - the beginning of a definition paragraph. That is, if a - paragraph begins with a [ character, then - it is assumed to be a definition paragraph, and the next - ] character found will close the definition - term. Other markup operators may be used freely within the + “definition term” enclosed in square brackets and followed by a colon. + Other markup operators may be used freely within the definition term. You can escape ] with a backslash as usual. Same rules about nesting and no newline separation as for bulleted and numbered lists apply. diff --git a/haddock-library/src/Documentation/Haddock/Parser.hs b/haddock-library/src/Documentation/Haddock/Parser.hs index ff03c7b..9901089 100644 --- a/haddock-library/src/Documentation/Haddock/Parser.hs +++ b/haddock-library/src/Documentation/Haddock/Parser.hs @@ -294,7 +294,7 @@ definitionList :: Parser (DocH mod Identifier) definitionList = DocDefList <$> p where p = do - label <- "[" *> (parseStringBS <$> takeWhile1 (`notElem` "]\n")) <* "]" + label <- "[" *> (parseStringBS <$> takeWhile1 (`notElem` "]\n")) <* ("]" <* optional ":") c <- takeLine (cs, items) <- more p let contents = parseString . dropNLs . unlines $ c : cs diff --git a/haddock-library/test/Documentation/Haddock/ParserSpec.hs b/haddock-library/test/Documentation/Haddock/ParserSpec.hs index 4373234..a228a95 100644 --- a/haddock-library/test/Documentation/Haddock/ParserSpec.hs +++ b/haddock-library/test/Documentation/Haddock/ParserSpec.hs @@ -646,7 +646,7 @@ spec = do it "can nest definition lists" $ do - "[a] foo\n\n [b] bar\n\n [c] baz\n qux" `shouldParseTo` + "[a]: foo\n\n [b]: bar\n\n [c]: baz\n qux" `shouldParseTo` DocDefList [ ("a", "foo" <> DocDefList [ ("b", "bar" <> DocDefList [("c", "baz\nqux")]) @@ -661,7 +661,7 @@ spec = do <> DocOrderedList [ DocParagraph "baz" ] it "definition lists can come back to top level with a different list" $ do - "[foo] foov\n\n [bar] barv\n\n1. baz" `shouldParseTo` + "[foo]: foov\n\n [bar]: barv\n\n1. baz" `shouldParseTo` DocDefList [ ("foo", "foov" <> DocDefList [ ("bar", "barv") ]) ] @@ -809,9 +809,9 @@ spec = do context "when parsing definition lists" $ do it "parses a simple list" $ do unlines [ - " [foo] one" - , " [bar] two" - , " [baz] three" + " [foo]: one" + , " [bar]: two" + , " [baz]: three" ] `shouldParseTo` DocDefList [ ("foo", "one") @@ -821,9 +821,9 @@ spec = do it "ignores empty lines between list items" $ do unlines [ - "[foo] one" + "[foo]: one" , "" - , "[bar] two" + , "[bar]: two" ] `shouldParseTo` DocDefList [ ("foo", "one") @@ -831,13 +831,13 @@ spec = do ] it "accepts an empty list item" $ do - "[foo]" `shouldParseTo` DocDefList [("foo", DocEmpty)] + "[foo]:" `shouldParseTo` DocDefList [("foo", DocEmpty)] it "accepts multi-line list items" $ do unlines [ - "[foo] point one" + "[foo]: point one" , " more one" - , "[bar] point two" + , "[bar]: point two" , "more two" ] `shouldParseTo` DocDefList [ @@ -846,21 +846,33 @@ spec = do ] it "accepts markup in list items" $ do - "[foo] /foo/" `shouldParseTo` DocDefList [("foo", DocEmphasis "foo")] + "[foo]: /foo/" `shouldParseTo` DocDefList [("foo", DocEmphasis "foo")] it "accepts markup for the label" $ do - "[/foo/] bar" `shouldParseTo` DocDefList [(DocEmphasis "foo", "bar")] + "[/foo/]: bar" `shouldParseTo` DocDefList [(DocEmphasis "foo", "bar")] it "requires empty lines between list and other paragraphs" $ do unlines [ "foo" , "" - , "[foo] bar" + , "[foo]: bar" , "" , "baz" ] `shouldParseTo` DocParagraph "foo" <> DocDefList [("foo", "bar")] <> DocParagraph "baz" + it "dose not require the colon (deprecated - this will be removed in a future release)" $ do + unlines [ + " [foo] one" + , " [bar] two" + , " [baz] three" + ] + `shouldParseTo` DocDefList [ + ("foo", "one") + , ("bar", "two") + , ("baz", "three") + ] + context "when parsing consecutive paragraphs" $ do it "will not capture irrelevant consecutive lists" $ do unlines [ " * bullet" @@ -873,9 +885,9 @@ spec = do , " " , " 2. different bullet" , " " - , " [cat] kitten" + , " [cat]: kitten" , " " - , " [pineapple] fruit" + , " [pineapple]: fruit" ] `shouldParseTo` DocUnorderedList [ DocParagraph "bullet" , DocParagraph "different bullet"] From git at git.haskell.org Wed Jul 8 08:32:34 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:32:34 +0000 (UTC) Subject: [commit: haddock] wip/ast-prepare-annotations, wip/ast-prepare-annotations-final: AST changes to prepare for annotations (99a29fd) Message-ID: <20150708083234.4D44A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: wip/ast-prepare-annotations,wip/ast-prepare-annotations-final Link : http://git.haskell.org/haddock.git/commitdiff/99a29fd8a55209ba13d2097727c4bae1d269237a >--------------------------------------------------------------- commit 99a29fd8a55209ba13d2097727c4bae1d269237a Author: Alan Zimmerman Date: Mon Nov 3 15:27:47 2014 +0200 AST changes to prepare for annotations >--------------------------------------------------------------- 99a29fd8a55209ba13d2097727c4bae1d269237a src/Haddock/Backends/Hoogle.hs | 6 +++--- src/Haddock/Backends/LaTeX.hs | 6 +++--- src/Haddock/Backends/Xhtml/Decl.hs | 8 ++++---- src/Haddock/Convert.hs | 4 ++-- src/Haddock/GhcUtils.hs | 6 +++--- src/Haddock/Interface/Create.hs | 30 ++++++++++++++++-------------- src/Haddock/Interface/Rename.hs | 12 ++++++++---- src/Haddock/Utils.hs | 10 +++++----- 8 files changed, 44 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 99a29fd8a55209ba13d2097727c4bae1d269237a From git at git.haskell.org Wed Jul 8 08:32:36 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:32:36 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, metainfo, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: whitespace only (08a2651) Message-ID: <20150708083236.5918F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,metainfo,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/08a2651a20d66ad94ff7092ed0195be6b4e8f267 >--------------------------------------------------------------- commit 08a2651a20d66ad94ff7092ed0195be6b4e8f267 Author: Mateusz Kowalczyk Date: Tue Nov 4 00:41:17 2014 +0000 whitespace only >--------------------------------------------------------------- 08a2651a20d66ad94ff7092ed0195be6b4e8f267 haddock-api/src/Haddock/Convert.hs | 0 1 file changed, 0 insertions(+), 0 deletions(-) From git at git.haskell.org Wed Jul 8 08:32:38 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:32:38 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, metainfo, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Fix re-exports of built-in type families (8d82524) Message-ID: <20150708083238.6ED0D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,metainfo,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/8d82524d9d9b278eae08993c2d4c54173d68481c >--------------------------------------------------------------- commit 8d82524d9d9b278eae08993c2d4c54173d68481c Author: Mateusz Kowalczyk Date: Tue Nov 4 01:16:20 2014 +0000 Fix re-exports of built-in type families Fixes #310 >--------------------------------------------------------------- 8d82524d9d9b278eae08993c2d4c54173d68481c CHANGES | 2 ++ haddock-api/src/Haddock/Convert.hs | 11 ++++--- html-test/ref/{Hyperlinks.html => Bug310.html} | 42 ++++++++++++++------------ html-test/src/Bug310.hs | 4 +++ 4 files changed, 35 insertions(+), 24 deletions(-) diff --git a/CHANGES b/CHANGES index 352a739..3a08424 100644 --- a/CHANGES +++ b/CHANGES @@ -8,6 +8,8 @@ Changes in version 2.15.1 This is to disambiguate them from markdown links and will be require with a future release. + * Fix re-exports of built-in type families (#310) + Changes in version 2.15.0 * Always read in prologue files as UTF8 (#286 and Cabal #1721) diff --git a/haddock-api/src/Haddock/Convert.hs b/haddock-api/src/Haddock/Convert.hs index 610e8fc..ff7ca56 100644 --- a/haddock-api/src/Haddock/Convert.hs +++ b/haddock-api/src/Haddock/Convert.hs @@ -136,6 +136,7 @@ synifyAxiom ax@(CoAxiom { co_ax_tc = tc }) | otherwise = error "synifyAxiom: closed/open family confusion" +-- | Turn type constructors into type class declarations synifyTyCon :: Maybe (CoAxiom br) -> TyCon -> TyClDecl Name synifyTyCon coax tc | isFunTyCon tc || isPrimTyCon tc @@ -163,10 +164,12 @@ synifyTyCon coax tc = case synTyConRhs_maybe tc of Just rhs -> let info = case rhs of - OpenSynFamilyTyCon -> OpenTypeFamily - ClosedSynFamilyTyCon (CoAxiom { co_ax_branches = branches }) -> - ClosedTypeFamily (brListMap (noLoc . synifyAxBranch tc) branches) - _ -> error "synifyTyCon: type/data family confusion" + OpenSynFamilyTyCon -> OpenTypeFamily + ClosedSynFamilyTyCon (CoAxiom { co_ax_branches = branches }) -> + ClosedTypeFamily (brListMap (noLoc . synifyAxBranch tc) branches) + BuiltInSynFamTyCon {} -> ClosedTypeFamily [] + AbstractClosedSynFamilyTyCon {} -> ClosedTypeFamily [] + _ -> error "synifyTyCon: type/data family confusion" in FamDecl (FamilyDecl { fdInfo = info , fdLName = synifyName tc , fdTyVars = synifyTyVars (tyConTyVars tc) diff --git a/html-test/ref/Hyperlinks.html b/html-test/ref/Bug310.html similarity index 72% copy from html-test/ref/Hyperlinks.html copy to html-test/ref/Bug310.html index 3454c48..926d6cf 100644 --- a/html-test/ref/Hyperlinks.html +++ b/html-test/ref/Bug310.html @@ -3,13 +3,13 @@ >HyperlinksBug310Safe HaskellSafe-InferredNone

                      Hyperlinks

                      Bug310

                    Synopsis

                    Documentation

                    foo :: Inttype family a + b :: Nat infixl 6

                    A plain URL: http://example.com/

                    A URL with a label: some link

                    Addition of type-level naturals.

                Produced by Haddock version 2.15.0

                version 2.15.1

              Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,metainfo,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/267e2c2e8226790f5d294ac06941ac5498608db4 >--------------------------------------------------------------- commit 267e2c2e8226790f5d294ac06941ac5498608db4 Author: Mateusz Kowalczyk Date: Tue Nov 4 02:54:28 2014 +0000 Turn some uses of error into recoverable warnings This should at the very least not abort when something weird happens. It does feel like we should have a type that carries these errors until the end however as the user might not see them unless they are printed at the end. >--------------------------------------------------------------- 267e2c2e8226790f5d294ac06941ac5498608db4 haddock-api/src/Haddock/Convert.hs | 175 ++++++++++++--------- .../src/Haddock/Interface/AttachInstances.hs | 57 ++++--- haddock-api/src/Haddock/Interface/Create.hs | 13 +- 3 files changed, 140 insertions(+), 105 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 267e2c2e8226790f5d294ac06941ac5498608db4 From git at git.haskell.org Wed Jul 8 08:32:42 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:32:42 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, metainfo, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Fix warnings (fc46251) Message-ID: <20150708083242.890353A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,metainfo,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/fc462513143aa0ec3fbed879a3483e376173d9fc >--------------------------------------------------------------- commit fc462513143aa0ec3fbed879a3483e376173d9fc Author: Mateusz Kowalczyk Date: Tue Nov 4 04:09:44 2014 +0000 Fix warnings >--------------------------------------------------------------- fc462513143aa0ec3fbed879a3483e376173d9fc haddock-api/src/Haddock/Convert.hs | 3 +-- haddock-api/src/Haddock/Interface/AttachInstances.hs | 3 +-- haddock-api/src/Haddock/Interface/Create.hs | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/haddock-api/src/Haddock/Convert.hs b/haddock-api/src/Haddock/Convert.hs index 803c1a3..d0d44f1 100644 --- a/haddock-api/src/Haddock/Convert.hs +++ b/haddock-api/src/Haddock/Convert.hs @@ -235,7 +235,6 @@ synifyTyCon coax tc use_gadt_syntax = any (not . isVanillaDataCon) (tyConDataCons tc) consRaw = map (synifyDataCon use_gadt_syntax) (tyConDataCons tc) cons = rights consRaw - dataConErrs = lefts consRaw -- "deriving" doesn't affect the signature, no need to specify any. alg_deriv = Nothing defn = HsDataDefn { dd_ND = alg_nd @@ -248,7 +247,7 @@ synifyTyCon coax tc [] -> return $ DataDecl { tcdLName = name, tcdTyVars = tyvars, tcdDataDefn = defn , tcdFVs = placeHolderNames } - ms -> Left $ unlines dataConErrs + dataConErrs -> Left $ unlines dataConErrs -- User beware: it is your responsibility to pass True (use_gadt_syntax) -- for any constructor that would be misrepresented by omitting its diff --git a/haddock-api/src/Haddock/Interface/AttachInstances.hs b/haddock-api/src/Haddock/Interface/AttachInstances.hs index 1351d38..1341e57 100644 --- a/haddock-api/src/Haddock/Interface/AttachInstances.hs +++ b/haddock-api/src/Haddock/Interface/AttachInstances.hs @@ -25,14 +25,13 @@ import Data.Function (on) import qualified Data.Map as Map import qualified Data.Set as Set -import Bag (listToBag) import Class import DynFlags import ErrUtils import FamInstEnv import FastString import GHC -import GhcMonad (withSession, logWarnings) +import GhcMonad (withSession) import Id import InstEnv import MonadUtils (liftIO) diff --git a/haddock-api/src/Haddock/Interface/Create.hs b/haddock-api/src/Haddock/Interface/Create.hs index 047960c..00c119f 100644 --- a/haddock-api/src/Haddock/Interface/Create.hs +++ b/haddock-api/src/Haddock/Interface/Create.hs @@ -620,8 +620,8 @@ hiDecl dflags t = do return Nothing Just x -> case tyThingToLHsDecl x of Left m -> liftErrMsg (tell [bugWarn m]) >> return Nothing - Right (m, t) -> liftErrMsg (tell $ map bugWarn m) - >> return (Just $ noLoc t) + Right (m, t') -> liftErrMsg (tell $ map bugWarn m) + >> return (Just $ noLoc t') where warnLine x = O.text "haddock-bug:" O.<+> O.text x O.<> O.comma O.<+> O.quotes (O.ppr t) O.<+> From git at git.haskell.org Wed Jul 8 08:32:44 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:32:44 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, metainfo, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Fix parsing of identifiers written in infix way (0891c56) Message-ID: <20150708083244.9627F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,metainfo,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/0891c568f645edcac35442576757ab6fcaa7b6ec >--------------------------------------------------------------- commit 0891c568f645edcac35442576757ab6fcaa7b6ec Author: Mateusz Kowalczyk Date: Tue Nov 4 21:04:07 2014 +0000 Fix parsing of identifiers written in infix way >--------------------------------------------------------------- 0891c568f645edcac35442576757ab6fcaa7b6ec CHANGES | 2 ++ doc/haddock.xml | 4 +++- .../src/Documentation/Haddock/Parser.hs | 23 +++++++++++----------- .../test/Documentation/Haddock/ParserSpec.hs | 6 ++++++ 4 files changed, 23 insertions(+), 12 deletions(-) diff --git a/CHANGES b/CHANGES index 3a08424..79a7e65 100644 --- a/CHANGES +++ b/CHANGES @@ -10,6 +10,8 @@ Changes in version 2.15.1 * Fix re-exports of built-in type families (#310) + * Fix parsing of infix identifiers such as ``elem``. + Changes in version 2.15.0 * Always read in prologue files as UTF8 (#286 and Cabal #1721) diff --git a/doc/haddock.xml b/doc/haddock.xml index 618e19f..3b58f82 100644 --- a/doc/haddock.xml +++ b/doc/haddock.xml @@ -1897,7 +1897,9 @@ module A where Nothing special is needed to hyperlink identifiers which contain apostrophes themselves: to hyperlink foo' one would simply type - 'foo''. + 'foo''. To hyperlink identifiers written in + infix form, simply put them in quotes as always: + '`elem`'. For compatibility with other systems, the following alternative form of markup is accepted diff --git a/haddock-library/src/Documentation/Haddock/Parser.hs b/haddock-library/src/Documentation/Haddock/Parser.hs index 9901089..bea1803 100644 --- a/haddock-library/src/Documentation/Haddock/Parser.hs +++ b/haddock-library/src/Documentation/Haddock/Parser.hs @@ -507,25 +507,26 @@ autoUrl = mkLink <$> url -- deems to be valid in an identifier. Note that it simply blindly consumes -- characters and does no actual validation itself. parseValid :: Parser String -parseValid = do - vs' <- many' $ utf8String "?" <|> return <$> idChar - let vs = concat vs' - c <- peekChar - case c of - Just '`' -> return vs - Just '\'' -> (\x -> vs ++ "'" ++ x) <$> ("'" *> parseValid) - <|> return vs - _ -> fail "outofvalid" +parseValid = p some where idChar = satisfy (`elem` "_.!#$%&*+/<=>?@\\|-~:^") <|> digit <|> letter_ascii + p p' = do + vs' <- p' $ utf8String "?" <|> return <$> idChar + let vs = concat vs' + c <- peekChar + case c of + Just '`' -> return vs + Just '\'' -> (\x -> vs ++ "'" ++ x) <$> ("'" *> p many') + <|> return vs + _ -> fail "outofvalid" -- | Parses UTF8 strings from ByteString streams. utf8String :: String -> Parser String utf8String x = decodeUtf8 <$> string (encodeUtf8 x) --- | Parses identifiers with help of 'parseValid'. Asks GHC for 'String' from the --- string it deems valid. +-- | Parses identifiers with help of 'parseValid'. Asks GHC for +-- 'String' from the string it deems valid. identifier :: Parser (DocH mod Identifier) identifier = do o <- idDelim diff --git a/haddock-library/test/Documentation/Haddock/ParserSpec.hs b/haddock-library/test/Documentation/Haddock/ParserSpec.hs index a228a95..5550e83 100644 --- a/haddock-library/test/Documentation/Haddock/ParserSpec.hs +++ b/haddock-library/test/Documentation/Haddock/ParserSpec.hs @@ -85,6 +85,12 @@ spec = do " don't use apostrophe's in the wrong place's" `shouldParseTo` "don't use apostrophe's in the wrong place's" + it "doesn't parse empty identifiers" $ do + "``" `shouldParseTo` "``" + + it "can parse infix identifiers" $ do + "``infix``" `shouldParseTo` "`" <> DocIdentifier "infix" <> "`" + context "when parsing URLs" $ do it "parses a URL" $ do "" `shouldParseTo` hyperlink "http://example.com/" Nothing From git at git.haskell.org Wed Jul 8 08:32:46 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:32:46 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, metainfo, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Minor code simplification (86ee241) Message-ID: <20150708083246.A120B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,metainfo,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/86ee2412abacff33340559f2f4626ea44564a038 >--------------------------------------------------------------- commit 86ee2412abacff33340559f2f4626ea44564a038 Author: Simon Hengel Date: Sat Nov 8 11:32:42 2014 +0800 Minor code simplification >--------------------------------------------------------------- 86ee2412abacff33340559f2f4626ea44564a038 haddock-library/src/Documentation/Haddock/Parser.hs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/haddock-library/src/Documentation/Haddock/Parser.hs b/haddock-library/src/Documentation/Haddock/Parser.hs index bea1803..b3387f5 100644 --- a/haddock-library/src/Documentation/Haddock/Parser.hs +++ b/haddock-library/src/Documentation/Haddock/Parser.hs @@ -514,11 +514,10 @@ parseValid = p some p p' = do vs' <- p' $ utf8String "?" <|> return <$> idChar let vs = concat vs' - c <- peekChar + c <- peekChar' case c of - Just '`' -> return vs - Just '\'' -> (\x -> vs ++ "'" ++ x) <$> ("'" *> p many') - <|> return vs + '`' -> return vs + '\'' -> (\x -> vs ++ "'" ++ x) <$> ("'" *> p many') <|> return vs _ -> fail "outofvalid" -- | Parses UTF8 strings from ByteString streams. From git at git.haskell.org Wed Jul 8 08:32:48 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:32:48 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, metainfo, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: newtype-wrap parser monad (b4b25f5) Message-ID: <20150708083248.B3B413A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,metainfo,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/b4b25f5b5777939584aa3c548a855490d5791f73 >--------------------------------------------------------------- commit b4b25f5b5777939584aa3c548a855490d5791f73 Author: Simon Hengel Date: Sat Nov 8 17:28:33 2014 +0800 newtype-wrap parser monad >--------------------------------------------------------------- b4b25f5b5777939584aa3c548a855490d5791f73 .../src/Documentation/Haddock/Parser.hs | 2 +- .../src/Documentation/Haddock/Parser/Monad.hs | 128 +++++++++++++++++++++ .../src/Documentation/Haddock/Parser/Util.hs | 2 +- .../test/Documentation/Haddock/Parser/UtilSpec.hs | 2 +- 4 files changed, 131 insertions(+), 3 deletions(-) diff --git a/haddock-library/src/Documentation/Haddock/Parser.hs b/haddock-library/src/Documentation/Haddock/Parser.hs index b3387f5..8b4ec78 100644 --- a/haddock-library/src/Documentation/Haddock/Parser.hs +++ b/haddock-library/src/Documentation/Haddock/Parser.hs @@ -22,13 +22,13 @@ module Documentation.Haddock.Parser ( parseString, parseParas import Control.Applicative import Control.Arrow (first) import Control.Monad -import Data.Attoparsec.ByteString.Char8 hiding (parse, take, endOfLine) import qualified Data.ByteString.Char8 as BS import Data.Char (chr, isAsciiUpper) import Data.List (stripPrefix, intercalate, unfoldr) import Data.Maybe (fromMaybe) import Data.Monoid import Documentation.Haddock.Doc +import Documentation.Haddock.Parser.Monad hiding (take, endOfLine) import Documentation.Haddock.Parser.Util import Documentation.Haddock.Types import Documentation.Haddock.Utf8 diff --git a/haddock-library/src/Documentation/Haddock/Parser/Monad.hs b/haddock-library/src/Documentation/Haddock/Parser/Monad.hs new file mode 100644 index 0000000..19edce0 --- /dev/null +++ b/haddock-library/src/Documentation/Haddock/Parser/Monad.hs @@ -0,0 +1,128 @@ +{-# LANGUAGE GeneralizedNewtypeDeriving #-} +module Documentation.Haddock.Parser.Monad ( + module Documentation.Haddock.Parser.Monad +, Attoparsec.isDigit +, Attoparsec.isDigit_w8 +, Attoparsec.isAlpha_iso8859_15 +, Attoparsec.isAlpha_ascii +, Attoparsec.isSpace +, Attoparsec.isSpace_w8 +, Attoparsec.inClass +, Attoparsec.notInClass +, Attoparsec.isEndOfLine +, Attoparsec.isHorizontalSpace +, Attoparsec.choice +, Attoparsec.count +, Attoparsec.option +, Attoparsec.many' +, Attoparsec.many1 +, Attoparsec.many1' +, Attoparsec.manyTill +, Attoparsec.manyTill' +, Attoparsec.sepBy +, Attoparsec.sepBy' +, Attoparsec.sepBy1 +, Attoparsec.sepBy1' +, Attoparsec.skipMany +, Attoparsec.skipMany1 +, Attoparsec.eitherP +) where + +import Control.Applicative +import Control.Monad +import Data.String +import Data.ByteString (ByteString) +import qualified Data.ByteString.Lazy as LB +import qualified Data.Attoparsec.ByteString.Char8 as Attoparsec +import Data.Word +import Data.Bits + +newtype Parser a = Parser (Attoparsec.Parser a) + deriving (Functor, Applicative, Alternative, Monad, MonadPlus, IsString) + +parseOnly :: Parser a -> ByteString -> Either String a +parseOnly (Parser p) = Attoparsec.parseOnly p + +lift :: Attoparsec.Parser a -> Parser a +lift = Parser + +char :: Char -> Parser Char +char = lift . Attoparsec.char + +char8 :: Char -> Parser Word8 +char8 = lift . Attoparsec.char8 + +anyChar :: Parser Char +anyChar = lift Attoparsec.anyChar + +notChar :: Char -> Parser Char +notChar = lift . Attoparsec.notChar + +satisfy :: (Char -> Bool) -> Parser Char +satisfy = lift . Attoparsec.satisfy + +peekChar :: Parser (Maybe Char) +peekChar = lift Attoparsec.peekChar + +peekChar' :: Parser Char +peekChar' = lift Attoparsec.peekChar' + +digit :: Parser Char +digit = lift Attoparsec.digit + +letter_iso8859_15 :: Parser Char +letter_iso8859_15 = lift Attoparsec.letter_iso8859_15 + +letter_ascii :: Parser Char +letter_ascii = lift Attoparsec.letter_ascii + +space :: Parser Char +space = lift Attoparsec.space + +string :: ByteString -> Parser ByteString +string = lift . Attoparsec.string + +stringCI :: ByteString -> Parser ByteString +stringCI = lift . Attoparsec.stringCI + +skipSpace :: Parser () +skipSpace = lift Attoparsec.skipSpace + +skipWhile :: (Char -> Bool) -> Parser () +skipWhile = lift . Attoparsec.skipWhile + +take :: Int -> Parser ByteString +take = lift . Attoparsec.take + +scan :: s -> (s -> Char -> Maybe s) -> Parser ByteString +scan s = lift . Attoparsec.scan s + +takeWhile :: (Char -> Bool) -> Parser ByteString +takeWhile = lift . Attoparsec.takeWhile + +takeWhile1 :: (Char -> Bool) -> Parser ByteString +takeWhile1 = lift . Attoparsec.takeWhile1 + +takeTill :: (Char -> Bool) -> Parser ByteString +takeTill = lift . Attoparsec.takeTill + +takeByteString :: Parser ByteString +takeByteString = lift Attoparsec.takeByteString + +takeLazyByteString :: Parser LB.ByteString +takeLazyByteString = lift Attoparsec.takeLazyByteString + +endOfLine :: Parser () +endOfLine = lift Attoparsec.endOfLine + +decimal :: Integral a => Parser a +decimal = lift Attoparsec.decimal + +hexadecimal :: (Integral a, Bits a) => Parser a +hexadecimal = lift Attoparsec.hexadecimal + +endOfInput :: Parser () +endOfInput = lift Attoparsec.endOfInput + +atEnd :: Parser Bool +atEnd = lift Attoparsec.atEnd diff --git a/haddock-library/src/Documentation/Haddock/Parser/Util.hs b/haddock-library/src/Documentation/Haddock/Parser/Util.hs index eff7dfc..d908ce1 100644 --- a/haddock-library/src/Documentation/Haddock/Parser/Util.hs +++ b/haddock-library/src/Documentation/Haddock/Parser/Util.hs @@ -22,7 +22,7 @@ module Documentation.Haddock.Parser.Util ( import Control.Applicative import Control.Monad (mfilter) -import Data.Attoparsec.ByteString.Char8 hiding (parse, take, endOfLine) +import Documentation.Haddock.Parser.Monad import Data.ByteString.Char8 (ByteString) import qualified Data.ByteString.Char8 as BS import Prelude hiding (takeWhile) diff --git a/haddock-library/test/Documentation/Haddock/Parser/UtilSpec.hs b/haddock-library/test/Documentation/Haddock/Parser/UtilSpec.hs index a6ac49e..32dd11d 100644 --- a/haddock-library/test/Documentation/Haddock/Parser/UtilSpec.hs +++ b/haddock-library/test/Documentation/Haddock/Parser/UtilSpec.hs @@ -1,7 +1,7 @@ {-# LANGUAGE OverloadedStrings #-} module Documentation.Haddock.Parser.UtilSpec (main, spec) where -import Data.Attoparsec.ByteString.Char8 +import Documentation.Haddock.Parser.Monad import Documentation.Haddock.Parser.Util import Data.Either.Compat (isLeft) import Test.Hspec From git at git.haskell.org Wed Jul 8 08:32:50 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:32:50 +0000 (UTC) Subject: [commit: haddock] wip/ast-prepare-annotations, wip/ast-prepare-annotations-final: con_name in ConDecl is now [Located Name] (1f234fa) Message-ID: <20150708083250.C6AE43A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: wip/ast-prepare-annotations,wip/ast-prepare-annotations-final Link : http://git.haskell.org/haddock.git/commitdiff/1f234fa243d7f9f5c553d304696744bcf8788a14 >--------------------------------------------------------------- commit 1f234fa243d7f9f5c553d304696744bcf8788a14 Author: Alan Zimmerman Date: Sat Nov 8 16:33:48 2014 +0200 con_name in ConDecl is now [Located Name] >--------------------------------------------------------------- 1f234fa243d7f9f5c553d304696744bcf8788a14 src/Haddock/Backends/Hoogle.hs | 6 +++--- src/Haddock/Backends/LaTeX.hs | 17 +++++++++-------- src/Haddock/Backends/Xhtml/Decl.hs | 37 ++++++++++++++++++++++--------------- src/Haddock/Convert.hs | 4 ++-- src/Haddock/GhcUtils.hs | 12 +++++------- src/Haddock/Interface/Create.hs | 12 ++++++------ src/Haddock/Interface/Rename.hs | 6 +++--- src/Haddock/Utils.hs | 8 ++++---- 8 files changed, 54 insertions(+), 48 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 1f234fa243d7f9f5c553d304696744bcf8788a14 From git at git.haskell.org Wed Jul 8 08:32:52 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:32:52 +0000 (UTC) Subject: [commit: haddock] wip/ast-prepare-annotations, wip/ast-prepare-annotations-final: Only print as a list when it is a list of names (c209a37) Message-ID: <20150708083252.D37ED3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: wip/ast-prepare-annotations,wip/ast-prepare-annotations-final Link : http://git.haskell.org/haddock.git/commitdiff/c209a37e001f5df4de584b7fa109abecf2d345d9 >--------------------------------------------------------------- commit c209a37e001f5df4de584b7fa109abecf2d345d9 Author: Alan Zimmerman Date: Sat Nov 8 19:08:22 2014 +0200 Only print as a list when it is a list of names >--------------------------------------------------------------- c209a37e001f5df4de584b7fa109abecf2d345d9 src/Haddock/Backends/LaTeX.hs | 4 +++- src/Haddock/Backends/Xhtml/Decl.hs | 20 ++++++++++++++++---- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/Haddock/Backends/LaTeX.hs b/src/Haddock/Backends/LaTeX.hs index 458e484..b0bb3da 100644 --- a/src/Haddock/Backends/LaTeX.hs +++ b/src/Haddock/Backends/LaTeX.hs @@ -671,7 +671,9 @@ ppSideBySideConstr subdocs unicode leader (L _ con) = header_ = ppConstrHdr forall tyVars context occ = map (nameOccName . getName . unLoc) $ con_name con - ppOcc = cat (punctuate comma (map ppBinder occ)) + ppOcc = case occ of + [one] -> ppBinder one + _ -> cat (punctuate comma (map ppBinder occ)) ltvs = con_qvars con tyVars = tyvarNames (con_qvars con) context = unLoc (con_cxt con) diff --git a/src/Haddock/Backends/Xhtml/Decl.hs b/src/Haddock/Backends/Xhtml/Decl.hs index 92f2052..9189846 100644 --- a/src/Haddock/Backends/Xhtml/Decl.hs +++ b/src/Haddock/Backends/Xhtml/Decl.hs @@ -634,8 +634,14 @@ ppShortConstrParts summary dataInst con unicode qual = case con_res con of header_ = ppConstrHdr forall_ tyVars context occ = map (nameOccName . getName . unLoc) $ con_name con - ppOcc = hsep (punctuate comma (map (ppBinder summary) occ)) - ppOccInfix = hsep (punctuate comma (map (ppBinderInfix summary) occ)) + + ppOcc = case occ of + [one] -> ppBinder summary one + _ -> hsep (punctuate comma (map (ppBinder summary) occ)) + + ppOccInfix = case occ of + [one] -> ppBinderInfix summary one + _ -> hsep (punctuate comma (map (ppBinderInfix summary) occ)) ltvs = con_qvars con tyVars = tyvarNames ltvs @@ -701,8 +707,14 @@ ppSideBySideConstr subdocs fixities unicode qual (L _ con) = (decl, mbDoc, field fixity = ppFixities fixities qual header_ = ppConstrHdr forall_ tyVars context unicode qual occ = map (nameOccName . getName . unLoc) $ con_name con - ppOcc = hsep (punctuate comma (map (ppBinder False) occ)) - ppOccInfix = hsep (punctuate comma (map (ppBinderInfix False) occ)) + + ppOcc = case occ of + [one] -> ppBinder False one + _ -> hsep (punctuate comma (map (ppBinder False) occ)) + + ppOccInfix = case occ of + [one] -> ppBinderInfix False one + _ -> hsep (punctuate comma (map (ppBinderInfix False) occ)) ltvs = con_qvars con tyVars = tyvarNames (con_qvars con) From git at git.haskell.org Wed Jul 8 08:32:54 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:32:54 +0000 (UTC) Subject: [commit: haddock] wip/ast-prepare-annotations-final: Change con_name to con_names in ConDecl (6b8c221) Message-ID: <20150708083254.E50A63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/ast-prepare-annotations-final Link : http://git.haskell.org/haddock.git/commitdiff/6b8c22136348d642ec7eee055672cda41e715208 >--------------------------------------------------------------- commit 6b8c22136348d642ec7eee055672cda41e715208 Author: Alan Zimmerman Date: Tue Nov 11 14:22:59 2014 +0200 Change con_name to con_names in ConDecl >--------------------------------------------------------------- 6b8c22136348d642ec7eee055672cda41e715208 src/Haddock/Backends/Hoogle.hs | 6 +++--- src/Haddock/Backends/LaTeX.hs | 5 +++-- src/Haddock/Backends/Xhtml/Decl.hs | 10 ++++++---- src/Haddock/GhcUtils.hs | 5 +++-- src/Haddock/Interface/Create.hs | 2 +- src/Haddock/Interface/Rename.hs | 9 +++++---- src/Haddock/Utils.hs | 2 +- 7 files changed, 22 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 6b8c22136348d642ec7eee055672cda41e715208 From git at git.haskell.org Wed Jul 8 08:32:56 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:32:56 +0000 (UTC) Subject: [commit: haddock] wip/ast-prepare-annotations-final: FixitySig has multiple names (d86af79) Message-ID: <20150708083256.F1FA73A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/ast-prepare-annotations-final Link : http://git.haskell.org/haddock.git/commitdiff/d86af79f2c314193a89fc40c7204d9b4198ce738 >--------------------------------------------------------------- commit d86af79f2c314193a89fc40c7204d9b4198ce738 Author: Alan Zimmerman Date: Wed Nov 12 18:22:10 2014 +0200 FixitySig has multiple names >--------------------------------------------------------------- d86af79f2c314193a89fc40c7204d9b4198ce738 src/Haddock/GhcUtils.hs | 25 ++++++++++++++----------- src/Haddock/Interface/Create.hs | 3 ++- src/Haddock/Interface/Rename.hs | 6 +++--- 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/src/Haddock/GhcUtils.hs b/src/Haddock/GhcUtils.hs index a81fc42..ef20d02 100644 --- a/src/Haddock/GhcUtils.hs +++ b/src/Haddock/GhcUtils.hs @@ -97,11 +97,14 @@ filterLSigNames :: (name -> Bool) -> LSig name -> Maybe (LSig name) filterLSigNames p (L loc sig) = L loc <$> (filterSigNames p sig) filterSigNames :: (name -> Bool) -> Sig name -> Maybe (Sig name) -filterSigNames p orig@(SpecSig n _ _) = ifTrueJust (p $ unLoc n) orig -filterSigNames p orig@(InlineSig n _) = ifTrueJust (p $ unLoc n) orig -filterSigNames p orig@(FixSig (FixitySig n _)) = ifTrueJust (p $ unLoc n) orig -filterSigNames _ orig@(MinimalSig _) = Just orig -filterSigNames p (TypeSig ns ty) = +filterSigNames p orig@(SpecSig n _ _) = ifTrueJust (p $ unLoc n) orig +filterSigNames p orig@(InlineSig n _) = ifTrueJust (p $ unLoc n) orig +filterSigNames p (FixSig (FixitySig ns ty)) = + case filter (p . unLoc) ns of + [] -> Nothing + filtered -> Just (FixSig (FixitySig filtered ty)) +filterSigNames _ orig@(MinimalSig _) = Just orig +filterSigNames p (TypeSig ns ty) = case filter (p . unLoc) ns of [] -> Nothing filtered -> Just (TypeSig filtered ty) @@ -115,12 +118,12 @@ sigName :: LSig name -> [name] sigName (L _ sig) = sigNameNoLoc sig sigNameNoLoc :: Sig name -> [name] -sigNameNoLoc (TypeSig ns _) = map unLoc ns -sigNameNoLoc (PatSynSig n _ _ _ _) = [unLoc n] -sigNameNoLoc (SpecSig n _ _) = [unLoc n] -sigNameNoLoc (InlineSig n _) = [unLoc n] -sigNameNoLoc (FixSig (FixitySig n _)) = [unLoc n] -sigNameNoLoc _ = [] +sigNameNoLoc (TypeSig ns _) = map unLoc ns +sigNameNoLoc (PatSynSig n _ _ _ _) = [unLoc n] +sigNameNoLoc (SpecSig n _ _) = [unLoc n] +sigNameNoLoc (InlineSig n _) = [unLoc n] +sigNameNoLoc (FixSig (FixitySig ns _)) = map unLoc ns +sigNameNoLoc _ = [] isTyClD :: HsDecl a -> Bool diff --git a/src/Haddock/Interface/Create.hs b/src/Haddock/Interface/Create.hs index 1e2ab40..6fa95de 100644 --- a/src/Haddock/Interface/Create.hs +++ b/src/Haddock/Interface/Create.hs @@ -374,7 +374,8 @@ topDecls = filterClasses . filterDecls . collectDocs . sortByLoc . ungroup -- | Extract a map of fixity declarations only mkFixMap :: HsGroup Name -> FixMap mkFixMap group_ = M.fromList [ (n,f) - | L _ (FixitySig (L _ n) f) <- hs_fixds group_ ] + | L _ (FixitySig ns f) <- hs_fixds group_, + L _ n <- ns ] -- | Take all declarations except pragmas, infix decls, rules from an 'HsGroup'. diff --git a/src/Haddock/Interface/Rename.hs b/src/Haddock/Interface/Rename.hs index e3932d4..7c870d9 100644 --- a/src/Haddock/Interface/Rename.hs +++ b/src/Haddock/Interface/Rename.hs @@ -416,9 +416,9 @@ renameSig sig = case sig of lreq' <- renameLContext lreq lprov' <- renameLContext lprov return $ PatSynSig lname' args' ltype' lreq' lprov' - FixSig (FixitySig lname fixity) -> do - lname' <- renameL lname - return $ FixSig (FixitySig lname' fixity) + FixSig (FixitySig lnames fixity) -> do + lnames' <- mapM renameL lnames + return $ FixSig (FixitySig lnames' fixity) MinimalSig s -> MinimalSig <$> traverse renameL s -- we have filtered out all other kinds of signatures in Interface.Create _ -> error "expected TypeSig" From git at git.haskell.org Wed Jul 8 08:32:59 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:32:59 +0000 (UTC) Subject: [commit: haddock] wip/ast-prepare-annotations-final2: Apply changes to match AST (dd68ece) Message-ID: <20150708083259.0FED63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/ast-prepare-annotations-final2 Link : http://git.haskell.org/haddock.git/commitdiff/dd68ece83fdf04b0466ebf93dab0bcf534224d81 >--------------------------------------------------------------- commit dd68ece83fdf04b0466ebf93dab0bcf534224d81 Author: Alan Zimmerman Date: Wed Nov 12 23:54:49 2014 +0200 Apply changes to match AST >--------------------------------------------------------------- dd68ece83fdf04b0466ebf93dab0bcf534224d81 src/Haddock/Backends/Hoogle.hs | 10 ++++---- src/Haddock/Backends/LaTeX.hs | 18 ++++++++------ src/Haddock/Backends/Xhtml/Decl.hs | 50 ++++++++++++++++++++++++++------------ src/Haddock/Convert.hs | 4 +-- src/Haddock/GhcUtils.hs | 33 +++++++++++++------------ src/Haddock/Interface/Create.hs | 27 ++++++++++---------- src/Haddock/Interface/Rename.hs | 21 +++++++++------- src/Haddock/Utils.hs | 7 +++--- 8 files changed, 99 insertions(+), 71 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 dd68ece83fdf04b0466ebf93dab0bcf534224d81 From git at git.haskell.org Wed Jul 8 08:33:01 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:33:01 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, wip/10268, wip/10313, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/ast-prepare-annotations-final3, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/orf-reboot, wip/pattern-synonyms, wip/trac-9744: Make compatible with `deepseq-1.4.0.0` (9cdf19b) Message-ID: <20150708083301.1CFAB3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,wip/10268,wip/10313,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/ast-prepare-annotations-final3,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/orf-reboot,wip/pattern-synonyms,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/9cdf19bad54a6cc4b322396fdd06f4c1ee045b22 >--------------------------------------------------------------- commit 9cdf19bad54a6cc4b322396fdd06f4c1ee045b22 Author: Herbert Valerio Riedel Date: Sat Nov 15 11:55:43 2014 +0100 Make compatible with `deepseq-1.4.0.0` ...by not relying on the default method implementation of `rnf` >--------------------------------------------------------------- 9cdf19bad54a6cc4b322396fdd06f4c1ee045b22 src/Haddock/Types.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Haddock/Types.hs b/src/Haddock/Types.hs index 1f44fde..7a66e16 100644 --- a/src/Haddock/Types.hs +++ b/src/Haddock/Types.hs @@ -342,9 +342,9 @@ instance (NFData a, NFData mod) DocHeader a -> a `deepseq` () -instance NFData Name -instance NFData OccName -instance NFData ModuleName +instance NFData Name where rnf x = seq x () +instance NFData OccName where rnf x = seq x () +instance NFData ModuleName where rnf x = seq x () instance NFData id => NFData (Header id) where rnf (Header a b) = a `deepseq` b `deepseq` () From git at git.haskell.org Wed Jul 8 08:33:03 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:33:03 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, metainfo, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: State intention rather than implementation details in Haddock comment (c2b84c0) Message-ID: <20150708083303.273E73A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,metainfo,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/c2b84c0c55bce1120db9826391de0466c33b3062 >--------------------------------------------------------------- commit c2b84c0c55bce1120db9826391de0466c33b3062 Author: Simon Hengel Date: Sun Nov 16 08:51:38 2014 +0800 State intention rather than implementation details in Haddock comment >--------------------------------------------------------------- c2b84c0c55bce1120db9826391de0466c33b3062 haddock-library/src/Documentation/Haddock/Parser.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haddock-library/src/Documentation/Haddock/Parser.hs b/haddock-library/src/Documentation/Haddock/Parser.hs index 8b4ec78..c323ce0 100644 --- a/haddock-library/src/Documentation/Haddock/Parser.hs +++ b/haddock-library/src/Documentation/Haddock/Parser.hs @@ -331,7 +331,7 @@ moreContent :: Monoid a => Parser a -> Parser ([String], Either (DocH mod Identifier) a) moreContent item = first . (:) <$> nonEmptyLine <*> more item --- | Runs the 'parseParas' parser on an indented paragraph. +-- | Parses an indented paragraph. -- The indentation is 4 spaces. indentedParagraphs :: Parser (DocH mod Identifier) indentedParagraphs = parseParas . concat <$> dropFrontOfPara " " From git at git.haskell.org Wed Jul 8 08:33:05 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:33:05 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, metainfo, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: (wip) Add support for @since (closes #26) (06517a6) Message-ID: <20150708083305.36C6B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,metainfo,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/06517a6a4c5c6c7a89ea4ad57d85ffc458393a07 >--------------------------------------------------------------- commit 06517a6a4c5c6c7a89ea4ad57d85ffc458393a07 Author: Simon Hengel Date: Sun Nov 16 08:58:40 2014 +0800 (wip) Add support for @since (closes #26) >--------------------------------------------------------------- 06517a6a4c5c6c7a89ea4ad57d85ffc458393a07 haddock-library/haddock-library.cabal | 13 +++++---- .../src/Documentation/Haddock/Parser.hs | 26 +++++++++++++---- .../src/Documentation/Haddock/Parser/Monad.hs | 33 ++++++++++++++++++---- haddock-library/src/Documentation/Haddock/Types.hs | 2 ++ .../test/Documentation/Haddock/Parser/UtilSpec.hs | 7 +++-- .../test/Documentation/Haddock/ParserSpec.hs | 24 ++++++++++++++-- 6 files changed, 82 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 06517a6a4c5c6c7a89ea4ad57d85ffc458393a07 From git at git.haskell.org Wed Jul 8 08:33:07 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:33:07 +0000 (UTC) Subject: [commit: haddock] wip/ast-prepare-annotations-final3: Apply changes to match AST (966fc04) Message-ID: <20150708083307.4C81C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/ast-prepare-annotations-final3 Link : http://git.haskell.org/haddock.git/commitdiff/966fc049aaf1eae44f9b6883c0ce22b9313015bb >--------------------------------------------------------------- commit 966fc049aaf1eae44f9b6883c0ce22b9313015bb Author: Alan Zimmerman Date: Wed Nov 12 23:54:49 2014 +0200 Apply changes to match AST >--------------------------------------------------------------- 966fc049aaf1eae44f9b6883c0ce22b9313015bb src/Haddock/Backends/Hoogle.hs | 10 ++++---- src/Haddock/Backends/LaTeX.hs | 18 ++++++++------ src/Haddock/Backends/Xhtml/Decl.hs | 50 ++++++++++++++++++++++++++------------ src/Haddock/Convert.hs | 4 +-- src/Haddock/GhcUtils.hs | 33 +++++++++++++------------ src/Haddock/Interface/Create.hs | 27 ++++++++++---------- src/Haddock/Interface/Rename.hs | 21 +++++++++------- src/Haddock/Utils.hs | 7 +++--- 8 files changed, 99 insertions(+), 71 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 966fc049aaf1eae44f9b6883c0ce22b9313015bb From git at git.haskell.org Wed Jul 8 08:33:09 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:33:09 +0000 (UTC) Subject: [commit: haddock] wip/ast-prepare-annotations-final3: CondeclField now has multiple cd_fld_names (e3f9cf9) Message-ID: <20150708083309.5C05E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/ast-prepare-annotations-final3 Link : http://git.haskell.org/haddock.git/commitdiff/e3f9cf910dbeb489aa06a148c6027ee3666bbb66 >--------------------------------------------------------------- commit e3f9cf910dbeb489aa06a148c6027ee3666bbb66 Author: Alan Zimmerman Date: Sun Nov 16 23:44:37 2014 +0200 CondeclField now has multiple cd_fld_names >--------------------------------------------------------------- e3f9cf910dbeb489aa06a148c6027ee3666bbb66 src/Haddock/Backends/Hoogle.hs | 8 ++++---- src/Haddock/Backends/LaTeX.hs | 9 +++++---- src/Haddock/Backends/Xhtml/Decl.hs | 15 ++++++++------- src/Haddock/Convert.hs | 6 +++--- src/Haddock/GhcUtils.hs | 2 +- src/Haddock/Interface/Create.hs | 10 ++++++---- src/Haddock/Interface/Rename.hs | 15 +++++++-------- src/Haddock/Utils.hs | 6 +++--- 8 files changed, 37 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 e3f9cf910dbeb489aa06a148c6027ee3666bbb66 From git at git.haskell.org Wed Jul 8 08:33:11 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:33:11 +0000 (UTC) Subject: [commit: haddock] wip/ast-prepare-annotations-final3: Apply changes to match AST (f4964b0) Message-ID: <20150708083311.714DA3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/ast-prepare-annotations-final3 Link : http://git.haskell.org/haddock.git/commitdiff/f4964b0212d9a4dcfd40d412655a0e4c29d9cbbd >--------------------------------------------------------------- commit f4964b0212d9a4dcfd40d412655a0e4c29d9cbbd Author: Alan Zimmerman Date: Sun Nov 16 23:44:37 2014 +0200 Apply changes to match AST Summary: Match the changes to the AST made in D426 Test Plan: built with GHC Differential Revision: https://phabricator.haskell.org/D494 GHC Trac Issues: #9628 >--------------------------------------------------------------- f4964b0212d9a4dcfd40d412655a0e4c29d9cbbd src/Haddock/Backends/Hoogle.hs | 8 ++++---- src/Haddock/Backends/LaTeX.hs | 9 +++++---- src/Haddock/Backends/Xhtml/Decl.hs | 15 ++++++++------- src/Haddock/Convert.hs | 6 +++--- src/Haddock/GhcUtils.hs | 2 +- src/Haddock/Interface/Create.hs | 10 ++++++---- src/Haddock/Interface/Rename.hs | 15 +++++++-------- src/Haddock/Utils.hs | 6 +++--- 8 files changed, 37 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 f4964b0212d9a4dcfd40d412655a0e4c29d9cbbd From git at git.haskell.org Wed Jul 8 08:33:13 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:33:13 +0000 (UTC) Subject: [commit: haddock] wip/ast-prepare-annotations-final3: Replace head with case/panic (044ac2a) Message-ID: <20150708083313.7DA3A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/ast-prepare-annotations-final3 Link : http://git.haskell.org/haddock.git/commitdiff/044ac2a9f2b93069f9031c2912269b30350010a9 >--------------------------------------------------------------- commit 044ac2a9f2b93069f9031c2912269b30350010a9 Author: Alan Zimmerman Date: Tue Nov 18 21:49:28 2014 +0200 Replace head with case/panic >--------------------------------------------------------------- 044ac2a9f2b93069f9031c2912269b30350010a9 src/Haddock/Backends/LaTeX.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Haddock/Backends/LaTeX.hs b/src/Haddock/Backends/LaTeX.hs index 09e99d4..ac9f3ac 100644 --- a/src/Haddock/Backends/LaTeX.hs +++ b/src/Haddock/Backends/LaTeX.hs @@ -26,6 +26,7 @@ import OccName import Name ( nameOccName ) import RdrName ( rdrNameOcc ) import FastString ( unpackFS, unpackLitString, zString ) +import Outputable ( panic) import qualified Data.Map as Map import System.Directory @@ -680,8 +681,10 @@ ppSideBySideConstr subdocs unicode leader (L _ con) = forall = con_explicit con -- don't use "con_doc con", in case it's reconstructed from a .hi file, -- or also because we want Haddock to do the doc-parsing, not GHC. - mbDoc = lookup (unLoc $ head $ con_names con) subdocs >>= - combineDocumentation . fst + mbDoc = case con_names con of + [] -> panic "empty con_names" + (cn:_) -> lookup (unLoc cn) subdocs >>= + combineDocumentation . fst mkFunTy a b = noLoc (HsFunTy a b) From git at git.haskell.org Wed Jul 8 08:33:15 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:33:15 +0000 (UTC) Subject: [commit: haddock] wip/ast-prepare-annotations-final3: Merge remote-tracking branch 'haskell/wip/ast-prepare-annotations-final3' into wip/ast-prepare-annotations-final3 (fa621a6) Message-ID: <20150708083315.8D7AA3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/ast-prepare-annotations-final3 Link : http://git.haskell.org/haddock.git/commitdiff/fa621a64af55724e7ec6b044e786b8dd497a2a2a >--------------------------------------------------------------- commit fa621a64af55724e7ec6b044e786b8dd497a2a2a Merge: 044ac2a e3f9cf9 Author: Alan Zimmerman Date: Tue Nov 18 21:52:17 2014 +0200 Merge remote-tracking branch 'haskell/wip/ast-prepare-annotations-final3' into wip/ast-prepare-annotations-final3 >--------------------------------------------------------------- fa621a64af55724e7ec6b044e786b8dd497a2a2a From git at git.haskell.org Wed Jul 8 08:33:17 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:33:17 +0000 (UTC) Subject: [commit: haddock] wip/rae: Changes to reflect refactoring in GHC as part of #7484 (73b03f8) Message-ID: <20150708083317.988E03A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/rae Link : http://git.haskell.org/haddock.git/commitdiff/73b03f8c88720a7288bd4ca439a8bfa5adb350a0 >--------------------------------------------------------------- commit 73b03f8c88720a7288bd4ca439a8bfa5adb350a0 Author: Richard Eisenberg Date: Tue Nov 18 21:49:31 2014 -0500 Changes to reflect refactoring in GHC as part of #7484 >--------------------------------------------------------------- 73b03f8c88720a7288bd4ca439a8bfa5adb350a0 src/Haddock/GhcUtils.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Haddock/GhcUtils.hs b/src/Haddock/GhcUtils.hs index 2c7b79a..43112ff 100644 --- a/src/Haddock/GhcUtils.hs +++ b/src/Haddock/GhcUtils.hs @@ -26,6 +26,7 @@ import Data.Traversable import Exception import Outputable import Name +import Lexeme import Packages import Module import RdrName (GlobalRdrEnv) From git at git.haskell.org Wed Jul 8 08:33:19 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:33:19 +0000 (UTC) Subject: [commit: haddock] wip/pattern-synonyms: Update Haddock to new pattern synonym type signature syntax (edd2a3b) Message-ID: <20150708083319.A8CBA3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/pattern-synonyms Link : http://git.haskell.org/haddock.git/commitdiff/edd2a3be44656e763419679bb426a384d9e1a74d >--------------------------------------------------------------- commit edd2a3be44656e763419679bb426a384d9e1a74d Author: Dr. ERDI Gergo Date: Wed Nov 19 18:57:18 2014 +0800 Update Haddock to new pattern synonym type signature syntax >--------------------------------------------------------------- edd2a3be44656e763419679bb426a384d9e1a74d src/Haddock/Backends/LaTeX.hs | 70 +++++++++++++++++------------------ src/Haddock/Backends/Xhtml/Decl.hs | 75 ++++++++++++++++++++------------------ src/Haddock/Convert.hs | 10 +++-- src/Haddock/Interface/Create.hs | 4 +- src/Haddock/Interface/Rename.hs | 10 ++--- 5 files changed, 85 insertions(+), 84 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 edd2a3be44656e763419679bb426a384d9e1a74d From git at git.haskell.org Wed Jul 8 08:33:21 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:33:21 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, wip/10268, wip/10313, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T8584, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/ast-prepare-annotations-final4, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/orf-reboot, wip/trac-9744: Update Haddock to new pattern synonym type signature syntax (bf80e2f) Message-ID: <20150708083321.B8FB33A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,wip/10268,wip/10313,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T8584,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/ast-prepare-annotations-final4,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/orf-reboot,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/bf80e2f594777c0c32fae092454bff0c13ae6181 >--------------------------------------------------------------- commit bf80e2f594777c0c32fae092454bff0c13ae6181 Author: Dr. ERDI Gergo Date: Thu Nov 20 22:35:38 2014 +0800 Update Haddock to new pattern synonym type signature syntax >--------------------------------------------------------------- bf80e2f594777c0c32fae092454bff0c13ae6181 html-test/ref/Operators.html | 4 +- html-test/ref/PatternSyns.html | 36 +++++++++--------- src/Haddock/Backends/LaTeX.hs | 70 +++++++++++++++++------------------ src/Haddock/Backends/Xhtml/Decl.hs | 75 ++++++++++++++++++++------------------ src/Haddock/Convert.hs | 10 +++-- src/Haddock/Interface/Create.hs | 4 +- src/Haddock/Interface/Rename.hs | 10 ++--- 7 files changed, 105 insertions(+), 104 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 bf80e2f594777c0c32fae092454bff0c13ae6181 From git at git.haskell.org Wed Jul 8 08:33:23 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:33:23 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, wip/10268, wip/10313, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/ast-prepare-annotations-final5, wip/ast-prepare-annotations-final6, wip/orf-reboot, wip/trac-9744: Follow changes from #9812 (1940912) Message-ID: <20150708083323.C57C33A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,wip/10268,wip/10313,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/ast-prepare-annotations-final5,wip/ast-prepare-annotations-final6,wip/orf-reboot,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/19409126be62383bc64d79698b265ffaf96269a5 >--------------------------------------------------------------- commit 19409126be62383bc64d79698b265ffaf96269a5 Author: Jan Stolarek Date: Wed Nov 19 23:00:19 2014 +0100 Follow changes from #9812 >--------------------------------------------------------------- 19409126be62383bc64d79698b265ffaf96269a5 src/Haddock/Convert.hs | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/Haddock/Convert.hs b/src/Haddock/Convert.hs index 08892cd..9efa8ad 100644 --- a/src/Haddock/Convert.hs +++ b/src/Haddock/Convert.hs @@ -117,7 +117,7 @@ synifyAxBranch tc (CoAxBranch { cab_tvs = tkvs, cab_lhs = args, cab_rhs = rhs }) synifyAxiom :: CoAxiom br -> HsDecl Name synifyAxiom ax@(CoAxiom { co_ax_tc = tc }) - | isOpenSynFamilyTyCon tc + | isOpenTypeFamilyTyCon tc , Just branch <- coAxiomSingleBranch_maybe ax = InstD (TyFamInstD (TyFamInstDecl { tfid_eqn = noLoc $ synifyAxBranch tc branch , tfid_fvs = placeHolderNamesTc })) @@ -152,8 +152,8 @@ synifyTyCon coax tc , dd_derivs = Nothing } , tcdFVs = placeHolderNamesTc } - | isSynFamilyTyCon tc - = case synTyConRhs_maybe tc of + | isTypeFamilyTyCon tc + = case famTyConFlav_maybe tc of Just rhs -> let info = case rhs of OpenSynFamilyTyCon -> OpenTypeFamily @@ -173,14 +173,11 @@ synifyTyCon coax tc FamDecl (FamilyDecl DataFamily (synifyName tc) (synifyTyVars (tyConTyVars tc)) Nothing) --always kind '*' _ -> error "synifyTyCon: impossible open data type?" - | isSynTyCon tc - = case synTyConRhs_maybe tc of - Just (SynonymTyCon ty) -> - SynDecl { tcdLName = synifyName tc - , tcdTyVars = synifyTyVars (tyConTyVars tc) - , tcdRhs = synifyType WithinType ty - , tcdFVs = placeHolderNamesTc } - _ -> error "synifyTyCon: impossible synTyCon" + | Just ty <- synTyConRhs_maybe tc + = SynDecl { tcdLName = synifyName tc + , tcdTyVars = synifyTyVars (tyConTyVars tc) + , tcdRhs = synifyType WithinType ty + , tcdFVs = placeHolderNamesTc } | otherwise = -- (closed) newtype and data let From git at git.haskell.org Wed Jul 8 08:33:25 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:33:25 +0000 (UTC) Subject: [commit: haddock] wip/ast-prepare-annotations-final4: Apply changes to match AST (73604b1) Message-ID: <20150708083325.D9CEA3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/ast-prepare-annotations-final4 Link : http://git.haskell.org/haddock.git/commitdiff/73604b1e153c8116b08a725fc611fcc496f0abab >--------------------------------------------------------------- commit 73604b1e153c8116b08a725fc611fcc496f0abab Author: Alan Zimmerman Date: Wed Nov 12 23:54:49 2014 +0200 Apply changes to match AST >--------------------------------------------------------------- 73604b1e153c8116b08a725fc611fcc496f0abab src/Haddock/Backends/Hoogle.hs | 10 ++++---- src/Haddock/Backends/LaTeX.hs | 18 ++++++++------ src/Haddock/Backends/Xhtml/Decl.hs | 50 ++++++++++++++++++++++++++------------ src/Haddock/Convert.hs | 4 +-- src/Haddock/GhcUtils.hs | 33 +++++++++++++------------ src/Haddock/Interface/Create.hs | 27 ++++++++++---------- src/Haddock/Interface/Rename.hs | 21 +++++++++------- src/Haddock/Utils.hs | 7 +++--- 8 files changed, 99 insertions(+), 71 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 73604b1e153c8116b08a725fc611fcc496f0abab From git at git.haskell.org Wed Jul 8 08:33:27 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:33:27 +0000 (UTC) Subject: [commit: haddock] wip/ast-prepare-annotations-final4: Replace head with case/panic (ef4f3bf) Message-ID: <20150708083327.E768B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/ast-prepare-annotations-final4 Link : http://git.haskell.org/haddock.git/commitdiff/ef4f3bfcfe1241f9e4518e85d81fa9ebfe2fd139 >--------------------------------------------------------------- commit ef4f3bfcfe1241f9e4518e85d81fa9ebfe2fd139 Author: Alan Zimmerman Date: Tue Nov 18 21:49:28 2014 +0200 Replace head with case/panic >--------------------------------------------------------------- ef4f3bfcfe1241f9e4518e85d81fa9ebfe2fd139 src/Haddock/Backends/LaTeX.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Haddock/Backends/LaTeX.hs b/src/Haddock/Backends/LaTeX.hs index d7469c9..ec3ea8d 100644 --- a/src/Haddock/Backends/LaTeX.hs +++ b/src/Haddock/Backends/LaTeX.hs @@ -26,6 +26,7 @@ import OccName import Name ( nameOccName ) import RdrName ( rdrNameOcc ) import FastString ( unpackFS, unpackLitString, zString ) +import Outputable ( panic) import qualified Data.Map as Map import System.Directory @@ -676,8 +677,10 @@ ppSideBySideConstr subdocs unicode leader (L _ con) = forall = con_explicit con -- don't use "con_doc con", in case it's reconstructed from a .hi file, -- or also because we want Haddock to do the doc-parsing, not GHC. - mbDoc = lookup (unLoc $ head $ con_names con) subdocs >>= - combineDocumentation . fst + mbDoc = case con_names con of + [] -> panic "empty con_names" + (cn:_) -> lookup (unLoc cn) subdocs >>= + combineDocumentation . fst mkFunTy a b = noLoc (HsFunTy a b) From git at git.haskell.org Wed Jul 8 08:33:30 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:33:30 +0000 (UTC) Subject: [commit: haddock] wip/ast-prepare-annotations-final4: CondeclField now has multiple cd_fld_names (c29ea43) Message-ID: <20150708083330.0437D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/ast-prepare-annotations-final4 Link : http://git.haskell.org/haddock.git/commitdiff/c29ea436a0a6532c903d3ac6e46988c7db87dee5 >--------------------------------------------------------------- commit c29ea436a0a6532c903d3ac6e46988c7db87dee5 Author: Alan Zimmerman Date: Sun Nov 16 23:44:37 2014 +0200 CondeclField now has multiple cd_fld_names >--------------------------------------------------------------- c29ea436a0a6532c903d3ac6e46988c7db87dee5 src/Haddock/Backends/Hoogle.hs | 8 ++++---- src/Haddock/Backends/LaTeX.hs | 9 +++++---- src/Haddock/Backends/Xhtml/Decl.hs | 15 ++++++++------- src/Haddock/Convert.hs | 6 +++--- src/Haddock/GhcUtils.hs | 2 +- src/Haddock/Interface/Create.hs | 10 ++++++---- src/Haddock/Interface/Rename.hs | 15 +++++++-------- src/Haddock/Utils.hs | 6 +++--- 8 files changed, 37 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 c29ea436a0a6532c903d3ac6e46988c7db87dee5 From git at git.haskell.org Wed Jul 8 08:33:32 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:33:32 +0000 (UTC) Subject: [commit: haddock] wip/ast-prepare-annotations-final5: CondeclField now has multiple cd_fld_names (04a2c90) Message-ID: <20150708083332.168963A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/ast-prepare-annotations-final5 Link : http://git.haskell.org/haddock.git/commitdiff/04a2c903586e2ea5a827f275e509e8cad886c94f >--------------------------------------------------------------- commit 04a2c903586e2ea5a827f275e509e8cad886c94f Author: Alan Zimmerman Date: Sun Nov 16 23:44:37 2014 +0200 CondeclField now has multiple cd_fld_names >--------------------------------------------------------------- 04a2c903586e2ea5a827f275e509e8cad886c94f src/Haddock/Backends/Hoogle.hs | 8 ++++---- src/Haddock/Backends/LaTeX.hs | 9 +++++---- src/Haddock/Backends/Xhtml/Decl.hs | 15 ++++++++------- src/Haddock/Convert.hs | 6 +++--- src/Haddock/GhcUtils.hs | 2 +- src/Haddock/Interface/Create.hs | 10 ++++++---- src/Haddock/Interface/Rename.hs | 15 +++++++-------- src/Haddock/Utils.hs | 6 +++--- 8 files changed, 37 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 04a2c903586e2ea5a827f275e509e8cad886c94f From git at git.haskell.org Wed Jul 8 08:33:34 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:33:34 +0000 (UTC) Subject: [commit: haddock] wip/ast-prepare-annotations-final5: Replace head with case/panic (0d6891a) Message-ID: <20150708083334.213BF3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/ast-prepare-annotations-final5 Link : http://git.haskell.org/haddock.git/commitdiff/0d6891a57ba43faba3995bce6a1a0a02889a21ed >--------------------------------------------------------------- commit 0d6891a57ba43faba3995bce6a1a0a02889a21ed Author: Alan Zimmerman Date: Tue Nov 18 21:49:28 2014 +0200 Replace head with case/panic >--------------------------------------------------------------- 0d6891a57ba43faba3995bce6a1a0a02889a21ed src/Haddock/Backends/LaTeX.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Haddock/Backends/LaTeX.hs b/src/Haddock/Backends/LaTeX.hs index d7469c9..ec3ea8d 100644 --- a/src/Haddock/Backends/LaTeX.hs +++ b/src/Haddock/Backends/LaTeX.hs @@ -26,6 +26,7 @@ import OccName import Name ( nameOccName ) import RdrName ( rdrNameOcc ) import FastString ( unpackFS, unpackLitString, zString ) +import Outputable ( panic) import qualified Data.Map as Map import System.Directory @@ -676,8 +677,10 @@ ppSideBySideConstr subdocs unicode leader (L _ con) = forall = con_explicit con -- don't use "con_doc con", in case it's reconstructed from a .hi file, -- or also because we want Haddock to do the doc-parsing, not GHC. - mbDoc = lookup (unLoc $ head $ con_names con) subdocs >>= - combineDocumentation . fst + mbDoc = case con_names con of + [] -> panic "empty con_names" + (cn:_) -> lookup (unLoc cn) subdocs >>= + combineDocumentation . fst mkFunTy a b = noLoc (HsFunTy a b) From git at git.haskell.org Wed Jul 8 08:33:36 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:33:36 +0000 (UTC) Subject: [commit: haddock] wip/ast-prepare-annotations-final5: Apply changes to match AST (7b45279) Message-ID: <20150708083336.30C543A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/ast-prepare-annotations-final5 Link : http://git.haskell.org/haddock.git/commitdiff/7b4527987f6dcedb4e1943d179d7a16dc67cf43b >--------------------------------------------------------------- commit 7b4527987f6dcedb4e1943d179d7a16dc67cf43b Author: Alan Zimmerman Date: Wed Nov 12 23:54:49 2014 +0200 Apply changes to match AST >--------------------------------------------------------------- 7b4527987f6dcedb4e1943d179d7a16dc67cf43b src/Haddock/Backends/Hoogle.hs | 10 ++++---- src/Haddock/Backends/LaTeX.hs | 18 ++++++++------ src/Haddock/Backends/Xhtml/Decl.hs | 50 ++++++++++++++++++++++++++------------ src/Haddock/Convert.hs | 4 +-- src/Haddock/GhcUtils.hs | 33 +++++++++++++------------ src/Haddock/Interface/Create.hs | 27 ++++++++++---------- src/Haddock/Interface/Rename.hs | 21 +++++++++------- src/Haddock/Utils.hs | 7 +++--- 8 files changed, 99 insertions(+), 71 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 7b4527987f6dcedb4e1943d179d7a16dc67cf43b From git at git.haskell.org Wed Jul 8 08:33:38 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:33:38 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, wip/10268, wip/10313, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/ast-prepare-annotations-final6, wip/orf-reboot, wip/trac-9744: Changes to reflect refactoring in GHC as part of #7484 (2b3712d) Message-ID: <20150708083338.3C5D53A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,wip/10268,wip/10313,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/ast-prepare-annotations-final6,wip/orf-reboot,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/2b3712d701c1df626abbc60525c35e735272e45d >--------------------------------------------------------------- commit 2b3712d701c1df626abbc60525c35e735272e45d Author: Richard Eisenberg Date: Tue Nov 18 21:49:31 2014 -0500 Changes to reflect refactoring in GHC as part of #7484 >--------------------------------------------------------------- 2b3712d701c1df626abbc60525c35e735272e45d src/Haddock/GhcUtils.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Haddock/GhcUtils.hs b/src/Haddock/GhcUtils.hs index 2c7b79a..43112ff 100644 --- a/src/Haddock/GhcUtils.hs +++ b/src/Haddock/GhcUtils.hs @@ -26,6 +26,7 @@ import Data.Traversable import Exception import Outputable import Name +import Lexeme import Packages import Module import RdrName (GlobalRdrEnv) From git at git.haskell.org Wed Jul 8 08:33:40 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:33:40 +0000 (UTC) Subject: [commit: haddock] wip/ast-prepare-annotations-final6: CondeclField now has multiple cd_fld_names (8d26618) Message-ID: <20150708083340.4DD7D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/ast-prepare-annotations-final6 Link : http://git.haskell.org/haddock.git/commitdiff/8d266181514ff1375a73977f1b30a6c63119c2dc >--------------------------------------------------------------- commit 8d266181514ff1375a73977f1b30a6c63119c2dc Author: Alan Zimmerman Date: Sun Nov 16 23:44:37 2014 +0200 CondeclField now has multiple cd_fld_names >--------------------------------------------------------------- 8d266181514ff1375a73977f1b30a6c63119c2dc src/Haddock/Backends/Hoogle.hs | 8 ++++---- src/Haddock/Backends/LaTeX.hs | 9 +++++---- src/Haddock/Backends/Xhtml/Decl.hs | 15 ++++++++------- src/Haddock/Convert.hs | 6 +++--- src/Haddock/GhcUtils.hs | 2 +- src/Haddock/Interface/Create.hs | 10 ++++++---- src/Haddock/Interface/Rename.hs | 15 +++++++-------- src/Haddock/Utils.hs | 6 +++--- 8 files changed, 37 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 8d266181514ff1375a73977f1b30a6c63119c2dc From git at git.haskell.org Wed Jul 8 08:33:42 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:33:42 +0000 (UTC) Subject: [commit: haddock] wip/ast-prepare-annotations-final6: Apply changes to match AST (3361656) Message-ID: <20150708083342.5F2E13A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/ast-prepare-annotations-final6 Link : http://git.haskell.org/haddock.git/commitdiff/3361656c888b217e381f81d61884333375b7e9ea >--------------------------------------------------------------- commit 3361656c888b217e381f81d61884333375b7e9ea Author: Alan Zimmerman Date: Wed Nov 12 23:54:49 2014 +0200 Apply changes to match AST >--------------------------------------------------------------- 3361656c888b217e381f81d61884333375b7e9ea src/Haddock/Backends/Hoogle.hs | 10 ++++---- src/Haddock/Backends/LaTeX.hs | 18 ++++++++------ src/Haddock/Backends/Xhtml/Decl.hs | 50 ++++++++++++++++++++++++++------------ src/Haddock/Convert.hs | 4 +-- src/Haddock/GhcUtils.hs | 33 +++++++++++++------------ src/Haddock/Interface/Create.hs | 27 ++++++++++---------- src/Haddock/Interface/Rename.hs | 21 +++++++++------- src/Haddock/Utils.hs | 7 +++--- 8 files changed, 99 insertions(+), 71 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 3361656c888b217e381f81d61884333375b7e9ea From git at git.haskell.org Wed Jul 8 08:33:44 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:33:44 +0000 (UTC) Subject: [commit: haddock] wip/ast-prepare-annotations-final6: Replace head with case/panic (e5c8fda) Message-ID: <20150708083344.6B0A03A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/ast-prepare-annotations-final6 Link : http://git.haskell.org/haddock.git/commitdiff/e5c8fdab729c98527d132f4a68760430e1f59141 >--------------------------------------------------------------- commit e5c8fdab729c98527d132f4a68760430e1f59141 Author: Alan Zimmerman Date: Tue Nov 18 21:49:28 2014 +0200 Replace head with case/panic >--------------------------------------------------------------- e5c8fdab729c98527d132f4a68760430e1f59141 src/Haddock/Backends/LaTeX.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Haddock/Backends/LaTeX.hs b/src/Haddock/Backends/LaTeX.hs index d7469c9..ec3ea8d 100644 --- a/src/Haddock/Backends/LaTeX.hs +++ b/src/Haddock/Backends/LaTeX.hs @@ -26,6 +26,7 @@ import OccName import Name ( nameOccName ) import RdrName ( rdrNameOcc ) import FastString ( unpackFS, unpackLitString, zString ) +import Outputable ( panic) import qualified Data.Map as Map import System.Directory @@ -676,8 +677,10 @@ ppSideBySideConstr subdocs unicode leader (L _ con) = forall = con_explicit con -- don't use "con_doc con", in case it's reconstructed from a .hi file, -- or also because we want Haddock to do the doc-parsing, not GHC. - mbDoc = lookup (unLoc $ head $ con_names con) subdocs >>= - combineDocumentation . fst + mbDoc = case con_names con of + [] -> panic "empty con_names" + (cn:_) -> lookup (unLoc cn) subdocs >>= + combineDocumentation . fst mkFunTy a b = noLoc (HsFunTy a b) From git at git.haskell.org Wed Jul 8 08:33:46 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:33:46 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, wip/10268, wip/10313, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/orf-reboot, wip/trac-9744: Follow API changes in D426 (5d8117d) Message-ID: <20150708083346.7CDA63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,wip/10268,wip/10313,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/orf-reboot,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/5d8117d8f1f910c85d36865d646b65510b23583d >--------------------------------------------------------------- commit 5d8117d8f1f910c85d36865d646b65510b23583d Author: Alan Zimmerman Date: Fri Nov 21 11:23:09 2014 -0600 Follow API changes in D426 Signed-off-by: Austin Seipp >--------------------------------------------------------------- 5d8117d8f1f910c85d36865d646b65510b23583d src/Haddock/Backends/Hoogle.hs | 14 ++++----- src/Haddock/Backends/LaTeX.hs | 28 ++++++++++------- src/Haddock/Backends/Xhtml/Decl.hs | 61 +++++++++++++++++++++++++------------- src/Haddock/Convert.hs | 6 ++-- src/Haddock/GhcUtils.hs | 33 +++++++++++---------- src/Haddock/Interface/Create.hs | 31 ++++++++++--------- src/Haddock/Interface/Rename.hs | 26 ++++++++-------- src/Haddock/Utils.hs | 7 ++--- 8 files changed, 120 insertions(+), 86 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 5d8117d8f1f910c85d36865d646b65510b23583d From git at git.haskell.org Wed Jul 8 08:33:48 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:33:48 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, wip/10268, wip/10313, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/orf-reboot, wip/trac-9744: Support for PartialTypeSignatures (1a9dcfe) Message-ID: <20150708083348.8D18A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,wip/10268,wip/10313,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/orf-reboot,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/1a9dcfef033dd66514015d4a942ba67d21f95482 >--------------------------------------------------------------- commit 1a9dcfef033dd66514015d4a942ba67d21f95482 Author: Thomas Winant Date: Wed Aug 6 10:26:54 2014 +0200 Support for PartialTypeSignatures >--------------------------------------------------------------- 1a9dcfef033dd66514015d4a942ba67d21f95482 src/Haddock/Backends/Hoogle.hs | 20 ++++++++++---------- src/Haddock/Backends/LaTeX.hs | 27 +++++++++++++++++---------- src/Haddock/Backends/Xhtml.hs | 2 +- src/Haddock/Backends/Xhtml/Decl.hs | 33 ++++++++++++++++++++------------- src/Haddock/Convert.hs | 9 +++++---- src/Haddock/GhcUtils.hs | 8 ++++---- src/Haddock/Interface/Create.hs | 16 ++++++++-------- src/Haddock/Interface/Rename.hs | 14 ++++++++------ 8 files changed, 73 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 1a9dcfef033dd66514015d4a942ba67d21f95482 From git at git.haskell.org Wed Jul 8 08:33:50 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:33:50 +0000 (UTC) Subject: [commit: haddock] wip/pattern-synonym-sig-backport: Update Haddock's format for pattern synonyms to match upcoming GHC 7.10 syntax (327b3d0) Message-ID: <20150708083350.9AA873A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/pattern-synonym-sig-backport Link : http://git.haskell.org/haddock.git/commitdiff/327b3d07a2eb7e12ad151d11787e119905d9ff24 >--------------------------------------------------------------- commit 327b3d07a2eb7e12ad151d11787e119905d9ff24 Author: Dr. ERDI Gergo Date: Sat Nov 29 14:46:10 2014 +0800 Update Haddock's format for pattern synonyms to match upcoming GHC 7.10 syntax >--------------------------------------------------------------- 327b3d07a2eb7e12ad151d11787e119905d9ff24 html-test/ref/Operators.html | 12 ++++++---- html-test/ref/PatternSyns.html | 48 +++++++++++++++++++++++++------------- src/Haddock/Backends/LaTeX.hs | 36 ++++++++++++++-------------- src/Haddock/Backends/Xhtml/Decl.hs | 34 ++++++++++++++++----------- 4 files changed, 79 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 327b3d07a2eb7e12ad151d11787e119905d9ff24 From git at git.haskell.org Wed Jul 8 08:33:52 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:33:52 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, wip/10268, wip/10313, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-ann-hstylit, wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5, wip/orf-reboot, wip/trac-9744: For pattern synonyms, render "pattern" as a keyword (b94ab90) Message-ID: <20150708083352.A6E253A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,wip/10268,wip/10313,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-ann-hstylit,wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5,wip/orf-reboot,wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/b94ab9034367f51b978904d60f2604db10abbd9f >--------------------------------------------------------------- commit b94ab9034367f51b978904d60f2604db10abbd9f Author: Dr. ERDI Gergo Date: Sat Nov 29 15:39:09 2014 +0800 For pattern synonyms, render "pattern" as a keyword >--------------------------------------------------------------- b94ab9034367f51b978904d60f2604db10abbd9f html-test/ref/Operators.html | 8 ++++++-- html-test/ref/PatternSyns.html | 32 ++++++++++++++++++++++++-------- src/Haddock/Backends/Xhtml/Decl.hs | 2 +- 3 files changed, 31 insertions(+), 11 deletions(-) diff --git a/html-test/ref/Operators.html b/html-test/ref/Operators.html index dc06e3b..b076206 100644 --- a/html-test/ref/Operators.html +++ b/html-test/ref/Operators.html @@ -90,7 +90,9 @@ window.onload = function () {pageLoad();setSynopsis("mini_Operators.html");}; >
          • pattern pattern (:+) :: t -> t -> [t]

          pattern pattern (:+) :: t -> t -> [t] infixr 3FooCtor x

        1. pattern pattern Foo :: t -> FooType t
        2. pattern pattern Bar :: t -> FooTypeFooType t)
        3. pattern pattern (:<->) :: t -> t -> (FooTypeEmpty
        4. pattern pattern E :: (><)
        5. pattern pattern Foo :: t -> FooType

          pattern pattern Bar :: t -> FooType

          pattern pattern (:<->) :: t -> t -> (FooType

          pattern pattern E :: (><) ppFixities fixities qual) +++ docSection Nothing qual doc where - pref1 = hsep [ toHtml "pattern" + pref1 = hsep [ keyword "pattern" , ppBinder summary occname , dcolon unicode , ppLTyVarBndrs expl qtvs unicode qual From git at git.haskell.org Wed Jul 8 08:33:54 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:33:54 +0000 (UTC) Subject: [commit: haddock] wip/api-ann-hstylit: HsTyLit now has a SourceText field (7138dba) Message-ID: <20150708083354.B41073A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/api-ann-hstylit Link : http://git.haskell.org/haddock.git/commitdiff/7138dbaf893df33e3f80ac624c80ac8d310a6719 >--------------------------------------------------------------- commit 7138dbaf893df33e3f80ac624c80ac8d310a6719 Author: Alan Zimmerman Date: Sun Nov 30 22:15:32 2014 +0200 HsTyLit now has a SourceText field Summary: HsTyLit now has a SourceText field Depends on D538 Reviewers: austin, Fuuzetsu Differential Revision: https://phabricator.haskell.org/D539 >--------------------------------------------------------------- 7138dbaf893df33e3f80ac624c80ac8d310a6719 src/Haddock/Backends/LaTeX.hs | 4 ++-- src/Haddock/Backends/Xhtml/Decl.hs | 4 ++-- src/Haddock/Convert.hs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Haddock/Backends/LaTeX.hs b/src/Haddock/Backends/LaTeX.hs index 801f313..f9ac096 100644 --- a/src/Haddock/Backends/LaTeX.hs +++ b/src/Haddock/Backends/LaTeX.hs @@ -948,8 +948,8 @@ ppr_mono_ty _ (HsTyLit t) u = ppr_tylit t u ppr_tylit :: HsTyLit -> Bool -> LaTeX -ppr_tylit (HsNumTy n) _ = integer n -ppr_tylit (HsStrTy s) _ = text (show s) +ppr_tylit (HsNumTy _ n) _ = integer n +ppr_tylit (HsStrTy _ s) _ = text (show s) -- XXX: Ok in verbatim, but not otherwise -- XXX: Do something with Unicode parameter? diff --git a/src/Haddock/Backends/Xhtml/Decl.hs b/src/Haddock/Backends/Xhtml/Decl.hs index 85e00e9..3353afe 100644 --- a/src/Haddock/Backends/Xhtml/Decl.hs +++ b/src/Haddock/Backends/Xhtml/Decl.hs @@ -908,8 +908,8 @@ ppr_mono_ty _ (HsNamedWildcardTy name) _ q = ppDocName q Prefix True name ppr_mono_ty _ (HsTyLit n) _ _ = ppr_tylit n ppr_tylit :: HsTyLit -> Html -ppr_tylit (HsNumTy n) = toHtml (show n) -ppr_tylit (HsStrTy s) = toHtml (show s) +ppr_tylit (HsNumTy _ n) = toHtml (show n) +ppr_tylit (HsStrTy _ s) = toHtml (show s) ppr_fun_ty :: Int -> LHsType DocName -> LHsType DocName -> Unicode -> Qualification -> Html diff --git a/src/Haddock/Convert.hs b/src/Haddock/Convert.hs index dd769c2..92dfc07 100644 --- a/src/Haddock/Convert.hs +++ b/src/Haddock/Convert.hs @@ -365,8 +365,8 @@ synifyType s forallty@(ForAllTy _tv _ty) = synifyType _ (LitTy t) = noLoc $ HsTyLit $ synifyTyLit t synifyTyLit :: TyLit -> HsTyLit -synifyTyLit (NumTyLit n) = HsNumTy n -synifyTyLit (StrTyLit s) = HsStrTy s +synifyTyLit (NumTyLit n) = HsNumTy "" n +synifyTyLit (StrTyLit s) = HsStrTy "" s synifyKindSig :: Kind -> LHsKind Name synifyKindSig k = synifyType WithinType k From git at git.haskell.org Wed Jul 8 08:33:56 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:33:56 +0000 (UTC) Subject: [commit: haddock] wip/api-ann-hstylit-1, wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5: HsTyLit now has a SourceText field (5eef94b) Message-ID: <20150708083356.C1A773A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: wip/api-ann-hstylit-1,wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5 Link : http://git.haskell.org/haddock.git/commitdiff/5eef94be45732c802c0816e3103e12b9f9095e13 >--------------------------------------------------------------- commit 5eef94be45732c802c0816e3103e12b9f9095e13 Author: Alan Zimmerman Date: Sun Nov 30 22:15:32 2014 +0200 HsTyLit now has a SourceText field Summary: HsTyLit now has a SourceText field Depends on D538 Reviewers: austin, Fuuzetsu Differential Revision: https://phabricator.haskell.org/D539 >--------------------------------------------------------------- 5eef94be45732c802c0816e3103e12b9f9095e13 src/Haddock/Backends/LaTeX.hs | 4 ++-- src/Haddock/Backends/Xhtml/Decl.hs | 4 ++-- src/Haddock/Convert.hs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Haddock/Backends/LaTeX.hs b/src/Haddock/Backends/LaTeX.hs index 801f313..f9ac096 100644 --- a/src/Haddock/Backends/LaTeX.hs +++ b/src/Haddock/Backends/LaTeX.hs @@ -948,8 +948,8 @@ ppr_mono_ty _ (HsTyLit t) u = ppr_tylit t u ppr_tylit :: HsTyLit -> Bool -> LaTeX -ppr_tylit (HsNumTy n) _ = integer n -ppr_tylit (HsStrTy s) _ = text (show s) +ppr_tylit (HsNumTy _ n) _ = integer n +ppr_tylit (HsStrTy _ s) _ = text (show s) -- XXX: Ok in verbatim, but not otherwise -- XXX: Do something with Unicode parameter? diff --git a/src/Haddock/Backends/Xhtml/Decl.hs b/src/Haddock/Backends/Xhtml/Decl.hs index 85e00e9..3353afe 100644 --- a/src/Haddock/Backends/Xhtml/Decl.hs +++ b/src/Haddock/Backends/Xhtml/Decl.hs @@ -908,8 +908,8 @@ ppr_mono_ty _ (HsNamedWildcardTy name) _ q = ppDocName q Prefix True name ppr_mono_ty _ (HsTyLit n) _ _ = ppr_tylit n ppr_tylit :: HsTyLit -> Html -ppr_tylit (HsNumTy n) = toHtml (show n) -ppr_tylit (HsStrTy s) = toHtml (show s) +ppr_tylit (HsNumTy _ n) = toHtml (show n) +ppr_tylit (HsStrTy _ s) = toHtml (show s) ppr_fun_ty :: Int -> LHsType DocName -> LHsType DocName -> Unicode -> Qualification -> Html diff --git a/src/Haddock/Convert.hs b/src/Haddock/Convert.hs index dd769c2..e8f29d3 100644 --- a/src/Haddock/Convert.hs +++ b/src/Haddock/Convert.hs @@ -365,8 +365,8 @@ synifyType s forallty@(ForAllTy _tv _ty) = synifyType _ (LitTy t) = noLoc $ HsTyLit $ synifyTyLit t synifyTyLit :: TyLit -> HsTyLit -synifyTyLit (NumTyLit n) = HsNumTy n -synifyTyLit (StrTyLit s) = HsStrTy s +synifyTyLit (NumTyLit n) = HsNumTy mempty n +synifyTyLit (StrTyLit s) = HsStrTy mempty s synifyKindSig :: Kind -> LHsKind Name synifyKindSig k = synifyType WithinType k From git at git.haskell.org Wed Jul 8 08:33:58 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:33:58 +0000 (UTC) Subject: [commit: haddock] wip/api-ann-hstylit-2, wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5: Adding SourceText to pragma declarations (23a6b47) Message-ID: <20150708083358.CEBDB3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: wip/api-ann-hstylit-2,wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5 Link : http://git.haskell.org/haddock.git/commitdiff/23a6b47ebf1d08b9683b32ef0fe00f1e95911105 >--------------------------------------------------------------- commit 23a6b47ebf1d08b9683b32ef0fe00f1e95911105 Author: Alan Zimmerman Date: Sun Dec 7 10:42:56 2014 +0200 Adding SourceText to pragma declarations >--------------------------------------------------------------- 23a6b47ebf1d08b9683b32ef0fe00f1e95911105 src/Haddock/Backends/Hoogle.hs | 2 +- src/Haddock/Backends/Xhtml/Decl.hs | 2 +- src/Haddock/Convert.hs | 6 +++--- src/Haddock/GhcUtils.hs | 4 ++-- src/Haddock/Interface/Create.hs | 8 ++++---- src/Haddock/Interface/Rename.hs | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Haddock/Backends/Hoogle.hs b/src/Haddock/Backends/Hoogle.hs index 1df6d9b..a0f3036 100644 --- a/src/Haddock/Backends/Hoogle.hs +++ b/src/Haddock/Backends/Hoogle.hs @@ -145,7 +145,7 @@ ppClass dflags x = out dflags x{tcdSigs=[]} : concatMap (ppSig dflags . addContext . unL) (tcdSigs x) where addContext (TypeSig name (L l sig) nwcs) = TypeSig name (L l $ f sig) nwcs - addContext (MinimalSig sig) = MinimalSig sig + addContext (MinimalSig src sig) = MinimalSig src sig addContext _ = error "expected TypeSig" f (HsForAllTy a b c con d) = HsForAllTy a b c (reL (context : unLoc con)) d diff --git a/src/Haddock/Backends/Xhtml/Decl.hs b/src/Haddock/Backends/Xhtml/Decl.hs index 3353afe..30912eb 100644 --- a/src/Haddock/Backends/Xhtml/Decl.hs +++ b/src/Haddock/Backends/Xhtml/Decl.hs @@ -471,7 +471,7 @@ ppClassDecl summary links instances fixities loc d subdocs -- there are different subdocs for different names in a single -- type signature? - minimalBit = case [ s | L _ (MinimalSig s) <- lsigs ] of + minimalBit = case [ s | L _ (MinimalSig _ s) <- lsigs ] of -- Miminal complete definition = every shown method And xs : _ | sort [getName n | Var (L _ n) <- xs] == sort [getName n | L _ (TypeSig ns _ _) <- lsigs, L _ n <- ns] diff --git a/src/Haddock/Convert.hs b/src/Haddock/Convert.hs index e8f29d3..bfc42bc 100644 --- a/src/Haddock/Convert.hs +++ b/src/Haddock/Convert.hs @@ -73,7 +73,7 @@ tyThingToLHsDecl t = noLoc $ case t of , tcdFDs = map (\ (l,r) -> noLoc (map getName l, map getName r) ) $ snd $ classTvsFds cl - , tcdSigs = noLoc (MinimalSig . fmap noLoc $ classMinimalDef cl) : + , tcdSigs = noLoc (MinimalSig mempty . fmap noLoc $ classMinimalDef cl) : map (noLoc . synifyIdSig DeleteTopLevelQuantification) (classMethods cl) , tcdMeths = emptyBag --ignore default method definitions, they don't affect signature @@ -245,8 +245,8 @@ synifyDataCon use_gadt_syntax dc = noLoc $ linear_tys = zipWith (\ty bang -> let tySyn = synifyType WithinType ty src_bang = case bang of - HsUnpack {} -> HsUserBang (Just True) True - HsStrict -> HsUserBang (Just False) True + HsUnpack {} -> HsUserBang Nothing (Just True) True + HsStrict -> HsUserBang Nothing (Just False) True _ -> bang in case src_bang of HsNoBang -> tySyn diff --git a/src/Haddock/GhcUtils.hs b/src/Haddock/GhcUtils.hs index 5aa9b81..cbf554a 100644 --- a/src/Haddock/GhcUtils.hs +++ b/src/Haddock/GhcUtils.hs @@ -104,8 +104,8 @@ filterSigNames p (FixSig (FixitySig ns ty)) = case filter (p . unLoc) ns of [] -> Nothing filtered -> Just (FixSig (FixitySig filtered ty)) -filterSigNames _ orig@(MinimalSig _) = Just orig -filterSigNames p (TypeSig ns ty nwcs) = +filterSigNames _ orig@(MinimalSig _ _) = Just orig +filterSigNames p (TypeSig ns ty nwcs) = case filter (p . unLoc) ns of [] -> Nothing filtered -> Just (TypeSig filtered ty nwcs) diff --git a/src/Haddock/Interface/Create.hs b/src/Haddock/Interface/Create.hs index 396c138..a9c6fb8 100644 --- a/src/Haddock/Interface/Create.hs +++ b/src/Haddock/Interface/Create.hs @@ -194,8 +194,8 @@ moduleWarning dflags gre (WarnAll w) = Just $ parseWarning dflags gre w parseWarning :: DynFlags -> GlobalRdrEnv -> WarningTxt -> Doc Name parseWarning dflags gre w = force $ case w of - DeprecatedTxt msg -> format "Deprecated: " (concatFS $ map unLoc msg) - WarningTxt msg -> format "Warning: " (concatFS $ map unLoc msg) + DeprecatedTxt _ msg -> format "Deprecated: " (concatFS $ map unLoc msg) + WarningTxt _ msg -> format "Warning: " (concatFS $ map unLoc msg) where format x xs = DocWarning . DocParagraph . DocAppend (DocString x) . processDocString dflags gre $ HsDocString xs @@ -550,7 +550,7 @@ mkExportItems L loc (TyClD cl at ClassDecl{}) -> do mdef <- liftGhcToErrMsgGhc $ minimalDef t - let sig = maybeToList $ fmap (noLoc . MinimalSig . fmap noLoc) mdef + let sig = maybeToList $ fmap (noLoc . MinimalSig mempty . fmap noLoc) mdef return [ mkExportDecl t (L loc $ TyClD cl { tcdSigs = sig ++ tcdSigs cl }) docs_ ] @@ -734,7 +734,7 @@ fullModuleContents dflags warnings gre (docMap, argMap, subMap, declMap, instMap return $ Just (ExportDecl decl doc subs [] (fixities name subs) (l `elem` splices)) mkExportItem (L l (TyClD cl at ClassDecl{ tcdLName = L _ name, tcdSigs = sigs })) = do mdef <- liftGhcToErrMsgGhc $ minimalDef name - let sig = maybeToList $ fmap (noLoc . MinimalSig . fmap noLoc) mdef + let sig = maybeToList $ fmap (noLoc . MinimalSig mempty . fmap noLoc) mdef expDecl (L l (TyClD cl { tcdSigs = sig ++ sigs })) l name mkExportItem decl@(L l d) | name:_ <- getMainDeclBinder d = expDecl decl l name diff --git a/src/Haddock/Interface/Rename.hs b/src/Haddock/Interface/Rename.hs index b08cd27..a0bb2cb 100644 --- a/src/Haddock/Interface/Rename.hs +++ b/src/Haddock/Interface/Rename.hs @@ -416,7 +416,7 @@ renameSig sig = case sig of FixSig (FixitySig lnames fixity) -> do lnames' <- mapM renameL lnames return $ FixSig (FixitySig lnames' fixity) - MinimalSig s -> MinimalSig <$> traverse renameL s + MinimalSig src s -> MinimalSig src <$> traverse renameL s -- we have filtered out all other kinds of signatures in Interface.Create _ -> error "expected TypeSig" From git at git.haskell.org Wed Jul 8 08:34:00 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:34:00 +0000 (UTC) Subject: [commit: haddock] wip/trac-9744: hide projectVersion from DynFlags since it clashes with Haddock.Version.projectVersion (f510419) Message-ID: <20150708083400.DBFFB3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/trac-9744 Link : http://git.haskell.org/haddock.git/commitdiff/f510419b1e918ec76d98190b966003cdbec107bb >--------------------------------------------------------------- commit f510419b1e918ec76d98190b966003cdbec107bb Author: Luite Stegeman Date: Wed Nov 19 01:59:50 2014 +0100 hide projectVersion from DynFlags since it clashes with Haddock.Version.projectVersion >--------------------------------------------------------------- f510419b1e918ec76d98190b966003cdbec107bb src/Haddock.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Haddock.hs b/src/Haddock.hs index c0a6714..02cad11 100644 --- a/src/Haddock.hs +++ b/src/Haddock.hs @@ -58,7 +58,7 @@ import Paths_haddock import GHC hiding (verbosity) import Config -import DynFlags hiding (verbosity) +import DynFlags hiding (projectVersion, verbosity) import StaticFlags (discardStaticFlags) import Panic (handleGhcException) import Module From git at git.haskell.org Wed Jul 8 08:34:02 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:34:02 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, metainfo, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: List new module in cabal file (c67e63a) Message-ID: <20150708083402.E775A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,metainfo,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/c67e63a1a426dc311ce4b1ad7c628b842d87024c >--------------------------------------------------------------- commit c67e63a1a426dc311ce4b1ad7c628b842d87024c Author: Mateusz Kowalczyk Date: Tue Dec 9 03:38:32 2014 +0000 List new module in cabal file >--------------------------------------------------------------- c67e63a1a426dc311ce4b1ad7c628b842d87024c haddock-library/haddock-library.cabal | 1 + 1 file changed, 1 insertion(+) diff --git a/haddock-library/haddock-library.cabal b/haddock-library/haddock-library.cabal index 40e9e17..4a502f6 100644 --- a/haddock-library/haddock-library.cabal +++ b/haddock-library/haddock-library.cabal @@ -31,6 +31,7 @@ library exposed-modules: Documentation.Haddock.Parser + Documentation.Haddock.Parser.Monad Documentation.Haddock.Types Documentation.Haddock.Doc From git at git.haskell.org Wed Jul 8 08:34:05 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:34:05 +0000 (UTC) Subject: [commit: haddock] wip/api-ann-hstylit-3, wip/api-ann-hstylit-4, wip/api-ann-hstylit-5: FunDeps are Located (f18360f) Message-ID: <20150708083405.02E7E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: wip/api-ann-hstylit-3,wip/api-ann-hstylit-4,wip/api-ann-hstylit-5 Link : http://git.haskell.org/haddock.git/commitdiff/f18360f9a2330492374726c3a29e54702109371f >--------------------------------------------------------------- commit f18360f9a2330492374726c3a29e54702109371f Author: Alan Zimmerman Date: Tue Dec 9 23:49:49 2014 +0200 FunDeps are Located >--------------------------------------------------------------- f18360f9a2330492374726c3a29e54702109371f src/Haddock/Backends/LaTeX.hs | 8 ++++---- src/Haddock/Backends/Xhtml/Decl.hs | 6 +++--- src/Haddock/Convert.hs | 2 +- src/Haddock/Interface/Rename.hs | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Haddock/Backends/LaTeX.hs b/src/Haddock/Backends/LaTeX.hs index f9ac096..021af8e 100644 --- a/src/Haddock/Backends/LaTeX.hs +++ b/src/Haddock/Backends/LaTeX.hs @@ -477,7 +477,7 @@ rDoc = maybeDoc . fmap latexStripTrailingWhitespace ppClassHdr :: Bool -> Located [LHsType DocName] -> DocName - -> LHsTyVarBndrs DocName -> [Located ([DocName], [DocName])] + -> LHsTyVarBndrs DocName -> [Located ([Located DocName], [Located DocName])] -> Bool -> LaTeX ppClassHdr summ lctxt n tvs fds unicode = keyword "class" @@ -486,13 +486,13 @@ ppClassHdr summ lctxt n tvs fds unicode = <+> ppFds fds unicode -ppFds :: [Located ([DocName], [DocName])] -> Bool -> LaTeX +ppFds :: [Located ([Located DocName], [Located DocName])] -> Bool -> LaTeX ppFds fds unicode = if null fds then empty else char '|' <+> hsep (punctuate comma (map (fundep . unLoc) fds)) where - fundep (vars1,vars2) = hsep (map ppDocName vars1) <+> arrow unicode <+> - hsep (map ppDocName vars2) + fundep (vars1,vars2) = hsep (map (ppDocName . unLoc) vars1) <+> arrow unicode <+> + hsep (map (ppDocName . unLoc) vars2) ppClassDecl :: [DocInstance DocName] -> SrcSpan diff --git a/src/Haddock/Backends/Xhtml/Decl.hs b/src/Haddock/Backends/Xhtml/Decl.hs index 30912eb..cf2338c 100644 --- a/src/Haddock/Backends/Xhtml/Decl.hs +++ b/src/Haddock/Backends/Xhtml/Decl.hs @@ -382,7 +382,7 @@ ppHsContext cxt unicode qual = parenList (map (ppType unicode qual) cxt) ppClassHdr :: Bool -> Located [LHsType DocName] -> DocName - -> LHsTyVarBndrs DocName -> [Located ([DocName], [DocName])] + -> LHsTyVarBndrs DocName -> [Located ([Located DocName], [Located DocName])] -> Unicode -> Qualification -> Html ppClassHdr summ lctxt n tvs fds unicode qual = keyword "class" @@ -391,13 +391,13 @@ ppClassHdr summ lctxt n tvs fds unicode qual = <+> ppFds fds unicode qual -ppFds :: [Located ([DocName], [DocName])] -> Unicode -> Qualification -> Html +ppFds :: [Located ([Located DocName], [Located DocName])] -> Unicode -> Qualification -> Html ppFds fds unicode qual = if null fds then noHtml else char '|' <+> hsep (punctuate comma (map (fundep . unLoc) fds)) where fundep (vars1,vars2) = ppVars vars1 <+> arrow unicode <+> ppVars vars2 - ppVars = hsep . map (ppDocName qual Prefix True) + ppVars = hsep . map ((ppDocName qual Prefix True) . unLoc) ppShortClassDecl :: Bool -> LinksInfo -> TyClDecl DocName -> SrcSpan -> [(DocName, DocForDecl DocName)] diff --git a/src/Haddock/Convert.hs b/src/Haddock/Convert.hs index bfc42bc..8afe4a2 100644 --- a/src/Haddock/Convert.hs +++ b/src/Haddock/Convert.hs @@ -71,7 +71,7 @@ tyThingToLHsDecl t = noLoc $ case t of , tcdLName = synifyName cl , tcdTyVars = synifyTyVars (classTyVars cl) , tcdFDs = map (\ (l,r) -> noLoc - (map getName l, map getName r) ) $ + (map (noLoc . getName) l, map (noLoc . getName) r) ) $ snd $ classTvsFds cl , tcdSigs = noLoc (MinimalSig mempty . fmap noLoc $ classMinimalDef cl) : map (noLoc . synifyIdSig DeleteTopLevelQuantification) diff --git a/src/Haddock/Interface/Rename.hs b/src/Haddock/Interface/Rename.hs index a0bb2cb..64357e8 100644 --- a/src/Haddock/Interface/Rename.hs +++ b/src/Haddock/Interface/Rename.hs @@ -332,9 +332,9 @@ renameTyClD d = case d of where renameLFunDep (L loc (xs, ys)) = do - xs' <- mapM rename xs - ys' <- mapM rename ys - return (L loc (xs', ys')) + xs' <- mapM rename (map unLoc xs) + ys' <- mapM rename (map unLoc ys) + return (L loc (map noLoc xs', map noLoc ys')) renameLSig (L loc sig) = return . L loc =<< renameSig sig From git at git.haskell.org Wed Jul 8 08:34:07 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:34:07 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, metainfo, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Allow the parser to spit out meta-info (12a066d) Message-ID: <20150708083407.28DC63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,metainfo,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/12a066d96332b40f346621c9376c5c7328c92a0b >--------------------------------------------------------------- commit 12a066d96332b40f346621c9376c5c7328c92a0b Author: Mateusz Kowalczyk Date: Tue Dec 9 07:00:07 2014 +0000 Allow the parser to spit out meta-info Currently we only use it only for ?since? annotations but with these patches it should be fairly simple to add new attributes if we wish to. Closes #26. It seems to work fine but due to 7.10 rush I don't have the chance to do more exhaustive testing right now. The way the meta is output (emphasis at the end of the whole comment) is fairly arbitrary and subject to bikeshedding. Note that this makes test for Bug310 fail due to interface version bump: it can't find the docs for base with this interface version so it fails. There is not much we can do to help this because it tests for ?built-in? identifier, not something we can provide ourselves. >--------------------------------------------------------------- 12a066d96332b40f346621c9376c5c7328c92a0b haddock-api/src/Haddock.hs | 9 +- haddock-api/src/Haddock/Backends/Hoogle.hs | 4 +- haddock-api/src/Haddock/Backends/LaTeX.hs | 13 +- haddock-api/src/Haddock/Backends/Xhtml.hs | 12 +- .../src/Haddock/Backends/Xhtml/DocMarkup.hs | 82 +++++++----- haddock-api/src/Haddock/Backends/Xhtml/Layout.hs | 2 +- haddock-api/src/Haddock/Doc.hs | 7 +- haddock-api/src/Haddock/Interface/Create.hs | 19 +-- haddock-api/src/Haddock/Interface/LexParseRn.hs | 35 +++--- .../src/Haddock/Interface/ParseModuleHeader.hs | 2 +- haddock-api/src/Haddock/Interface/Rename.hs | 5 +- haddock-api/src/Haddock/InterfaceFile.hs | 15 ++- haddock-api/src/Haddock/ModuleTree.hs | 10 +- haddock-api/src/Haddock/Parser.hs | 4 +- haddock-api/src/Haddock/Types.hs | 15 +-- haddock-api/src/Haddock/Utils.hs | 12 +- haddock-library/src/Documentation/Haddock/Doc.hs | 20 ++- .../src/Documentation/Haddock/Parser.hs | 6 +- haddock-library/src/Documentation/Haddock/Types.hs | 20 +++ .../test/Documentation/Haddock/ParserSpec.hs | 23 ++-- html-test/ref/{DeprecatedClass.html => Bug26.html} | 138 ++++++++++++--------- html-test/src/Bug26.hs | 29 +++++ 22 files changed, 311 insertions(+), 171 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 12a066d96332b40f346621c9376c5c7328c92a0b From git at git.haskell.org Wed Jul 8 08:34:09 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:34:09 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, metainfo, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Update doctest parts of comments (d453ce0) Message-ID: <20150708083409.352F83A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,metainfo,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/d453ce0df20a588e80287352954a79a4b3d70eb0 >--------------------------------------------------------------- commit d453ce0df20a588e80287352954a79a4b3d70eb0 Author: Mateusz Kowalczyk Date: Wed Dec 10 01:17:19 2014 +0000 Update doctest parts of comments >--------------------------------------------------------------- d453ce0df20a588e80287352954a79a4b3d70eb0 .../src/Documentation/Haddock/Parser.hs | 40 ++++++++++++---------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/haddock-library/src/Documentation/Haddock/Parser.hs b/haddock-library/src/Documentation/Haddock/Parser.hs index b88a8c7..7e400a2 100644 --- a/haddock-library/src/Documentation/Haddock/Parser.hs +++ b/haddock-library/src/Documentation/Haddock/Parser.hs @@ -119,8 +119,8 @@ parseStringBS = snd . parse p -- | Parses and processes -- -- --- >>> parseOnly encodedChar "A" --- Right (DocString "A") +-- >>> parseString "A" +-- DocString "A" encodedChar :: Parser (DocH mod a) encodedChar = "&#" *> c <* ";" where @@ -152,16 +152,16 @@ skipSpecialChar = DocString . return <$> satisfy (`elem` specialChar) -- | Emphasis parser. -- --- >>> parseOnly emphasis "/Hello world/" --- Right (DocEmphasis (DocString "Hello world")) +-- >>> parseString "/Hello world/" +-- DocEmphasis (DocString "Hello world") emphasis :: Parser (DocH mod Identifier) emphasis = DocEmphasis . parseStringBS <$> mfilter ('\n' `BS.notElem`) ("/" *> takeWhile1_ (/= '/') <* "/") -- | Bold parser. -- --- >>> parseOnly bold "__Hello world__" --- Right (DocBold (DocString "Hello world")) +-- >>> parseString "__Hello world__" +-- DocBold (DocString "Hello world") bold :: Parser (DocH mod Identifier) bold = DocBold . parseStringBS <$> disallowNewline ("__" *> takeUntil "__") @@ -183,19 +183,23 @@ takeWhile1_ = mfilter (not . BS.null) . takeWhile_ -- | Text anchors to allow for jumping around the generated documentation. -- --- >>> parseOnly anchor "#Hello world#" --- Right (DocAName "Hello world") +-- >>> parseString "#Hello world#" +-- DocAName "Hello world" anchor :: Parser (DocH mod a) anchor = DocAName . decodeUtf8 <$> disallowNewline ("#" *> takeWhile1_ (/= '#') <* "#") -- | Monospaced strings. -- --- >>> parseOnly monospace "@cruel@" --- Right (DocMonospaced (DocString "cruel")) +-- >>> parseString "@cruel@" +-- DocMonospaced (DocString "cruel") monospace :: Parser (DocH mod Identifier) -monospace = DocMonospaced . parseStringBS <$> ("@" *> takeWhile1_ (/= '@') <* "@") +monospace = DocMonospaced . parseStringBS + <$> ("@" *> takeWhile1_ (/= '@') <* "@") +-- | Module names: we try our reasonable best to only allow valid +-- Haskell module names, with caveat about not matching on technically +-- valid unicode symbols. moduleName :: Parser (DocH mod a) moduleName = DocModule <$> (char '"' *> modid <* char '"') where @@ -211,10 +215,10 @@ moduleName = DocModule <$> (char '"' *> modid <* char '"') -- | Picture parser, surrounded by \<\< and \>\>. It's possible to specify -- a title for the picture. -- --- >>> parseOnly picture "<>" --- Right (DocPic (Picture {pictureUri = "hello.png", pictureTitle = Nothing})) --- >>> parseOnly picture "<>" --- Right (DocPic (Picture {pictureUri = "hello.png", pictureTitle = Just "world"})) +-- >>> parseString "<>" +-- DocPic (Picture {pictureUri = "hello.png", pictureTitle = Nothing}) +-- >>> parseString "<>" +-- DocPic (Picture {pictureUri = "hello.png", pictureTitle = Just "world"}) picture :: Parser (DocH mod a) picture = DocPic . makeLabeled Picture . decodeUtf8 <$> disallowNewline ("<<" *> takeUntil ">>") @@ -247,9 +251,9 @@ since = ("@since " *> version <* skipHorizontalSpace <* endOfLine) >>= setSince -- | Headers inside the comment denoted with @=@ signs, up to 6 levels -- deep. -- --- >>> parseOnly header "= Hello" +-- >>> snd <$> parseOnly header "= Hello" -- Right (DocHeader (Header {headerLevel = 1, headerTitle = DocString "Hello"})) --- >>> parseOnly header "== World" +-- >>> snd <$> parseOnly header "== World" -- Right (DocHeader (Header {headerLevel = 2, headerTitle = DocString "World"})) header :: Parser (DocH mod Identifier) header = do @@ -438,7 +442,7 @@ endOfLine = void "\n" <|> endOfInput -- | Property parser. -- --- >>> parseOnly property "prop> hello world" +-- >>> snd <$> parseOnly property "prop> hello world" -- Right (DocProperty "hello world") property :: Parser (DocH mod a) property = DocProperty . strip . decodeUtf8 <$> ("prop>" *> takeWhile1 (/= '\n')) From git at git.haskell.org Wed Jul 8 08:34:11 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:34:11 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: header could contain several lines (d867ff1) Message-ID: <20150708083411.42CFE3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/d867ff18c6d23d792d070b17cc76cba35f69c649 >--------------------------------------------------------------- commit d867ff18c6d23d792d070b17cc76cba35f69c649 Author: jpmoresmau Date: Sun Nov 16 16:22:48 2014 +0100 header could contain several lines Closes #348 >--------------------------------------------------------------- d867ff18c6d23d792d070b17cc76cba35f69c649 haddock-api/src/Haddock/Backends/Hoogle.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haddock-api/src/Haddock/Backends/Hoogle.hs b/haddock-api/src/Haddock/Backends/Hoogle.hs index 79ada0f..dd2e738 100644 --- a/haddock-api/src/Haddock/Backends/Hoogle.hs +++ b/haddock-api/src/Haddock/Backends/Hoogle.hs @@ -220,7 +220,7 @@ docWith :: Outputable o => DynFlags -> String -> Maybe (Doc o) -> [String] docWith _ [] Nothing = [] docWith dflags header d = ("":) $ zipWith (++) ("-- | " : repeat "-- ") $ - [header | header /= ""] ++ ["" | header /= "" && isJust d] ++ + lines header ++ ["" | header /= "" && isJust d] ++ maybe [] (showTags . markup (markupTag dflags)) d From git at git.haskell.org Wed Jul 8 08:34:13 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:34:13 +0000 (UTC) Subject: [commit: haddock] wip/api-ann-hstylit-4, wip/api-ann-hstylit-5: Make RecCon payload Located (5f87fee) Message-ID: <20150708083413.55A2A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: wip/api-ann-hstylit-4,wip/api-ann-hstylit-5 Link : http://git.haskell.org/haddock.git/commitdiff/5f87fee8d4e11e87062d60ac1b467ae25a02b9bf >--------------------------------------------------------------- commit 5f87fee8d4e11e87062d60ac1b467ae25a02b9bf Author: Alan Zimmerman Date: Wed Dec 10 23:22:50 2014 +0200 Make RecCon payload Located >--------------------------------------------------------------- 5f87fee8d4e11e87062d60ac1b467ae25a02b9bf src/Haddock/Backends/Hoogle.hs | 2 +- src/Haddock/Backends/LaTeX.hs | 4 ++-- src/Haddock/Backends/Xhtml/Decl.hs | 6 +++--- src/Haddock/Convert.hs | 2 +- src/Haddock/GhcUtils.hs | 2 +- src/Haddock/Interface/Create.hs | 6 +++--- src/Haddock/Interface/Rename.hs | 4 ++-- src/Haddock/Utils.hs | 4 ++-- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/Haddock/Backends/Hoogle.hs b/src/Haddock/Backends/Hoogle.hs index a0f3036..1e34331 100644 --- a/src/Haddock/Backends/Hoogle.hs +++ b/src/Haddock/Backends/Hoogle.hs @@ -189,7 +189,7 @@ ppCtor dflags dat subdocs con where f (PrefixCon args) = [typeSig name $ args ++ [resType]] f (InfixCon a1 a2) = f $ PrefixCon [a1,a2] - f (RecCon recs) = f (PrefixCon $ map cd_fld_type (map unLoc recs)) ++ concat + f (RecCon (L _ recs)) = f (PrefixCon $ map cd_fld_type (map unLoc recs)) ++ concat [(concatMap (lookupCon dflags subdocs) (cd_fld_names r)) ++ [out dflags (map unL $ cd_fld_names r) `typeSig` [resType, cd_fld_type r]] | r <- map unLoc recs] diff --git a/src/Haddock/Backends/LaTeX.hs b/src/Haddock/Backends/LaTeX.hs index 021af8e..bf64c74 100644 --- a/src/Haddock/Backends/LaTeX.hs +++ b/src/Haddock/Backends/LaTeX.hs @@ -636,7 +636,7 @@ ppSideBySideConstr subdocs unicode leader (L _ con) = map (ppLParendType unicode) args)) <-> rDoc mbDoc <+> nl - RecCon fields -> + RecCon (L _ fields) -> (decltt (header_ unicode <+> ppOcc) <-> rDoc mbDoc <+> nl) $$ @@ -652,7 +652,7 @@ ppSideBySideConstr subdocs unicode leader (L _ con) = -- prefix & infix could also use hsConDeclArgTys if it seemed to -- simplify the code. PrefixCon args -> doGADTCon args resTy - cd@(RecCon fields) -> doGADTCon (hsConDeclArgTys cd) resTy <+> nl $$ + cd@(RecCon (L _ fields)) -> doGADTCon (hsConDeclArgTys cd) resTy <+> nl $$ doRecordFields fields InfixCon arg1 arg2 -> doGADTCon [arg1, arg2] resTy diff --git a/src/Haddock/Backends/Xhtml/Decl.hs b/src/Haddock/Backends/Xhtml/Decl.hs index cf2338c..bf1e4d8 100644 --- a/src/Haddock/Backends/Xhtml/Decl.hs +++ b/src/Haddock/Backends/Xhtml/Decl.hs @@ -601,7 +601,7 @@ ppShortConstrParts summary dataInst con unicode qual = case con_res con of PrefixCon args -> (header_ unicode qual +++ hsep (ppOcc : map (ppLParendType unicode qual) args), noHtml, noHtml) - RecCon fields -> + RecCon (L _ fields) -> (header_ unicode qual +++ ppOcc <+> char '{', doRecordFields fields, char '}') @@ -618,7 +618,7 @@ ppShortConstrParts summary dataInst con unicode qual = case con_res con of -- Constr :: (Context) => { field :: a, field2 :: b } -> Ty (a, b) -- (except each field gets its own line in docs, to match -- non-GADT records) - RecCon fields -> (ppOcc <+> dcolon unicode <+> + RecCon (L _ fields) -> (ppOcc <+> dcolon unicode <+> ppForAll forall_ ltvs lcontext unicode qual <+> char '{', doRecordFields fields, char '}' <+> arrow unicode <+> ppLType unicode qual resTy) @@ -691,7 +691,7 @@ ppSideBySideConstr subdocs fixities unicode qual (L _ con) = (decl, mbDoc, field InfixCon arg1 arg2 -> doGADTCon [arg1, arg2] resTy fieldPart = case con_details con of - RecCon fields -> [doRecordFields fields] + RecCon (L _ fields) -> [doRecordFields fields] _ -> [] doRecordFields fields = subFields qual diff --git a/src/Haddock/Convert.hs b/src/Haddock/Convert.hs index 8afe4a2..47ec777 100644 --- a/src/Haddock/Convert.hs +++ b/src/Haddock/Convert.hs @@ -259,7 +259,7 @@ synifyDataCon use_gadt_syntax dc = noLoc $ (dataConFieldLabels dc) linear_tys hs_arg_tys = case (use_named_field_syntax, use_infix_syntax) of (True,True) -> error "synifyDataCon: contradiction!" - (True,False) -> RecCon field_tys + (True,False) -> RecCon (noLoc field_tys) (False,False) -> PrefixCon linear_tys (False,True) -> case linear_tys of [a,b] -> InfixCon a b diff --git a/src/Haddock/GhcUtils.hs b/src/Haddock/GhcUtils.hs index cbf554a..9f9b269 100644 --- a/src/Haddock/GhcUtils.hs +++ b/src/Haddock/GhcUtils.hs @@ -210,7 +210,7 @@ class Parent a where instance Parent (ConDecl Name) where children con = case con_details con of - RecCon fields -> map unL $ concatMap (cd_fld_names . unL) fields + RecCon fields -> map unL $ concatMap (cd_fld_names . unL) (unL fields) _ -> [] instance Parent (TyClDecl Name) where diff --git a/src/Haddock/Interface/Create.hs b/src/Haddock/Interface/Create.hs index a9c6fb8..5420ef0 100644 --- a/src/Haddock/Interface/Create.hs +++ b/src/Haddock/Interface/Create.hs @@ -332,7 +332,7 @@ subordinates instMap decl = case decl of | c <- cons, cname <- con_names c ] fields = [ (unL n, maybeToList $ fmap unL doc, M.empty) | RecCon flds <- map con_details cons - , L _ (ConDeclField ns _ doc) <- flds + , L _ (ConDeclField ns _ doc) <- (unLoc flds) , n <- ns ] -- | Extract function argument docs from inside types. @@ -774,7 +774,7 @@ extractDecl name mdl decl InstD (ClsInstD ClsInstDecl { cid_datafam_insts = insts }) -> let matches = [ d | L _ d <- insts , L _ ConDecl { con_details = RecCon rec } <- dd_cons (dfid_defn d) - , ConDeclField { cd_fld_names = ns } <- map unLoc rec + , ConDeclField { cd_fld_names = ns } <- map unLoc (unLoc rec) , L _ n <- ns , n == name ] @@ -807,7 +807,7 @@ extractRecSel _ _ _ _ [] = error "extractRecSel: selector not found" extractRecSel nm mdl t tvs (L _ con : rest) = case con_details con of - RecCon fields | ((n,L _ (ConDeclField _nn ty _)) : _) <- matching_fields fields -> + RecCon (L _ fields) | ((n,L _ (ConDeclField _nn ty _)) : _) <- matching_fields fields -> L (getLoc n) (TypeSig [noLoc nm] (noLoc (HsFunTy data_ty (getBangType ty))) []) _ -> extractRecSel nm mdl t tvs rest where diff --git a/src/Haddock/Interface/Rename.hs b/src/Haddock/Interface/Rename.hs index 64357e8..3f324f4 100644 --- a/src/Haddock/Interface/Rename.hs +++ b/src/Haddock/Interface/Rename.hs @@ -379,9 +379,9 @@ renameCon decl@(ConDecl { con_names = lnames, con_qvars = ltyvars , con_details = details', con_res = restype', con_doc = mbldoc' }) where - renameDetails (RecCon fields) = do + renameDetails (RecCon (L l fields)) = do fields' <- mapM renameConDeclFieldField fields - return (RecCon fields') + return (RecCon (L l fields')) renameDetails (PrefixCon ps) = return . PrefixCon =<< mapM renameLType ps renameDetails (InfixCon a b) = do a' <- renameLType a diff --git a/src/Haddock/Utils.hs b/src/Haddock/Utils.hs index ecf58b3..95ee045 100644 --- a/src/Haddock/Utils.hs +++ b/src/Haddock/Utils.hs @@ -150,8 +150,8 @@ restrictCons names decls = [ L p d | L p (Just d) <- map (fmap keep) decls ] case con_details d of PrefixCon _ -> Just d RecCon fields - | all field_avail fields -> Just d - | otherwise -> Just (d { con_details = PrefixCon (field_types (map unL fields)) }) + | all field_avail (unL fields) -> Just d + | otherwise -> Just (d { con_details = PrefixCon (field_types (map unL (unL fields))) }) -- if we have *all* the field names available, then -- keep the record declaration. Otherwise degrade to -- a constructor declaration. This isn't quite right, but From git at git.haskell.org Wed Jul 8 08:34:15 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:34:15 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Revert "Merge branch 'reverts'" (e1156b5) Message-ID: <20150708083415.6B6C13A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/e1156b56e4711546956f5588b7b4258cb42caaac >--------------------------------------------------------------- commit e1156b56e4711546956f5588b7b4258cb42caaac Author: Mateusz Kowalczyk Date: Fri Dec 12 06:22:31 2014 +0000 Revert "Merge branch 'reverts'" This reverts commit 5c93cc347773c7634321edd5f808d5b55b46301f, reversing changes made to 5b81a9e53894d2ae591ca0c6c96199632d39eb06. Conflicts: haddock-api/src/Haddock/Convert.hs >--------------------------------------------------------------- e1156b56e4711546956f5588b7b4258cb42caaac haddock-api/src/Haddock.hs | 10 ++++---- haddock-api/src/Haddock/Backends/Xhtml.hs | 2 +- haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | 4 +-- haddock-api/src/Haddock/Backends/Xhtml/Layout.hs | 2 +- haddock-api/src/Haddock/Backends/Xhtml/Types.hs | 2 +- haddock-api/src/Haddock/Convert.hs | 12 ++++----- haddock-api/src/Haddock/GhcUtils.hs | 16 ++++++------ haddock-api/src/Haddock/Interface/Create.hs | 16 ++++++------ haddock-api/src/Haddock/Interface/Rename.hs | 32 +++++++++++++++++------- haddock-api/src/Haddock/InterfaceFile.hs | 12 ++++----- haddock-api/src/Haddock/ModuleTree.hs | 6 ++--- haddock-api/src/Haddock/Types.hs | 2 +- haddock-api/src/Haddock/Utils.hs | 6 +---- html-test/run.lhs | 2 +- latex-test/run.lhs | 2 +- 15 files changed, 67 insertions(+), 59 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 e1156b56e4711546956f5588b7b4258cb42caaac From git at git.haskell.org Wed Jul 8 08:34:17 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:34:17 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Changes due to ghc api changes in package representation (b455abf) Message-ID: <20150708083417.7899F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/b455abf0132b109512f967af917cd516b69d1c01 >--------------------------------------------------------------- commit b455abf0132b109512f967af917cd516b69d1c01 Author: Duncan Coutts Date: Wed Aug 27 13:49:31 2014 +0100 Changes due to ghc api changes in package representation Also fix a bug with finding the package name and version given a module. This had become wrong due to the package key changes (it was very hacky in the first place). We now look up the package key in the package db to get the package info properly. Conflicts: haddock-api/src/Haddock.hs >--------------------------------------------------------------- b455abf0132b109512f967af917cd516b69d1c01 haddock-api/src/Haddock.hs | 13 ++++++++----- haddock-api/src/Haddock/Backends/Hoogle.hs | 6 ++++-- haddock-api/src/Haddock/GhcUtils.hs | 25 +++++-------------------- 3 files changed, 17 insertions(+), 27 deletions(-) diff --git a/haddock-api/src/Haddock.hs b/haddock-api/src/Haddock.hs index ee6e305..0bf9412 100644 --- a/haddock-api/src/Haddock.hs +++ b/haddock-api/src/Haddock.hs @@ -47,7 +47,6 @@ import Data.IORef import qualified Data.Map as Map import System.IO import System.Exit -import System.Directory #if defined(mingw32_HOST_OS) import Foreign @@ -68,6 +67,8 @@ import DynFlags hiding (verbosity) import StaticFlags (discardStaticFlags) import Panic (handleGhcException) import Module +import PackageConfig +import FastString -------------------------------------------------------------------------------- -- * Exception handling @@ -250,7 +251,7 @@ render dflags flags qual ifaces installedIfaces srcMap = do pkgMod = ifaceMod (head ifaces) pkgKey = modulePackageKey pkgMod pkgStr = Just (packageKeyString pkgKey) - (pkgName,pkgVer) = modulePackageInfo pkgMod + (pkgName,pkgVer) = modulePackageInfo dflags pkgMod (srcBase, srcModule, srcEntity, srcLEntity) = sourceUrls flags srcMap' = maybe srcMap (\path -> Map.insert pkgKey path srcMap) srcEntity @@ -286,15 +287,17 @@ render dflags flags qual ifaces installedIfaces srcMap = do -- TODO: we throw away Meta for both Hoogle and LaTeX right now, -- might want to fix that if/when these two get some work on them when (Flag_Hoogle `elem` flags) $ do - let pkgName2 = if pkgName == "main" && title /= [] then title else pkgName - ppHoogle dflags pkgName2 pkgVer title (fmap _doc prologue) visibleIfaces + let pkgNameStr | unpackFS pkgNameFS == "main" && title /= [] + = title + | otherwise = unpackFS pkgNameFS + where PackageName pkgNameFS = pkgName + ppHoogle dflags pkgNameStr pkgVer title (fmap _doc prologue) visibleIfaces odir when (Flag_LaTeX `elem` flags) $ do ppLaTeX title pkgStr visibleIfaces odir (fmap _doc prologue) opt_latex_style libDir - ------------------------------------------------------------------------------- -- * Reading and dumping interface files ------------------------------------------------------------------------------- diff --git a/haddock-api/src/Haddock/Backends/Hoogle.hs b/haddock-api/src/Haddock/Backends/Hoogle.hs index dd2e738..3ea73db 100644 --- a/haddock-api/src/Haddock/Backends/Hoogle.hs +++ b/haddock-api/src/Haddock/Backends/Hoogle.hs @@ -25,6 +25,7 @@ import Outputable import Data.Char import Data.List import Data.Maybe +import Data.Version import System.FilePath import System.IO @@ -34,13 +35,14 @@ prefix = ["-- Hoogle documentation, generated by Haddock" ,""] -ppHoogle :: DynFlags -> String -> String -> String -> Maybe (Doc RdrName) -> [Interface] -> FilePath -> IO () +ppHoogle :: DynFlags -> String -> Version -> String -> Maybe (Doc RdrName) -> [Interface] -> FilePath -> IO () ppHoogle dflags package version synopsis prologue ifaces odir = do let filename = package ++ ".txt" contents = prefix ++ docWith dflags (drop 2 $ dropWhile (/= ':') synopsis) prologue ++ ["@package " ++ package] ++ - ["@version " ++ version | version /= ""] ++ + ["@version " ++ showVersion version + | not (null (versionBranch version)) ] ++ concat [ppModule dflags i | i <- ifaces, OptHide `notElem` ifaceOptions i] h <- openFile (odir filename) WriteMode hSetEncoding h utf8 diff --git a/haddock-api/src/Haddock/GhcUtils.hs b/haddock-api/src/Haddock/GhcUtils.hs index 33d9213..2c7b79a 100644 --- a/haddock-api/src/Haddock/GhcUtils.hs +++ b/haddock-api/src/Haddock/GhcUtils.hs @@ -22,8 +22,6 @@ import Control.Arrow import Data.Foldable hiding (concatMap) import Data.Function import Data.Traversable -import Distribution.Compat.ReadP -import Distribution.Text import Exception import Outputable @@ -43,24 +41,11 @@ moduleString = moduleNameString . moduleName -- return the (name,version) of the package -modulePackageInfo :: Module -> (String, [Char]) -modulePackageInfo modu = case unpackPackageKey pkg of - Nothing -> (packageKeyString pkg, "") - Just x -> (display $ pkgName x, showVersion (pkgVersion x)) - where pkg = modulePackageKey modu - - --- This was removed from GHC 6.11 --- XXX we shouldn't be using it, probably - --- | Try and interpret a GHC 'PackageKey' as a cabal 'PackageIdentifer'. Returns @Nothing@ if --- we could not parse it as such an object. -unpackPackageKey :: PackageKey -> Maybe PackageIdentifier -unpackPackageKey p - = case [ pid | (pid,"") <- readP_to_S parse str ] of - [] -> Nothing - (pid:_) -> Just pid - where str = packageKeyString p +modulePackageInfo :: DynFlags -> Module -> (PackageName, Version) +modulePackageInfo dflags modu = + (packageName pkg, packageVersion pkg) + where + pkg = getPackageDetails dflags (modulePackageKey modu) lookupLoadedHomeModuleGRE :: GhcMonad m => ModuleName -> m (Maybe GlobalRdrEnv) From git at git.haskell.org Wed Jul 8 08:34:19 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:34:19 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Import Data.Word w/o import-list (aa88d2c) Message-ID: <20150708083419.85B273A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/aa88d2cc920e0879481483ba427ace44199137e7 >--------------------------------------------------------------- commit aa88d2cc920e0879481483ba427ace44199137e7 Author: Herbert Valerio Riedel Date: Sun Aug 31 11:23:53 2014 +0200 Import Data.Word w/o import-list This is needed to keep the compilation warning free (and thus pass GHC's ./validate) regardless of whether Word is re-exported from Prelude or not See https://ghc.haskell.org/trac/ghc/ticket/9531 for more details >--------------------------------------------------------------- aa88d2cc920e0879481483ba427ace44199137e7 .../vendor/attoparsec-0.12.1.1/Data/Attoparsec/ByteString/Char8.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haddock-library/vendor/attoparsec-0.12.1.1/Data/Attoparsec/ByteString/Char8.hs b/haddock-library/vendor/attoparsec-0.12.1.1/Data/Attoparsec/ByteString/Char8.hs index eda8fd8..576dded 100644 --- a/haddock-library/vendor/attoparsec-0.12.1.1/Data/Attoparsec/ByteString/Char8.hs +++ b/haddock-library/vendor/attoparsec-0.12.1.1/Data/Attoparsec/ByteString/Char8.hs @@ -129,7 +129,7 @@ import Data.Bits (Bits, (.|.), shiftL) import Data.ByteString.Internal (c2w, w2c) import Data.Int (Int8, Int16, Int32, Int64) import Data.String (IsString(..)) -import Data.Word (Word8, Word16, Word32, Word64, Word) +import Data.Word import Prelude hiding (takeWhile) import qualified Data.Attoparsec.ByteString as A import qualified Data.Attoparsec.ByteString.Internal as I From git at git.haskell.org Wed Jul 8 08:34:21 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:34:21 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Follow changes to TypeAnnot in GHC HEAD (906ac8d) Message-ID: <20150708083421.944953A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/906ac8d0b1d243ea8a7b6b0d2fa1316e9303d31c >--------------------------------------------------------------- commit 906ac8d0b1d243ea8a7b6b0d2fa1316e9303d31c Author: Alan Zimmerman Date: Fri Sep 5 18:13:24 2014 -0500 Follow changes to TypeAnnot in GHC HEAD Signed-off-by: Austin Seipp Conflicts: haddock-api/src/Haddock/Convert.hs >--------------------------------------------------------------- 906ac8d0b1d243ea8a7b6b0d2fa1316e9303d31c haddock-api/src/Haddock/Convert.hs | 10 +++++----- haddock-api/src/Haddock/Interface/Rename.hs | 27 +++++++++++++++++++++------ 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/haddock-api/src/Haddock/Convert.hs b/haddock-api/src/Haddock/Convert.hs index 749421c..91581c7 100644 --- a/haddock-api/src/Haddock/Convert.hs +++ b/haddock-api/src/Haddock/Convert.hs @@ -85,7 +85,7 @@ tyThingToLHsDecl t = case t of , tcdATs = rights atFamDecls , tcdATDefs = [] --ignore associated type defaults , tcdDocs = [] --we don't have any docs at this point - , tcdFVs = placeHolderNames } + , tcdFVs = placeHolderNamesTc } | otherwise -> synifyTyCon Nothing tc >>= allOK . TyClD @@ -135,7 +135,7 @@ synifyAxiom ax@(CoAxiom { co_ax_tc = tc }) , Just branch <- coAxiomSingleBranch_maybe ax = return $ InstD (TyFamInstD (TyFamInstDecl { tfid_eqn = noLoc $ synifyAxBranch tc branch - , tfid_fvs = placeHolderNames })) + , tfid_fvs = placeHolderNamesTc })) | Just ax' <- isClosedSynFamilyTyCon_maybe tc , getUnique ax' == getUnique ax -- without the getUniques, type error @@ -167,7 +167,7 @@ synifyTyCon coax tc -- we have their kind accurately: , dd_cons = [] -- No constructors , dd_derivs = Nothing } - , tcdFVs = placeHolderNames } + , tcdFVs = placeHolderNamesTc } | isSynFamilyTyCon tc = case synTyConRhs_maybe tc of @@ -203,7 +203,7 @@ synifyTyCon coax tc SynDecl { tcdLName = synifyName tc , tcdTyVars = synifyTyVars (tyConTyVars tc) , tcdRhs = synifyType WithinType ty - , tcdFVs = placeHolderNames } + , tcdFVs = placeHolderNamesTc } _ -> Left "synifyTyCon: impossible synTyCon" | otherwise = -- (closed) newtype and data @@ -246,7 +246,7 @@ synifyTyCon coax tc in case lefts consRaw of [] -> return $ DataDecl { tcdLName = name, tcdTyVars = tyvars, tcdDataDefn = defn - , tcdFVs = placeHolderNames } + , tcdFVs = placeHolderNamesTc } dataConErrs -> Left $ unlines dataConErrs -- User beware: it is your responsibility to pass True (use_gadt_syntax) diff --git a/haddock-api/src/Haddock/Interface/Rename.hs b/haddock-api/src/Haddock/Interface/Rename.hs index 1cc8c8d..31bb2b9 100644 --- a/haddock-api/src/Haddock/Interface/Rename.hs +++ b/haddock-api/src/Haddock/Interface/Rename.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE TypeFamilies #-} ---------------------------------------------------------------------------- -- | -- Module : Haddock.Interface.Rename @@ -20,6 +21,8 @@ import Haddock.Types import Bag (emptyBag) import GHC hiding (NoLink) import Name +import NameSet +import Coercion import Control.Applicative import Control.Monad hiding (mapM) @@ -176,6 +179,7 @@ renameLKind = renameLType renameMaybeLKind :: Maybe (LHsKind Name) -> RnM (Maybe (LHsKind DocName)) renameMaybeLKind = traverse renameLKind + renameType :: HsType Name -> RnM (HsType DocName) renameType t = case t of HsForAllTy expl tyvars lcontext ltype -> do @@ -302,17 +306,17 @@ renameTyClD d = case d of decl' <- renameFamilyDecl decl return (FamDecl { tcdFam = decl' }) - SynDecl { tcdLName = lname, tcdTyVars = tyvars, tcdRhs = rhs, tcdFVs = fvs } -> do + SynDecl { tcdLName = lname, tcdTyVars = tyvars, tcdRhs = rhs, tcdFVs = _fvs } -> do lname' <- renameL lname tyvars' <- renameLTyVarBndrs tyvars rhs' <- renameLType rhs - return (SynDecl { tcdLName = lname', tcdTyVars = tyvars', tcdRhs = rhs', tcdFVs = fvs }) + return (SynDecl { tcdLName = lname', tcdTyVars = tyvars', tcdRhs = rhs', tcdFVs = placeHolderNames }) - DataDecl { tcdLName = lname, tcdTyVars = tyvars, tcdDataDefn = defn, tcdFVs = fvs } -> do + DataDecl { tcdLName = lname, tcdTyVars = tyvars, tcdDataDefn = defn, tcdFVs = _fvs } -> do lname' <- renameL lname tyvars' <- renameLTyVarBndrs tyvars defn' <- renameDataDefn defn - return (DataDecl { tcdLName = lname', tcdTyVars = tyvars', tcdDataDefn = defn', tcdFVs = fvs }) + return (DataDecl { tcdLName = lname', tcdTyVars = tyvars', tcdDataDefn = defn', tcdFVs = placeHolderNames }) ClassDecl { tcdCtxt = lcontext, tcdLName = lname, tcdTyVars = ltyvars , tcdFDs = lfundeps, tcdSigs = lsigs, tcdATs = ats, tcdATDefs = at_defs } -> do @@ -465,7 +469,7 @@ renameLTyFamInstEqn (L loc (TyFamEqn { tfe_tycon = tc, tfe_pats = pats_w_bndrs, ; pats' <- mapM renameLType (hswb_cts pats_w_bndrs) ; rhs' <- renameLType rhs ; return (L loc (TyFamEqn { tfe_tycon = tc' - , tfe_pats = pats_w_bndrs { hswb_cts = pats' } + , tfe_pats = HsWB pats' PlaceHolder PlaceHolder , tfe_rhs = rhs' })) } renameLTyFamDefltEqn :: LTyFamDefltEqn Name -> RnM (LTyFamDefltEqn DocName) @@ -482,7 +486,9 @@ renameDataFamInstD (DataFamInstDecl { dfid_tycon = tc, dfid_pats = pats_w_bndrs, = do { tc' <- renameL tc ; pats' <- mapM renameLType (hswb_cts pats_w_bndrs) ; defn' <- renameDataDefn defn - ; return (DataFamInstDecl { dfid_tycon = tc', dfid_pats = pats_w_bndrs { hswb_cts = pats' } + ; return (DataFamInstDecl { dfid_tycon = tc' + , dfid_pats + = HsWB pats' PlaceHolder PlaceHolder , dfid_defn = defn', dfid_fvs = placeHolderNames }) } renameExportItem :: ExportItem Name -> RnM (ExportItem DocName) @@ -517,3 +523,12 @@ renameSub (n,doc) = do n' <- rename n doc' <- renameDocForDecl doc return (n', doc') + +type instance PostRn DocName NameSet = PlaceHolder +type instance PostRn DocName Fixity = PlaceHolder +type instance PostRn DocName Bool = PlaceHolder +type instance PostRn DocName [Name] = PlaceHolder + +type instance PostTc DocName Kind = PlaceHolder +type instance PostTc DocName Type = PlaceHolder +type instance PostTc DocName Coercion = PlaceHolder From git at git.haskell.org Wed Jul 8 08:34:23 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:34:23 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families,adamse-D1033,ghc-head,master,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot: Bump ‘base’ constraint (cb8921e) Message-ID: <20150708083423.9DC4C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/cb8921ec1d6bc1b10833536457a9e25bad278a52 >--------------------------------------------------------------- commit cb8921ec1d6bc1b10833536457a9e25bad278a52 Author: Mateusz Kowalczyk Date: Fri Dec 12 06:35:07 2014 +0000 Bump ?base? constraint Follows the similar commit made on ghc-head branch >--------------------------------------------------------------- cb8921ec1d6bc1b10833536457a9e25bad278a52 haddock-api/haddock-api.cabal | 2 +- haddock-library/haddock-library.cabal | 2 +- haddock.cabal | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/haddock-api/haddock-api.cabal b/haddock-api/haddock-api.cabal index 5e49b4c..d18a30e 100644 --- a/haddock-api/haddock-api.cabal +++ b/haddock-api/haddock-api.cabal @@ -36,7 +36,7 @@ library Haskell2010 build-depends: - base >= 4.3 && < 4.8 + base >= 4.3 && < 4.9 , bytestring , filepath , directory diff --git a/haddock-library/haddock-library.cabal b/haddock-library/haddock-library.cabal index 4a502f6..83aad2d 100644 --- a/haddock-library/haddock-library.cabal +++ b/haddock-library/haddock-library.cabal @@ -21,7 +21,7 @@ library default-language: Haskell2010 build-depends: - base >= 4.3 && < 4.8 + base >= 4.3 && < 4.9 , bytestring , transformers , deepseq diff --git a/haddock.cabal b/haddock.cabal index 7bd2dfb..c1d7fdb 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -45,7 +45,7 @@ executable haddock ghc-options: -funbox-strict-fields -Wall -fwarn-tabs -O2 build-depends: - base >= 4.3 && < 4.8 + base >= 4.3 && < 4.9 if flag(in-ghc-tree) hs-source-dirs: haddock-api/src, haddock-library/vendor/attoparsec-0.12.1.1, haddock-library/src cpp-options: -DIN_GHC_TREE From git at git.haskell.org Wed Jul 8 08:34:25 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:34:25 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Followup changes to addition of -fwarn-context-quantification (GHC Trac #4426) (0833291) Message-ID: <20150708083425.AA31C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/08332912f745dbd48c6e5fbf0c35e9828600b4db >--------------------------------------------------------------- commit 08332912f745dbd48c6e5fbf0c35e9828600b4db Author: Krzysztof Gogolewski Date: Sun Sep 14 14:08:35 2014 +0200 Followup changes to addition of -fwarn-context-quantification (GHC Trac #4426) >--------------------------------------------------------------- 08332912f745dbd48c6e5fbf0c35e9828600b4db haddock-api/src/Haddock/Backends/Hoogle.hs | 1 + haddock-api/src/Haddock/Backends/LaTeX.hs | 5 ++++- haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/haddock-api/src/Haddock/Backends/Hoogle.hs b/haddock-api/src/Haddock/Backends/Hoogle.hs index 3ea73db..c8085fa 100644 --- a/haddock-api/src/Haddock/Backends/Hoogle.hs +++ b/haddock-api/src/Haddock/Backends/Hoogle.hs @@ -134,6 +134,7 @@ ppSig dflags (TypeSig names sig) prettyNames = intercalate ", " $ map (out dflags) names typ = case unL sig of HsForAllTy Explicit a b c -> HsForAllTy Implicit a b c + HsForAllTy Qualified a b c -> HsForAllTy Implicit a b c x -> x ppSig _ _ = [] diff --git a/haddock-api/src/Haddock/Backends/LaTeX.hs b/haddock-api/src/Haddock/Backends/LaTeX.hs index f540527..e9cc48c 100644 --- a/haddock-api/src/Haddock/Backends/LaTeX.hs +++ b/haddock-api/src/Haddock/Backends/LaTeX.hs @@ -402,6 +402,8 @@ ppTypeOrFunSig _ _ typ (doc, argDocs) (pref1, pref2, sep0) ppLContextNoArrow lctxt unicode) <+> nl $$ do_largs n (darrow unicode) ltype + do_args n leader (HsForAllTy Qualified a lctxt ltype) + = do_args n leader (HsForAllTy Implicit a lctxt ltype) do_args n leader (HsForAllTy Implicit _ lctxt ltype) | not (null (unLoc lctxt)) = decltt leader <-> decltt (ppLContextNoArrow lctxt unicode) <+> nl $$ @@ -621,6 +623,7 @@ ppConstrHdr forall tvs ctxt unicode where ppForall = case forall of Explicit -> forallSymbol unicode <+> hsep (map ppName tvs) <+> text ". " + Qualified -> empty Implicit -> empty @@ -872,7 +875,7 @@ ppForAll expl tvs cxt unicode | otherwise = ppLContext cxt unicode where show_forall = not (null (hsQTvBndrs tvs)) && is_explicit - is_explicit = case expl of {Explicit -> True; Implicit -> False} + is_explicit = case expl of {Explicit -> True; Implicit -> False; Qualified -> False} forall_part = hsep (forallSymbol unicode : ppTyVars tvs) <> dot diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs index 517ad64..893c2a5 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs @@ -651,6 +651,7 @@ ppConstrHdr forall_ tvs ctxt unicode qual where ppForall = case forall_ of Explicit -> forallSymbol unicode <+> hsep (map (ppName Prefix) tvs) <+> toHtml ". " + Qualified -> noHtml Implicit -> noHtml @@ -813,7 +814,7 @@ ppForAllCon expl tvs cxt unicode qual | otherwise = ppLContext cxt unicode qual where show_forall = not (null (hsQTvBndrs tvs)) && is_explicit - is_explicit = case expl of {Explicit -> True; Implicit -> False} + is_explicit = case expl of {Explicit -> True; Implicit -> False; Qualified -> False} forall_part = hsep (forallSymbol unicode : ppTyVars tvs) +++ dot From git at git.haskell.org Wed Jul 8 08:34:27 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:34:27 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Properly render package ID (not package key) in index, fixes #329. (6e95f42) Message-ID: <20150708083427.B87DA3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/6e95f42907970c9cbb9f6279509a4bf5542ffae4 >--------------------------------------------------------------- commit 6e95f42907970c9cbb9f6279509a4bf5542ffae4 Author: Edward Z. Yang Date: Thu Sep 18 13:38:11 2014 -0700 Properly render package ID (not package key) in index, fixes #329. Signed-off-by: Edward Z. Yang Conflicts: haddock-api/src/Haddock/ModuleTree.hs >--------------------------------------------------------------- 6e95f42907970c9cbb9f6279509a4bf5542ffae4 haddock-api/src/Haddock.hs | 4 ++-- haddock-api/src/Haddock/Backends/Xhtml.hs | 14 ++++++++------ haddock-api/src/Haddock/ModuleTree.hs | 13 ++++++++----- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/haddock-api/src/Haddock.hs b/haddock-api/src/Haddock.hs index 0bf9412..ef03f8f 100644 --- a/haddock-api/src/Haddock.hs +++ b/haddock-api/src/Haddock.hs @@ -270,14 +270,14 @@ render dflags flags qual ifaces installedIfaces srcMap = do copyHtmlBits odir libDir themes when (Flag_GenContents `elem` flags) $ do - ppHtmlContents odir title pkgStr + ppHtmlContents dflags odir title pkgStr themes opt_index_url sourceUrls' opt_wiki_urls allVisibleIfaces True prologue pretty (makeContentsQual qual) copyHtmlBits odir libDir themes when (Flag_Html `elem` flags) $ do - ppHtml title pkgStr visibleIfaces odir + ppHtml dflags title pkgStr visibleIfaces odir prologue themes sourceUrls' opt_wiki_urls opt_contents_url opt_index_url unicode qual diff --git a/haddock-api/src/Haddock/Backends/Xhtml.hs b/haddock-api/src/Haddock/Backends/Xhtml.hs index d117652..f065104 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml.hs @@ -60,7 +60,8 @@ import Module -------------------------------------------------------------------------------- -ppHtml :: String +ppHtml :: DynFlags + -> String -- ^ Title -> Maybe String -- ^ Package -> [Interface] -> FilePath -- ^ Destination directory @@ -75,7 +76,7 @@ ppHtml :: String -> Bool -- ^ Output pretty html (newlines and indenting) -> IO () -ppHtml doctitle maybe_package ifaces odir prologue +ppHtml dflags doctitle maybe_package ifaces odir prologue themes maybe_source_url maybe_wiki_url maybe_contents_url maybe_index_url unicode qual debug = do @@ -84,7 +85,7 @@ ppHtml doctitle maybe_package ifaces odir prologue visible i = OptHide `notElem` ifaceOptions i when (isNothing maybe_contents_url) $ - ppHtmlContents odir doctitle maybe_package + ppHtmlContents dflags odir doctitle maybe_package themes maybe_index_url maybe_source_url maybe_wiki_url (map toInstalledIface visible_ifaces) False -- we don't want to display the packages in a single-package contents @@ -239,7 +240,8 @@ moduleInfo iface = ppHtmlContents - :: FilePath + :: DynFlags + -> FilePath -> String -> Maybe String -> Themes @@ -250,10 +252,10 @@ ppHtmlContents -> Bool -> Qualification -- ^ How to qualify names -> IO () -ppHtmlContents odir doctitle _maybe_package +ppHtmlContents dflags odir doctitle _maybe_package themes maybe_index_url maybe_source_url maybe_wiki_url ifaces showPkgs prologue debug qual = do - let tree = mkModuleTree showPkgs + let tree = mkModuleTree dflags showPkgs [(instMod iface, toInstalledDescription iface) | iface <- ifaces] html = headHtml doctitle Nothing themes +++ diff --git a/haddock-api/src/Haddock/ModuleTree.hs b/haddock-api/src/Haddock/ModuleTree.hs index 662d702..eec1342 100644 --- a/haddock-api/src/Haddock/ModuleTree.hs +++ b/haddock-api/src/Haddock/ModuleTree.hs @@ -15,18 +15,21 @@ module Haddock.ModuleTree ( ModuleTree(..), mkModuleTree ) where import Haddock.Types ( MDoc ) import GHC ( Name ) -import Module ( Module, moduleNameString, moduleName, modulePackageKey, - packageKeyString ) +import Module ( Module, moduleNameString, moduleName, modulePackageKey ) +import DynFlags ( DynFlags ) +import Packages ( lookupPackage ) +import PackageConfig ( sourcePackageIdString ) data ModuleTree = Node String Bool (Maybe String) (Maybe (MDoc Name)) [ModuleTree] -mkModuleTree :: Bool -> [(Module, Maybe (MDoc Name))] -> [ModuleTree] -mkModuleTree showPkgs mods = +mkModuleTree :: DynFlags -> Bool -> [(Module, Maybe (MDoc Name))] -> [ModuleTree] +mkModuleTree dflags showPkgs mods = foldr fn [] [ (splitModule mdl, modPkg mdl, short) | (mdl, short) <- mods ] where - modPkg mod_ | showPkgs = Just (packageKeyString (modulePackageKey mod_)) + modPkg mod_ | showPkgs = fmap sourcePackageIdString + (lookupPackage dflags (modulePackageKey mod_)) | otherwise = Nothing fn (mod_,pkg,short) = addToTrees mod_ pkg short From git at git.haskell.org Wed Jul 8 08:34:29 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:34:29 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Disambiguate string-literals (4f93def) Message-ID: <20150708083429.C70513A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/4f93def9cee7941d1bab97055913bdeeed8119b2 >--------------------------------------------------------------- commit 4f93def9cee7941d1bab97055913bdeeed8119b2 Author: Herbert Valerio Riedel Date: Thu Sep 18 23:57:37 2014 +0200 Disambiguate string-literals GHC fails type-inference with `OverloadedStrings` + `Data.Foldable.elem` otherwise. Conflicts: haddock-library/src/Documentation/Haddock/Parser.hs >--------------------------------------------------------------- 4f93def9cee7941d1bab97055913bdeeed8119b2 haddock-library/src/Documentation/Haddock/Parser.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/haddock-library/src/Documentation/Haddock/Parser.hs b/haddock-library/src/Documentation/Haddock/Parser.hs index 7e400a2..b7ab85b 100644 --- a/haddock-library/src/Documentation/Haddock/Parser.hs +++ b/haddock-library/src/Documentation/Haddock/Parser.hs @@ -210,7 +210,7 @@ moduleName = DocModule <$> (char '"' *> modid <* char '"') -- accept {small | large | digit | ' } here. But as we can't -- match on unicode characters, this is currently not possible. -- Note that we allow ?#? to suport anchors. - <*> (decodeUtf8 <$> takeWhile (`notElem` " .&[{}(=*)+]!|@/;,^?\"\n")) + <*> (decodeUtf8 <$> takeWhile (`notElem` (" .&[{}(=*)+]!|@/;,^?\"\n"::String))) -- | Picture parser, surrounded by \<\< and \>\>. It's possible to specify -- a title for the picture. @@ -314,7 +314,7 @@ definitionList :: Parser (DocH mod Identifier) definitionList = DocDefList <$> p where p = do - label <- "[" *> (parseStringBS <$> takeWhile1 (`notElem` "]\n")) <* ("]" <* optional ":") + label <- "[" *> (parseStringBS <$> takeWhile1 (`notElem` ("]\n" :: String))) <* ("]" <* optional ":") c <- takeLine (cs, items) <- more p let contents = parseString . dropNLs . unlines $ c : cs @@ -520,7 +520,7 @@ autoUrl = mkLink <$> url url = mappend <$> ("http://" <|> "https://" <|> "ftp://") <*> takeWhile1 (not . isSpace) mkLink :: BS.ByteString -> DocH mod a mkLink s = case unsnoc s of - Just (xs, x) | x `elem` ",.!?" -> DocHyperlink (Hyperlink (decodeUtf8 xs) Nothing) `docAppend` DocString [x] + Just (xs, x) | x `elem` (",.!?" :: String) -> DocHyperlink (Hyperlink (decodeUtf8 xs) Nothing) `docAppend` DocString [x] _ -> DocHyperlink (Hyperlink (decodeUtf8 s) Nothing) -- | Parses strings between identifier delimiters. Consumes all input that it @@ -529,7 +529,7 @@ autoUrl = mkLink <$> url parseValid :: Parser String parseValid = p some where - idChar = satisfy (`elem` "_.!#$%&*+/<=>?@\\|-~:^") + idChar = satisfy (`elem` ("_.!#$%&*+/<=>?@\\|-~:^"::String)) <|> digit <|> letter_ascii p p' = do vs' <- p' $ utf8String "?" <|> return <$> idChar From git at git.haskell.org Wed Jul 8 08:34:31 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:34:31 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Add an .arcconfig file. (9110762) Message-ID: <20150708083431.D56F13A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/9110762aff9464e5436bd9855853bb5cfe15fa87 >--------------------------------------------------------------- commit 9110762aff9464e5436bd9855853bb5cfe15fa87 Author: Austin Seipp Date: Mon Oct 20 20:05:27 2014 -0500 Add an .arcconfig file. Signed-off-by: Austin Seipp >--------------------------------------------------------------- 9110762aff9464e5436bd9855853bb5cfe15fa87 .arcconfig | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.arcconfig b/.arcconfig new file mode 100644 index 0000000..0693c58 --- /dev/null +++ b/.arcconfig @@ -0,0 +1,5 @@ +{ + "project.name" : "haddock", + "repository.callsign" : "HADDOCK", + "phabricator.uri" : "https://phabricator.haskell.org" +} From git at git.haskell.org Wed Jul 8 08:34:33 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:34:33 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Add .arclint file. (53ba3a8) Message-ID: <20150708083433.E4EC53A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/53ba3a8dd8407a816faa709fa3da4dc85a18e530 >--------------------------------------------------------------- commit 53ba3a8dd8407a816faa709fa3da4dc85a18e530 Author: Austin Seipp Date: Mon Oct 20 20:07:01 2014 -0500 Add .arclint file. Signed-off-by: Austin Seipp >--------------------------------------------------------------- 53ba3a8dd8407a816faa709fa3da4dc85a18e530 .arclint | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.arclint b/.arclint new file mode 100644 index 0000000..01f217d --- /dev/null +++ b/.arclint @@ -0,0 +1,24 @@ +{ + "linters": { + "filename": { + "type": "filename" + }, + "generated": { + "type": "generated" + }, + "merge-conflict": { + "type": "merge-conflict" + }, + "nolint": { + "type": "nolint" + }, + "haskell": { + "type": "text", + "include": ["(\\.(l?hs(-boot)?|x|y\\.pp)(\\.in)?$)"], + "severity": { + "5": "disabled", + "2": "warning" + } + } + } +} From git at git.haskell.org Wed Jul 8 08:34:35 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:34:35 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Collapse user-defined section by default (re #335) (ad22493) Message-ID: <20150708083435.F0DF43A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/ad22493300eff0c1f55a617bdb129408011c35e0 >--------------------------------------------------------------- commit ad22493300eff0c1f55a617bdb129408011c35e0 Author: Herbert Valerio Riedel Date: Fri Oct 31 11:08:02 2014 +0100 Collapse user-defined section by default (re #335) Conflicts: haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs >--------------------------------------------------------------- ad22493300eff0c1f55a617bdb129408011c35e0 haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs b/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs index 565adef..921e409 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs @@ -161,7 +161,7 @@ hackMarkup fmt' h' = CollapsingHeader (Header lvl titl) par n nm -> let id_ = makeAnchorId $ "ch:" ++ fromMaybe "noid:" nm ++ show n col' = collapseControl id_ True "caption" - instTable = (thediv ! collapseSection id_ True [] <<) + instTable = (thediv ! collapseSection id_ False [] <<) lvs = zip [1 .. ] [h1, h2, h3, h4, h5, h6] getHeader = fromMaybe caption (lookup lvl lvs) subCaption = getHeader ! col' << markup fmt titl From git at git.haskell.org Wed Jul 8 08:34:38 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:34:38 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: reflect ForeignType constructore removal (1e99fd0) Message-ID: <20150708083438.06FC33A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/1e99fd024be45203452d82a036f5a5b113cb7a06 >--------------------------------------------------------------- commit 1e99fd024be45203452d82a036f5a5b113cb7a06 Author: Yuras Shumovich Date: Fri Oct 31 16:11:04 2014 -0500 reflect ForeignType constructore removal Reviewers: austin Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D358 >--------------------------------------------------------------- 1e99fd024be45203452d82a036f5a5b113cb7a06 haddock-api/src/Haddock/Interface/Rename.hs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/haddock-api/src/Haddock/Interface/Rename.hs b/haddock-api/src/Haddock/Interface/Rename.hs index 31bb2b9..e9048b5 100644 --- a/haddock-api/src/Haddock/Interface/Rename.hs +++ b/haddock-api/src/Haddock/Interface/Rename.hs @@ -297,10 +297,6 @@ renameLThing fn (L loc x) = return . L loc =<< fn x renameTyClD :: TyClDecl Name -> RnM (TyClDecl DocName) renameTyClD d = case d of - ForeignType lname b -> do - lname' <- renameL lname - return (ForeignType lname' b) - -- TyFamily flav lname ltyvars kind tckind -> do FamDecl { tcdFam = decl } -> do decl' <- renameFamilyDecl decl From git at git.haskell.org Wed Jul 8 08:34:40 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:34:40 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Remove overlapping pattern match (ccebf5d) Message-ID: <20150708083440.12E443A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/ccebf5d18e3f5ba187581e8c4cc3f79f33efb03b >--------------------------------------------------------------- commit ccebf5d18e3f5ba187581e8c4cc3f79f33efb03b Author: Austin Seipp Date: Fri Oct 31 19:33:53 2014 -0500 Remove overlapping pattern match Signed-off-by: Austin Seipp >--------------------------------------------------------------- ccebf5d18e3f5ba187581e8c4cc3f79f33efb03b haddock-api/src/Haddock/Backends/Xhtml.hs | 1 - 1 file changed, 1 deletion(-) diff --git a/haddock-api/src/Haddock/Backends/Xhtml.hs b/haddock-api/src/Haddock/Backends/Xhtml.hs index f065104..455bfcd 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml.hs @@ -587,7 +587,6 @@ processForMiniSynopsis mdl unicode qual ExportDecl { expItemDecl = L _loc decl0 (DataDecl{}) -> [keyword "data" <+> b] (SynDecl{}) -> [keyword "type" <+> b] (ClassDecl {}) -> [keyword "class" <+> b] - _ -> [] SigD (TypeSig lnames (L _ _)) -> map (ppNameMini Prefix mdl . nameOccName . getName . unLoc) lnames _ -> [] From git at git.haskell.org Wed Jul 8 08:34:42 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:34:42 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Make compatible with `deepseq-1.4.0.0` (d5950c8) Message-ID: <20150708083442.1F9FF3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/d5950c8a95dc46fe2702d04f724145c73355043e >--------------------------------------------------------------- commit d5950c8a95dc46fe2702d04f724145c73355043e Author: Herbert Valerio Riedel Date: Sat Nov 15 11:55:43 2014 +0100 Make compatible with `deepseq-1.4.0.0` ...by not relying on the default method implementation of `rnf` >--------------------------------------------------------------- d5950c8a95dc46fe2702d04f724145c73355043e haddock-api/src/Haddock/Types.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/haddock-api/src/Haddock/Types.hs b/haddock-api/src/Haddock/Types.hs index 7113997..e93294a 100644 --- a/haddock-api/src/Haddock/Types.hs +++ b/haddock-api/src/Haddock/Types.hs @@ -343,9 +343,9 @@ instance (NFData a, NFData mod) DocHeader a -> a `deepseq` () -instance NFData Name -instance NFData OccName -instance NFData ModuleName +instance NFData Name where rnf x = seq x () +instance NFData OccName where rnf x = seq x () +instance NFData ModuleName where rnf x = seq x () instance NFData id => NFData (Header id) where rnf (Header a b) = a `deepseq` b `deepseq` () From git at git.haskell.org Wed Jul 8 08:34:44 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:34:44 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Update Haddock to new pattern synonym type signature syntax (a197615) Message-ID: <20150708083444.3055D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/a197615a032f14f20761a7dec21ea098297eda31 >--------------------------------------------------------------- commit a197615a032f14f20761a7dec21ea098297eda31 Author: Dr. ERDI Gergo Date: Thu Nov 20 22:35:38 2014 +0800 Update Haddock to new pattern synonym type signature syntax Conflicts: haddock-api/src/Haddock/Backends/Xhtml/Decl.hs haddock-api/src/Haddock/Convert.hs >--------------------------------------------------------------- a197615a032f14f20761a7dec21ea098297eda31 haddock-api/src/Haddock/Backends/LaTeX.hs | 70 ++++++++++++------------- haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | 72 ++++++++++++++------------ haddock-api/src/Haddock/Convert.hs | 21 +++----- haddock-api/src/Haddock/Interface/Create.hs | 4 +- haddock-api/src/Haddock/Interface/Rename.hs | 10 ++-- html-test/ref/Operators.html | 4 +- html-test/ref/PatternSyns.html | 36 ++++++------- 7 files changed, 105 insertions(+), 112 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 a197615a032f14f20761a7dec21ea098297eda31 From git at git.haskell.org Wed Jul 8 08:34:46 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:34:46 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Follow changes from #9812 (79db0e9) Message-ID: <20150708083446.3CA363A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/79db0e9ef140f88c12d239a2e7dd4eb8bb06d825 >--------------------------------------------------------------- commit 79db0e9ef140f88c12d239a2e7dd4eb8bb06d825 Author: Jan Stolarek Date: Wed Nov 19 23:00:19 2014 +0100 Follow changes from #9812 Conflicts: haddock-api/src/Haddock/Convert.hs >--------------------------------------------------------------- 79db0e9ef140f88c12d239a2e7dd4eb8bb06d825 haddock-api/src/Haddock/Convert.hs | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/haddock-api/src/Haddock/Convert.hs b/haddock-api/src/Haddock/Convert.hs index 3b454fe..8940d93 100644 --- a/haddock-api/src/Haddock/Convert.hs +++ b/haddock-api/src/Haddock/Convert.hs @@ -124,7 +124,7 @@ synifyAxBranch tc (CoAxBranch { cab_tvs = tkvs, cab_lhs = args, cab_rhs = rhs }) synifyAxiom :: CoAxiom br -> Either ErrMsg (HsDecl Name) synifyAxiom ax@(CoAxiom { co_ax_tc = tc }) - | isOpenSynFamilyTyCon tc + | isOpenTypeFamilyTyCon tc , Just branch <- coAxiomSingleBranch_maybe ax = return $ InstD (TyFamInstD (TyFamInstDecl { tfid_eqn = noLoc $ synifyAxBranch tc branch @@ -162,8 +162,8 @@ synifyTyCon coax tc , dd_derivs = Nothing } , tcdFVs = placeHolderNamesTc } - | isSynFamilyTyCon tc - = case synTyConRhs_maybe tc of + | isTypeFamilyTyCon tc + = case famTyConFlav_maybe tc of Just rhs -> let info = case rhs of OpenSynFamilyTyCon -> return OpenTypeFamily @@ -190,14 +190,11 @@ synifyTyCon coax tc FamDecl (FamilyDecl DataFamily (synifyName tc) (synifyTyVars (tyConTyVars tc)) Nothing) --always kind '*' _ -> Left "synifyTyCon: impossible open data type?" - | isSynTyCon tc - = case synTyConRhs_maybe tc of - Just (SynonymTyCon ty) -> return $ - SynDecl { tcdLName = synifyName tc - , tcdTyVars = synifyTyVars (tyConTyVars tc) - , tcdRhs = synifyType WithinType ty - , tcdFVs = placeHolderNamesTc } - _ -> Left "synifyTyCon: impossible synTyCon" + | Just ty <- synTyConRhs_maybe tc + = return $ SynDecl { tcdLName = synifyName tc + , tcdTyVars = synifyTyVars (tyConTyVars tc) + , tcdRhs = synifyType WithinType ty + , tcdFVs = placeHolderNamesTc } | otherwise = -- (closed) newtype and data let From git at git.haskell.org Wed Jul 8 08:34:48 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:34:48 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Changes to reflect refactoring in GHC as part of #7484 (d3f7216) Message-ID: <20150708083448.490513A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/d3f72165640de939eef36910f89f37f2a9154d31 >--------------------------------------------------------------- commit d3f72165640de939eef36910f89f37f2a9154d31 Author: Richard Eisenberg Date: Tue Nov 18 21:49:31 2014 -0500 Changes to reflect refactoring in GHC as part of #7484 >--------------------------------------------------------------- d3f72165640de939eef36910f89f37f2a9154d31 haddock-api/src/Haddock/GhcUtils.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/haddock-api/src/Haddock/GhcUtils.hs b/haddock-api/src/Haddock/GhcUtils.hs index 2c7b79a..43112ff 100644 --- a/haddock-api/src/Haddock/GhcUtils.hs +++ b/haddock-api/src/Haddock/GhcUtils.hs @@ -26,6 +26,7 @@ import Data.Traversable import Exception import Outputable import Name +import Lexeme import Packages import Module import RdrName (GlobalRdrEnv) From git at git.haskell.org Wed Jul 8 08:34:50 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:34:50 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Follow API changes in D426 (7962951) Message-ID: <20150708083450.594653A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/79629515c0fd71baf182a487df94cb5eaa27ab47 >--------------------------------------------------------------- commit 79629515c0fd71baf182a487df94cb5eaa27ab47 Author: Alan Zimmerman Date: Fri Nov 21 11:23:09 2014 -0600 Follow API changes in D426 Signed-off-by: Austin Seipp Conflicts: haddock-api/src/Haddock/Backends/LaTeX.hs haddock-api/src/Haddock/Backends/Xhtml/Decl.hs haddock-api/src/Haddock/Convert.hs >--------------------------------------------------------------- 79629515c0fd71baf182a487df94cb5eaa27ab47 haddock-api/src/Haddock/Backends/Hoogle.hs | 14 +++--- haddock-api/src/Haddock/Backends/LaTeX.hs | 29 +++++++----- haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | 61 +++++++++++++++++--------- haddock-api/src/Haddock/Convert.hs | 7 ++- haddock-api/src/Haddock/GhcUtils.hs | 33 +++++++------- haddock-api/src/Haddock/Interface/Create.hs | 31 +++++++------ haddock-api/src/Haddock/Interface/Rename.hs | 26 ++++++----- haddock-api/src/Haddock/Utils.hs | 7 ++- 8 files changed, 120 insertions(+), 88 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 79629515c0fd71baf182a487df94cb5eaa27ab47 From git at git.haskell.org Wed Jul 8 08:34:52 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:34:52 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Support for PartialTypeSignatures (0573481) Message-ID: <20150708083452.6A6853A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/0573481fd4ed19ce72e23d631a7e8e3d0e4cb288 >--------------------------------------------------------------- commit 0573481fd4ed19ce72e23d631a7e8e3d0e4cb288 Author: Thomas Winant Date: Wed Aug 6 10:26:54 2014 +0200 Support for PartialTypeSignatures Conflicts: haddock-api/src/Haddock/Backends/Xhtml/Decl.hs haddock-api/src/Haddock/Convert.hs haddock-api/src/Haddock/Interface/Create.hs >--------------------------------------------------------------- 0573481fd4ed19ce72e23d631a7e8e3d0e4cb288 haddock-api/src/Haddock/Backends/Hoogle.hs | 20 +++++++++--------- haddock-api/src/Haddock/Backends/LaTeX.hs | 27 +++++++++++++++--------- haddock-api/src/Haddock/Backends/Xhtml.hs | 2 +- haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | 29 ++++++++++++++++---------- haddock-api/src/Haddock/Convert.hs | 9 ++++---- haddock-api/src/Haddock/GhcUtils.hs | 8 +++---- haddock-api/src/Haddock/Interface/Create.hs | 18 ++++++++-------- haddock-api/src/Haddock/Interface/Rename.hs | 14 +++++++------ 8 files changed, 72 insertions(+), 55 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 0573481fd4ed19ce72e23d631a7e8e3d0e4cb288 From git at git.haskell.org Wed Jul 8 08:34:54 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:34:54 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: For pattern synonyms, render "pattern" as a keyword (3fd4c8c) Message-ID: <20150708083454.75D353A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/3fd4c8c0b1be302d209e580d7190aef7c923a2ee >--------------------------------------------------------------- commit 3fd4c8c0b1be302d209e580d7190aef7c923a2ee Author: Dr. ERDI Gergo Date: Sat Nov 29 15:39:09 2014 +0800 For pattern synonyms, render "pattern" as a keyword >--------------------------------------------------------------- 3fd4c8c0b1be302d209e580d7190aef7c923a2ee haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | 2 +- html-test/ref/Operators.html | 8 +++++-- html-test/ref/PatternSyns.html | 32 +++++++++++++++++++------- 3 files changed, 31 insertions(+), 11 deletions(-) diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs index 25a080d..a75553b 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs @@ -83,7 +83,7 @@ ppLPatSig summary links loc (doc, _argDocs) (L _ name) (expl, qtvs) lprov lreq t | otherwise = topDeclElem links loc splice [name] (pref1 <+> ppFixities fixities qual) +++ docSection Nothing qual doc where - pref1 = hsep [ toHtml "pattern" + pref1 = hsep [ keyword "pattern" , ppBinder summary occname , dcolon unicode , ppLTyVarBndrs expl qtvs unicode qual diff --git a/html-test/ref/Operators.html b/html-test/ref/Operators.html index 516fe60..e9be655 100644 --- a/html-test/ref/Operators.html +++ b/html-test/ref/Operators.html @@ -90,7 +90,9 @@ window.onload = function () {pageLoad();setSynopsis("mini_Operators.html");}; >

    • pattern pattern (:+) :: t -> t -> [t]

pattern pattern (:+) :: t -> t -> [t] infixr 3FooCtor x

  • pattern pattern Foo :: t -> FooType t
  • pattern pattern Bar :: t -> FooTypeFooType t)
  • pattern pattern (:<->) :: t -> t -> (FooTypeEmpty
  • pattern pattern E :: (><)
  • pattern pattern Foo :: t -> FooType

    pattern pattern Bar :: t -> FooType

    pattern pattern (:<->) :: t -> t -> (FooType

    pattern pattern E :: (><) Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/1739375eb23342618a3ac01c46a9e4a48cabf716 >--------------------------------------------------------------- commit 1739375eb23342618a3ac01c46a9e4a48cabf716 Author: Mateusz Kowalczyk Date: Fri Dec 12 07:48:42 2014 +0000 Various fixups and bumps for next release >--------------------------------------------------------------- 1739375eb23342618a3ac01c46a9e4a48cabf716 .travis.yml | 4 ++-- CHANGES | 2 +- ghc.mk | 7 +++---- haddock-api/haddock-api.cabal | 6 +++--- haddock-api/src/Haddock/Backends/Hoogle.hs | 2 +- haddock-api/src/Haddock/Backends/Xhtml.hs | 3 --- haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | 7 +++---- haddock-api/src/Haddock/Interface/Create.hs | 8 -------- haddock-api/src/Haddock/InterfaceFile.hs | 4 ++-- haddock-library/haddock-library.cabal | 2 +- haddock.cabal | 10 ++++++---- html-test/run.lhs | 2 +- 12 files changed, 23 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 1739375eb23342618a3ac01c46a9e4a48cabf716 From git at git.haskell.org Wed Jul 8 08:34:58 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:34:58 +0000 (UTC) Subject: [commit: haddock] wip/api-ann-hstylit-4: IEThingAbs now carries a Located name (1a507af) Message-ID: <20150708083458.937653A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/api-ann-hstylit-4 Link : http://git.haskell.org/haddock.git/commitdiff/1a507afaa2212634c7b5724ec6ca7e3699b714bf >--------------------------------------------------------------- commit 1a507afaa2212634c7b5724ec6ca7e3699b714bf Author: Alan Zimmerman Date: Sat Dec 13 12:05:09 2014 +0200 IEThingAbs now carries a Located name >--------------------------------------------------------------- 1a507afaa2212634c7b5724ec6ca7e3699b714bf src/Haddock/Interface/Create.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Haddock/Interface/Create.hs b/src/Haddock/Interface/Create.hs index 5420ef0..7b13ad6 100644 --- a/src/Haddock/Interface/Create.hs +++ b/src/Haddock/Interface/Create.hs @@ -493,7 +493,7 @@ mkExportItems Just exports -> liftM concat $ mapM lookupExport exports where lookupExport (IEVar (L _ x)) = declWith x - lookupExport (IEThingAbs t) = declWith t + lookupExport (IEThingAbs (L _ t)) = declWith t lookupExport (IEThingAll (L _ t)) = declWith t lookupExport (IEThingWith (L _ t) _) = declWith t lookupExport (IEModuleContents (L _ m)) = From git at git.haskell.org Wed Jul 8 08:35:00 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:35:00 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Remove redundant wild-card pattern match (b4b82e8) Message-ID: <20150708083500.A272E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/b4b82e84099196ff22762e90922aea48671781a2 >--------------------------------------------------------------- commit b4b82e84099196ff22762e90922aea48671781a2 Author: Herbert Valerio Riedel Date: Sun Dec 14 10:11:47 2014 +0100 Remove redundant wild-card pattern match (this would otherwise cause a build-failure with `-Werror`) >--------------------------------------------------------------- b4b82e84099196ff22762e90922aea48671781a2 haddock-api/src/Haddock/Convert.hs | 1 - 1 file changed, 1 deletion(-) diff --git a/haddock-api/src/Haddock/Convert.hs b/haddock-api/src/Haddock/Convert.hs index 3a77eca..1b1a8a8 100644 --- a/haddock-api/src/Haddock/Convert.hs +++ b/haddock-api/src/Haddock/Convert.hs @@ -173,7 +173,6 @@ synifyTyCon coax tc (brListMap (noLoc . synifyAxBranch tc) branches) BuiltInSynFamTyCon {} -> return $ ClosedTypeFamily [] AbstractClosedSynFamilyTyCon {} -> return $ ClosedTypeFamily [] - _ -> Left "synifyTyCon: type/data family confusion" in info >>= \i -> return (FamDecl (FamilyDecl { fdInfo = i From git at git.haskell.org Wed Jul 8 08:35:02 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:35:02 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Treat GHC 7.10 the same as GHC 7.9 (8cd72a0) Message-ID: <20150708083502.AEBCD3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/8cd72a05e857388e3ca184fbef3f04d3bffbc5b4 >--------------------------------------------------------------- commit 8cd72a05e857388e3ca184fbef3f04d3bffbc5b4 Author: Herbert Valerio Riedel Date: Sun Dec 14 10:17:06 2014 +0100 Treat GHC 7.10 the same as GHC 7.9 ...since the current GHC 7.9 is going to become GHC 7.10 real-soon-now anyway >--------------------------------------------------------------- 8cd72a05e857388e3ca184fbef3f04d3bffbc5b4 haddock-api/src/Haddock/InterfaceFile.hs | 2 +- haddock.cabal | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/haddock-api/src/Haddock/InterfaceFile.hs b/haddock-api/src/Haddock/InterfaceFile.hs index ad00635..b0df549 100644 --- a/haddock-api/src/Haddock/InterfaceFile.hs +++ b/haddock-api/src/Haddock/InterfaceFile.hs @@ -76,7 +76,7 @@ binaryInterfaceMagic = 0xD0Cface -- (2) set `binaryInterfaceVersionCompatibility` to [binaryInterfaceVersion] -- binaryInterfaceVersion :: Word16 -#if __GLASGOW_HASKELL__ == 709 +#if (__GLASGOW_HASKELL__ >= 709) && (__GLASGOW_HASKELL__ < 711) binaryInterfaceVersion = 27 binaryInterfaceVersionCompatibility :: [Word16] diff --git a/haddock.cabal b/haddock.cabal index 8153af1..fbb4bfe 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -57,7 +57,7 @@ executable haddock array, xhtml >= 3000.2 && < 3000.3, Cabal >= 1.10, - ghc == 7.9.*, + ghc >= 7.9 && < 7.11, bytestring, transformers From git at git.haskell.org Wed Jul 8 08:35:04 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:35:04 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, wip/10268, wip/10313, wip/D538, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Fixup ghc.mk (follow-up to 1739375eb23342) (179a3fa) Message-ID: <20150708083504.BA38F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,wip/10268,wip/10313,wip/D538,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/179a3faca1524f6cb1cd21e0cefc2000bb6480be >--------------------------------------------------------------- commit 179a3faca1524f6cb1cd21e0cefc2000bb6480be Author: Herbert Valerio Riedel Date: Sun Dec 14 18:26:50 2014 +0100 Fixup ghc.mk (follow-up to 1739375eb23342) This makes the GHC build-system aware of the data-files to be copied into the bindist (as haddock.cabal doesn't list those anymore) >--------------------------------------------------------------- 179a3faca1524f6cb1cd21e0cefc2000bb6480be ghc.mk | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/ghc.mk b/ghc.mk index e8bf736..a3bb834 100644 --- a/ghc.mk +++ b/ghc.mk @@ -36,6 +36,19 @@ endif utils/haddock_dist_MODULES += Paths_haddock +utils/haddock_dist_DATA_FILES += html/frames.html +utils/haddock_dist_DATA_FILES += html/haddock-util.js +utils/haddock_dist_DATA_FILES += html/Classic.theme/haskell_icon.gif +utils/haddock_dist_DATA_FILES += html/Classic.theme/minus.gif +utils/haddock_dist_DATA_FILES += html/Classic.theme/plus.gif +utils/haddock_dist_DATA_FILES += html/Classic.theme/xhaddock.css +utils/haddock_dist_DATA_FILES += html/Ocean.std-theme/hslogo-16.png +utils/haddock_dist_DATA_FILES += html/Ocean.std-theme/minus.gif +utils/haddock_dist_DATA_FILES += html/Ocean.std-theme/ocean.css +utils/haddock_dist_DATA_FILES += html/Ocean.std-theme/plus.gif +utils/haddock_dist_DATA_FILES += html/Ocean.std-theme/synopsis.png +utils/haddock_dist_DATA_FILES += latex/haddock.sty + ifeq "$(HADDOCK_DOCS)" "YES" install: install_utils/haddock_data ifeq "$(Windows_Host)" "NO" @@ -55,4 +68,4 @@ install_utils/haddock_link: $(call removeFiles,"$(DESTDIR)$(bindir)/haddock") $(LN_S) $(utils/haddock_dist_INSTALL_SHELL_WRAPPER_NAME) "$(DESTDIR)$(bindir)/haddock" -BINDIST_EXTRAS += $(addprefix utils/haddock/resources/,$(utils/haddock_dist_DATA_FILES)) +BINDIST_EXTRAS += $(addprefix utils/haddock/haddock-api/resources/,$(utils/haddock_dist_DATA_FILES)) From git at git.haskell.org Wed Jul 8 08:35:06 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:35:06 +0000 (UTC) Subject: [commit: haddock] wip/api-ann-hstylit-5: IEThingAbs now carries a Located name (126d5a1) Message-ID: <20150708083506.C7A5B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/api-ann-hstylit-5 Link : http://git.haskell.org/haddock.git/commitdiff/126d5a1553782ec71a93d6cba920f748869b98b0 >--------------------------------------------------------------- commit 126d5a1553782ec71a93d6cba920f748869b98b0 Author: Alan Zimmerman Date: Sat Dec 13 12:05:09 2014 +0200 IEThingAbs now carries a Located name >--------------------------------------------------------------- 126d5a1553782ec71a93d6cba920f748869b98b0 src/Haddock/GhcUtils.hs | 4 +++- src/Haddock/Interface/Create.hs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Haddock/GhcUtils.hs b/src/Haddock/GhcUtils.hs index 9f9b269..c33c27b 100644 --- a/src/Haddock/GhcUtils.hs +++ b/src/Haddock/GhcUtils.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleInstances, ViewPatterns #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {-# OPTIONS_HADDOCK hide #-} @@ -185,10 +186,11 @@ before = (<) `on` getLoc instance Foldable (GenLocated l) where foldMap f (L _ x) = f x - +#if __GLASGOW_HASKELL__ < 709 instance Traversable (GenLocated l) where mapM f (L l x) = (return . L l) =<< f x traverse f (L l x) = L l <$> f x +#endif ------------------------------------------------------------------------------- -- * NamedThing instances diff --git a/src/Haddock/Interface/Create.hs b/src/Haddock/Interface/Create.hs index 5420ef0..7b13ad6 100644 --- a/src/Haddock/Interface/Create.hs +++ b/src/Haddock/Interface/Create.hs @@ -493,7 +493,7 @@ mkExportItems Just exports -> liftM concat $ mapM lookupExport exports where lookupExport (IEVar (L _ x)) = declWith x - lookupExport (IEThingAbs t) = declWith t + lookupExport (IEThingAbs (L _ t)) = declWith t lookupExport (IEThingAll (L _ t)) = declWith t lookupExport (IEThingWith (L _ t) _) = declWith t lookupExport (IEModuleContents (L _ m)) = From git at git.haskell.org Wed Jul 8 08:35:08 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:35:08 +0000 (UTC) Subject: [commit: haddock] wip/api-ann-hstylit-5: Add Location in KindedTyVar (597c878) Message-ID: <20150708083508.D7CAF3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/api-ann-hstylit-5 Link : http://git.haskell.org/haddock.git/commitdiff/597c878101eced8b506db54e25e8a703ac165cca >--------------------------------------------------------------- commit 597c878101eced8b506db54e25e8a703ac165cca Author: Alan Zimmerman Date: Tue Dec 16 10:13:50 2014 +0200 Add Location in KindedTyVar >--------------------------------------------------------------- 597c878101eced8b506db54e25e8a703ac165cca src/Haddock/Convert.hs | 4 ++-- src/Haddock/Interface/Rename.hs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Haddock/Convert.hs b/src/Haddock/Convert.hs index 47ec777..61c7067 100644 --- a/src/Haddock/Convert.hs +++ b/src/Haddock/Convert.hs @@ -136,7 +136,7 @@ synifyTyCon coax tc = DataDecl { tcdLName = synifyName tc , tcdTyVars = -- tyConTyVars doesn't work on fun/prim, but we can make them up: let mk_hs_tv realKind fakeTyVar - = noLoc $ KindedTyVar (getName fakeTyVar) + = noLoc $ KindedTyVar (noLoc (getName fakeTyVar)) (synifyKindSig realKind) in HsQTvs { hsq_kvs = [] -- No kind polymorphism , hsq_tvs = zipWith mk_hs_tv (fst (splitKindFunTys (tyConKind tc))) @@ -292,7 +292,7 @@ synifyTyVars ktvs = HsQTvs { hsq_kvs = map tyVarName kvs (kvs, tvs) = partition isKindVar ktvs synifyTyVar tv | isLiftedTypeKind kind = noLoc (UserTyVar name) - | otherwise = noLoc (KindedTyVar name (synifyKindSig kind)) + | otherwise = noLoc (KindedTyVar (noLoc name) (synifyKindSig kind)) where kind = tyVarKind tv name = getName tv diff --git a/src/Haddock/Interface/Rename.hs b/src/Haddock/Interface/Rename.hs index 3f324f4..6c3e194 100644 --- a/src/Haddock/Interface/Rename.hs +++ b/src/Haddock/Interface/Rename.hs @@ -252,10 +252,10 @@ renameLTyVarBndr :: LHsTyVarBndr Name -> RnM (LHsTyVarBndr DocName) renameLTyVarBndr (L loc (UserTyVar n)) = do { n' <- rename n ; return (L loc (UserTyVar n')) } -renameLTyVarBndr (L loc (KindedTyVar n kind)) +renameLTyVarBndr (L loc (KindedTyVar (L lv n) kind)) = do { n' <- rename n ; kind' <- renameLKind kind - ; return (L loc (KindedTyVar n' kind')) } + ; return (L loc (KindedTyVar (L lv n') kind')) } renameLContext :: Located [LHsType Name] -> RnM (Located [LHsType DocName]) renameLContext (L loc context) = do From git at git.haskell.org Wed Jul 8 08:35:10 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:35:10 +0000 (UTC) Subject: [commit: haddock] wip/api-ann-hstylit-5: Remove Traversable instance for GenLocated SrcSpan (5ccca44) Message-ID: <20150708083510.E570C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/api-ann-hstylit-5 Link : http://git.haskell.org/haddock.git/commitdiff/5ccca44efa0833227622973276c4f63566fc27ab >--------------------------------------------------------------- commit 5ccca44efa0833227622973276c4f63566fc27ab Author: Alan Zimmerman Date: Tue Dec 16 16:06:21 2014 +0200 Remove Traversable instance for GenLocated SrcSpan >--------------------------------------------------------------- 5ccca44efa0833227622973276c4f63566fc27ab src/Haddock/GhcUtils.hs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/Haddock/GhcUtils.hs b/src/Haddock/GhcUtils.hs index c33c27b..918edab 100644 --- a/src/Haddock/GhcUtils.hs +++ b/src/Haddock/GhcUtils.hs @@ -1,4 +1,3 @@ -{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleInstances, ViewPatterns #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {-# OPTIONS_HADDOCK hide #-} @@ -186,12 +185,6 @@ before = (<) `on` getLoc instance Foldable (GenLocated l) where foldMap f (L _ x) = f x -#if __GLASGOW_HASKELL__ < 709 -instance Traversable (GenLocated l) where - mapM f (L l x) = (return . L l) =<< f x - traverse f (L l x) = L l <$> f x -#endif - ------------------------------------------------------------------------------- -- * NamedThing instances ------------------------------------------------------------------------------- From git at git.haskell.org Wed Jul 8 08:35:12 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:35:12 +0000 (UTC) Subject: [commit: haddock] wip/D538: Fix import of 'empty' due to AMP. (8cd8010) Message-ID: <20150708083512.F367D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/D538 Link : http://git.haskell.org/haddock.git/commitdiff/8cd801073d9331779a92ada7b97346c10764ce0a >--------------------------------------------------------------- commit 8cd801073d9331779a92ada7b97346c10764ce0a Author: Austin Seipp Date: Tue Sep 9 01:03:27 2014 -0500 Fix import of 'empty' due to AMP. Signed-off-by: Austin Seipp >--------------------------------------------------------------- 8cd801073d9331779a92ada7b97346c10764ce0a haddock-api/src/Haddock/Backends/LaTeX.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haddock-api/src/Haddock/Backends/LaTeX.hs b/haddock-api/src/Haddock/Backends/LaTeX.hs index b717fc0..8e781d1 100644 --- a/haddock-api/src/Haddock/Backends/LaTeX.hs +++ b/haddock-api/src/Haddock/Backends/LaTeX.hs @@ -32,7 +32,7 @@ import qualified Data.Map as Map import System.Directory import System.FilePath import Data.Char -import Control.Monad +import Control.Monad hiding (empty) import Data.Maybe import Data.List From git at git.haskell.org Wed Jul 8 08:35:15 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:35:15 +0000 (UTC) Subject: [commit: haddock] wip/D538: Revert "Fix import of 'empty' due to AMP." (1169625) Message-ID: <20150708083515.0CB5F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/D538 Link : http://git.haskell.org/haddock.git/commitdiff/1169625d3f26a9f5e3290913e908aa4af368e5b0 >--------------------------------------------------------------- commit 1169625d3f26a9f5e3290913e908aa4af368e5b0 Author: Herbert Valerio Riedel Date: Fri Sep 26 19:18:28 2014 +0200 Revert "Fix import of 'empty' due to AMP." This reverts commit 0cc5bc85e9fca92ab712b68a2ba2c0dd9d3d79f4 since it turns out we don't need to re-export `empty` from Control.Monad after all. >--------------------------------------------------------------- 1169625d3f26a9f5e3290913e908aa4af368e5b0 haddock-api/src/Haddock/Backends/LaTeX.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haddock-api/src/Haddock/Backends/LaTeX.hs b/haddock-api/src/Haddock/Backends/LaTeX.hs index 8e781d1..b717fc0 100644 --- a/haddock-api/src/Haddock/Backends/LaTeX.hs +++ b/haddock-api/src/Haddock/Backends/LaTeX.hs @@ -32,7 +32,7 @@ import qualified Data.Map as Map import System.Directory import System.FilePath import Data.Char -import Control.Monad hiding (empty) +import Control.Monad import Data.Maybe import Data.List From git at git.haskell.org Wed Jul 8 08:35:17 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:35:17 +0000 (UTC) Subject: [commit: haddock] wip/D538: HsTyLit now has a SourceText field (8b4886a) Message-ID: <20150708083517.1B6573A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/D538 Link : http://git.haskell.org/haddock.git/commitdiff/8b4886a617ac72a4b80e672beda98c5bd02aa33f >--------------------------------------------------------------- commit 8b4886a617ac72a4b80e672beda98c5bd02aa33f Author: Alan Zimmerman Date: Sun Nov 30 22:15:32 2014 +0200 HsTyLit now has a SourceText field Summary: HsTyLit now has a SourceText field Depends on D538 Reviewers: austin, Fuuzetsu Differential Revision: https://phabricator.haskell.org/D539 >--------------------------------------------------------------- 8b4886a617ac72a4b80e672beda98c5bd02aa33f haddock-api/src/Haddock/Backends/LaTeX.hs | 4 ++-- haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | 4 ++-- haddock-api/src/Haddock/Convert.hs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/haddock-api/src/Haddock/Backends/LaTeX.hs b/haddock-api/src/Haddock/Backends/LaTeX.hs index b717fc0..9bac9d0 100644 --- a/haddock-api/src/Haddock/Backends/LaTeX.hs +++ b/haddock-api/src/Haddock/Backends/LaTeX.hs @@ -948,8 +948,8 @@ ppr_mono_ty _ (HsTyLit t) u = ppr_tylit t u ppr_tylit :: HsTyLit -> Bool -> LaTeX -ppr_tylit (HsNumTy n) _ = integer n -ppr_tylit (HsStrTy s) _ = text (show s) +ppr_tylit (HsNumTy _ n) _ = integer n +ppr_tylit (HsStrTy _ s) _ = text (show s) -- XXX: Ok in verbatim, but not otherwise -- XXX: Do something with Unicode parameter? diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs index 3bf4322..ae89fb3 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs @@ -907,8 +907,8 @@ ppr_mono_ty _ (HsNamedWildcardTy name) _ q = ppDocName q Prefix True name ppr_mono_ty _ (HsTyLit n) _ _ = ppr_tylit n ppr_tylit :: HsTyLit -> Html -ppr_tylit (HsNumTy n) = toHtml (show n) -ppr_tylit (HsStrTy s) = toHtml (show s) +ppr_tylit (HsNumTy _ n) = toHtml (show n) +ppr_tylit (HsStrTy _ s) = toHtml (show s) ppr_fun_ty :: Int -> LHsType DocName -> LHsType DocName -> Unicode -> Qualification -> Html diff --git a/haddock-api/src/Haddock/Convert.hs b/haddock-api/src/Haddock/Convert.hs index 1b1a8a8..4c019bc 100644 --- a/haddock-api/src/Haddock/Convert.hs +++ b/haddock-api/src/Haddock/Convert.hs @@ -384,8 +384,8 @@ synifyType s forallty@(ForAllTy _tv _ty) = synifyType _ (LitTy t) = noLoc $ HsTyLit $ synifyTyLit t synifyTyLit :: TyLit -> HsTyLit -synifyTyLit (NumTyLit n) = HsNumTy n -synifyTyLit (StrTyLit s) = HsStrTy s +synifyTyLit (NumTyLit n) = HsNumTy mempty n +synifyTyLit (StrTyLit s) = HsStrTy mempty s synifyKindSig :: Kind -> LHsKind Name synifyKindSig k = synifyType WithinType k From git at git.haskell.org Wed Jul 8 08:35:19 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:35:19 +0000 (UTC) Subject: [commit: haddock] wip/D538: Adding SourceText to pragma declarations (ade0426) Message-ID: <20150708083519.2BAB73A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/D538 Link : http://git.haskell.org/haddock.git/commitdiff/ade04264df95ebebec1a4c15b2ba222aa40b67ed >--------------------------------------------------------------- commit ade04264df95ebebec1a4c15b2ba222aa40b67ed Author: Alan Zimmerman Date: Sun Dec 7 10:42:56 2014 +0200 Adding SourceText to pragma declarations >--------------------------------------------------------------- ade04264df95ebebec1a4c15b2ba222aa40b67ed haddock-api/src/Haddock/Backends/Hoogle.hs | 2 +- haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | 2 +- haddock-api/src/Haddock/Convert.hs | 6 +++--- haddock-api/src/Haddock/GhcUtils.hs | 4 ++-- haddock-api/src/Haddock/Interface/Create.hs | 8 ++++---- haddock-api/src/Haddock/Interface/Rename.hs | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/haddock-api/src/Haddock/Backends/Hoogle.hs b/haddock-api/src/Haddock/Backends/Hoogle.hs index dd10bb0..6353a5f 100644 --- a/haddock-api/src/Haddock/Backends/Hoogle.hs +++ b/haddock-api/src/Haddock/Backends/Hoogle.hs @@ -145,7 +145,7 @@ ppClass dflags x = out dflags x{tcdSigs=[]} : concatMap (ppSig dflags . addContext . unL) (tcdSigs x) where addContext (TypeSig name (L l sig) nwcs) = TypeSig name (L l $ f sig) nwcs - addContext (MinimalSig sig) = MinimalSig sig + addContext (MinimalSig src sig) = MinimalSig src sig addContext _ = error "expected TypeSig" f (HsForAllTy a b c con d) = HsForAllTy a b c (reL (context : unLoc con)) d diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs index ae89fb3..20cac37 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs @@ -470,7 +470,7 @@ ppClassDecl summary links instances fixities loc d subdocs -- there are different subdocs for different names in a single -- type signature? - minimalBit = case [ s | L _ (MinimalSig s) <- lsigs ] of + minimalBit = case [ s | L _ (MinimalSig _ s) <- lsigs ] of -- Miminal complete definition = every shown method And xs : _ | sort [getName n | Var (L _ n) <- xs] == sort [getName n | L _ (TypeSig ns _ _) <- lsigs, L _ n <- ns] diff --git a/haddock-api/src/Haddock/Convert.hs b/haddock-api/src/Haddock/Convert.hs index 4c019bc..a5b97ad 100644 --- a/haddock-api/src/Haddock/Convert.hs +++ b/haddock-api/src/Haddock/Convert.hs @@ -77,7 +77,7 @@ tyThingToLHsDecl t = case t of , tcdFDs = map (\ (l,r) -> noLoc (map getName l, map getName r) ) $ snd $ classTvsFds cl - , tcdSigs = noLoc (MinimalSig . fmap noLoc $ classMinimalDef cl) : + , tcdSigs = noLoc (MinimalSig mempty . fmap noLoc $ classMinimalDef cl) : map (noLoc . synifyIdSig DeleteTopLevelQuantification) (classMethods cl) , tcdMeths = emptyBag --ignore default method definitions, they don't affect signature @@ -265,8 +265,8 @@ synifyDataCon use_gadt_syntax dc = linear_tys = zipWith (\ty bang -> let tySyn = synifyType WithinType ty src_bang = case bang of - HsUnpack {} -> HsUserBang (Just True) True - HsStrict -> HsUserBang (Just False) True + HsUnpack {} -> HsUserBang Nothing (Just True) True + HsStrict -> HsUserBang Nothing (Just False) True _ -> bang in case src_bang of HsNoBang -> tySyn diff --git a/haddock-api/src/Haddock/GhcUtils.hs b/haddock-api/src/Haddock/GhcUtils.hs index 5aa9b81..cbf554a 100644 --- a/haddock-api/src/Haddock/GhcUtils.hs +++ b/haddock-api/src/Haddock/GhcUtils.hs @@ -104,8 +104,8 @@ filterSigNames p (FixSig (FixitySig ns ty)) = case filter (p . unLoc) ns of [] -> Nothing filtered -> Just (FixSig (FixitySig filtered ty)) -filterSigNames _ orig@(MinimalSig _) = Just orig -filterSigNames p (TypeSig ns ty nwcs) = +filterSigNames _ orig@(MinimalSig _ _) = Just orig +filterSigNames p (TypeSig ns ty nwcs) = case filter (p . unLoc) ns of [] -> Nothing filtered -> Just (TypeSig filtered ty nwcs) diff --git a/haddock-api/src/Haddock/Interface/Create.hs b/haddock-api/src/Haddock/Interface/Create.hs index 98a715a..8de8c62 100644 --- a/haddock-api/src/Haddock/Interface/Create.hs +++ b/haddock-api/src/Haddock/Interface/Create.hs @@ -194,8 +194,8 @@ moduleWarning dflags gre (WarnAll w) = Just $ parseWarning dflags gre w parseWarning :: DynFlags -> GlobalRdrEnv -> WarningTxt -> Doc Name parseWarning dflags gre w = force $ case w of - DeprecatedTxt msg -> format "Deprecated: " (concatFS $ map unLoc msg) - WarningTxt msg -> format "Warning: " (concatFS $ map unLoc msg) + DeprecatedTxt _ msg -> format "Deprecated: " (concatFS $ map unLoc msg) + WarningTxt _ msg -> format "Warning: " (concatFS $ map unLoc msg) where format x xs = DocWarning . DocParagraph . DocAppend (DocString x) . processDocString dflags gre $ HsDocString xs @@ -553,7 +553,7 @@ mkExportItems L loc (TyClD cl at ClassDecl{}) -> do mdef <- liftGhcToErrMsgGhc $ minimalDef t - let sig = maybeToList $ fmap (noLoc . MinimalSig . fmap noLoc) mdef + let sig = maybeToList $ fmap (noLoc . MinimalSig mempty . fmap noLoc) mdef return [ mkExportDecl t (L loc $ TyClD cl { tcdSigs = sig ++ tcdSigs cl }) docs_ ] @@ -745,7 +745,7 @@ fullModuleContents dflags warnings gre (docMap, argMap, subMap, declMap, instMap return $ Just (ExportDecl decl doc subs [] (fixities name subs) (l `elem` splices)) mkExportItem (L l (TyClD cl at ClassDecl{ tcdLName = L _ name, tcdSigs = sigs })) = do mdef <- liftGhcToErrMsgGhc $ minimalDef name - let sig = maybeToList $ fmap (noLoc . MinimalSig . fmap noLoc) mdef + let sig = maybeToList $ fmap (noLoc . MinimalSig mempty . fmap noLoc) mdef expDecl (L l (TyClD cl { tcdSigs = sig ++ sigs })) l name mkExportItem decl@(L l d) | name:_ <- getMainDeclBinder d = expDecl decl l name diff --git a/haddock-api/src/Haddock/Interface/Rename.hs b/haddock-api/src/Haddock/Interface/Rename.hs index 1ea212f..719c068 100644 --- a/haddock-api/src/Haddock/Interface/Rename.hs +++ b/haddock-api/src/Haddock/Interface/Rename.hs @@ -415,7 +415,7 @@ renameSig sig = case sig of FixSig (FixitySig lnames fixity) -> do lnames' <- mapM renameL lnames return $ FixSig (FixitySig lnames' fixity) - MinimalSig s -> MinimalSig <$> traverse renameL s + MinimalSig src s -> MinimalSig src <$> traverse renameL s -- we have filtered out all other kinds of signatures in Interface.Create _ -> error "expected TypeSig" From git at git.haskell.org Wed Jul 8 08:35:21 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:35:21 +0000 (UTC) Subject: [commit: haddock] wip/D538: FunDeps are Located (39f8cae) Message-ID: <20150708083521.3C0053A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/D538 Link : http://git.haskell.org/haddock.git/commitdiff/39f8cae1051b7fe9f6fbf97ad2ae58ba5db23520 >--------------------------------------------------------------- commit 39f8cae1051b7fe9f6fbf97ad2ae58ba5db23520 Author: Alan Zimmerman Date: Tue Dec 9 23:49:49 2014 +0200 FunDeps are Located >--------------------------------------------------------------- 39f8cae1051b7fe9f6fbf97ad2ae58ba5db23520 haddock-api/src/Haddock/Backends/LaTeX.hs | 8 ++++---- haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | 6 +++--- haddock-api/src/Haddock/Convert.hs | 2 +- haddock-api/src/Haddock/Interface/Rename.hs | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/haddock-api/src/Haddock/Backends/LaTeX.hs b/haddock-api/src/Haddock/Backends/LaTeX.hs index 9bac9d0..5046da8 100644 --- a/haddock-api/src/Haddock/Backends/LaTeX.hs +++ b/haddock-api/src/Haddock/Backends/LaTeX.hs @@ -477,7 +477,7 @@ rDoc = maybeDoc . fmap latexStripTrailingWhitespace ppClassHdr :: Bool -> Located [LHsType DocName] -> DocName - -> LHsTyVarBndrs DocName -> [Located ([DocName], [DocName])] + -> LHsTyVarBndrs DocName -> [Located ([Located DocName], [Located DocName])] -> Bool -> LaTeX ppClassHdr summ lctxt n tvs fds unicode = keyword "class" @@ -486,13 +486,13 @@ ppClassHdr summ lctxt n tvs fds unicode = <+> ppFds fds unicode -ppFds :: [Located ([DocName], [DocName])] -> Bool -> LaTeX +ppFds :: [Located ([Located DocName], [Located DocName])] -> Bool -> LaTeX ppFds fds unicode = if null fds then empty else char '|' <+> hsep (punctuate comma (map (fundep . unLoc) fds)) where - fundep (vars1,vars2) = hsep (map ppDocName vars1) <+> arrow unicode <+> - hsep (map ppDocName vars2) + fundep (vars1,vars2) = hsep (map (ppDocName . unLoc) vars1) <+> arrow unicode <+> + hsep (map (ppDocName . unLoc) vars2) ppClassDecl :: [DocInstance DocName] -> SrcSpan diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs index 20cac37..5b88fb4 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs @@ -381,7 +381,7 @@ ppHsContext cxt unicode qual = parenList (map (ppType unicode qual) cxt) ppClassHdr :: Bool -> Located [LHsType DocName] -> DocName - -> LHsTyVarBndrs DocName -> [Located ([DocName], [DocName])] + -> LHsTyVarBndrs DocName -> [Located ([Located DocName], [Located DocName])] -> Unicode -> Qualification -> Html ppClassHdr summ lctxt n tvs fds unicode qual = keyword "class" @@ -390,13 +390,13 @@ ppClassHdr summ lctxt n tvs fds unicode qual = <+> ppFds fds unicode qual -ppFds :: [Located ([DocName], [DocName])] -> Unicode -> Qualification -> Html +ppFds :: [Located ([Located DocName], [Located DocName])] -> Unicode -> Qualification -> Html ppFds fds unicode qual = if null fds then noHtml else char '|' <+> hsep (punctuate comma (map (fundep . unLoc) fds)) where fundep (vars1,vars2) = ppVars vars1 <+> arrow unicode <+> ppVars vars2 - ppVars = hsep . map (ppDocName qual Prefix True) + ppVars = hsep . map ((ppDocName qual Prefix True) . unLoc) ppShortClassDecl :: Bool -> LinksInfo -> TyClDecl DocName -> SrcSpan -> [(DocName, DocForDecl DocName)] diff --git a/haddock-api/src/Haddock/Convert.hs b/haddock-api/src/Haddock/Convert.hs index a5b97ad..5606abf 100644 --- a/haddock-api/src/Haddock/Convert.hs +++ b/haddock-api/src/Haddock/Convert.hs @@ -75,7 +75,7 @@ tyThingToLHsDecl t = case t of , tcdLName = synifyName cl , tcdTyVars = synifyTyVars (classTyVars cl) , tcdFDs = map (\ (l,r) -> noLoc - (map getName l, map getName r) ) $ + (map (noLoc . getName) l, map (noLoc . getName) r) ) $ snd $ classTvsFds cl , tcdSigs = noLoc (MinimalSig mempty . fmap noLoc $ classMinimalDef cl) : map (noLoc . synifyIdSig DeleteTopLevelQuantification) diff --git a/haddock-api/src/Haddock/Interface/Rename.hs b/haddock-api/src/Haddock/Interface/Rename.hs index 719c068..b222a39 100644 --- a/haddock-api/src/Haddock/Interface/Rename.hs +++ b/haddock-api/src/Haddock/Interface/Rename.hs @@ -331,9 +331,9 @@ renameTyClD d = case d of where renameLFunDep (L loc (xs, ys)) = do - xs' <- mapM rename xs - ys' <- mapM rename ys - return (L loc (xs', ys')) + xs' <- mapM rename (map unLoc xs) + ys' <- mapM rename (map unLoc ys) + return (L loc (map noLoc xs', map noLoc ys')) renameLSig (L loc sig) = return . L loc =<< renameSig sig From git at git.haskell.org Wed Jul 8 08:35:23 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:35:23 +0000 (UTC) Subject: [commit: haddock] wip/D538: Make RecCon payload Located (90a816e) Message-ID: <20150708083523.502013A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/D538 Link : http://git.haskell.org/haddock.git/commitdiff/90a816e99fd242864796dcefb09ae934e207da19 >--------------------------------------------------------------- commit 90a816e99fd242864796dcefb09ae934e207da19 Author: Alan Zimmerman Date: Wed Dec 10 23:22:50 2014 +0200 Make RecCon payload Located >--------------------------------------------------------------- 90a816e99fd242864796dcefb09ae934e207da19 haddock-api/src/Haddock/Backends/Hoogle.hs | 2 +- haddock-api/src/Haddock/Backends/LaTeX.hs | 4 ++-- haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | 8 ++++---- haddock-api/src/Haddock/Convert.hs | 2 +- haddock-api/src/Haddock/GhcUtils.hs | 2 +- haddock-api/src/Haddock/Interface/Create.hs | 6 +++--- haddock-api/src/Haddock/Interface/Rename.hs | 4 ++-- haddock-api/src/Haddock/Utils.hs | 4 ++-- 8 files changed, 16 insertions(+), 16 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 90a816e99fd242864796dcefb09ae934e207da19 From git at git.haskell.org Wed Jul 8 08:35:25 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:35:25 +0000 (UTC) Subject: [commit: haddock] wip/D538: IEThingAbs now carries a Located name (fced924) Message-ID: <20150708083525.5B7253A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/D538 Link : http://git.haskell.org/haddock.git/commitdiff/fced9248d5db11b393c4a246b5b0fe8044ec9d0e >--------------------------------------------------------------- commit fced9248d5db11b393c4a246b5b0fe8044ec9d0e Author: Alan Zimmerman Date: Sat Dec 13 12:05:09 2014 +0200 IEThingAbs now carries a Located name >--------------------------------------------------------------- fced9248d5db11b393c4a246b5b0fe8044ec9d0e haddock-api/src/Haddock/GhcUtils.hs | 4 +++- haddock-api/src/Haddock/Interface/Create.hs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/haddock-api/src/Haddock/GhcUtils.hs b/haddock-api/src/Haddock/GhcUtils.hs index 9f9b269..c33c27b 100644 --- a/haddock-api/src/Haddock/GhcUtils.hs +++ b/haddock-api/src/Haddock/GhcUtils.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleInstances, ViewPatterns #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {-# OPTIONS_HADDOCK hide #-} @@ -185,10 +186,11 @@ before = (<) `on` getLoc instance Foldable (GenLocated l) where foldMap f (L _ x) = f x - +#if __GLASGOW_HASKELL__ < 709 instance Traversable (GenLocated l) where mapM f (L l x) = (return . L l) =<< f x traverse f (L l x) = L l <$> f x +#endif ------------------------------------------------------------------------------- -- * NamedThing instances diff --git a/haddock-api/src/Haddock/Interface/Create.hs b/haddock-api/src/Haddock/Interface/Create.hs index f714e2f..68a98c8 100644 --- a/haddock-api/src/Haddock/Interface/Create.hs +++ b/haddock-api/src/Haddock/Interface/Create.hs @@ -496,7 +496,7 @@ mkExportItems Just exports -> liftM concat $ mapM lookupExport exports where lookupExport (IEVar (L _ x)) = declWith x - lookupExport (IEThingAbs t) = declWith t + lookupExport (IEThingAbs (L _ t)) = declWith t lookupExport (IEThingAll (L _ t)) = declWith t lookupExport (IEThingWith (L _ t) _) = declWith t lookupExport (IEModuleContents (L _ m)) = From git at git.haskell.org Wed Jul 8 08:35:27 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:35:27 +0000 (UTC) Subject: [commit: haddock] wip/D538: Remove Traversable instance for GenLocated SrcSpan (20a7845) Message-ID: <20150708083527.66FCE3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/D538 Link : http://git.haskell.org/haddock.git/commitdiff/20a7845cf8f482d26a8accef7d2bd7658fbba5ae >--------------------------------------------------------------- commit 20a7845cf8f482d26a8accef7d2bd7658fbba5ae Author: Alan Zimmerman Date: Tue Dec 16 16:06:21 2014 +0200 Remove Traversable instance for GenLocated SrcSpan >--------------------------------------------------------------- 20a7845cf8f482d26a8accef7d2bd7658fbba5ae haddock-api/src/Haddock/GhcUtils.hs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/haddock-api/src/Haddock/GhcUtils.hs b/haddock-api/src/Haddock/GhcUtils.hs index c33c27b..918edab 100644 --- a/haddock-api/src/Haddock/GhcUtils.hs +++ b/haddock-api/src/Haddock/GhcUtils.hs @@ -1,4 +1,3 @@ -{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleInstances, ViewPatterns #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {-# OPTIONS_HADDOCK hide #-} @@ -186,12 +185,6 @@ before = (<) `on` getLoc instance Foldable (GenLocated l) where foldMap f (L _ x) = f x -#if __GLASGOW_HASKELL__ < 709 -instance Traversable (GenLocated l) where - mapM f (L l x) = (return . L l) =<< f x - traverse f (L l x) = L l <$> f x -#endif - ------------------------------------------------------------------------------- -- * NamedThing instances ------------------------------------------------------------------------------- From git at git.haskell.org Wed Jul 8 08:35:29 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:35:29 +0000 (UTC) Subject: [commit: haddock] wip/D538: Add Location in KindedTyVar (704efef) Message-ID: <20150708083529.743523A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/D538 Link : http://git.haskell.org/haddock.git/commitdiff/704efefdf2228779e52221e9a82821a605a6c832 >--------------------------------------------------------------- commit 704efefdf2228779e52221e9a82821a605a6c832 Author: Alan Zimmerman Date: Tue Dec 16 10:13:50 2014 +0200 Add Location in KindedTyVar >--------------------------------------------------------------- 704efefdf2228779e52221e9a82821a605a6c832 haddock-api/src/Haddock/Convert.hs | 4 ++-- haddock-api/src/Haddock/Interface/Rename.hs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/haddock-api/src/Haddock/Convert.hs b/haddock-api/src/Haddock/Convert.hs index 7799794..632d3bc 100644 --- a/haddock-api/src/Haddock/Convert.hs +++ b/haddock-api/src/Haddock/Convert.hs @@ -146,7 +146,7 @@ synifyTyCon coax tc DataDecl { tcdLName = synifyName tc , tcdTyVars = -- tyConTyVars doesn't work on fun/prim, but we can make them up: let mk_hs_tv realKind fakeTyVar - = noLoc $ KindedTyVar (getName fakeTyVar) + = noLoc $ KindedTyVar (noLoc (getName fakeTyVar)) (synifyKindSig realKind) in HsQTvs { hsq_kvs = [] -- No kind polymorphism , hsq_tvs = zipWith mk_hs_tv (fst (splitKindFunTys (tyConKind tc))) @@ -313,7 +313,7 @@ synifyTyVars ktvs = HsQTvs { hsq_kvs = map tyVarName kvs (kvs, tvs) = partition isKindVar ktvs synifyTyVar tv | isLiftedTypeKind kind = noLoc (UserTyVar name) - | otherwise = noLoc (KindedTyVar name (synifyKindSig kind)) + | otherwise = noLoc (KindedTyVar (noLoc name) (synifyKindSig kind)) where kind = tyVarKind tv name = getName tv diff --git a/haddock-api/src/Haddock/Interface/Rename.hs b/haddock-api/src/Haddock/Interface/Rename.hs index 862d5ec..fbdbac9 100644 --- a/haddock-api/src/Haddock/Interface/Rename.hs +++ b/haddock-api/src/Haddock/Interface/Rename.hs @@ -251,10 +251,10 @@ renameLTyVarBndr :: LHsTyVarBndr Name -> RnM (LHsTyVarBndr DocName) renameLTyVarBndr (L loc (UserTyVar n)) = do { n' <- rename n ; return (L loc (UserTyVar n')) } -renameLTyVarBndr (L loc (KindedTyVar n kind)) +renameLTyVarBndr (L loc (KindedTyVar (L lv n) kind)) = do { n' <- rename n ; kind' <- renameLKind kind - ; return (L loc (KindedTyVar n' kind')) } + ; return (L loc (KindedTyVar (L lv n') kind')) } renameLContext :: Located [LHsType Name] -> RnM (Located [LHsType DocName]) renameLContext (L loc context) = do From git at git.haskell.org Wed Jul 8 08:35:31 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:35:31 +0000 (UTC) Subject: [commit: haddock] wip/D538: Rebase against master (814dfd7) Message-ID: <20150708083531.80D513A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/D538 Link : http://git.haskell.org/haddock.git/commitdiff/814dfd7ed36e7dba9081f0a7df6d33925f35070a >--------------------------------------------------------------- commit 814dfd7ed36e7dba9081f0a7df6d33925f35070a Author: Alan Zimmerman Date: Wed Dec 17 00:58:14 2014 +0200 Rebase against master >--------------------------------------------------------------- 814dfd7ed36e7dba9081f0a7df6d33925f35070a haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs index c164bc0..cb5956e 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs @@ -146,7 +146,7 @@ ppTypeOrFunSig summary links loc docnames typ (doc, argDocs) (pref1, pref2, sep) ppForAll :: LHsTyVarBndrs DocName -> Unicode -> Qualification -> Html ppForAll tvs unicode qual = - case [ppKTv n k | L _ (KindedTyVar n k) <- hsQTvBndrs tvs] of + case [ppKTv n k | L _ (KindedTyVar (L _ n) k) <- hsQTvBndrs tvs] of [] -> noHtml ts -> forallSymbol unicode <+> hsep ts +++ dot where ppKTv n k = parens $ @@ -618,7 +618,7 @@ ppShortConstrParts summary dataInst con unicode qual = case con_res con of -- (except each field gets its own line in docs, to match -- non-GADT records) RecCon (L _ fields) -> (ppOcc <+> dcolon unicode <+> - ppForAll forall_ ltvs lcontext unicode qual <+> char '{', + ppForAllCon forall_ ltvs lcontext unicode qual <+> char '{', doRecordFields fields, char '}' <+> arrow unicode <+> ppLType unicode qual resTy) InfixCon arg1 arg2 -> (doGADTCon [arg1, arg2] resTy, noHtml, noHtml) From git at git.haskell.org Wed Jul 8 08:35:33 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:35:33 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, wip/10268, wip/10313, wip/D538-1, wip/D538-2, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Only keep one Version instead of blindly appending (b8ffb16) Message-ID: <20150708083533.8C6A43A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,wip/10268,wip/10313,wip/D538-1,wip/D538-2,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/b8ffb16aa4e146855c78594879662dc606ffe0b1 >--------------------------------------------------------------- commit b8ffb16aa4e146855c78594879662dc606ffe0b1 Author: Mateusz Kowalczyk Date: Wed Dec 17 09:13:54 2014 +0000 Only keep one Version instead of blindly appending >--------------------------------------------------------------- b8ffb16aa4e146855c78594879662dc606ffe0b1 haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs | 6 +++--- haddock-library/src/Documentation/Haddock/Doc.hs | 21 +++++++++++++++++---- haddock-library/src/Documentation/Haddock/Types.hs | 6 ------ 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs b/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs index 921e409..96d734e 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs @@ -22,12 +22,12 @@ module Haddock.Backends.Xhtml.DocMarkup ( import Control.Applicative ((<$>)) import Data.List -import Data.Monoid (mconcat) import Haddock.Backends.Xhtml.Names import Haddock.Backends.Xhtml.Utils import Haddock.Types import Haddock.Utils -import Haddock.Doc (combineDocumentation, emptyMetaDoc, metaDocAppend) +import Haddock.Doc (combineDocumentation, emptyMetaDoc, + metaDocAppend, metaConcat) import Text.XHtml hiding ( name, p, quote ) import Data.Maybe (fromMaybe) @@ -152,7 +152,7 @@ flatten x = [x] hackMarkup :: DocMarkup id Html -> Hack (ModuleName, OccName) id -> Html hackMarkup fmt' h' = let (html, ms) = hackMarkup' fmt' h' - in html +++ renderMeta fmt' (mconcat ms) + in html +++ renderMeta fmt' (metaConcat ms) where hackMarkup' :: DocMarkup id Html -> Hack (ModuleName, OccName) id -> (Html, [Meta]) diff --git a/haddock-library/src/Documentation/Haddock/Doc.hs b/haddock-library/src/Documentation/Haddock/Doc.hs index fe8cf99..66bd1c9 100644 --- a/haddock-library/src/Documentation/Haddock/Doc.hs +++ b/haddock-library/src/Documentation/Haddock/Doc.hs @@ -1,15 +1,20 @@ {-# OPTIONS_GHC -fno-warn-orphans #-} module Documentation.Haddock.Doc (docParagraph, docAppend, docConcat, metaDocConcat, - metaDocAppend, emptyMetaDoc) where + metaDocAppend, emptyMetaDoc, + metaAppend, metaConcat) where -import Data.Monoid (mempty, (<>)) +import Control.Applicative ((<|>), empty) import Documentation.Haddock.Types import Data.Char (isSpace) docConcat :: [DocH mod id] -> DocH mod id docConcat = foldr docAppend DocEmpty +-- | Concat using 'metaAppend'. +metaConcat :: [Meta] -> Meta +metaConcat = foldr metaAppend emptyMeta + -- | Like 'docConcat' but also joins the 'Meta' info. metaDocConcat :: [MetaDoc mod id] -> MetaDoc mod id metaDocConcat = foldr metaDocAppend emptyMetaDoc @@ -20,10 +25,18 @@ metaDocConcat = foldr metaDocAppend emptyMetaDoc metaDocAppend :: MetaDoc mod id -> MetaDoc mod id -> MetaDoc mod id metaDocAppend (MetaDoc { _meta = m, _doc = d }) (MetaDoc { _meta = m', _doc = d' }) = - MetaDoc { _meta = m' <> m, _doc = d `docAppend` d' } + MetaDoc { _meta = m' `metaAppend` m, _doc = d `docAppend` d' } + +-- | This is not a monoidal append, it uses '<|>' for the '_version'. +metaAppend :: Meta -> Meta -> Meta +metaAppend (Meta { _version = v }) (Meta { _version = v' }) = + Meta { _version = v <|> v' } emptyMetaDoc :: MetaDoc mod id -emptyMetaDoc = MetaDoc { _meta = mempty, _doc = DocEmpty } +emptyMetaDoc = MetaDoc { _meta = emptyMeta, _doc = DocEmpty } + +emptyMeta :: Meta +emptyMeta = Meta { _version = empty } docAppend :: DocH mod id -> DocH mod id -> DocH mod id docAppend (DocDefList ds1) (DocDefList ds2) = DocDefList (ds1++ds2) diff --git a/haddock-library/src/Documentation/Haddock/Types.hs b/haddock-library/src/Documentation/Haddock/Types.hs index 6f22efb..4ef8965 100644 --- a/haddock-library/src/Documentation/Haddock/Types.hs +++ b/haddock-library/src/Documentation/Haddock/Types.hs @@ -15,7 +15,6 @@ module Documentation.Haddock.Types where import Data.Foldable -import Data.Monoid import Data.Traversable -- | With the advent of 'Version', we may want to start attaching more @@ -24,11 +23,6 @@ import Data.Traversable -- info. newtype Meta = Meta { _version :: Maybe Version } deriving (Eq, Show) -instance Monoid Meta where - mempty = Meta { _version = Nothing } - Meta { _version = v } `mappend` Meta { _version = v' } = - Meta { _version = v `mappend` v' } - data MetaDoc mod id = MetaDoc { _meta :: Meta , _doc :: DocH mod id From git at git.haskell.org Wed Jul 8 08:35:35 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:35:35 +0000 (UTC) Subject: [commit: haddock] wip/D538-1: Make RecCon payload Located (8dcc42e) Message-ID: <20150708083535.A01C53A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/D538-1 Link : http://git.haskell.org/haddock.git/commitdiff/8dcc42e2edc208210e2c3b7a4a7a65bc71b97f01 >--------------------------------------------------------------- commit 8dcc42e2edc208210e2c3b7a4a7a65bc71b97f01 Author: Alan Zimmerman Date: Wed Dec 10 23:22:50 2014 +0200 Make RecCon payload Located >--------------------------------------------------------------- 8dcc42e2edc208210e2c3b7a4a7a65bc71b97f01 haddock-api/src/Haddock/Backends/Hoogle.hs | 2 +- haddock-api/src/Haddock/Backends/LaTeX.hs | 4 ++-- haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | 8 ++++---- haddock-api/src/Haddock/Convert.hs | 2 +- haddock-api/src/Haddock/GhcUtils.hs | 2 +- haddock-api/src/Haddock/Interface/Create.hs | 6 +++--- haddock-api/src/Haddock/Interface/Rename.hs | 4 ++-- haddock-api/src/Haddock/Utils.hs | 4 ++-- 8 files changed, 16 insertions(+), 16 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 8dcc42e2edc208210e2c3b7a4a7a65bc71b97f01 From git at git.haskell.org Wed Jul 8 08:35:37 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:35:37 +0000 (UTC) Subject: [commit: haddock] wip/D538-1: IEThingAbs now carries a Located name (3e83af3) Message-ID: <20150708083537.AC2CB3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/D538-1 Link : http://git.haskell.org/haddock.git/commitdiff/3e83af375e87441a75af7d1b18876cd2d78818c7 >--------------------------------------------------------------- commit 3e83af375e87441a75af7d1b18876cd2d78818c7 Author: Alan Zimmerman Date: Sat Dec 13 12:05:09 2014 +0200 IEThingAbs now carries a Located name >--------------------------------------------------------------- 3e83af375e87441a75af7d1b18876cd2d78818c7 haddock-api/src/Haddock/GhcUtils.hs | 4 +++- haddock-api/src/Haddock/Interface/Create.hs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/haddock-api/src/Haddock/GhcUtils.hs b/haddock-api/src/Haddock/GhcUtils.hs index 9f9b269..c33c27b 100644 --- a/haddock-api/src/Haddock/GhcUtils.hs +++ b/haddock-api/src/Haddock/GhcUtils.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleInstances, ViewPatterns #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {-# OPTIONS_HADDOCK hide #-} @@ -185,10 +186,11 @@ before = (<) `on` getLoc instance Foldable (GenLocated l) where foldMap f (L _ x) = f x - +#if __GLASGOW_HASKELL__ < 709 instance Traversable (GenLocated l) where mapM f (L l x) = (return . L l) =<< f x traverse f (L l x) = L l <$> f x +#endif ------------------------------------------------------------------------------- -- * NamedThing instances diff --git a/haddock-api/src/Haddock/Interface/Create.hs b/haddock-api/src/Haddock/Interface/Create.hs index f714e2f..68a98c8 100644 --- a/haddock-api/src/Haddock/Interface/Create.hs +++ b/haddock-api/src/Haddock/Interface/Create.hs @@ -496,7 +496,7 @@ mkExportItems Just exports -> liftM concat $ mapM lookupExport exports where lookupExport (IEVar (L _ x)) = declWith x - lookupExport (IEThingAbs t) = declWith t + lookupExport (IEThingAbs (L _ t)) = declWith t lookupExport (IEThingAll (L _ t)) = declWith t lookupExport (IEThingWith (L _ t) _) = declWith t lookupExport (IEModuleContents (L _ m)) = From git at git.haskell.org Wed Jul 8 08:35:39 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:35:39 +0000 (UTC) Subject: [commit: haddock] wip/D538-1: Rebase against master (e9a17bd) Message-ID: <20150708083539.B9F023A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/D538-1 Link : http://git.haskell.org/haddock.git/commitdiff/e9a17bd9407e9ae780737cfc0ae457f7a294ff60 >--------------------------------------------------------------- commit e9a17bd9407e9ae780737cfc0ae457f7a294ff60 Author: Alan Zimmerman Date: Wed Dec 17 00:58:14 2014 +0200 Rebase against master >--------------------------------------------------------------- e9a17bd9407e9ae780737cfc0ae457f7a294ff60 haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs index c164bc0..cb5956e 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs @@ -146,7 +146,7 @@ ppTypeOrFunSig summary links loc docnames typ (doc, argDocs) (pref1, pref2, sep) ppForAll :: LHsTyVarBndrs DocName -> Unicode -> Qualification -> Html ppForAll tvs unicode qual = - case [ppKTv n k | L _ (KindedTyVar n k) <- hsQTvBndrs tvs] of + case [ppKTv n k | L _ (KindedTyVar (L _ n) k) <- hsQTvBndrs tvs] of [] -> noHtml ts -> forallSymbol unicode <+> hsep ts +++ dot where ppKTv n k = parens $ @@ -618,7 +618,7 @@ ppShortConstrParts summary dataInst con unicode qual = case con_res con of -- (except each field gets its own line in docs, to match -- non-GADT records) RecCon (L _ fields) -> (ppOcc <+> dcolon unicode <+> - ppForAll forall_ ltvs lcontext unicode qual <+> char '{', + ppForAllCon forall_ ltvs lcontext unicode qual <+> char '{', doRecordFields fields, char '}' <+> arrow unicode <+> ppLType unicode qual resTy) InfixCon arg1 arg2 -> (doGADTCon [arg1, arg2] resTy, noHtml, noHtml) From git at git.haskell.org Wed Jul 8 08:35:41 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:35:41 +0000 (UTC) Subject: [commit: haddock] wip/D538-1: Add Location in KindedTyVar (5572bd8) Message-ID: <20150708083541.C555C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/D538-1 Link : http://git.haskell.org/haddock.git/commitdiff/5572bd87f781e957235f5ad1d9d0b43fa475684b >--------------------------------------------------------------- commit 5572bd87f781e957235f5ad1d9d0b43fa475684b Author: Alan Zimmerman Date: Tue Dec 16 10:13:50 2014 +0200 Add Location in KindedTyVar >--------------------------------------------------------------- 5572bd87f781e957235f5ad1d9d0b43fa475684b haddock-api/src/Haddock/Convert.hs | 4 ++-- haddock-api/src/Haddock/Interface/Rename.hs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/haddock-api/src/Haddock/Convert.hs b/haddock-api/src/Haddock/Convert.hs index 7799794..632d3bc 100644 --- a/haddock-api/src/Haddock/Convert.hs +++ b/haddock-api/src/Haddock/Convert.hs @@ -146,7 +146,7 @@ synifyTyCon coax tc DataDecl { tcdLName = synifyName tc , tcdTyVars = -- tyConTyVars doesn't work on fun/prim, but we can make them up: let mk_hs_tv realKind fakeTyVar - = noLoc $ KindedTyVar (getName fakeTyVar) + = noLoc $ KindedTyVar (noLoc (getName fakeTyVar)) (synifyKindSig realKind) in HsQTvs { hsq_kvs = [] -- No kind polymorphism , hsq_tvs = zipWith mk_hs_tv (fst (splitKindFunTys (tyConKind tc))) @@ -313,7 +313,7 @@ synifyTyVars ktvs = HsQTvs { hsq_kvs = map tyVarName kvs (kvs, tvs) = partition isKindVar ktvs synifyTyVar tv | isLiftedTypeKind kind = noLoc (UserTyVar name) - | otherwise = noLoc (KindedTyVar name (synifyKindSig kind)) + | otherwise = noLoc (KindedTyVar (noLoc name) (synifyKindSig kind)) where kind = tyVarKind tv name = getName tv diff --git a/haddock-api/src/Haddock/Interface/Rename.hs b/haddock-api/src/Haddock/Interface/Rename.hs index 862d5ec..fbdbac9 100644 --- a/haddock-api/src/Haddock/Interface/Rename.hs +++ b/haddock-api/src/Haddock/Interface/Rename.hs @@ -251,10 +251,10 @@ renameLTyVarBndr :: LHsTyVarBndr Name -> RnM (LHsTyVarBndr DocName) renameLTyVarBndr (L loc (UserTyVar n)) = do { n' <- rename n ; return (L loc (UserTyVar n')) } -renameLTyVarBndr (L loc (KindedTyVar n kind)) +renameLTyVarBndr (L loc (KindedTyVar (L lv n) kind)) = do { n' <- rename n ; kind' <- renameLKind kind - ; return (L loc (KindedTyVar n' kind')) } + ; return (L loc (KindedTyVar (L lv n') kind')) } renameLContext :: Located [LHsType Name] -> RnM (Located [LHsType DocName]) renameLContext (L loc context) = do From git at git.haskell.org Wed Jul 8 08:35:43 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:35:43 +0000 (UTC) Subject: [commit: haddock] wip/D538-1: Remove Traversable instance for GenLocated SrcSpan (5ac5b40) Message-ID: <20150708083543.CF6883A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/D538-1 Link : http://git.haskell.org/haddock.git/commitdiff/5ac5b403a63a44ac629b6cd6618407436c7eac33 >--------------------------------------------------------------- commit 5ac5b403a63a44ac629b6cd6618407436c7eac33 Author: Alan Zimmerman Date: Tue Dec 16 16:06:21 2014 +0200 Remove Traversable instance for GenLocated SrcSpan >--------------------------------------------------------------- 5ac5b403a63a44ac629b6cd6618407436c7eac33 haddock-api/src/Haddock/GhcUtils.hs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/haddock-api/src/Haddock/GhcUtils.hs b/haddock-api/src/Haddock/GhcUtils.hs index c33c27b..918edab 100644 --- a/haddock-api/src/Haddock/GhcUtils.hs +++ b/haddock-api/src/Haddock/GhcUtils.hs @@ -1,4 +1,3 @@ -{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleInstances, ViewPatterns #-} {-# OPTIONS_GHC -fno-warn-orphans #-} {-# OPTIONS_HADDOCK hide #-} @@ -186,12 +185,6 @@ before = (<) `on` getLoc instance Foldable (GenLocated l) where foldMap f (L _ x) = f x -#if __GLASGOW_HASKELL__ < 709 -instance Traversable (GenLocated l) where - mapM f (L l x) = (return . L l) =<< f x - traverse f (L l x) = L l <$> f x -#endif - ------------------------------------------------------------------------------- -- * NamedThing instances ------------------------------------------------------------------------------- From git at git.haskell.org Wed Jul 8 08:35:45 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:35:45 +0000 (UTC) Subject: [commit: haddock] wip/D538-1: Revert "Fix import of 'empty' due to AMP." (18ff229) Message-ID: <20150708083545.DA5C83A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/D538-1 Link : http://git.haskell.org/haddock.git/commitdiff/18ff2291f4d337338d6ca9d0dbdeace392c740b8 >--------------------------------------------------------------- commit 18ff2291f4d337338d6ca9d0dbdeace392c740b8 Author: Herbert Valerio Riedel Date: Fri Sep 26 19:18:28 2014 +0200 Revert "Fix import of 'empty' due to AMP." This reverts commit 0cc5bc85e9fca92ab712b68a2ba2c0dd9d3d79f4 since it turns out we don't need to re-export `empty` from Control.Monad after all. >--------------------------------------------------------------- 18ff2291f4d337338d6ca9d0dbdeace392c740b8 haddock-api/src/Haddock/Backends/LaTeX.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haddock-api/src/Haddock/Backends/LaTeX.hs b/haddock-api/src/Haddock/Backends/LaTeX.hs index 8e781d1..b717fc0 100644 --- a/haddock-api/src/Haddock/Backends/LaTeX.hs +++ b/haddock-api/src/Haddock/Backends/LaTeX.hs @@ -32,7 +32,7 @@ import qualified Data.Map as Map import System.Directory import System.FilePath import Data.Char -import Control.Monad hiding (empty) +import Control.Monad import Data.Maybe import Data.List From git at git.haskell.org Wed Jul 8 08:35:47 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:35:47 +0000 (UTC) Subject: [commit: haddock] wip/D538-1: Fix import of 'empty' due to AMP. (2f0b699) Message-ID: <20150708083547.E673A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/D538-1 Link : http://git.haskell.org/haddock.git/commitdiff/2f0b6994ceba5f035bae5754b6feb291868c387c >--------------------------------------------------------------- commit 2f0b6994ceba5f035bae5754b6feb291868c387c Author: Austin Seipp Date: Tue Sep 9 01:03:27 2014 -0500 Fix import of 'empty' due to AMP. Signed-off-by: Austin Seipp >--------------------------------------------------------------- 2f0b6994ceba5f035bae5754b6feb291868c387c haddock-api/src/Haddock/Backends/LaTeX.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haddock-api/src/Haddock/Backends/LaTeX.hs b/haddock-api/src/Haddock/Backends/LaTeX.hs index b717fc0..8e781d1 100644 --- a/haddock-api/src/Haddock/Backends/LaTeX.hs +++ b/haddock-api/src/Haddock/Backends/LaTeX.hs @@ -32,7 +32,7 @@ import qualified Data.Map as Map import System.Directory import System.FilePath import Data.Char -import Control.Monad +import Control.Monad hiding (empty) import Data.Maybe import Data.List From git at git.haskell.org Wed Jul 8 08:35:50 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:35:50 +0000 (UTC) Subject: [commit: haddock] wip/D538-1: Adding SourceText to pragma declarations (f39be51) Message-ID: <20150708083550.00A303A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/D538-1 Link : http://git.haskell.org/haddock.git/commitdiff/f39be51327483a4e10b890e84df8ad6d34b6be62 >--------------------------------------------------------------- commit f39be51327483a4e10b890e84df8ad6d34b6be62 Author: Alan Zimmerman Date: Sun Dec 7 10:42:56 2014 +0200 Adding SourceText to pragma declarations >--------------------------------------------------------------- f39be51327483a4e10b890e84df8ad6d34b6be62 haddock-api/src/Haddock/Backends/Hoogle.hs | 2 +- haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | 2 +- haddock-api/src/Haddock/Convert.hs | 6 +++--- haddock-api/src/Haddock/GhcUtils.hs | 4 ++-- haddock-api/src/Haddock/Interface/Create.hs | 8 ++++---- haddock-api/src/Haddock/Interface/Rename.hs | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/haddock-api/src/Haddock/Backends/Hoogle.hs b/haddock-api/src/Haddock/Backends/Hoogle.hs index dd10bb0..6353a5f 100644 --- a/haddock-api/src/Haddock/Backends/Hoogle.hs +++ b/haddock-api/src/Haddock/Backends/Hoogle.hs @@ -145,7 +145,7 @@ ppClass dflags x = out dflags x{tcdSigs=[]} : concatMap (ppSig dflags . addContext . unL) (tcdSigs x) where addContext (TypeSig name (L l sig) nwcs) = TypeSig name (L l $ f sig) nwcs - addContext (MinimalSig sig) = MinimalSig sig + addContext (MinimalSig src sig) = MinimalSig src sig addContext _ = error "expected TypeSig" f (HsForAllTy a b c con d) = HsForAllTy a b c (reL (context : unLoc con)) d diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs index ae89fb3..20cac37 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs @@ -470,7 +470,7 @@ ppClassDecl summary links instances fixities loc d subdocs -- there are different subdocs for different names in a single -- type signature? - minimalBit = case [ s | L _ (MinimalSig s) <- lsigs ] of + minimalBit = case [ s | L _ (MinimalSig _ s) <- lsigs ] of -- Miminal complete definition = every shown method And xs : _ | sort [getName n | Var (L _ n) <- xs] == sort [getName n | L _ (TypeSig ns _ _) <- lsigs, L _ n <- ns] diff --git a/haddock-api/src/Haddock/Convert.hs b/haddock-api/src/Haddock/Convert.hs index 4c019bc..a5b97ad 100644 --- a/haddock-api/src/Haddock/Convert.hs +++ b/haddock-api/src/Haddock/Convert.hs @@ -77,7 +77,7 @@ tyThingToLHsDecl t = case t of , tcdFDs = map (\ (l,r) -> noLoc (map getName l, map getName r) ) $ snd $ classTvsFds cl - , tcdSigs = noLoc (MinimalSig . fmap noLoc $ classMinimalDef cl) : + , tcdSigs = noLoc (MinimalSig mempty . fmap noLoc $ classMinimalDef cl) : map (noLoc . synifyIdSig DeleteTopLevelQuantification) (classMethods cl) , tcdMeths = emptyBag --ignore default method definitions, they don't affect signature @@ -265,8 +265,8 @@ synifyDataCon use_gadt_syntax dc = linear_tys = zipWith (\ty bang -> let tySyn = synifyType WithinType ty src_bang = case bang of - HsUnpack {} -> HsUserBang (Just True) True - HsStrict -> HsUserBang (Just False) True + HsUnpack {} -> HsUserBang Nothing (Just True) True + HsStrict -> HsUserBang Nothing (Just False) True _ -> bang in case src_bang of HsNoBang -> tySyn diff --git a/haddock-api/src/Haddock/GhcUtils.hs b/haddock-api/src/Haddock/GhcUtils.hs index 5aa9b81..cbf554a 100644 --- a/haddock-api/src/Haddock/GhcUtils.hs +++ b/haddock-api/src/Haddock/GhcUtils.hs @@ -104,8 +104,8 @@ filterSigNames p (FixSig (FixitySig ns ty)) = case filter (p . unLoc) ns of [] -> Nothing filtered -> Just (FixSig (FixitySig filtered ty)) -filterSigNames _ orig@(MinimalSig _) = Just orig -filterSigNames p (TypeSig ns ty nwcs) = +filterSigNames _ orig@(MinimalSig _ _) = Just orig +filterSigNames p (TypeSig ns ty nwcs) = case filter (p . unLoc) ns of [] -> Nothing filtered -> Just (TypeSig filtered ty nwcs) diff --git a/haddock-api/src/Haddock/Interface/Create.hs b/haddock-api/src/Haddock/Interface/Create.hs index 98a715a..8de8c62 100644 --- a/haddock-api/src/Haddock/Interface/Create.hs +++ b/haddock-api/src/Haddock/Interface/Create.hs @@ -194,8 +194,8 @@ moduleWarning dflags gre (WarnAll w) = Just $ parseWarning dflags gre w parseWarning :: DynFlags -> GlobalRdrEnv -> WarningTxt -> Doc Name parseWarning dflags gre w = force $ case w of - DeprecatedTxt msg -> format "Deprecated: " (concatFS $ map unLoc msg) - WarningTxt msg -> format "Warning: " (concatFS $ map unLoc msg) + DeprecatedTxt _ msg -> format "Deprecated: " (concatFS $ map unLoc msg) + WarningTxt _ msg -> format "Warning: " (concatFS $ map unLoc msg) where format x xs = DocWarning . DocParagraph . DocAppend (DocString x) . processDocString dflags gre $ HsDocString xs @@ -553,7 +553,7 @@ mkExportItems L loc (TyClD cl at ClassDecl{}) -> do mdef <- liftGhcToErrMsgGhc $ minimalDef t - let sig = maybeToList $ fmap (noLoc . MinimalSig . fmap noLoc) mdef + let sig = maybeToList $ fmap (noLoc . MinimalSig mempty . fmap noLoc) mdef return [ mkExportDecl t (L loc $ TyClD cl { tcdSigs = sig ++ tcdSigs cl }) docs_ ] @@ -745,7 +745,7 @@ fullModuleContents dflags warnings gre (docMap, argMap, subMap, declMap, instMap return $ Just (ExportDecl decl doc subs [] (fixities name subs) (l `elem` splices)) mkExportItem (L l (TyClD cl at ClassDecl{ tcdLName = L _ name, tcdSigs = sigs })) = do mdef <- liftGhcToErrMsgGhc $ minimalDef name - let sig = maybeToList $ fmap (noLoc . MinimalSig . fmap noLoc) mdef + let sig = maybeToList $ fmap (noLoc . MinimalSig mempty . fmap noLoc) mdef expDecl (L l (TyClD cl { tcdSigs = sig ++ sigs })) l name mkExportItem decl@(L l d) | name:_ <- getMainDeclBinder d = expDecl decl l name diff --git a/haddock-api/src/Haddock/Interface/Rename.hs b/haddock-api/src/Haddock/Interface/Rename.hs index 1ea212f..719c068 100644 --- a/haddock-api/src/Haddock/Interface/Rename.hs +++ b/haddock-api/src/Haddock/Interface/Rename.hs @@ -415,7 +415,7 @@ renameSig sig = case sig of FixSig (FixitySig lnames fixity) -> do lnames' <- mapM renameL lnames return $ FixSig (FixitySig lnames' fixity) - MinimalSig s -> MinimalSig <$> traverse renameL s + MinimalSig src s -> MinimalSig src <$> traverse renameL s -- we have filtered out all other kinds of signatures in Interface.Create _ -> error "expected TypeSig" From git at git.haskell.org Wed Jul 8 08:35:52 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:35:52 +0000 (UTC) Subject: [commit: haddock] wip/D538-1: FunDeps are Located (c38a560) Message-ID: <20150708083552.0E1FA3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/D538-1 Link : http://git.haskell.org/haddock.git/commitdiff/c38a56037f0c3782dc94190de129ebe394c127ee >--------------------------------------------------------------- commit c38a56037f0c3782dc94190de129ebe394c127ee Author: Alan Zimmerman Date: Tue Dec 9 23:49:49 2014 +0200 FunDeps are Located >--------------------------------------------------------------- c38a56037f0c3782dc94190de129ebe394c127ee haddock-api/src/Haddock/Backends/LaTeX.hs | 8 ++++---- haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | 6 +++--- haddock-api/src/Haddock/Convert.hs | 2 +- haddock-api/src/Haddock/Interface/Rename.hs | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/haddock-api/src/Haddock/Backends/LaTeX.hs b/haddock-api/src/Haddock/Backends/LaTeX.hs index 9bac9d0..5046da8 100644 --- a/haddock-api/src/Haddock/Backends/LaTeX.hs +++ b/haddock-api/src/Haddock/Backends/LaTeX.hs @@ -477,7 +477,7 @@ rDoc = maybeDoc . fmap latexStripTrailingWhitespace ppClassHdr :: Bool -> Located [LHsType DocName] -> DocName - -> LHsTyVarBndrs DocName -> [Located ([DocName], [DocName])] + -> LHsTyVarBndrs DocName -> [Located ([Located DocName], [Located DocName])] -> Bool -> LaTeX ppClassHdr summ lctxt n tvs fds unicode = keyword "class" @@ -486,13 +486,13 @@ ppClassHdr summ lctxt n tvs fds unicode = <+> ppFds fds unicode -ppFds :: [Located ([DocName], [DocName])] -> Bool -> LaTeX +ppFds :: [Located ([Located DocName], [Located DocName])] -> Bool -> LaTeX ppFds fds unicode = if null fds then empty else char '|' <+> hsep (punctuate comma (map (fundep . unLoc) fds)) where - fundep (vars1,vars2) = hsep (map ppDocName vars1) <+> arrow unicode <+> - hsep (map ppDocName vars2) + fundep (vars1,vars2) = hsep (map (ppDocName . unLoc) vars1) <+> arrow unicode <+> + hsep (map (ppDocName . unLoc) vars2) ppClassDecl :: [DocInstance DocName] -> SrcSpan diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs index 20cac37..5b88fb4 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs @@ -381,7 +381,7 @@ ppHsContext cxt unicode qual = parenList (map (ppType unicode qual) cxt) ppClassHdr :: Bool -> Located [LHsType DocName] -> DocName - -> LHsTyVarBndrs DocName -> [Located ([DocName], [DocName])] + -> LHsTyVarBndrs DocName -> [Located ([Located DocName], [Located DocName])] -> Unicode -> Qualification -> Html ppClassHdr summ lctxt n tvs fds unicode qual = keyword "class" @@ -390,13 +390,13 @@ ppClassHdr summ lctxt n tvs fds unicode qual = <+> ppFds fds unicode qual -ppFds :: [Located ([DocName], [DocName])] -> Unicode -> Qualification -> Html +ppFds :: [Located ([Located DocName], [Located DocName])] -> Unicode -> Qualification -> Html ppFds fds unicode qual = if null fds then noHtml else char '|' <+> hsep (punctuate comma (map (fundep . unLoc) fds)) where fundep (vars1,vars2) = ppVars vars1 <+> arrow unicode <+> ppVars vars2 - ppVars = hsep . map (ppDocName qual Prefix True) + ppVars = hsep . map ((ppDocName qual Prefix True) . unLoc) ppShortClassDecl :: Bool -> LinksInfo -> TyClDecl DocName -> SrcSpan -> [(DocName, DocForDecl DocName)] diff --git a/haddock-api/src/Haddock/Convert.hs b/haddock-api/src/Haddock/Convert.hs index a5b97ad..5606abf 100644 --- a/haddock-api/src/Haddock/Convert.hs +++ b/haddock-api/src/Haddock/Convert.hs @@ -75,7 +75,7 @@ tyThingToLHsDecl t = case t of , tcdLName = synifyName cl , tcdTyVars = synifyTyVars (classTyVars cl) , tcdFDs = map (\ (l,r) -> noLoc - (map getName l, map getName r) ) $ + (map (noLoc . getName) l, map (noLoc . getName) r) ) $ snd $ classTvsFds cl , tcdSigs = noLoc (MinimalSig mempty . fmap noLoc $ classMinimalDef cl) : map (noLoc . synifyIdSig DeleteTopLevelQuantification) diff --git a/haddock-api/src/Haddock/Interface/Rename.hs b/haddock-api/src/Haddock/Interface/Rename.hs index 719c068..b222a39 100644 --- a/haddock-api/src/Haddock/Interface/Rename.hs +++ b/haddock-api/src/Haddock/Interface/Rename.hs @@ -331,9 +331,9 @@ renameTyClD d = case d of where renameLFunDep (L loc (xs, ys)) = do - xs' <- mapM rename xs - ys' <- mapM rename ys - return (L loc (xs', ys')) + xs' <- mapM rename (map unLoc xs) + ys' <- mapM rename (map unLoc ys) + return (L loc (map noLoc xs', map noLoc ys')) renameLSig (L loc sig) = return . L loc =<< renameSig sig From git at git.haskell.org Wed Jul 8 08:35:54 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:35:54 +0000 (UTC) Subject: [commit: haddock] wip/D538-1: HsTyLit now has a SourceText field (40c73a4) Message-ID: <20150708083554.1AA723A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/D538-1 Link : http://git.haskell.org/haddock.git/commitdiff/40c73a486f2977b502fefbe999ae12165d7896dd >--------------------------------------------------------------- commit 40c73a486f2977b502fefbe999ae12165d7896dd Author: Alan Zimmerman Date: Sun Nov 30 22:15:32 2014 +0200 HsTyLit now has a SourceText field Summary: HsTyLit now has a SourceText field Depends on D538 Reviewers: austin, Fuuzetsu Differential Revision: https://phabricator.haskell.org/D539 >--------------------------------------------------------------- 40c73a486f2977b502fefbe999ae12165d7896dd haddock-api/src/Haddock/Backends/LaTeX.hs | 4 ++-- haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | 4 ++-- haddock-api/src/Haddock/Convert.hs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/haddock-api/src/Haddock/Backends/LaTeX.hs b/haddock-api/src/Haddock/Backends/LaTeX.hs index b717fc0..9bac9d0 100644 --- a/haddock-api/src/Haddock/Backends/LaTeX.hs +++ b/haddock-api/src/Haddock/Backends/LaTeX.hs @@ -948,8 +948,8 @@ ppr_mono_ty _ (HsTyLit t) u = ppr_tylit t u ppr_tylit :: HsTyLit -> Bool -> LaTeX -ppr_tylit (HsNumTy n) _ = integer n -ppr_tylit (HsStrTy s) _ = text (show s) +ppr_tylit (HsNumTy _ n) _ = integer n +ppr_tylit (HsStrTy _ s) _ = text (show s) -- XXX: Ok in verbatim, but not otherwise -- XXX: Do something with Unicode parameter? diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs index 3bf4322..ae89fb3 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs @@ -907,8 +907,8 @@ ppr_mono_ty _ (HsNamedWildcardTy name) _ q = ppDocName q Prefix True name ppr_mono_ty _ (HsTyLit n) _ _ = ppr_tylit n ppr_tylit :: HsTyLit -> Html -ppr_tylit (HsNumTy n) = toHtml (show n) -ppr_tylit (HsStrTy s) = toHtml (show s) +ppr_tylit (HsNumTy _ n) = toHtml (show n) +ppr_tylit (HsStrTy _ s) = toHtml (show s) ppr_fun_ty :: Int -> LHsType DocName -> LHsType DocName -> Unicode -> Qualification -> Html diff --git a/haddock-api/src/Haddock/Convert.hs b/haddock-api/src/Haddock/Convert.hs index 1b1a8a8..4c019bc 100644 --- a/haddock-api/src/Haddock/Convert.hs +++ b/haddock-api/src/Haddock/Convert.hs @@ -384,8 +384,8 @@ synifyType s forallty@(ForAllTy _tv _ty) = synifyType _ (LitTy t) = noLoc $ HsTyLit $ synifyTyLit t synifyTyLit :: TyLit -> HsTyLit -synifyTyLit (NumTyLit n) = HsNumTy n -synifyTyLit (StrTyLit s) = HsStrTy s +synifyTyLit (NumTyLit n) = HsNumTy mempty n +synifyTyLit (StrTyLit s) = HsStrTy mempty s synifyKindSig :: Kind -> LHsKind Name synifyKindSig k = synifyType WithinType k From git at git.haskell.org Wed Jul 8 08:35:56 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:35:56 +0000 (UTC) Subject: [commit: haddock] wip/D538-2: Update to match D538 (52af2fa) Message-ID: <20150708083556.275CB3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/D538-2 Link : http://git.haskell.org/haddock.git/commitdiff/52af2fa2a73d139d56a30291eb2e43bec69f0a53 >--------------------------------------------------------------- commit 52af2fa2a73d139d56a30291eb2e43bec69f0a53 Author: Austin Seipp Date: Tue Sep 9 01:03:27 2014 -0500 Update to match D538 Signed-off-by: Austin Seipp >--------------------------------------------------------------- 52af2fa2a73d139d56a30291eb2e43bec69f0a53 haddock-api/src/Haddock/Backends/LaTeX.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haddock-api/src/Haddock/Backends/LaTeX.hs b/haddock-api/src/Haddock/Backends/LaTeX.hs index b717fc0..8e781d1 100644 --- a/haddock-api/src/Haddock/Backends/LaTeX.hs +++ b/haddock-api/src/Haddock/Backends/LaTeX.hs @@ -32,7 +32,7 @@ import qualified Data.Map as Map import System.Directory import System.FilePath import Data.Char -import Control.Monad +import Control.Monad hiding (empty) import Data.Maybe import Data.List From git at git.haskell.org Wed Jul 8 08:35:58 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:35:58 +0000 (UTC) Subject: [commit: haddock] wip/D538-2: Update to match D538 (f0bddae) Message-ID: <20150708083558.3917F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/D538-2 Link : http://git.haskell.org/haddock.git/commitdiff/f0bddaed1812155b716c5b0760d58372aa3412ed >--------------------------------------------------------------- commit f0bddaed1812155b716c5b0760d58372aa3412ed Author: Austin Seipp Date: Tue Sep 9 01:03:27 2014 -0500 Update to match D538 >--------------------------------------------------------------- f0bddaed1812155b716c5b0760d58372aa3412ed haddock-api/src/Haddock/Backends/Hoogle.hs | 4 ++-- haddock-api/src/Haddock/Backends/LaTeX.hs | 18 +++++++++--------- haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | 20 ++++++++++---------- haddock-api/src/Haddock/Convert.hs | 18 +++++++++--------- haddock-api/src/Haddock/GhcUtils.hs | 11 +++-------- haddock-api/src/Haddock/Interface/Create.hs | 16 ++++++++-------- haddock-api/src/Haddock/Interface/Rename.hs | 16 ++++++++-------- haddock-api/src/Haddock/Utils.hs | 4 ++-- 8 files changed, 51 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 f0bddaed1812155b716c5b0760d58372aa3412ed From git at git.haskell.org Wed Jul 8 08:36:00 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:36:00 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, wip/10268, wip/10313, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Fix dependency version (bbe19d7) Message-ID: <20150708083600.4566E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,wip/10268,wip/10313,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/bbe19d79f427b784f6423e72fb77fed9c81832b2 >--------------------------------------------------------------- commit bbe19d79f427b784f6423e72fb77fed9c81832b2 Author: Mateusz Kowalczyk Date: Thu Dec 18 07:09:44 2014 +0000 Fix dependency version >--------------------------------------------------------------- bbe19d79f427b784f6423e72fb77fed9c81832b2 haddock-api/haddock-api.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haddock-api/haddock-api.cabal b/haddock-api/haddock-api.cabal index 57a2011..b2199c6 100644 --- a/haddock-api/haddock-api.cabal +++ b/haddock-api/haddock-api.cabal @@ -48,7 +48,7 @@ library , ghc == 7.9.* , ghc-paths - , haddock-library == 1.20.0.* + , haddock-library == 1.2.0.* hs-source-dirs: src From git at git.haskell.org Wed Jul 8 08:36:02 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:36:02 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, wip/10268, wip/10313, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Print missing docs by default (d5090d5) Message-ID: <20150708083602.5A3443A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,wip/10268,wip/10313,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/d5090d5e9921a61d0a15a95b088210d51f825033 >--------------------------------------------------------------- commit d5090d5e9921a61d0a15a95b088210d51f825033 Author: Mateusz Kowalczyk Date: Thu Dec 18 07:14:23 2014 +0000 Print missing docs by default Adds --no-print-missing-docs >--------------------------------------------------------------- d5090d5e9921a61d0a15a95b088210d51f825033 CHANGES | 2 ++ haddock-api/src/Haddock/Interface.hs | 2 +- haddock-api/src/Haddock/Options.hs | 6 +++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index 2dd563d..ef0b1be 100644 --- a/CHANGES +++ b/CHANGES @@ -12,6 +12,8 @@ Changes in version 2.16.0 * Fix parsing of infix identifiers such as ``elem``. + * Print missing docs by default and add --no-print-missing-docs + Changes in version 2.15.0 * Always read in prologue files as UTF8 (#286 and Cabal #1721) diff --git a/haddock-api/src/Haddock/Interface.hs b/haddock-api/src/Haddock/Interface.hs index 60a20fe..1bb04ed 100644 --- a/haddock-api/src/Haddock/Interface.hs +++ b/haddock-api/src/Haddock/Interface.hs @@ -195,7 +195,7 @@ processModule verbosity modsum flags modMap instIfaceMap = do else n out verbosity normal coverageMsg - when (Flag_PrintMissingDocs `elem` flags + when (Flag_NoPrintMissingDocs `notElem` flags && not (null undocumentedExports && header)) $ do out verbosity normal " Missing documentation for:" unless header $ out verbosity normal " Module header" diff --git a/haddock-api/src/Haddock/Options.hs b/haddock-api/src/Haddock/Options.hs index b166de4..3fa6397 100644 --- a/haddock-api/src/Haddock/Options.hs +++ b/haddock-api/src/Haddock/Options.hs @@ -82,7 +82,7 @@ data Flag | Flag_NoTmpCompDir | Flag_Qualification String | Flag_PrettyHtml - | Flag_PrintMissingDocs + | Flag_NoPrintMissingDocs deriving (Eq) @@ -170,8 +170,8 @@ options backwardsCompat = "do not re-direct compilation output to a temporary directory", Option [] ["pretty-html"] (NoArg Flag_PrettyHtml) "generate html with newlines and indenting (for use with --html)", - Option [] ["print-missing-docs"] (NoArg Flag_PrintMissingDocs) - "print information about any undocumented entities" + Option [] ["no-print-missing-docs"] (NoArg Flag_NoPrintMissingDocs) + "don't print information about any undocumented entities" ] From git at git.haskell.org Wed Jul 8 08:36:04 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:36:04 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, wip/10268, wip/10313, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: update changelog (15f1081) Message-ID: <20150708083604.69B6B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,wip/10268,wip/10313,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/15f10811226a761617a408943936b13ed2624b37 >--------------------------------------------------------------- commit 15f10811226a761617a408943936b13ed2624b37 Author: Mateusz Kowalczyk Date: Thu Dec 18 07:21:37 2014 +0000 update changelog >--------------------------------------------------------------- 15f10811226a761617a408943936b13ed2624b37 CHANGES | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGES b/CHANGES index ef0b1be..5688537 100644 --- a/CHANGES +++ b/CHANGES @@ -14,6 +14,18 @@ Changes in version 2.16.0 * Print missing docs by default and add --no-print-missing-docs + * parser: now parses out some meta data too, breaking the API + + * parser: markdown syntax for images and URLs is now accepted: + <> style for images and style for links is now + considered deprecated. for links is still OK. + + * parser: add support for @since element: this is paragraph-level + element of the form ?@since x.y.z? where x.y.z is the version + number. The way it is rendered is subject to change. + + * properly render package ID (not package key) in index (#329) + Changes in version 2.15.0 * Always read in prologue files as UTF8 (#286 and Cabal #1721) From git at git.haskell.org Wed Jul 8 08:36:06 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:36:06 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, wip/10268, wip/10313, wip/D538-3, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Update docs for @since (60ccf50) Message-ID: <20150708083606.7B9033A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,wip/10268,wip/10313,wip/D538-3,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/60ccf50433d823f18ee63e9c25c979e7b81f2fc1 >--------------------------------------------------------------- commit 60ccf50433d823f18ee63e9c25c979e7b81f2fc1 Author: Mateusz Kowalczyk Date: Thu Dec 18 07:30:58 2014 +0000 Update docs for @since >--------------------------------------------------------------- 60ccf50433d823f18ee63e9c25c979e7b81f2fc1 doc/haddock.xml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/doc/haddock.xml b/doc/haddock.xml index 3b58f82..2ffd7d7 100644 --- a/doc/haddock.xml +++ b/doc/haddock.xml @@ -2210,6 +2210,40 @@ This belongs to the list above! +

    + Metadata + Since Haddock 2.16.0, some support for embedding + metadata in the comments has started to appear. The use of + such data aims to standardise various community conventions in + how such information is conveyed and to provide uniform + rendering. + + +
    + Since + @since annotation can be used to + convey information about when the function was introduced or + when it has changed in the way significant to the user. + @since is a paragraph-level element. + While multiple such annotations are not an error, only the + one to appear in the comment last will be used. + @since has to be followed with a version + number, no further description is currently allowed. The + meaning of this feature is subject to change in the future + per user feedback. + + + +-- | +-- Some comment +-- +-- @since 1.2.3 + + +
    + +
    + From git at git.haskell.org Wed Jul 8 08:36:08 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:36:08 +0000 (UTC) Subject: [commit: haddock] wip/D538-3: Update to match D538 (b5d8ea7) Message-ID: <20150708083608.86D083A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/D538-3 Link : http://git.haskell.org/haddock.git/commitdiff/b5d8ea7aa331a5c9ec75d7e31f284e5a5f5724a6 >--------------------------------------------------------------- commit b5d8ea7aa331a5c9ec75d7e31f284e5a5f5724a6 Author: Austin Seipp Date: Tue Sep 9 01:03:27 2014 -0500 Update to match D538 Signed-off-by: Austin Seipp >--------------------------------------------------------------- b5d8ea7aa331a5c9ec75d7e31f284e5a5f5724a6 haddock-api/src/Haddock/Backends/LaTeX.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haddock-api/src/Haddock/Backends/LaTeX.hs b/haddock-api/src/Haddock/Backends/LaTeX.hs index b717fc0..8e781d1 100644 --- a/haddock-api/src/Haddock/Backends/LaTeX.hs +++ b/haddock-api/src/Haddock/Backends/LaTeX.hs @@ -32,7 +32,7 @@ import qualified Data.Map as Map import System.Directory import System.FilePath import Data.Char -import Control.Monad +import Control.Monad hiding (empty) import Data.Maybe import Data.List From git at git.haskell.org Wed Jul 8 08:36:10 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:36:10 +0000 (UTC) Subject: [commit: haddock] wip/D538-3: Update to match D538 (fd25ec5) Message-ID: <20150708083610.98FC93A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/D538-3 Link : http://git.haskell.org/haddock.git/commitdiff/fd25ec56e3e4b504e1643ebb2f4b1ac24e635e61 >--------------------------------------------------------------- commit fd25ec56e3e4b504e1643ebb2f4b1ac24e635e61 Author: Austin Seipp Date: Tue Sep 9 01:03:27 2014 -0500 Update to match D538 >--------------------------------------------------------------- fd25ec56e3e4b504e1643ebb2f4b1ac24e635e61 haddock-api/src/Haddock/Backends/Hoogle.hs | 4 ++-- haddock-api/src/Haddock/Backends/LaTeX.hs | 18 +++++++++--------- haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | 20 ++++++++++---------- haddock-api/src/Haddock/Convert.hs | 18 +++++++++--------- haddock-api/src/Haddock/GhcUtils.hs | 11 +++-------- haddock-api/src/Haddock/Interface/Create.hs | 16 ++++++++-------- haddock-api/src/Haddock/Interface/Rename.hs | 16 ++++++++-------- haddock-api/src/Haddock/Utils.hs | 4 ++-- 8 files changed, 51 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 fd25ec56e3e4b504e1643ebb2f4b1ac24e635e61 From git at git.haskell.org Wed Jul 8 08:36:12 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:36:12 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, wip/10268, wip/10313, wip/D538-4, wip/D538-5, wip/D538-6, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: hide projectVersion from DynFlags since it clashes with Haddock.Version.projectVersion (7f23bd5) Message-ID: <20150708083612.A71553A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,wip/10268,wip/10313,wip/D538-4,wip/D538-5,wip/D538-6,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/7f23bd526a6dd6ed0a2ddeeb30724606ea058ef5 >--------------------------------------------------------------- commit 7f23bd526a6dd6ed0a2ddeeb30724606ea058ef5 Author: Luite Stegeman Date: Wed Nov 19 01:59:50 2014 +0100 hide projectVersion from DynFlags since it clashes with Haddock.Version.projectVersion >--------------------------------------------------------------- 7f23bd526a6dd6ed0a2ddeeb30724606ea058ef5 haddock-api/src/Haddock.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haddock-api/src/Haddock.hs b/haddock-api/src/Haddock.hs index ef03f8f..7e01090 100644 --- a/haddock-api/src/Haddock.hs +++ b/haddock-api/src/Haddock.hs @@ -63,7 +63,7 @@ import Paths_haddock_api (getDataDir) import GHC hiding (verbosity) import Config -import DynFlags hiding (verbosity) +import DynFlags hiding (projectVersion, verbosity) import StaticFlags (discardStaticFlags) import Panic (handleGhcException) import Module From git at git.haskell.org Wed Jul 8 08:36:14 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:36:14 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, master, wip/10268, wip/10313, wip/D538-4, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3, wip/orf-reboot: Add missing import for standalone haddock-api package (7c7468c) Message-ID: <20150708083614.B45A63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,master,wip/10268,wip/10313,wip/D538-4,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/7c7468c3a0cb2fa398379ea8ea019b8230229c1c >--------------------------------------------------------------- commit 7c7468c3a0cb2fa398379ea8ea019b8230229c1c Author: Luite Stegeman Date: Mon Dec 22 15:58:43 2014 +0100 Add missing import for standalone haddock-api package >--------------------------------------------------------------- 7c7468c3a0cb2fa398379ea8ea019b8230229c1c haddock-api/src/Haddock.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/haddock-api/src/Haddock.hs b/haddock-api/src/Haddock.hs index 7e01090..915ad47 100644 --- a/haddock-api/src/Haddock.hs +++ b/haddock-api/src/Haddock.hs @@ -59,6 +59,7 @@ import System.FilePath #else import qualified GHC.Paths as GhcPaths import Paths_haddock_api (getDataDir) +import System.Directory (doesDirectoryExist) #endif import GHC hiding (verbosity) From git at git.haskell.org Wed Jul 8 08:36:16 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:36:16 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, wip/10268, wip/10313, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/orf-reboot: Reset ghc-head with master's tree (3c191ef) Message-ID: <20150708083616.E10213A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,wip/10268,wip/10313,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/3c191ef6ef857c92b9962a72731482fb29ddfb7f >--------------------------------------------------------------- commit 3c191ef6ef857c92b9962a72731482fb29ddfb7f Merge: 7c7468c b94ab90 Author: Herbert Valerio Riedel Date: Mon Dec 22 17:46:37 2014 +0100 Reset ghc-head with master's tree (this is an overwriting git merge of master into ghc-head) >--------------------------------------------------------------- 3c191ef6ef857c92b9962a72731482fb29ddfb7f From git at git.haskell.org Wed Jul 8 08:36:18 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:36:18 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, wip/10268, wip/10313, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/orf-reboot: Bump versions for ghc-7.11 (45acead) Message-ID: <20150708083618.EE5A03A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,wip/10268,wip/10313,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/45acead293f9fc18e984d2e83d137809359d506d >--------------------------------------------------------------- commit 45acead293f9fc18e984d2e83d137809359d506d Author: Herbert Valerio Riedel Date: Mon Dec 22 17:51:52 2014 +0100 Bump versions for ghc-7.11 >--------------------------------------------------------------- 45acead293f9fc18e984d2e83d137809359d506d haddock-api/src/Haddock/InterfaceFile.hs | 2 +- haddock.cabal | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/haddock-api/src/Haddock/InterfaceFile.hs b/haddock-api/src/Haddock/InterfaceFile.hs index b0df549..e8db3cf 100644 --- a/haddock-api/src/Haddock/InterfaceFile.hs +++ b/haddock-api/src/Haddock/InterfaceFile.hs @@ -76,7 +76,7 @@ binaryInterfaceMagic = 0xD0Cface -- (2) set `binaryInterfaceVersionCompatibility` to [binaryInterfaceVersion] -- binaryInterfaceVersion :: Word16 -#if (__GLASGOW_HASKELL__ >= 709) && (__GLASGOW_HASKELL__ < 711) +#if (__GLASGOW_HASKELL__ >= 711) && (__GLASGOW_HASKELL__ < 713) binaryInterfaceVersion = 27 binaryInterfaceVersionCompatibility :: [Word16] diff --git a/haddock.cabal b/haddock.cabal index fbb4bfe..3b6002f 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -57,7 +57,7 @@ executable haddock array, xhtml >= 3000.2 && < 3000.3, Cabal >= 1.10, - ghc >= 7.9 && < 7.11, + ghc >= 7.11 && < 7.13, bytestring, transformers From git at git.haskell.org Wed Jul 8 08:36:21 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:36:21 +0000 (UTC) Subject: [commit: haddock] wip/D538-4: Update to match D538 (d1db447) Message-ID: <20150708083621.0B2BE3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/D538-4 Link : http://git.haskell.org/haddock.git/commitdiff/d1db447d6922f46250042b69317eeec9fbdcf8d9 >--------------------------------------------------------------- commit d1db447d6922f46250042b69317eeec9fbdcf8d9 Author: Austin Seipp Date: Tue Sep 9 01:03:27 2014 -0500 Update to match D538 >--------------------------------------------------------------- d1db447d6922f46250042b69317eeec9fbdcf8d9 haddock-api/src/Haddock/Backends/Hoogle.hs | 4 ++-- haddock-api/src/Haddock/Backends/LaTeX.hs | 18 +++++++++--------- haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | 20 ++++++++++---------- haddock-api/src/Haddock/Convert.hs | 18 +++++++++--------- haddock-api/src/Haddock/GhcUtils.hs | 11 +++-------- haddock-api/src/Haddock/Interface/Create.hs | 16 ++++++++-------- haddock-api/src/Haddock/Interface/Rename.hs | 16 ++++++++-------- haddock-api/src/Haddock/Utils.hs | 4 ++-- 8 files changed, 51 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 d1db447d6922f46250042b69317eeec9fbdcf8d9 From git at git.haskell.org Wed Jul 8 08:36:23 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:36:23 +0000 (UTC) Subject: [commit: haddock] wip/D538-4: Update to match D538 (49938e3) Message-ID: <20150708083623.164BF3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/D538-4 Link : http://git.haskell.org/haddock.git/commitdiff/49938e358421f29bad7b933a7ac8c843b5d2e30a >--------------------------------------------------------------- commit 49938e358421f29bad7b933a7ac8c843b5d2e30a Author: Austin Seipp Date: Tue Sep 9 01:03:27 2014 -0500 Update to match D538 Signed-off-by: Austin Seipp >--------------------------------------------------------------- 49938e358421f29bad7b933a7ac8c843b5d2e30a haddock-api/src/Haddock/Backends/LaTeX.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haddock-api/src/Haddock/Backends/LaTeX.hs b/haddock-api/src/Haddock/Backends/LaTeX.hs index b717fc0..8e781d1 100644 --- a/haddock-api/src/Haddock/Backends/LaTeX.hs +++ b/haddock-api/src/Haddock/Backends/LaTeX.hs @@ -32,7 +32,7 @@ import qualified Data.Map as Map import System.Directory import System.FilePath import Data.Char -import Control.Monad +import Control.Monad hiding (empty) import Data.Maybe import Data.List From git at git.haskell.org Wed Jul 8 08:36:25 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:36:25 +0000 (UTC) Subject: [commit: haddock] wip/D538-5, wip/D538-6: Fix import of 'empty' due to AMP. (f1113a7) Message-ID: <20150708083625.229353A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: wip/D538-5,wip/D538-6 Link : http://git.haskell.org/haddock.git/commitdiff/f1113a711c8a16a1e056ab0497cf50cf591bd88c >--------------------------------------------------------------- commit f1113a711c8a16a1e056ab0497cf50cf591bd88c Author: Austin Seipp Date: Tue Sep 9 01:03:27 2014 -0500 Fix import of 'empty' due to AMP. Signed-off-by: Austin Seipp >--------------------------------------------------------------- f1113a711c8a16a1e056ab0497cf50cf591bd88c haddock-api/src/Haddock/Backends/LaTeX.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haddock-api/src/Haddock/Backends/LaTeX.hs b/haddock-api/src/Haddock/Backends/LaTeX.hs index b717fc0..8e781d1 100644 --- a/haddock-api/src/Haddock/Backends/LaTeX.hs +++ b/haddock-api/src/Haddock/Backends/LaTeX.hs @@ -32,7 +32,7 @@ import qualified Data.Map as Map import System.Directory import System.FilePath import Data.Char -import Control.Monad +import Control.Monad hiding (empty) import Data.Maybe import Data.List From git at git.haskell.org Wed Jul 8 08:36:27 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:36:27 +0000 (UTC) Subject: [commit: haddock] wip/D538-5, wip/D538-6: Revert "Fix import of 'empty' due to AMP." (ef6dff0) Message-ID: <20150708083627.341AC3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: wip/D538-5,wip/D538-6 Link : http://git.haskell.org/haddock.git/commitdiff/ef6dff06a2b2919a394a7c06cd78c53490dbf7c1 >--------------------------------------------------------------- commit ef6dff06a2b2919a394a7c06cd78c53490dbf7c1 Author: Herbert Valerio Riedel Date: Fri Sep 26 19:18:28 2014 +0200 Revert "Fix import of 'empty' due to AMP." This reverts commit 0cc5bc85e9fca92ab712b68a2ba2c0dd9d3d79f4 since it turns out we don't need to re-export `empty` from Control.Monad after all. >--------------------------------------------------------------- ef6dff06a2b2919a394a7c06cd78c53490dbf7c1 haddock-api/src/Haddock/Backends/LaTeX.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haddock-api/src/Haddock/Backends/LaTeX.hs b/haddock-api/src/Haddock/Backends/LaTeX.hs index 8e781d1..b717fc0 100644 --- a/haddock-api/src/Haddock/Backends/LaTeX.hs +++ b/haddock-api/src/Haddock/Backends/LaTeX.hs @@ -32,7 +32,7 @@ import qualified Data.Map as Map import System.Directory import System.FilePath import Data.Char -import Control.Monad hiding (empty) +import Control.Monad import Data.Maybe import Data.List From git at git.haskell.org Wed Jul 8 08:36:29 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:36:29 +0000 (UTC) Subject: [commit: haddock] wip/D538-5, wip/D538-6: Update to match D538 (d29f7c5) Message-ID: <20150708083629.412713A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: wip/D538-5,wip/D538-6 Link : http://git.haskell.org/haddock.git/commitdiff/d29f7c5f0de69e8710132aad5151cf4206673b35 >--------------------------------------------------------------- commit d29f7c5f0de69e8710132aad5151cf4206673b35 Author: Austin Seipp Date: Tue Sep 9 01:03:27 2014 -0500 Update to match D538 Signed-off-by: Austin Seipp >--------------------------------------------------------------- d29f7c5f0de69e8710132aad5151cf4206673b35 haddock-api/src/Haddock/Backends/LaTeX.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haddock-api/src/Haddock/Backends/LaTeX.hs b/haddock-api/src/Haddock/Backends/LaTeX.hs index b717fc0..8e781d1 100644 --- a/haddock-api/src/Haddock/Backends/LaTeX.hs +++ b/haddock-api/src/Haddock/Backends/LaTeX.hs @@ -32,7 +32,7 @@ import qualified Data.Map as Map import System.Directory import System.FilePath import Data.Char -import Control.Monad +import Control.Monad hiding (empty) import Data.Maybe import Data.List From git at git.haskell.org Wed Jul 8 08:36:31 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:36:31 +0000 (UTC) Subject: [commit: haddock] wip/D538-5, wip/D538-6: Add missing import for standalone haddock-api package (b89e31b) Message-ID: <20150708083631.4EA333A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: wip/D538-5,wip/D538-6 Link : http://git.haskell.org/haddock.git/commitdiff/b89e31b3a30bad40b27fd03ce6fe6e3e636083f9 >--------------------------------------------------------------- commit b89e31b3a30bad40b27fd03ce6fe6e3e636083f9 Author: Luite Stegeman Date: Mon Dec 22 15:58:43 2014 +0100 Add missing import for standalone haddock-api package >--------------------------------------------------------------- b89e31b3a30bad40b27fd03ce6fe6e3e636083f9 haddock-api/src/Haddock.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/haddock-api/src/Haddock.hs b/haddock-api/src/Haddock.hs index 7e01090..915ad47 100644 --- a/haddock-api/src/Haddock.hs +++ b/haddock-api/src/Haddock.hs @@ -59,6 +59,7 @@ import System.FilePath #else import qualified GHC.Paths as GhcPaths import Paths_haddock_api (getDataDir) +import System.Directory (doesDirectoryExist) #endif import GHC hiding (verbosity) From git at git.haskell.org Wed Jul 8 08:36:33 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:36:33 +0000 (UTC) Subject: [commit: haddock] wip/D538-5, wip/D538-6: Bump versions for ghc-7.11 (0475714) Message-ID: <20150708083633.5E2743A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: wip/D538-5,wip/D538-6 Link : http://git.haskell.org/haddock.git/commitdiff/04757141e4c8646578ddc952310f489560b467e4 >--------------------------------------------------------------- commit 04757141e4c8646578ddc952310f489560b467e4 Author: Herbert Valerio Riedel Date: Mon Dec 22 17:51:52 2014 +0100 Bump versions for ghc-7.11 >--------------------------------------------------------------- 04757141e4c8646578ddc952310f489560b467e4 haddock-api/src/Haddock/InterfaceFile.hs | 2 +- haddock.cabal | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/haddock-api/src/Haddock/InterfaceFile.hs b/haddock-api/src/Haddock/InterfaceFile.hs index b0df549..e8db3cf 100644 --- a/haddock-api/src/Haddock/InterfaceFile.hs +++ b/haddock-api/src/Haddock/InterfaceFile.hs @@ -76,7 +76,7 @@ binaryInterfaceMagic = 0xD0Cface -- (2) set `binaryInterfaceVersionCompatibility` to [binaryInterfaceVersion] -- binaryInterfaceVersion :: Word16 -#if (__GLASGOW_HASKELL__ >= 709) && (__GLASGOW_HASKELL__ < 711) +#if (__GLASGOW_HASKELL__ >= 711) && (__GLASGOW_HASKELL__ < 713) binaryInterfaceVersion = 27 binaryInterfaceVersionCompatibility :: [Word16] diff --git a/haddock.cabal b/haddock.cabal index fbb4bfe..3b6002f 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -57,7 +57,7 @@ executable haddock array, xhtml >= 3000.2 && < 3000.3, Cabal >= 1.10, - ghc >= 7.9 && < 7.11, + ghc >= 7.11 && < 7.13, bytestring, transformers From git at git.haskell.org Wed Jul 8 08:36:35 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:36:35 +0000 (UTC) Subject: [commit: haddock] wip/D538-5: Update to match D538 (54c5e7c) Message-ID: <20150708083635.70E2F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/D538-5 Link : http://git.haskell.org/haddock.git/commitdiff/54c5e7cd0b5844712301cacc826a6b112dbc1090 >--------------------------------------------------------------- commit 54c5e7cd0b5844712301cacc826a6b112dbc1090 Author: Austin Seipp Date: Tue Sep 9 01:03:27 2014 -0500 Update to match D538 >--------------------------------------------------------------- 54c5e7cd0b5844712301cacc826a6b112dbc1090 haddock-api/src/Haddock/Backends/Hoogle.hs | 4 ++-- haddock-api/src/Haddock/Backends/LaTeX.hs | 18 +++++++++--------- haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | 20 ++++++++++---------- haddock-api/src/Haddock/Convert.hs | 18 +++++++++--------- haddock-api/src/Haddock/GhcUtils.hs | 11 +++-------- haddock-api/src/Haddock/Interface/Create.hs | 16 ++++++++-------- haddock-api/src/Haddock/Interface/Rename.hs | 16 ++++++++-------- haddock-api/src/Haddock/InterfaceFile.hs | 2 +- haddock-api/src/Haddock/Utils.hs | 4 ++-- haddock.cabal | 2 +- 10 files changed, 53 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 54c5e7cd0b5844712301cacc826a6b112dbc1090 From git at git.haskell.org Wed Jul 8 08:36:37 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:36:37 +0000 (UTC) Subject: [commit: haddock] master, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3: travis-ci: test with HEAD (c1cab87) Message-ID: <20150708083637.7D3FA3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: master,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3 Link : http://git.haskell.org/haddock.git/commitdiff/c1cab874c739c9b08ff28d3d67757e59a75531bf >--------------------------------------------------------------- commit c1cab874c739c9b08ff28d3d67757e59a75531bf Author: Mateusz Kowalczyk Date: Thu Dec 18 07:52:34 2014 +0000 travis-ci: test with HEAD >--------------------------------------------------------------- c1cab874c739c9b08ff28d3d67757e59a75531bf .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index ad1331f..9161d8d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,7 @@ language: haskell env: # - GHCVER=7.8.2 # - GHCVER=7.8.3 + - GHCVER=head before_install: - sudo add-apt-repository -y ppa:hvr/ghc From git at git.haskell.org Wed Jul 8 08:36:39 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:36:39 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, wip/10268, wip/10313, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/orf-reboot: Eliminate instanceHead' in favour of GHC's instanceSig (56b9e6b) Message-ID: <20150708083639.894FC3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,wip/10268,wip/10313,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/56b9e6bcef33612b40d3f93f170397eff77411eb >--------------------------------------------------------------- commit 56b9e6bcef33612b40d3f93f170397eff77411eb Author: Simon Peyton Jones Date: Tue Dec 23 15:22:56 2014 +0000 Eliminate instanceHead' in favour of GHC's instanceSig This is made possible by the elimination of "silent superclass parameters" in GHC >--------------------------------------------------------------- 56b9e6bcef33612b40d3f93f170397eff77411eb haddock-api/src/Haddock/Interface/AttachInstances.hs | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/haddock-api/src/Haddock/Interface/AttachInstances.hs b/haddock-api/src/Haddock/Interface/AttachInstances.hs index 1341e57..080de6f 100644 --- a/haddock-api/src/Haddock/Interface/AttachInstances.hs +++ b/haddock-api/src/Haddock/Interface/AttachInstances.hs @@ -80,7 +80,7 @@ attachToExportItem expInfo iface ifaceMap instIfaceMap export = , let opaque = isTypeHidden expInfo (fi_rhs i) ] cls_insts = [ (synifyInstHead i, instLookup instDocMap n iface ifaceMap instIfaceMap) - | let is = [ (instanceHead' i, getName i) | i <- cls_instances ] + | let is = [ (instanceSig i, getName i) | i <- cls_instances ] , (i@(_,_,cls,tys), n) <- sortBy (comparing $ first instHead) is , not $ isInstanceHidden expInfo cls tys ] @@ -117,20 +117,6 @@ instLookup f name iface ifaceMap instIfaceMap = iface' <- Map.lookup (nameModule name) ifaceMaps Map.lookup name (f iface') --- | Like GHC's 'instanceHead' but drops "silent" arguments. -instanceHead' :: ClsInst -> ([TyVar], ThetaType, Class, [Type]) -instanceHead' ispec = (tvs, dropSilentArgs dfun theta, cls, tys) - where - dfun = is_dfun ispec - (tvs, cls, tys) = instanceHead ispec - (_, theta, _) = tcSplitSigmaTy (idType dfun) - --- | Drop "silent" arguments. See GHC Note [Silent superclass --- arguments]. -dropSilentArgs :: DFunId -> ThetaType -> ThetaType -dropSilentArgs dfun theta = drop (dfunNSilent dfun) theta - - -- | Like GHC's getInfo but doesn't cut things out depending on the -- interative context, which we don't set sufficiently anyway. getAllInfo :: GhcMonad m => Name -> m (Maybe (TyThing,Fixity,[ClsInst],[FamInst])) From git at git.haskell.org Wed Jul 8 08:36:41 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:36:41 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, v2.15: Make 2.15.0.1 release (8ad134e) Message-ID: <20150708083641.947543A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,v2.15 Link : http://git.haskell.org/haddock.git/commitdiff/8ad134ee712c7a4fe9907d729d958b6e8c5fb85b >--------------------------------------------------------------- commit 8ad134ee712c7a4fe9907d729d958b6e8c5fb85b Author: Mateusz Kowalczyk Date: Tue Dec 23 18:26:27 2014 +0000 Make 2.15.0.1 release >--------------------------------------------------------------- 8ad134ee712c7a4fe9907d729d958b6e8c5fb85b .travis.yml | 1 + CHANGES | 4 ++++ haddock-api/haddock-api.cabal | 2 +- haddock.cabal | 6 +++--- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index ce6d680..e8ccb51 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,7 @@ language: haskell env: - GHCVER=7.8.2 - GHCVER=7.8.3 + - GHCVER=7.8.4 before_install: - sudo add-apt-repository -y ppa:hvr/ghc diff --git a/CHANGES b/CHANGES index a815567..e3b7658 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +Changes in version 2.15.0.1 + + * This release is identical to 2.15.0 except the GHC version bound. + Changes in version 2.15.0 * Always read in prologue files as UTF8 (#286 and Cabal #1721) diff --git a/haddock-api/haddock-api.cabal b/haddock-api/haddock-api.cabal index 028ef5b..864164d 100644 --- a/haddock-api/haddock-api.cabal +++ b/haddock-api/haddock-api.cabal @@ -45,7 +45,7 @@ library , array , xhtml >= 3000.2 && < 3000.3 , Cabal >= 1.10 - , ghc >= 7.8.2 && < 7.8.4 + , ghc >= 7.8.2 && <= 7.8.4 , ghc-paths , haddock-library == 1.1.1.* diff --git a/haddock.cabal b/haddock.cabal index bb14ee6..d43b654 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -1,5 +1,5 @@ name: haddock -version: 2.15.0 +version: 2.15.0.1 synopsis: A documentation-generation tool for Haskell libraries description: Haddock is a documentation-generation tool for Haskell libraries @@ -57,7 +57,7 @@ executable haddock array, xhtml >= 3000.2 && < 3000.3, Cabal >= 1.10, - ghc == 7.8.3, + ghc >= 7.8.2 && <= 7.8.4, bytestring other-modules: @@ -108,7 +108,7 @@ executable haddock Haddock.GhcUtils Haddock.Convert else - build-depends: haddock-api == 2.15.0 + build-depends: haddock-api == 2.15.0.1 test-suite html-test type: exitcode-stdio-1.0 From git at git.haskell.org Wed Jul 8 08:36:43 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:36:43 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.1, 2.15.0.2, v2.15: Bump haddock-api to 2.15.0.1 too (d230fef) Message-ID: <20150708083643.A1C613A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.1,2.15.0.2,v2.15 Link : http://git.haskell.org/haddock.git/commitdiff/d230feffebc89c61dbd243a54fe4ccc2694dd052 >--------------------------------------------------------------- commit d230feffebc89c61dbd243a54fe4ccc2694dd052 Author: Mateusz Kowalczyk Date: Tue Dec 23 18:33:28 2014 +0000 Bump haddock-api to 2.15.0.1 too >--------------------------------------------------------------- d230feffebc89c61dbd243a54fe4ccc2694dd052 haddock-api/haddock-api.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haddock-api/haddock-api.cabal b/haddock-api/haddock-api.cabal index 864164d..ccda734 100644 --- a/haddock-api/haddock-api.cabal +++ b/haddock-api/haddock-api.cabal @@ -1,5 +1,5 @@ name: haddock-api -version: 2.15.0 +version: 2.15.0.1 synopsis: A documentation-generation tool for Haskell libraries description: Haddock is a documentation-generation tool for Haskell libraries From git at git.haskell.org Wed Jul 8 08:36:45 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:36:45 +0000 (UTC) Subject: [commit: haddock] master, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3: Make travis use 7.10.x (43d0789) Message-ID: <20150708083645.B147C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: master,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3 Link : http://git.haskell.org/haddock.git/commitdiff/43d0789910061eda305141ca19c35e51d3888188 >--------------------------------------------------------------- commit 43d0789910061eda305141ca19c35e51d3888188 Author: Mateusz Kowalczyk Date: Mon Dec 29 15:28:47 2014 +0000 Make travis use 7.10.x >--------------------------------------------------------------- 43d0789910061eda305141ca19c35e51d3888188 .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9161d8d..f0b7eb1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,7 @@ language: haskell env: # - GHCVER=7.8.2 # - GHCVER=7.8.3 - - GHCVER=head + - GHCVER=7.10.1 before_install: - sudo add-apt-repository -y ppa:hvr/ghc From git at git.haskell.org Wed Jul 8 08:36:47 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:36:47 +0000 (UTC) Subject: [commit: haddock] master, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3: Turn the README into GitHub Markdown format. (9bd2bf9) Message-ID: <20150708083647.C6B0B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: master,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3 Link : http://git.haskell.org/haddock.git/commitdiff/9bd2bf9e8cbf1b2cc2affd27096b79d149528c5b >--------------------------------------------------------------- commit 9bd2bf9e8cbf1b2cc2affd27096b79d149528c5b Author: Njagi Mwaniki Date: Sat Dec 27 23:28:59 2014 +0300 Turn the README into GitHub Markdown format. Closes #354 >--------------------------------------------------------------- 9bd2bf9e8cbf1b2cc2affd27096b79d149528c5b README => README.md | 18 ++++++++++++++---- doc/{README => README.md} | 13 ++++++------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/README b/README.md similarity index 90% rename from README rename to README.md index 53f84bf..b85d99b 100644 --- a/README +++ b/README.md @@ -1,5 +1,7 @@ -Haddock, a Haskell Documentation Tool -===================================== +# Haddock, a Haskell Documentation Tool + + +#### About haddock This is Haddock, a tool for automatically generating documentation from annotated Haskell source code. It is primary intended for @@ -26,12 +28,20 @@ generated. Abstract types and classes are handled correctly. In fact, even without any documentation annotations, Haddock can generate useful documentation from your source code. + +#### Documentation formats + Haddock can generate documentation in multiple formats; currently HTML is implemented, and there is partial support for generating LaTeX and Hoogle. + +#### Source code documentation + Full documentation can be found in the doc/ subdirectory, in DocBook format. -Please create issues when you have any problems and pull requests if -you have some code. \ No newline at end of file + +#### Contributing + +Please create issues when you have any problems and pull requests if you have some code. diff --git a/doc/README b/doc/README.md similarity index 84% rename from doc/README rename to doc/README.md index 5bc038b..cf1fc31 100644 --- a/doc/README +++ b/doc/README.md @@ -1,5 +1,4 @@ -Haddock documentation ---------------------- +# Haddock documentation The documentation is in DocBook XML format. You need some tools to process it: at least xsltproc, and the DocBook XML DTD and XSL @@ -8,19 +7,19 @@ process the documentation on your system, and a Makefile to actually do the processing (so, on Windows, you'll need Cygwin or MSys in addition to the DocBook XML tools). To build the HTML documentation: - $ autoconf - $ ./configure - $ make html + $ autoconf + $ ./configure + $ make html which leaves the HTML documentation in a haddock/ subdirectory. Printable documentation can also be produced, eg.: - $ make pdf + $ make pdf or - $ make ps + $ make ps Generating the printed formats requires more tools (fop or xmltex) and tends to be a bit harder. From git at git.haskell.org Wed Jul 8 08:36:49 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:36:49 +0000 (UTC) Subject: [commit: haddock] 2.15, 2.15.0.2, v2.15: Make v2.15.0.2 release (a6016cd) Message-ID: <20150708083649.D17CD3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: 2.15,2.15.0.2,v2.15 Link : http://git.haskell.org/haddock.git/commitdiff/a6016cd3424c5caa4ae41996801d62e4be6f52a7 >--------------------------------------------------------------- commit a6016cd3424c5caa4ae41996801d62e4be6f52a7 Author: Mateusz Kowalczyk Date: Tue Dec 30 23:43:35 2014 +0000 Make v2.15.0.2 release Changes upper GHC bound from ?<= 7.8.4? to ?< 7.8.5 which admits patched GHC 7.8.4 versions (see comment on issue #349) Acked-by: Mateusz Kowalczyk >--------------------------------------------------------------- a6016cd3424c5caa4ae41996801d62e4be6f52a7 CHANGES | 5 +++++ haddock-api/haddock-api.cabal | 4 ++-- haddock.cabal | 6 +++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index e3b7658..ec955ca 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,8 @@ +Changes in version 2.15.0.2 + + * This release is identical to 2.15.0.2 except the GHC version bound + which was made more lenient. + Changes in version 2.15.0.1 * This release is identical to 2.15.0 except the GHC version bound. diff --git a/haddock-api/haddock-api.cabal b/haddock-api/haddock-api.cabal index ccda734..5df4efa 100644 --- a/haddock-api/haddock-api.cabal +++ b/haddock-api/haddock-api.cabal @@ -1,5 +1,5 @@ name: haddock-api -version: 2.15.0.1 +version: 2.15.0.2 synopsis: A documentation-generation tool for Haskell libraries description: Haddock is a documentation-generation tool for Haskell libraries @@ -45,7 +45,7 @@ library , array , xhtml >= 3000.2 && < 3000.3 , Cabal >= 1.10 - , ghc >= 7.8.2 && <= 7.8.4 + , ghc >= 7.8.2 && < 7.8.5 , ghc-paths , haddock-library == 1.1.1.* diff --git a/haddock.cabal b/haddock.cabal index d43b654..a595d2e 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -1,5 +1,5 @@ name: haddock -version: 2.15.0.1 +version: 2.15.0.2 synopsis: A documentation-generation tool for Haskell libraries description: Haddock is a documentation-generation tool for Haskell libraries @@ -57,7 +57,7 @@ executable haddock array, xhtml >= 3000.2 && < 3000.3, Cabal >= 1.10, - ghc >= 7.8.2 && <= 7.8.4, + ghc >= 7.8.2 && < 7.8.5, bytestring other-modules: @@ -108,7 +108,7 @@ executable haddock Haddock.GhcUtils Haddock.Convert else - build-depends: haddock-api == 2.15.0.1 + build-depends: haddock-api == 2.15.0.2 test-suite html-test type: exitcode-stdio-1.0 From git at git.haskell.org Wed Jul 8 08:36:51 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:36:51 +0000 (UTC) Subject: [commit: haddock] master, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3: bump haddock-api ghc dependency to allow release candidate and first release (959d205) Message-ID: <20150708083651.DC96E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: master,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3 Link : http://git.haskell.org/haddock.git/commitdiff/959d205924694fa4a803932ba80d2cb68f08989f >--------------------------------------------------------------- commit 959d205924694fa4a803932ba80d2cb68f08989f Author: Luite Stegeman Date: Mon Jan 5 16:25:37 2015 +0100 bump haddock-api ghc dependency to allow release candidate and first release >--------------------------------------------------------------- 959d205924694fa4a803932ba80d2cb68f08989f haddock-api/haddock-api.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haddock-api/haddock-api.cabal b/haddock-api/haddock-api.cabal index b2199c6..22b3ae5 100644 --- a/haddock-api/haddock-api.cabal +++ b/haddock-api/haddock-api.cabal @@ -45,7 +45,7 @@ library , array , xhtml >= 3000.2 && < 3000.3 , Cabal >= 1.10 - , ghc == 7.9.* + , ghc >= 7.10 && < 7.10.2 , ghc-paths , haddock-library == 1.2.0.* From git at git.haskell.org Wed Jul 8 08:36:53 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:36:53 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, wip/10268, wip/10313, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/orf-reboot: Remove redundant constraints from haddock, discovered by -fwarn-redundant-constraints (8b1d44f) Message-ID: <20150708083653.E8E293A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,wip/10268,wip/10313,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/8b1d44fbdde141cf883f5ddcd337bbbab8433228 >--------------------------------------------------------------- commit 8b1d44fbdde141cf883f5ddcd337bbbab8433228 Author: Simon Peyton Jones Date: Tue Jan 6 16:37:47 2015 +0000 Remove redundant constraints from haddock, discovered by -fwarn-redundant-constraints >--------------------------------------------------------------- 8b1d44fbdde141cf883f5ddcd337bbbab8433228 haddock-api/src/Haddock/Interface.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haddock-api/src/Haddock/Interface.hs b/haddock-api/src/Haddock/Interface.hs index 1bb04ed..afb5111 100644 --- a/haddock-api/src/Haddock/Interface.hs +++ b/haddock-api/src/Haddock/Interface.hs @@ -239,6 +239,6 @@ buildHomeLinks ifaces = foldl upd Map.empty (reverse ifaces) -------------------------------------------------------------------------------- -withTempDir :: (ExceptionMonad m, MonadIO m) => FilePath -> m a -> m a +withTempDir :: (ExceptionMonad m) => FilePath -> m a -> m a withTempDir dir = gbracket_ (liftIO $ createDirectory dir) (liftIO $ removeDirectoryRecursive dir) From git at git.haskell.org Wed Jul 8 08:36:56 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:36:56 +0000 (UTC) Subject: [commit: haddock] wip/D538-6: Update to match D538 (f60be3d) Message-ID: <20150708083656.0755B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/D538-6 Link : http://git.haskell.org/haddock.git/commitdiff/f60be3d460aa7e1e7c568a8d43d7ef7dbe25e0bf >--------------------------------------------------------------- commit f60be3d460aa7e1e7c568a8d43d7ef7dbe25e0bf Author: Austin Seipp Date: Tue Sep 9 01:03:27 2014 -0500 Update to match D538 >--------------------------------------------------------------- f60be3d460aa7e1e7c568a8d43d7ef7dbe25e0bf haddock-api/src/Haddock/Backends/Hoogle.hs | 6 +++--- haddock-api/src/Haddock/Backends/LaTeX.hs | 24 ++++++++++++------------ haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | 26 +++++++++++++------------- haddock-api/src/Haddock/Convert.hs | 22 +++++++++++----------- haddock-api/src/Haddock/GhcUtils.hs | 11 +++-------- haddock-api/src/Haddock/Interface/Create.hs | 18 +++++++++--------- haddock-api/src/Haddock/Interface/Rename.hs | 18 +++++++++--------- haddock-api/src/Haddock/InterfaceFile.hs | 2 +- haddock-api/src/Haddock/Utils.hs | 4 ++-- haddock.cabal | 2 +- 10 files changed, 64 insertions(+), 69 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 f60be3d460aa7e1e7c568a8d43d7ef7dbe25e0bf From git at git.haskell.org Wed Jul 8 08:36:58 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:36:58 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, wip/10268, wip/10313, wip/D548-master, wip/D548-master-2, wip/T10483, wip/T9840, wip/orf-reboot: Track naming change in DataCon (04cf63d) Message-ID: <20150708083658.12FDB3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,wip/10268,wip/10313,wip/D548-master,wip/D548-master-2,wip/T10483,wip/T9840,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/04cf63d0195837ed52075ed7d2676e71831e8a0b >--------------------------------------------------------------- commit 04cf63d0195837ed52075ed7d2676e71831e8a0b Author: Simon Peyton Jones Date: Thu Jan 8 15:50:22 2015 +0000 Track naming change in DataCon >--------------------------------------------------------------- 04cf63d0195837ed52075ed7d2676e71831e8a0b haddock-api/src/Haddock/Convert.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/haddock-api/src/Haddock/Convert.hs b/haddock-api/src/Haddock/Convert.hs index 1b1a8a8..29d1339 100644 --- a/haddock-api/src/Haddock/Convert.hs +++ b/haddock-api/src/Haddock/Convert.hs @@ -265,15 +265,15 @@ synifyDataCon use_gadt_syntax dc = linear_tys = zipWith (\ty bang -> let tySyn = synifyType WithinType ty src_bang = case bang of - HsUnpack {} -> HsUserBang (Just True) True - HsStrict -> HsUserBang (Just False) True + HsUnpack {} -> HsSrcBang (Just True) True + HsStrict -> HsSrcBang (Just False) True _ -> bang in case src_bang of HsNoBang -> tySyn _ -> noLoc $ HsBangTy bang tySyn -- HsNoBang never appears, it's implied instead. ) - arg_tys (dataConStrictMarks dc) + arg_tys (dataConSrcBangs dc) field_tys = zipWith (\field synTy -> noLoc $ ConDeclField [synifyName field] synTy Nothing) (dataConFieldLabels dc) linear_tys From git at git.haskell.org Wed Jul 8 08:37:00 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:37:00 +0000 (UTC) Subject: [commit: haddock] wip/D548-master, wip/D548-master-2: Fix import of 'empty' due to AMP. (bef589a) Message-ID: <20150708083700.1FCB03A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: wip/D548-master,wip/D548-master-2 Link : http://git.haskell.org/haddock.git/commitdiff/bef589a72b6029b310c04ede73ae2e5d9b3e3264 >--------------------------------------------------------------- commit bef589a72b6029b310c04ede73ae2e5d9b3e3264 Author: Austin Seipp Date: Tue Sep 9 01:03:27 2014 -0500 Fix import of 'empty' due to AMP. Signed-off-by: Austin Seipp >--------------------------------------------------------------- bef589a72b6029b310c04ede73ae2e5d9b3e3264 haddock-api/src/Haddock/Backends/LaTeX.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haddock-api/src/Haddock/Backends/LaTeX.hs b/haddock-api/src/Haddock/Backends/LaTeX.hs index b717fc0..8e781d1 100644 --- a/haddock-api/src/Haddock/Backends/LaTeX.hs +++ b/haddock-api/src/Haddock/Backends/LaTeX.hs @@ -32,7 +32,7 @@ import qualified Data.Map as Map import System.Directory import System.FilePath import Data.Char -import Control.Monad +import Control.Monad hiding (empty) import Data.Maybe import Data.List From git at git.haskell.org Wed Jul 8 08:37:02 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:37:02 +0000 (UTC) Subject: [commit: haddock] wip/D548-master, wip/D548-master-2: Revert "Fix import of 'empty' due to AMP." (5c0d3d6) Message-ID: <20150708083702.2CBFF3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: wip/D548-master,wip/D548-master-2 Link : http://git.haskell.org/haddock.git/commitdiff/5c0d3d6e1cb15261b617e3c05469cae9a65f0b03 >--------------------------------------------------------------- commit 5c0d3d6e1cb15261b617e3c05469cae9a65f0b03 Author: Herbert Valerio Riedel Date: Fri Sep 26 19:18:28 2014 +0200 Revert "Fix import of 'empty' due to AMP." This reverts commit 0cc5bc85e9fca92ab712b68a2ba2c0dd9d3d79f4 since it turns out we don't need to re-export `empty` from Control.Monad after all. >--------------------------------------------------------------- 5c0d3d6e1cb15261b617e3c05469cae9a65f0b03 haddock-api/src/Haddock/Backends/LaTeX.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haddock-api/src/Haddock/Backends/LaTeX.hs b/haddock-api/src/Haddock/Backends/LaTeX.hs index 8e781d1..b717fc0 100644 --- a/haddock-api/src/Haddock/Backends/LaTeX.hs +++ b/haddock-api/src/Haddock/Backends/LaTeX.hs @@ -32,7 +32,7 @@ import qualified Data.Map as Map import System.Directory import System.FilePath import Data.Char -import Control.Monad hiding (empty) +import Control.Monad import Data.Maybe import Data.List From git at git.haskell.org Wed Jul 8 08:37:04 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:37:04 +0000 (UTC) Subject: [commit: haddock] wip/D548-master, wip/D548-master-2: Update to match D538 (091b9e6) Message-ID: <20150708083704.3AAF23A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: wip/D548-master,wip/D548-master-2 Link : http://git.haskell.org/haddock.git/commitdiff/091b9e6687e853598db8f9f1efe7078011ea110b >--------------------------------------------------------------- commit 091b9e6687e853598db8f9f1efe7078011ea110b Author: Austin Seipp Date: Tue Sep 9 01:03:27 2014 -0500 Update to match D538 Signed-off-by: Austin Seipp >--------------------------------------------------------------- 091b9e6687e853598db8f9f1efe7078011ea110b haddock-api/src/Haddock/Backends/LaTeX.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haddock-api/src/Haddock/Backends/LaTeX.hs b/haddock-api/src/Haddock/Backends/LaTeX.hs index b717fc0..8e781d1 100644 --- a/haddock-api/src/Haddock/Backends/LaTeX.hs +++ b/haddock-api/src/Haddock/Backends/LaTeX.hs @@ -32,7 +32,7 @@ import qualified Data.Map as Map import System.Directory import System.FilePath import Data.Char -import Control.Monad +import Control.Monad hiding (empty) import Data.Maybe import Data.List From git at git.haskell.org Wed Jul 8 08:37:06 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:37:06 +0000 (UTC) Subject: [commit: haddock] wip/D548-master: Update to match D538 (0bceabc) Message-ID: <20150708083706.4EAC43A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/D548-master Link : http://git.haskell.org/haddock.git/commitdiff/0bceabc3bd56408bddcbeb0c5a919f0098a3d9a7 >--------------------------------------------------------------- commit 0bceabc3bd56408bddcbeb0c5a919f0098a3d9a7 Author: Austin Seipp Date: Tue Sep 9 01:03:27 2014 -0500 Update to match D538 >--------------------------------------------------------------- 0bceabc3bd56408bddcbeb0c5a919f0098a3d9a7 haddock-api/src/Haddock/Backends/Hoogle.hs | 6 +++--- haddock-api/src/Haddock/Backends/LaTeX.hs | 24 ++++++++++++------------ haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | 26 +++++++++++++------------- haddock-api/src/Haddock/Convert.hs | 22 +++++++++++----------- haddock-api/src/Haddock/GhcUtils.hs | 11 +++-------- haddock-api/src/Haddock/Interface/Create.hs | 18 +++++++++--------- haddock-api/src/Haddock/Interface/Rename.hs | 18 +++++++++--------- haddock-api/src/Haddock/Utils.hs | 4 ++-- 8 files changed, 62 insertions(+), 67 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 0bceabc3bd56408bddcbeb0c5a919f0098a3d9a7 From git at git.haskell.org Wed Jul 8 08:37:08 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:37:08 +0000 (UTC) Subject: [commit: haddock] wip/D548-master-2: Update to match D538 (7cce80a) Message-ID: <20150708083708.677523A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/D548-master-2 Link : http://git.haskell.org/haddock.git/commitdiff/7cce80ac19748cef4446e0373b9078d69b2319a5 >--------------------------------------------------------------- commit 7cce80ac19748cef4446e0373b9078d69b2319a5 Author: Austin Seipp Date: Tue Sep 9 01:03:27 2014 -0500 Update to match D538 >--------------------------------------------------------------- 7cce80ac19748cef4446e0373b9078d69b2319a5 haddock-api/src/Haddock/Backends/Hoogle.hs | 6 +++--- haddock-api/src/Haddock/Backends/LaTeX.hs | 24 ++++++++++++------------ haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | 26 +++++++++++++------------- haddock-api/src/Haddock/Convert.hs | 22 +++++++++++----------- haddock-api/src/Haddock/GhcUtils.hs | 14 +++----------- haddock-api/src/Haddock/Interface/Create.hs | 18 +++++++++--------- haddock-api/src/Haddock/Interface/Rename.hs | 18 +++++++++--------- haddock-api/src/Haddock/Utils.hs | 4 ++-- 8 files changed, 62 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 7cce80ac19748cef4446e0373b9078d69b2319a5 From git at git.haskell.org Wed Jul 8 08:37:10 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:37:10 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, wip/10268, wip/10313, wip/T10483, wip/T9840, wip/orf-reboot: Follow API changes in D538 (d61bbc7) Message-ID: <20150708083710.7A3923A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,wip/10268,wip/10313,wip/T10483,wip/T9840,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/d61bbc75890e4eb0ad508b9c2a27b91f691213e6 >--------------------------------------------------------------- commit d61bbc75890e4eb0ad508b9c2a27b91f691213e6 Author: Alan Zimmerman Date: Tue Sep 9 01:03:27 2014 -0500 Follow API changes in D538 Signed-off-by: Austin Seipp >--------------------------------------------------------------- d61bbc75890e4eb0ad508b9c2a27b91f691213e6 haddock-api/src/Haddock/Backends/Hoogle.hs | 6 +++--- haddock-api/src/Haddock/Backends/LaTeX.hs | 22 +++++++++++----------- haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | 26 +++++++++++++------------- haddock-api/src/Haddock/Convert.hs | 22 +++++++++++----------- haddock-api/src/Haddock/GhcUtils.hs | 14 +++----------- haddock-api/src/Haddock/Interface/Create.hs | 18 +++++++++--------- haddock-api/src/Haddock/Interface/Rename.hs | 18 +++++++++--------- haddock-api/src/Haddock/Utils.hs | 4 ++-- 8 files changed, 61 insertions(+), 69 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 d61bbc75890e4eb0ad508b9c2a27b91f691213e6 From git at git.haskell.org Wed Jul 8 08:37:12 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:37:12 +0000 (UTC) Subject: [commit: haddock] master, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3: Ignore warnings, install Cabal 1.22 (7b65f55) Message-ID: <20150708083712.8493D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: master,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3 Link : http://git.haskell.org/haddock.git/commitdiff/7b65f556c1087f205eaa45b8592dfa687e78c669 >--------------------------------------------------------------- commit 7b65f556c1087f205eaa45b8592dfa687e78c669 Author: JP Moresmau Date: Wed Jan 21 16:34:08 2015 +0100 Ignore warnings, install Cabal 1.22 >--------------------------------------------------------------- 7b65f556c1087f205eaa45b8592dfa687e78c669 .travis.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index f0b7eb1..ab3388c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,14 +10,18 @@ before_install: - sudo apt-get update - sudo apt-get install ghc-$GHCVER - export PATH=/opt/ghc/$GHCVER/bin:$PATH + - sudo apt-get install cabal-install-1.22 + - export PATH=/opt/cabal/1.22/bin:$PATH + - cabal --version - cd haddock-library - cabal install --only-dependencies --enable-tests - cabal install doctest - - cabal configure --enable-tests --ghc-options=-Werror && cabal build && cabal test + # --ghc-options=-Werror + - cabal configure --enable-tests && cabal build && cabal test - doctest -isrc -i$(echo vendor/attoparsec-*) -optP-include -optPdist/build/autogen/cabal_macros.h src/Documentation/Haddock/Parser.hs - cabal install - cd .. - - (cd haddock-api/ && cabal install --only-dependencies --enable-tests && cabal configure --enable-tests --ghc-options=-Werror && cabal build && cabal test && cabal install) + - (cd haddock-api/ && cabal install --only-dependencies --enable-tests && cabal configure --enable-tests && cabal build && cabal test && cabal install) script: - - cabal configure --enable-tests --ghc-options=-Werror && cabal build && cabal test + - cabal configure --enable-tests && cabal build && cabal test From git at git.haskell.org Wed Jul 8 08:37:14 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:37:14 +0000 (UTC) Subject: [commit: haddock] master, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3: solve dataDir ambiguity (08c65a9) Message-ID: <20150708083714.907AD3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: master,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3 Link : http://git.haskell.org/haddock.git/commitdiff/08c65a9cdd3eb01b1b9e3e5d572cd1fdc1bd4188 >--------------------------------------------------------------- commit 08c65a9cdd3eb01b1b9e3e5d572cd1fdc1bd4188 Author: jpmoresmau Date: Wed Jan 21 20:10:39 2015 +0100 solve dataDir ambiguity >--------------------------------------------------------------- 08c65a9cdd3eb01b1b9e3e5d572cd1fdc1bd4188 latex-test/run.lhs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/latex-test/run.lhs b/latex-test/run.lhs index c1d48d9..d3e39e9 100755 --- a/latex-test/run.lhs +++ b/latex-test/run.lhs @@ -6,7 +6,7 @@ import Control.Monad import Control.Applicative import Data.List import Data.Maybe -import Distribution.InstalledPackageInfo +import Distribution.InstalledPackageInfo hiding (dataDir) import Distribution.Package (PackageName (..)) import Distribution.Simple.Compiler import Distribution.Simple.GHC From git at git.haskell.org Wed Jul 8 08:37:16 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:37:16 +0000 (UTC) Subject: [commit: haddock] master, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3: support GHC 7.10: no Safe-Inferred, Foldable instance (8d3df49) Message-ID: <20150708083716.A75CA3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: master,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3 Link : http://git.haskell.org/haddock.git/commitdiff/8d3df49ae1aa2eb58af530bba0c71817411fd49d >--------------------------------------------------------------- commit 8d3df49ae1aa2eb58af530bba0c71817411fd49d Author: jpmoresmau Date: Wed Jan 21 21:31:24 2015 +0100 support GHC 7.10: no Safe-Inferred, Foldable instance >--------------------------------------------------------------- 8d3df49ae1aa2eb58af530bba0c71817411fd49d html-test/ref/A.html | 2 +- html-test/ref/AdvanceTypes.html | 2 +- html-test/ref/B.html | 2 +- html-test/ref/Bold.html | 2 +- html-test/ref/Bug1.html | 2 +- html-test/ref/Bug195.html | 4 ++-- html-test/ref/Bug2.html | 2 +- html-test/ref/Bug201.html | 2 +- html-test/ref/Bug26.html | 2 +- html-test/ref/Bug294.html | 2 +- html-test/ref/Bug298.html | 2 +- html-test/ref/Bug3.html | 2 +- html-test/ref/Bug308.html | 2 +- html-test/ref/Bug308CrossModule.html | 2 +- html-test/ref/Bug313.html | 2 +- html-test/ref/Bug335.html | 2 +- html-test/ref/Bug4.html | 2 +- html-test/ref/Bug6.html | 2 +- html-test/ref/Bug7.html | 2 +- html-test/ref/Bug8.html | 8 +++++--- html-test/ref/Bug85.html | 4 ++-- html-test/ref/BugDeprecated.html | 2 +- html-test/ref/BugExportHeadings.html | 2 +- html-test/ref/Bugs.html | 2 +- html-test/ref/CrossPackageDocs.html | 2 +- html-test/ref/DeprecatedClass.html | 2 +- html-test/ref/DeprecatedData.html | 2 +- html-test/ref/DeprecatedFunction.html | 2 +- html-test/ref/DeprecatedFunction2.html | 2 +- html-test/ref/DeprecatedFunction3.html | 2 +- html-test/ref/DeprecatedModule.html | 2 +- html-test/ref/DeprecatedModule2.html | 2 +- html-test/ref/DeprecatedNewtype.html | 2 +- html-test/ref/DeprecatedReExport.html | 2 +- html-test/ref/DeprecatedRecord.html | 2 +- html-test/ref/DeprecatedTypeFamily.html | 4 ++-- html-test/ref/DeprecatedTypeSynonym.html | 2 +- html-test/ref/Examples.html | 2 +- html-test/ref/Extensions.html | 2 +- html-test/ref/FunArgs.html | 2 +- html-test/ref/GADTRecords.html | 2 +- html-test/ref/Hash.html | 2 +- html-test/ref/HiddenInstances.html | 2 +- html-test/ref/HiddenInstancesB.html | 2 +- html-test/ref/Hyperlinks.html | 2 +- html-test/ref/IgnoreExports.html | 2 +- html-test/ref/ImplicitParams.html | 2 +- html-test/ref/Minimal.html | 2 +- html-test/ref/ModuleWithWarning.html | 2 +- html-test/ref/NamedDoc.html | 2 +- html-test/ref/Nesting.html | 2 +- html-test/ref/NoLayout.html | 2 +- html-test/ref/NonGreedy.html | 2 +- html-test/ref/Operators.html | 2 +- html-test/ref/PatternSyns.html | 2 +- html-test/ref/Properties.html | 2 +- html-test/ref/PruneWithWarning.html | 2 +- html-test/ref/SpuriousSuperclassConstraints.html | 2 +- html-test/ref/Test.html | 2 +- html-test/ref/Ticket253_1.html | 2 +- html-test/ref/Ticket253_2.html | 2 +- html-test/ref/Ticket61.html | 2 +- html-test/ref/Ticket75.html | 2 +- html-test/ref/TitledPicture.html | 2 +- html-test/ref/TypeFamilies.html | 2 +- html-test/ref/TypeFamilies2.html | 2 +- html-test/ref/TypeOperators.html | 2 +- html-test/ref/Unicode.html | 2 +- html-test/ref/Visible.html | 2 +- html-test/src/Bug8.hs | 1 + 70 files changed, 77 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 8d3df49ae1aa2eb58af530bba0c71817411fd49d From git at git.haskell.org Wed Jul 8 08:37:18 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:37:18 +0000 (UTC) Subject: [commit: haddock] master, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3: Update test files (2c60cb0) Message-ID: <20150708083718.B46CB3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: master,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3 Link : http://git.haskell.org/haddock.git/commitdiff/2c60cb0da855d76c57980298056cefe15ff4c226 >--------------------------------------------------------------- commit 2c60cb0da855d76c57980298056cefe15ff4c226 Author: Mateusz Kowalczyk Date: Thu Jan 22 19:32:10 2015 +0000 Update test files Test: a correct behaviour for fields comma-separating values. I'm surprised we had no bug open for this. Maybe it affects how #301 renders now but I doubt. Operators: Seems GHC is giving us a new order for operators, something must have changed on their side again. cc @haasn , this makes the fixity to the side not match the order on the LHS which is a bit unpleasant. Maybe the fixity can be made to match the GHC order? Bug335: We expand examples by default now. Bug310: Now inferred safe. >--------------------------------------------------------------- 2c60cb0da855d76c57980298056cefe15ff4c226 html-test/ref/Bug310.html | 4 ++-- html-test/ref/Bug335.html | 6 +++--- html-test/ref/Operators.html | 16 ++++++++-------- html-test/ref/Test.html | 40 +++++----------------------------------- 4 files changed, 18 insertions(+), 48 deletions(-) diff --git a/html-test/ref/Bug310.html b/html-test/ref/Bug310.html index 926d6cf..c38af59 100644 --- a/html-test/ref/Bug310.html +++ b/html-test/ref/Bug310.html @@ -35,7 +35,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_Bug310.html");}; >Safe HaskellNoneSafe

    Produced by Haddock version 2.15.1

    version 2.16.0

    ExF:

    abc

    ExG:

    >>> 

    Produced by Haddock version 2.15.1

    version 2.16.0

    (**>), (<**)(**<), (>**), (**<)(<**) :: a -> a -> ()

    (**>), (<**), (>**), (**<), (>**), (<**) :: a -> a -> () infixr 8 **>, >**infixl 8 <**, **<infixl 8 **<, <**

    Produced by Haddock version 2.15.0

    version 2.16.0

  • r :: Int
  • , s :: Int
  • u :: Int
  • , v :: Int
    r :: Int

    This comment applies to both r and s

    , s :: Int
    u :: Int
     
    , v :: Int

    Produced by Haddock version 2.15.0

    version 2.16.0

  • Repository : ssh://git at git.haskell.org/haddock On branches: master,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3 Link : http://git.haskell.org/haddock.git/commitdiff/279a662adc83dba2e24bd0b99f7da9d63455f840 >--------------------------------------------------------------- commit 279a662adc83dba2e24bd0b99f7da9d63455f840 Author: jpmoresmau Date: Tue Jan 20 18:27:16 2015 +0100 Links to source location of class instance definitions >--------------------------------------------------------------- 279a662adc83dba2e24bd0b99f7da9d63455f840 .../resources/html/Ocean.std-theme/ocean.css | 9 +++++ haddock-api/src/Haddock/Backends/LaTeX.hs | 4 +- haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | 18 ++++----- haddock-api/src/Haddock/Backends/Xhtml/Layout.hs | 44 ++++++++++++++++------ .../src/Haddock/Interface/AttachInstances.hs | 11 +++--- haddock-api/src/Haddock/Interface/Rename.hs | 4 +- haddock-api/src/Haddock/Types.hs | 4 +- 7 files changed, 62 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 279a662adc83dba2e24bd0b99f7da9d63455f840 From git at git.haskell.org Wed Jul 8 08:37:22 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:37:22 +0000 (UTC) Subject: [commit: haddock] master, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3: Filter '\r' from comments due to Windows problems. (41e146b) Message-ID: <20150708083722.D66D93A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: master,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3 Link : http://git.haskell.org/haddock.git/commitdiff/41e146b93456e5181df479952f066d747d8dcb83 >--------------------------------------------------------------- commit 41e146b93456e5181df479952f066d747d8dcb83 Author: Vincent Berthoux Date: Wed Jan 21 23:11:12 2015 +0100 Filter '\r' from comments due to Windows problems. On Windows this was causing newline to be rendered twice in code blocks. Closes #359, fixes #356. >--------------------------------------------------------------- 41e146b93456e5181df479952f066d747d8dcb83 haddock-library/src/Documentation/Haddock/Parser.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/haddock-library/src/Documentation/Haddock/Parser.hs b/haddock-library/src/Documentation/Haddock/Parser.hs index b7ab85b..5c607a1 100644 --- a/haddock-library/src/Documentation/Haddock/Parser.hs +++ b/haddock-library/src/Documentation/Haddock/Parser.hs @@ -93,7 +93,8 @@ parseParas input = case parseParasState input of } parseParasState :: String -> (ParserState, DocH mod Identifier) -parseParasState = parse (p <* skipSpace) . encodeUtf8 . (++ "\n") +parseParasState = + parse (p <* skipSpace) . encodeUtf8 . (++ "\n") . filter (/= '\r') where p :: Parser (DocH mod Identifier) p = docConcat <$> paragraph `sepBy` many (skipHorizontalSpace *> "\n") @@ -105,7 +106,7 @@ parseParagraphs input = case parseParasState input of -- | Parse a text paragraph. Actually just a wrapper over 'parseStringBS' which -- drops leading whitespace and encodes the string to UTF8 first. parseString :: String -> DocH mod Identifier -parseString = parseStringBS . encodeUtf8 . dropWhile isSpace +parseString = parseStringBS . encodeUtf8 . dropWhile isSpace . filter (/= '\r') parseStringBS :: BS.ByteString -> DocH mod Identifier parseStringBS = snd . parse p From git at git.haskell.org Wed Jul 8 08:37:24 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:37:24 +0000 (UTC) Subject: [commit: haddock] master, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3: Changelog only (fe10d30) Message-ID: <20150708083724.E412D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: master,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3 Link : http://git.haskell.org/haddock.git/commitdiff/fe10d3082457f744fd27bbb1085edcfd813f6290 >--------------------------------------------------------------- commit fe10d3082457f744fd27bbb1085edcfd813f6290 Author: Mateusz Kowalczyk Date: Thu Jan 22 20:31:27 2015 +0000 Changelog only >--------------------------------------------------------------- fe10d3082457f744fd27bbb1085edcfd813f6290 CHANGES | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGES b/CHANGES index 5688537..d98f7e1 100644 --- a/CHANGES +++ b/CHANGES @@ -26,6 +26,10 @@ Changes in version 2.16.0 * properly render package ID (not package key) in index (#329) + * links to source location of class instance definitions + + * Fix code blocks in presence of Windows line endings + Changes in version 2.15.0 * Always read in prologue files as UTF8 (#286 and Cabal #1721) From git at git.haskell.org Wed Jul 8 08:37:27 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:37:27 +0000 (UTC) Subject: [commit: haddock] master, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3: --package-name and --package-version flags (8e06728) Message-ID: <20150708083727.00BBD3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: master,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3 Link : http://git.haskell.org/haddock.git/commitdiff/8e06728afb0784128ab2df0be7a5d7a191d30ff4 >--------------------------------------------------------------- commit 8e06728afb0784128ab2df0be7a5d7a191d30ff4 Author: Mateusz Kowalczyk Date: Thu Jan 22 23:34:05 2015 +0000 --package-name and --package-version flags Used for --hoogle amongst other things. Now we need to teach cabal to use it. The situation is still a bit sub-par because if the flags aren't passed in, the crash will occur. Closes #353. >--------------------------------------------------------------- 8e06728afb0784128ab2df0be7a5d7a191d30ff4 haddock-api/src/Haddock.hs | 27 ++++++++++++++++++++++++--- haddock-api/src/Haddock/GhcUtils.hs | 14 -------------- haddock-api/src/Haddock/Options.hs | 37 +++++++++++++++++++++++++++++-------- 3 files changed, 53 insertions(+), 25 deletions(-) diff --git a/haddock-api/src/Haddock.hs b/haddock-api/src/Haddock.hs index 915ad47..72c544e 100644 --- a/haddock-api/src/Haddock.hs +++ b/haddock-api/src/Haddock.hs @@ -25,6 +25,7 @@ module Haddock ( withGhc ) where +import Data.Version import Haddock.Backends.Xhtml import Haddock.Backends.Xhtml.Themes (getThemes) import Haddock.Backends.LaTeX @@ -36,7 +37,6 @@ import Haddock.Version import Haddock.InterfaceFile import Haddock.Options import Haddock.Utils -import Haddock.GhcUtils hiding (pretty) import Control.Monad hiding (forM_) import Data.Foldable (forM_) @@ -66,9 +66,9 @@ import GHC hiding (verbosity) import Config import DynFlags hiding (projectVersion, verbosity) import StaticFlags (discardStaticFlags) +import Packages import Panic (handleGhcException) import Module -import PackageConfig import FastString -------------------------------------------------------------------------------- @@ -252,7 +252,7 @@ render dflags flags qual ifaces installedIfaces srcMap = do pkgMod = ifaceMod (head ifaces) pkgKey = modulePackageKey pkgMod pkgStr = Just (packageKeyString pkgKey) - (pkgName,pkgVer) = modulePackageInfo dflags pkgMod + (pkgName,pkgVer) = modulePackageInfo dflags flags pkgMod (srcBase, srcModule, srcEntity, srcLEntity) = sourceUrls flags srcMap' = maybe srcMap (\path -> Map.insert pkgKey path srcMap) srcEntity @@ -299,6 +299,27 @@ render dflags flags qual ifaces installedIfaces srcMap = do ppLaTeX title pkgStr visibleIfaces odir (fmap _doc prologue) opt_latex_style libDir +-- | From GHC 7.10, this function has a potential to crash with a +-- nasty message such as @expectJust getPackageDetails@ because +-- package name and versions can no longer reliably be extracted in +-- all cases: if the package is not installed yet then this info is no +-- longer available. The @--package-name@ and @--package-version@ +-- Haddock flags allow the user to specify this information and it is +-- returned here if present: if it is not present, the error will +-- occur. Nasty but that's how it is for now. Potential TODO. +modulePackageInfo :: DynFlags + -> [Flag] -- ^ Haddock flags are checked as they may + -- contain the package name or version + -- provided by the user which we + -- prioritise + -> Module -> (PackageName, Data.Version.Version) +modulePackageInfo dflags flags modu = + (fromMaybe (packageName pkg) (optPackageName flags), + fromMaybe (packageVersion pkg) (optPackageVersion flags)) + where + pkg = getPackageDetails dflags (modulePackageKey modu) + + ------------------------------------------------------------------------------- -- * Reading and dumping interface files ------------------------------------------------------------------------------- diff --git a/haddock-api/src/Haddock/GhcUtils.hs b/haddock-api/src/Haddock/GhcUtils.hs index 5aa9b81..416f5d7 100644 --- a/haddock-api/src/Haddock/GhcUtils.hs +++ b/haddock-api/src/Haddock/GhcUtils.hs @@ -16,18 +16,14 @@ module Haddock.GhcUtils where -import Data.Version import Control.Applicative ( (<$>) ) import Control.Arrow -import Data.Foldable hiding (concatMap) import Data.Function -import Data.Traversable import Exception import Outputable import Name import Lexeme -import Packages import Module import RdrName (GlobalRdrEnv) import GhcMonad (withSession) @@ -40,15 +36,6 @@ import Class moduleString :: Module -> String moduleString = moduleNameString . moduleName - --- return the (name,version) of the package -modulePackageInfo :: DynFlags -> Module -> (PackageName, Version) -modulePackageInfo dflags modu = - (packageName pkg, packageVersion pkg) - where - pkg = getPackageDetails dflags (modulePackageKey modu) - - lookupLoadedHomeModuleGRE :: GhcMonad m => ModuleName -> m (Maybe GlobalRdrEnv) lookupLoadedHomeModuleGRE mod_name = withSession $ \hsc_env -> case lookupUFM (hsc_HPT hsc_env) mod_name of @@ -288,4 +275,3 @@ setStubDir f d = d{ stubDir = Just f, includePaths = f : includePaths d } -- -stubdir D adds an implicit -I D, so that gcc can find the _stub.h file -- \#included from the .hc file when compiling with -fvia-C. setOutputDir f = setObjectDir f . setHiDir f . setStubDir f - diff --git a/haddock-api/src/Haddock/Options.hs b/haddock-api/src/Haddock/Options.hs index 3fa6397..e847333 100644 --- a/haddock-api/src/Haddock/Options.hs +++ b/haddock-api/src/Haddock/Options.hs @@ -28,15 +28,21 @@ module Haddock.Options ( qualification, verbosity, ghcFlags, - readIfaceArgs + readIfaceArgs, + optPackageName, + optPackageVersion ) where -import Distribution.Verbosity -import Haddock.Utils -import Haddock.Types -import System.Console.GetOpt import qualified Data.Char as Char +import Data.Version +import Distribution.Verbosity +import FastString +import Haddock.Types +import Haddock.Utils +import Packages +import System.Console.GetOpt +import qualified Text.ParserCombinators.ReadP as RP data Flag @@ -83,7 +89,9 @@ data Flag | Flag_Qualification String | Flag_PrettyHtml | Flag_NoPrintMissingDocs - deriving (Eq) + | Flag_PackageName String + | Flag_PackageVersion String + deriving (Eq, Show) options :: Bool -> [OptDescr Flag] @@ -107,7 +115,7 @@ options backwardsCompat = Option [] ["latex-style"] (ReqArg Flag_LaTeXStyle "FILE") "provide your own LaTeX style in FILE", Option ['U'] ["use-unicode"] (NoArg Flag_UseUnicode) "use Unicode in HTML output", Option [] ["hoogle"] (NoArg Flag_Hoogle) - "output for Hoogle", + "output for Hoogle; you may want --package-name and --package-version too", Option [] ["source-base"] (ReqArg Flag_SourceBaseURL "URL") "URL for a source code link on the contents\nand index pages", Option ['s'] (if backwardsCompat then ["source", "source-module"] else ["source-module"]) @@ -171,7 +179,11 @@ options backwardsCompat = Option [] ["pretty-html"] (NoArg Flag_PrettyHtml) "generate html with newlines and indenting (for use with --html)", Option [] ["no-print-missing-docs"] (NoArg Flag_NoPrintMissingDocs) - "don't print information about any undocumented entities" + "don't print information about any undocumented entities", + Option [] ["package-name"] (ReqArg Flag_PackageName "NAME") + "name of the package being documented", + Option [] ["package-version"] (ReqArg Flag_PackageVersion "VERSION") + "version of the package being documented in usual x.y.z.w format" ] @@ -192,6 +204,15 @@ parseHaddockOpts params = usage <- getUsage throwE (concat errors ++ usage) +optPackageVersion :: [Flag] -> Maybe Data.Version.Version +optPackageVersion flags = + let ver = optLast [ v | Flag_PackageVersion v <- flags ] + in ver >>= fmap fst . optLast . RP.readP_to_S parseVersion + +optPackageName :: [Flag] -> Maybe PackageName +optPackageName flags = + optLast [ PackageName $ mkFastString n | Flag_PackageName n <- flags ] + optTitle :: [Flag] -> Maybe String optTitle flags = From git at git.haskell.org Wed Jul 8 08:37:29 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:37:29 +0000 (UTC) Subject: [commit: haddock] master, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3: Sort out some module import warnings (bf77580) Message-ID: <20150708083729.0CA413A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: master,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3 Link : http://git.haskell.org/haddock.git/commitdiff/bf77580eb40fa960b701296ac828372d127a43dd >--------------------------------------------------------------- commit bf77580eb40fa960b701296ac828372d127a43dd Author: Mateusz Kowalczyk Date: Thu Jan 22 23:43:18 2015 +0000 Sort out some module import warnings >--------------------------------------------------------------- bf77580eb40fa960b701296ac828372d127a43dd haddock-api/src/Haddock/Convert.hs | 1 - haddock-api/src/Haddock/Interface/Rename.hs | 3 +-- haddock-api/src/Haddock/Types.hs | 1 - 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/haddock-api/src/Haddock/Convert.hs b/haddock-api/src/Haddock/Convert.hs index 1b1a8a8..b52c331 100644 --- a/haddock-api/src/Haddock/Convert.hs +++ b/haddock-api/src/Haddock/Convert.hs @@ -23,7 +23,6 @@ import CoAxiom import ConLike import Data.Either (lefts, rights) import Data.List( partition ) -import Data.Monoid (mempty) import DataCon import FamInstEnv import Haddock.Types diff --git a/haddock-api/src/Haddock/Interface/Rename.hs b/haddock-api/src/Haddock/Interface/Rename.hs index 7b9481f..7f69b91 100644 --- a/haddock-api/src/Haddock/Interface/Rename.hs +++ b/haddock-api/src/Haddock/Interface/Rename.hs @@ -13,7 +13,7 @@ module Haddock.Interface.Rename (renameInterface) where -import Data.Traversable (traverse, Traversable) +import Data.Traversable (mapM) import Haddock.GhcUtils import Haddock.Types @@ -28,7 +28,6 @@ import Control.Applicative import Control.Monad hiding (mapM) import Data.List import qualified Data.Map as Map hiding ( Map ) -import Data.Traversable (mapM) import Prelude hiding (mapM) diff --git a/haddock-api/src/Haddock/Types.hs b/haddock-api/src/Haddock/Types.hs index ae90ff0..f9cf6e1 100644 --- a/haddock-api/src/Haddock/Types.hs +++ b/haddock-api/src/Haddock/Types.hs @@ -34,7 +34,6 @@ import GHC hiding (NoLink) import DynFlags (ExtensionFlag, Language) import OccName import Outputable -import Control.Applicative (Applicative(..)) import Control.Monad (ap) ----------------------------------------------------------------------------- From git at git.haskell.org Wed Jul 8 08:37:31 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:37:31 +0000 (UTC) Subject: [commit: haddock] master, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3: Track naming change in DataCon (df0239b) Message-ID: <20150708083731.190563A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: master,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3 Link : http://git.haskell.org/haddock.git/commitdiff/df0239b587e2a25531962f5b46f715ebb9b09685 >--------------------------------------------------------------- commit df0239b587e2a25531962f5b46f715ebb9b09685 Author: Simon Peyton Jones Date: Thu Jan 8 15:50:22 2015 +0000 Track naming change in DataCon (cherry picked from commit 04cf63d0195837ed52075ed7d2676e71831e8a0b) >--------------------------------------------------------------- df0239b587e2a25531962f5b46f715ebb9b09685 haddock-api/src/Haddock/Convert.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/haddock-api/src/Haddock/Convert.hs b/haddock-api/src/Haddock/Convert.hs index b52c331..ac7f8bd 100644 --- a/haddock-api/src/Haddock/Convert.hs +++ b/haddock-api/src/Haddock/Convert.hs @@ -264,15 +264,15 @@ synifyDataCon use_gadt_syntax dc = linear_tys = zipWith (\ty bang -> let tySyn = synifyType WithinType ty src_bang = case bang of - HsUnpack {} -> HsUserBang (Just True) True - HsStrict -> HsUserBang (Just False) True + HsUnpack {} -> HsSrcBang (Just True) True + HsStrict -> HsSrcBang (Just False) True _ -> bang in case src_bang of HsNoBang -> tySyn _ -> noLoc $ HsBangTy bang tySyn -- HsNoBang never appears, it's implied instead. ) - arg_tys (dataConStrictMarks dc) + arg_tys (dataConSrcBangs dc) field_tys = zipWith (\field synTy -> noLoc $ ConDeclField [synifyName field] synTy Nothing) (dataConFieldLabels dc) linear_tys From git at git.haskell.org Wed Jul 8 08:37:33 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:37:33 +0000 (UTC) Subject: [commit: haddock] master, wip/api-annot-tweaks-7.10, wip/api-annots-ghc-7.10-3: Follow API changes in D538 (89fc560) Message-ID: <20150708083733.2FC4C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: master,wip/api-annot-tweaks-7.10,wip/api-annots-ghc-7.10-3 Link : http://git.haskell.org/haddock.git/commitdiff/89fc5605c865d0e0ce5ed7e396102e678426533b >--------------------------------------------------------------- commit 89fc5605c865d0e0ce5ed7e396102e678426533b Author: Alan Zimmerman Date: Tue Sep 9 01:03:27 2014 -0500 Follow API changes in D538 Signed-off-by: Austin Seipp (cherry picked from commit d61bbc75890e4eb0ad508b9c2a27b91f691213e6) >--------------------------------------------------------------- 89fc5605c865d0e0ce5ed7e396102e678426533b haddock-api/src/Haddock/Backends/Hoogle.hs | 6 +++--- haddock-api/src/Haddock/Backends/LaTeX.hs | 22 +++++++++++----------- haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | 26 +++++++++++++------------- haddock-api/src/Haddock/Convert.hs | 22 +++++++++++----------- haddock-api/src/Haddock/GhcUtils.hs | 14 +++----------- haddock-api/src/Haddock/Interface/Create.hs | 18 +++++++++--------- haddock-api/src/Haddock/Interface/Rename.hs | 18 +++++++++--------- haddock-api/src/Haddock/Utils.hs | 4 ++-- 8 files changed, 61 insertions(+), 69 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 89fc5605c865d0e0ce5ed7e396102e678426533b From git at git.haskell.org Wed Jul 8 08:37:35 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:37:35 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, wip/10268, wip/10313, wip/T10483, wip/T9840, wip/orf-reboot: Track changes in HsSyn for quasi-quotes (4bb685b) Message-ID: <20150708083735.415213A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,wip/10268,wip/10313,wip/T10483,wip/T9840,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/4bb685bd0f5774584c6bef3f8786daffeac13b56 >--------------------------------------------------------------- commit 4bb685bd0f5774584c6bef3f8786daffeac13b56 Author: Simon Peyton Jones Date: Tue Feb 10 12:10:33 2015 +0000 Track changes in HsSyn for quasi-quotes >--------------------------------------------------------------- 4bb685bd0f5774584c6bef3f8786daffeac13b56 haddock-api/src/Haddock/Backends/LaTeX.hs | 1 - haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | 1 - haddock-api/src/Haddock/Interface/Rename.hs | 4 ---- 3 files changed, 6 deletions(-) diff --git a/haddock-api/src/Haddock/Backends/LaTeX.hs b/haddock-api/src/Haddock/Backends/LaTeX.hs index b0a18b7..c9262c7 100644 --- a/haddock-api/src/Haddock/Backends/LaTeX.hs +++ b/haddock-api/src/Haddock/Backends/LaTeX.hs @@ -911,7 +911,6 @@ ppr_mono_ty _ (HsListTy ty) u = brackets (ppr_mono_lty pREC_TOP ty ppr_mono_ty _ (HsPArrTy ty) u = pabrackets (ppr_mono_lty pREC_TOP ty u) ppr_mono_ty _ (HsIParamTy n ty) u = brackets (ppIPName n <+> dcolon u <+> ppr_mono_lty pREC_TOP ty u) ppr_mono_ty _ (HsSpliceTy {}) _ = error "ppr_mono_ty HsSpliceTy" -ppr_mono_ty _ (HsQuasiQuoteTy {}) _ = error "ppr_mono_ty HsQuasiQuoteTy" ppr_mono_ty _ (HsRecTy {}) _ = error "ppr_mono_ty HsRecTy" ppr_mono_ty _ (HsCoreTy {}) _ = error "ppr_mono_ty HsCoreTy" ppr_mono_ty _ (HsExplicitListTy _ tys) u = Pretty.quote $ brackets $ hsep $ punctuate comma $ map (ppLType u) tys diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs index bed9488..2fcc21e 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs @@ -872,7 +872,6 @@ ppr_mono_ty _ (HsPArrTy ty) u q = pabrackets (ppr_mono_lty pREC_TO ppr_mono_ty ctxt_prec (HsIParamTy n ty) u q = maybeParen ctxt_prec pREC_CTX $ ppIPName n <+> dcolon u <+> ppr_mono_lty pREC_TOP ty u q ppr_mono_ty _ (HsSpliceTy {}) _ _ = error "ppr_mono_ty HsSpliceTy" -ppr_mono_ty _ (HsQuasiQuoteTy {}) _ _ = error "ppr_mono_ty HsQuasiQuoteTy" ppr_mono_ty _ (HsRecTy {}) _ _ = error "ppr_mono_ty HsRecTy" ppr_mono_ty _ (HsCoreTy {}) _ _ = error "ppr_mono_ty HsCoreTy" ppr_mono_ty _ (HsExplicitListTy _ tys) u q = quote $ brackets $ hsep $ punctuate comma $ map (ppLType u q) tys diff --git a/haddock-api/src/Haddock/Interface/Rename.hs b/haddock-api/src/Haddock/Interface/Rename.hs index 25ea9e9..1234d05 100644 --- a/haddock-api/src/Haddock/Interface/Rename.hs +++ b/haddock-api/src/Haddock/Interface/Rename.hs @@ -233,14 +233,10 @@ renameType t = case t of HsCoreTy a -> pure (HsCoreTy a) HsExplicitListTy a b -> HsExplicitListTy a <$> mapM renameLType b HsExplicitTupleTy a b -> HsExplicitTupleTy a <$> mapM renameLType b - HsQuasiQuoteTy a -> HsQuasiQuoteTy <$> renameHsQuasiQuote a HsSpliceTy _ _ -> error "renameType: HsSpliceTy" HsWildcardTy -> pure HsWildcardTy HsNamedWildcardTy a -> HsNamedWildcardTy <$> rename a -renameHsQuasiQuote :: HsQuasiQuote Name -> RnM (HsQuasiQuote DocName) -renameHsQuasiQuote (HsQuasiQuote a b c) = HsQuasiQuote <$> rename a <*> pure b <*> pure c - renameLTyVarBndrs :: LHsTyVarBndrs Name -> RnM (LHsTyVarBndrs DocName) renameLTyVarBndrs (HsQTvs { hsq_kvs = _, hsq_tvs = tvs }) = do { tvs' <- mapM renameLTyVarBndr tvs From git at git.haskell.org Wed Jul 8 08:37:37 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:37:37 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families, adamse-D1033, ghc-head, wip/10268, wip/10313, wip/T10483, wip/T9840, wip/orf-reboot: --package-name and --package-version flags (f9ae6aa) Message-ID: <20150708083737.501543A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: T6018-injective-type-families,adamse-D1033,ghc-head,wip/10268,wip/10313,wip/T10483,wip/T9840,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/f9ae6aaf269474228f368380966fc80b73587832 >--------------------------------------------------------------- commit f9ae6aaf269474228f368380966fc80b73587832 Author: Mateusz Kowalczyk Date: Thu Jan 22 23:34:05 2015 +0000 --package-name and --package-version flags Used for --hoogle amongst other things. Now we need to teach cabal to use it. The situation is still a bit sub-par because if the flags aren't passed in, the crash will occur. Closes #353. (cherry picked from commit 8e06728afb0784128ab2df0be7a5d7a191d30ff4) >--------------------------------------------------------------- f9ae6aaf269474228f368380966fc80b73587832 haddock-api/src/Haddock.hs | 27 ++++++++++++++++++++++++--- haddock-api/src/Haddock/GhcUtils.hs | 14 -------------- haddock-api/src/Haddock/Options.hs | 37 +++++++++++++++++++++++++++++-------- 3 files changed, 53 insertions(+), 25 deletions(-) diff --git a/haddock-api/src/Haddock.hs b/haddock-api/src/Haddock.hs index 915ad47..72c544e 100644 --- a/haddock-api/src/Haddock.hs +++ b/haddock-api/src/Haddock.hs @@ -25,6 +25,7 @@ module Haddock ( withGhc ) where +import Data.Version import Haddock.Backends.Xhtml import Haddock.Backends.Xhtml.Themes (getThemes) import Haddock.Backends.LaTeX @@ -36,7 +37,6 @@ import Haddock.Version import Haddock.InterfaceFile import Haddock.Options import Haddock.Utils -import Haddock.GhcUtils hiding (pretty) import Control.Monad hiding (forM_) import Data.Foldable (forM_) @@ -66,9 +66,9 @@ import GHC hiding (verbosity) import Config import DynFlags hiding (projectVersion, verbosity) import StaticFlags (discardStaticFlags) +import Packages import Panic (handleGhcException) import Module -import PackageConfig import FastString -------------------------------------------------------------------------------- @@ -252,7 +252,7 @@ render dflags flags qual ifaces installedIfaces srcMap = do pkgMod = ifaceMod (head ifaces) pkgKey = modulePackageKey pkgMod pkgStr = Just (packageKeyString pkgKey) - (pkgName,pkgVer) = modulePackageInfo dflags pkgMod + (pkgName,pkgVer) = modulePackageInfo dflags flags pkgMod (srcBase, srcModule, srcEntity, srcLEntity) = sourceUrls flags srcMap' = maybe srcMap (\path -> Map.insert pkgKey path srcMap) srcEntity @@ -299,6 +299,27 @@ render dflags flags qual ifaces installedIfaces srcMap = do ppLaTeX title pkgStr visibleIfaces odir (fmap _doc prologue) opt_latex_style libDir +-- | From GHC 7.10, this function has a potential to crash with a +-- nasty message such as @expectJust getPackageDetails@ because +-- package name and versions can no longer reliably be extracted in +-- all cases: if the package is not installed yet then this info is no +-- longer available. The @--package-name@ and @--package-version@ +-- Haddock flags allow the user to specify this information and it is +-- returned here if present: if it is not present, the error will +-- occur. Nasty but that's how it is for now. Potential TODO. +modulePackageInfo :: DynFlags + -> [Flag] -- ^ Haddock flags are checked as they may + -- contain the package name or version + -- provided by the user which we + -- prioritise + -> Module -> (PackageName, Data.Version.Version) +modulePackageInfo dflags flags modu = + (fromMaybe (packageName pkg) (optPackageName flags), + fromMaybe (packageVersion pkg) (optPackageVersion flags)) + where + pkg = getPackageDetails dflags (modulePackageKey modu) + + ------------------------------------------------------------------------------- -- * Reading and dumping interface files ------------------------------------------------------------------------------- diff --git a/haddock-api/src/Haddock/GhcUtils.hs b/haddock-api/src/Haddock/GhcUtils.hs index b0ea173..5caefa7 100644 --- a/haddock-api/src/Haddock/GhcUtils.hs +++ b/haddock-api/src/Haddock/GhcUtils.hs @@ -16,18 +16,14 @@ module Haddock.GhcUtils where -import Data.Version import Control.Applicative ( (<$>) ) import Control.Arrow -import Data.Foldable hiding (concatMap) import Data.Function -import Data.Traversable import Exception import Outputable import Name import Lexeme -import Packages import Module import RdrName (GlobalRdrEnv) import GhcMonad (withSession) @@ -40,15 +36,6 @@ import Class moduleString :: Module -> String moduleString = moduleNameString . moduleName - --- return the (name,version) of the package -modulePackageInfo :: DynFlags -> Module -> (PackageName, Version) -modulePackageInfo dflags modu = - (packageName pkg, packageVersion pkg) - where - pkg = getPackageDetails dflags (modulePackageKey modu) - - lookupLoadedHomeModuleGRE :: GhcMonad m => ModuleName -> m (Maybe GlobalRdrEnv) lookupLoadedHomeModuleGRE mod_name = withSession $ \hsc_env -> case lookupUFM (hsc_HPT hsc_env) mod_name of @@ -280,4 +267,3 @@ setStubDir f d = d{ stubDir = Just f, includePaths = f : includePaths d } -- -stubdir D adds an implicit -I D, so that gcc can find the _stub.h file -- \#included from the .hc file when compiling with -fvia-C. setOutputDir f = setObjectDir f . setHiDir f . setStubDir f - diff --git a/haddock-api/src/Haddock/Options.hs b/haddock-api/src/Haddock/Options.hs index 3fa6397..e847333 100644 --- a/haddock-api/src/Haddock/Options.hs +++ b/haddock-api/src/Haddock/Options.hs @@ -28,15 +28,21 @@ module Haddock.Options ( qualification, verbosity, ghcFlags, - readIfaceArgs + readIfaceArgs, + optPackageName, + optPackageVersion ) where -import Distribution.Verbosity -import Haddock.Utils -import Haddock.Types -import System.Console.GetOpt import qualified Data.Char as Char +import Data.Version +import Distribution.Verbosity +import FastString +import Haddock.Types +import Haddock.Utils +import Packages +import System.Console.GetOpt +import qualified Text.ParserCombinators.ReadP as RP data Flag @@ -83,7 +89,9 @@ data Flag | Flag_Qualification String | Flag_PrettyHtml | Flag_NoPrintMissingDocs - deriving (Eq) + | Flag_PackageName String + | Flag_PackageVersion String + deriving (Eq, Show) options :: Bool -> [OptDescr Flag] @@ -107,7 +115,7 @@ options backwardsCompat = Option [] ["latex-style"] (ReqArg Flag_LaTeXStyle "FILE") "provide your own LaTeX style in FILE", Option ['U'] ["use-unicode"] (NoArg Flag_UseUnicode) "use Unicode in HTML output", Option [] ["hoogle"] (NoArg Flag_Hoogle) - "output for Hoogle", + "output for Hoogle; you may want --package-name and --package-version too", Option [] ["source-base"] (ReqArg Flag_SourceBaseURL "URL") "URL for a source code link on the contents\nand index pages", Option ['s'] (if backwardsCompat then ["source", "source-module"] else ["source-module"]) @@ -171,7 +179,11 @@ options backwardsCompat = Option [] ["pretty-html"] (NoArg Flag_PrettyHtml) "generate html with newlines and indenting (for use with --html)", Option [] ["no-print-missing-docs"] (NoArg Flag_NoPrintMissingDocs) - "don't print information about any undocumented entities" + "don't print information about any undocumented entities", + Option [] ["package-name"] (ReqArg Flag_PackageName "NAME") + "name of the package being documented", + Option [] ["package-version"] (ReqArg Flag_PackageVersion "VERSION") + "version of the package being documented in usual x.y.z.w format" ] @@ -192,6 +204,15 @@ parseHaddockOpts params = usage <- getUsage throwE (concat errors ++ usage) +optPackageVersion :: [Flag] -> Maybe Data.Version.Version +optPackageVersion flags = + let ver = optLast [ v | Flag_PackageVersion v <- flags ] + in ver >>= fmap fst . optLast . RP.readP_to_S parseVersion + +optPackageName :: [Flag] -> Maybe PackageName +optPackageName flags = + optLast [ PackageName $ mkFastString n | Flag_PackageName n <- flags ] + optTitle :: [Flag] -> Maybe String optTitle flags = From git at git.haskell.org Wed Jul 8 08:37:39 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:37:39 +0000 (UTC) Subject: [commit: haddock] master, wip/api-annots-ghc-7.10-3: Prevent Synopsis from using up too much horizontal space (71170fc) Message-ID: <20150708083739.601173A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: master,wip/api-annots-ghc-7.10-3 Link : http://git.haskell.org/haddock.git/commitdiff/71170fc77962f10d7d001e3b8bc8b92bfeda99bc >--------------------------------------------------------------- commit 71170fc77962f10d7d001e3b8bc8b92bfeda99bc Author: Phil Ruffwind Date: Mon Mar 16 04:31:13 2015 -0400 Prevent Synopsis from using up too much horizontal space When long type signatures occur in the Synopsis, the element is stretched beyond the width of the window. Scrollbars don't appear, so it's impossible to read anything when this happens. >--------------------------------------------------------------- 71170fc77962f10d7d001e3b8bc8b92bfeda99bc haddock-api/resources/html/Ocean.std-theme/ocean.css | 1 + 1 file changed, 1 insertion(+) diff --git a/haddock-api/resources/html/Ocean.std-theme/ocean.css b/haddock-api/resources/html/Ocean.std-theme/ocean.css index f762e83..ef652a2 100644 --- a/haddock-api/resources/html/Ocean.std-theme/ocean.css +++ b/haddock-api/resources/html/Ocean.std-theme/ocean.css @@ -318,6 +318,7 @@ div#style-menu-holder { height: 80%; top: 10%; padding: 0; + max-width: 75%; } #synopsis .caption { From git at git.haskell.org Wed Jul 8 08:37:41 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:37:41 +0000 (UTC) Subject: [commit: haddock] master, wip/api-annots-ghc-7.10-3: Update changelog (0fc494f) Message-ID: <20150708083741.6EE1B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: master,wip/api-annots-ghc-7.10-3 Link : http://git.haskell.org/haddock.git/commitdiff/0fc494f2015b7d9cc2cd80e87d67c430e9842777 >--------------------------------------------------------------- commit 0fc494f2015b7d9cc2cd80e87d67c430e9842777 Author: Mateusz Kowalczyk Date: Tue Mar 17 21:59:39 2015 +0000 Update changelog Closes #151 due to 71170fc77962f10d7d001e3b8bc8b92bfeda99bc >--------------------------------------------------------------- 0fc494f2015b7d9cc2cd80e87d67c430e9842777 CHANGES | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES b/CHANGES index d98f7e1..c988423 100644 --- a/CHANGES +++ b/CHANGES @@ -30,6 +30,8 @@ Changes in version 2.16.0 * Fix code blocks in presence of Windows line endings + * Deal better with long synopsis lines (#151) + Changes in version 2.15.0 * Always read in prologue files as UTF8 (#286 and Cabal #1721) From git at git.haskell.org Wed Jul 8 08:37:43 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:37:43 +0000 (UTC) Subject: [commit: haddock] master, wip/api-annots-ghc-7.10-3: Make the error encountered when a package can't be found more user-friendly (fdcd190) Message-ID: <20150708083743.7B5653A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: master,wip/api-annots-ghc-7.10-3 Link : http://git.haskell.org/haddock.git/commitdiff/fdcd1907a358ef274b687e31118277d2487c60e9 >--------------------------------------------------------------- commit fdcd1907a358ef274b687e31118277d2487c60e9 Author: Ben Gamari Date: Wed Feb 25 02:01:08 2015 -0500 Make the error encountered when a package can't be found more user-friendly Closes #369 >--------------------------------------------------------------- fdcd1907a358ef274b687e31118277d2487c60e9 haddock-api/src/Haddock.hs | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/haddock-api/src/Haddock.hs b/haddock-api/src/Haddock.hs index 72c544e..3e58aba 100644 --- a/haddock-api/src/Haddock.hs +++ b/haddock-api/src/Haddock.hs @@ -39,6 +39,7 @@ import Haddock.Options import Haddock.Utils import Control.Monad hiding (forM_) +import Control.Applicative import Data.Foldable (forM_) import Data.List (isPrefixOf) import Control.Exception @@ -250,9 +251,9 @@ render dflags flags qual ifaces installedIfaces srcMap = do allVisibleIfaces = [ i | i <- allIfaces, OptHide `notElem` instOptions i ] pkgMod = ifaceMod (head ifaces) - pkgKey = modulePackageKey pkgMod + pkgKey = modulePackageKey pkgMod pkgStr = Just (packageKeyString pkgKey) - (pkgName,pkgVer) = modulePackageInfo dflags flags pkgMod + pkgNameVer = modulePackageInfo dflags flags pkgMod (srcBase, srcModule, srcEntity, srcLEntity) = sourceUrls flags srcMap' = maybe srcMap (\path -> Map.insert pkgKey path srcMap) srcEntity @@ -288,12 +289,20 @@ render dflags flags qual ifaces installedIfaces srcMap = do -- TODO: we throw away Meta for both Hoogle and LaTeX right now, -- might want to fix that if/when these two get some work on them when (Flag_Hoogle `elem` flags) $ do - let pkgNameStr | unpackFS pkgNameFS == "main" && title /= [] - = title - | otherwise = unpackFS pkgNameFS - where PackageName pkgNameFS = pkgName - ppHoogle dflags pkgNameStr pkgVer title (fmap _doc prologue) visibleIfaces - odir + case pkgNameVer of + Nothing -> putStrLn . unlines $ + [ "haddock: Unable to find a package providing module " + ++ moduleNameString (moduleName pkgMod) ++ ", skipping Hoogle." + , "" + , " Perhaps try specifying the desired package explicitly" + ++ " using the --package-name" + , " and --package-version arguments." + ] + Just (PackageName pkgNameFS, pkgVer) -> + let pkgNameStr | unpackFS pkgNameFS == "main" && title /= [] = title + | otherwise = unpackFS pkgNameFS + in ppHoogle dflags pkgNameStr pkgVer title (fmap _doc prologue) + visibleIfaces odir when (Flag_LaTeX `elem` flags) $ do ppLaTeX title pkgStr visibleIfaces odir (fmap _doc prologue) opt_latex_style @@ -312,12 +321,12 @@ modulePackageInfo :: DynFlags -- contain the package name or version -- provided by the user which we -- prioritise - -> Module -> (PackageName, Data.Version.Version) + -> Module -> Maybe (PackageName, Data.Version.Version) modulePackageInfo dflags flags modu = - (fromMaybe (packageName pkg) (optPackageName flags), - fromMaybe (packageVersion pkg) (optPackageVersion flags)) + cmdline <|> pkgDb where - pkg = getPackageDetails dflags (modulePackageKey modu) + cmdline = (,) <$> optPackageName flags <*> optPackageVersion flags + pkgDb = (\pkg -> (packageName pkg, packageVersion pkg)) <$> lookupPackage dflags (modulePackageKey modu) ------------------------------------------------------------------------------- From git at git.haskell.org Wed Jul 8 08:37:45 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:37:45 +0000 (UTC) Subject: [commit: haddock] master, wip/api-annots-ghc-7.10-3: Remove now redundant imports (10437c8) Message-ID: <20150708083745.893BD3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: master,wip/api-annots-ghc-7.10-3 Link : http://git.haskell.org/haddock.git/commitdiff/10437c8cfe3524eee7e1cc297cd6ae7dff16dbb3 >--------------------------------------------------------------- commit 10437c8cfe3524eee7e1cc297cd6ae7dff16dbb3 Author: Mateusz Kowalczyk Date: Thu Mar 26 16:31:40 2015 +0000 Remove now redundant imports >--------------------------------------------------------------- 10437c8cfe3524eee7e1cc297cd6ae7dff16dbb3 haddock-api/src/Haddock/Backends/Xhtml.hs | 1 - haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | 1 - haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs | 2 -- haddock-api/src/Haddock/Backends/Xhtml/Themes.hs | 2 -- haddock-api/src/Haddock/GhcUtils.hs | 1 - haddock-api/src/Haddock/Interface/LexParseRn.hs | 1 - haddock-api/src/Haddock/Interface/ParseModuleHeader.hs | 1 - haddock-api/src/Haddock/InterfaceFile.hs | 1 - 8 files changed, 10 deletions(-) diff --git a/haddock-api/src/Haddock/Backends/Xhtml.hs b/haddock-api/src/Haddock/Backends/Xhtml.hs index 65a7e6c..948ef64 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml.hs @@ -36,7 +36,6 @@ import Haddock.GhcUtils import Control.Monad ( when, unless ) import Data.Char ( toUpper ) -import Data.Functor ( (<$>) ) import Data.List ( sortBy, groupBy, intercalate, isPrefixOf ) import Data.Maybe import System.FilePath hiding ( () ) diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs index 405a13f..952d29c 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs @@ -27,7 +27,6 @@ import Haddock.GhcUtils import Haddock.Types import Haddock.Doc (combineDocumentation) -import Control.Applicative import Data.List ( intersperse, sort ) import qualified Data.Map as Map import Data.Maybe diff --git a/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs b/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs index 96d734e..e807eb9 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs @@ -19,8 +19,6 @@ module Haddock.Backends.Xhtml.DocMarkup ( docElement, docSection, docSection_, ) where -import Control.Applicative ((<$>)) - import Data.List import Haddock.Backends.Xhtml.Names import Haddock.Backends.Xhtml.Utils diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Themes.hs b/haddock-api/src/Haddock/Backends/Xhtml/Themes.hs index 79b093e..10d6ab1 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml/Themes.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml/Themes.hs @@ -18,7 +18,6 @@ module Haddock.Backends.Xhtml.Themes ( import Haddock.Options -import Control.Applicative import Control.Monad (liftM) import Data.Char (toLower) import Data.Either (lefts, rights) @@ -206,4 +205,3 @@ liftEither f = either Left (Right . f) concatEither :: [Either a [b]] -> Either a [b] concatEither = liftEither concat . sequenceEither - diff --git a/haddock-api/src/Haddock/GhcUtils.hs b/haddock-api/src/Haddock/GhcUtils.hs index 5caefa7..ce4ca38 100644 --- a/haddock-api/src/Haddock/GhcUtils.hs +++ b/haddock-api/src/Haddock/GhcUtils.hs @@ -16,7 +16,6 @@ module Haddock.GhcUtils where -import Control.Applicative ( (<$>) ) import Control.Arrow import Data.Function diff --git a/haddock-api/src/Haddock/Interface/LexParseRn.hs b/haddock-api/src/Haddock/Interface/LexParseRn.hs index 35abf8a..614e606 100644 --- a/haddock-api/src/Haddock/Interface/LexParseRn.hs +++ b/haddock-api/src/Haddock/Interface/LexParseRn.hs @@ -18,7 +18,6 @@ module Haddock.Interface.LexParseRn , processModuleHeader ) where -import Control.Applicative import Data.IntSet (toList) import Data.List import Documentation.Haddock.Doc (metaDocConcat) diff --git a/haddock-api/src/Haddock/Interface/ParseModuleHeader.hs b/haddock-api/src/Haddock/Interface/ParseModuleHeader.hs index d92e8b2..e7d2a08 100644 --- a/haddock-api/src/Haddock/Interface/ParseModuleHeader.hs +++ b/haddock-api/src/Haddock/Interface/ParseModuleHeader.hs @@ -11,7 +11,6 @@ ----------------------------------------------------------------------------- module Haddock.Interface.ParseModuleHeader (parseModuleHeader) where -import Control.Applicative ((<$>)) import Control.Monad (mplus) import Data.Char import DynFlags diff --git a/haddock-api/src/Haddock/InterfaceFile.hs b/haddock-api/src/Haddock/InterfaceFile.hs index b0df549..4b39d31 100644 --- a/haddock-api/src/Haddock/InterfaceFile.hs +++ b/haddock-api/src/Haddock/InterfaceFile.hs @@ -25,7 +25,6 @@ import Haddock.Utils hiding (out) import Control.Monad import Data.Array -import Data.Functor ((<$>)) import Data.IORef import Data.List import qualified Data.Map as Map From git at git.haskell.org Wed Jul 8 08:37:47 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:37:47 +0000 (UTC) Subject: [commit: haddock] master, wip/api-annots-ghc-7.10-3: Update test to account for \r filtering (f42970c) Message-ID: <20150708083747.96A193A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: master,wip/api-annots-ghc-7.10-3 Link : http://git.haskell.org/haddock.git/commitdiff/f42970cc6d62a63529874bf7dfe0f6e3c010dd13 >--------------------------------------------------------------- commit f42970cc6d62a63529874bf7dfe0f6e3c010dd13 Author: Mateusz Kowalczyk Date: Thu Mar 26 16:45:52 2015 +0000 Update test to account for \r filtering >--------------------------------------------------------------- f42970cc6d62a63529874bf7dfe0f6e3c010dd13 haddock-library/test/Documentation/Haddock/ParserSpec.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/haddock-library/test/Documentation/Haddock/ParserSpec.hs b/haddock-library/test/Documentation/Haddock/ParserSpec.hs index 44ec298..9161160 100644 --- a/haddock-library/test/Documentation/Haddock/ParserSpec.hs +++ b/haddock-library/test/Documentation/Haddock/ParserSpec.hs @@ -1,4 +1,5 @@ {-# LANGUAGE OverloadedStrings, FlexibleInstances #-} +{-# LANGUAGE LambdaCase #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Documentation.Haddock.ParserSpec (main, spec) where @@ -55,8 +56,10 @@ spec = do it "accepts hexadecimal character references" $ do "e" `shouldParseTo` "e" - it "allows to backslash-escape characters" $ do - property $ \x -> ['\\', x] `shouldParseTo` DocString [x] + it "allows to backslash-escape characters except \\r" $ do + property $ \case + '\r' -> "\\\r" `shouldParseTo` DocString "\\" + x -> ['\\', x] `shouldParseTo` DocString [x] context "when parsing strings contaning numeric character references" $ do it "will implicitly convert digits to characters" $ do From git at git.haskell.org Wed Jul 8 08:37:49 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:37:49 +0000 (UTC) Subject: [commit: haddock] master, wip/api-annots-ghc-7.10-3: Test for anchor defaulting (7d8ece2) Message-ID: <20150708083749.B07163A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: master,wip/api-annots-ghc-7.10-3 Link : http://git.haskell.org/haddock.git/commitdiff/7d8ece225e5387d0d08a675bda82bd2a1af5a173 >--------------------------------------------------------------- commit 7d8ece225e5387d0d08a675bda82bd2a1af5a173 Author: Mateusz Kowalczyk Date: Thu Mar 26 19:29:25 2015 +0000 Test for anchor defaulting I delete the old tests because it turns out that: * test runner would never put them in scope of each other even with imports so just one would suffice * test runner actually needed some hacking to keep links so in the end we would end up with no anchors making them useless >--------------------------------------------------------------- 7d8ece225e5387d0d08a675bda82bd2a1af5a173 html-test/ref/{Ticket253_1.html => Bug253.html} | 54 +++++++----- html-test/ref/Ticket253_2.html | 111 ------------------------ html-test/run.lhs | 24 +++-- html-test/src/Bug253.hs | 10 +++ html-test/src/Ticket253_1.hs | 6 -- html-test/src/Ticket253_2.hs | 6 -- 6 files changed, 58 insertions(+), 153 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 7d8ece225e5387d0d08a675bda82bd2a1af5a173 From git at git.haskell.org Wed Jul 8 08:37:51 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:37:51 +0000 (UTC) Subject: [commit: haddock] master, wip/api-annots-ghc-7.10-3: Clearly default to variables in out of scope case (6dee5e8) Message-ID: <20150708083751.BB7F73A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: master,wip/api-annots-ghc-7.10-3 Link : http://git.haskell.org/haddock.git/commitdiff/6dee5e814d1934cbed458894e01b4913452422e6 >--------------------------------------------------------------- commit 6dee5e814d1934cbed458894e01b4913452422e6 Author: Mateusz Kowalczyk Date: Fri Mar 27 00:05:58 2015 +0000 Clearly default to variables in out of scope case >--------------------------------------------------------------- 6dee5e814d1934cbed458894e01b4913452422e6 CHANGES | 3 ++ haddock-api/src/Haddock/Interface/LexParseRn.hs | 63 ++++++++++++++++--------- 2 files changed, 43 insertions(+), 23 deletions(-) diff --git a/CHANGES b/CHANGES index c988423..419a7be 100644 --- a/CHANGES +++ b/CHANGES @@ -32,6 +32,9 @@ Changes in version 2.16.0 * Deal better with long synopsis lines (#151) + * Don't default to type constructors for out-of-scope names (#253 and + #375) + Changes in version 2.15.0 * Always read in prologue files as UTF8 (#286 and Cabal #1721) diff --git a/haddock-api/src/Haddock/Interface/LexParseRn.hs b/haddock-api/src/Haddock/Interface/LexParseRn.hs index 614e606..14826ea 100644 --- a/haddock-api/src/Haddock/Interface/LexParseRn.hs +++ b/haddock-api/src/Haddock/Interface/LexParseRn.hs @@ -30,6 +30,7 @@ import Haddock.Types import Name import Outputable (showPpr) import RdrName +import RnEnv (dataTcOccs) processDocStrings :: DynFlags -> GlobalRdrEnv -> [HsDocString] -> Maybe (MDoc Name) @@ -73,7 +74,13 @@ processModuleHeader dflags gre safety mayStr = do where failure = (emptyHaddockModInfo, Nothing) - +-- | Takes a 'GlobalRdrEnv' which (hopefully) contains all the +-- definitions and a parsed comment and we attempt to make sense of +-- where the identifiers in the comment point to. We're in effect +-- trying to convert 'RdrName's to 'Name's, with some guesswork and +-- fallbacks in case we can't locate the identifiers. +-- +-- See the comments in the source for implementation commentary. rename :: DynFlags -> GlobalRdrEnv -> Doc RdrName -> Doc Name rename dflags gre = rn where @@ -81,19 +88,36 @@ rename dflags gre = rn DocAppend a b -> DocAppend (rn a) (rn b) DocParagraph doc -> DocParagraph (rn doc) DocIdentifier x -> do - let choices = dataTcOccs' x + -- Generate the choices for the possible kind of thing this + -- is. + let choices = dataTcOccs x + -- Try to look up all the names in the GlobalRdrEnv that match + -- the names. let names = concatMap (\c -> map gre_name (lookupGRE_RdrName c gre)) choices + case names of + -- We found no names in the env so we start guessing. [] -> case choices of [] -> DocMonospaced (DocString (showPpr dflags x)) - [a] -> outOfScope dflags a - a:b:_ | isRdrTc a -> outOfScope dflags a - | otherwise -> outOfScope dflags b + -- There was nothing in the environment so we need to + -- pick some default from what's available to us. We + -- diverge here from the old way where we would default + -- to type constructors as we're much more likely to + -- actually want anchors to regular definitions than + -- type constructor names (such as in #253). So now we + -- only get type constructor links if they are actually + -- in scope. + a:_ -> outOfScope dflags a + + -- There is only one name in the environment that matches so + -- use it. [a] -> DocIdentifier a - a:b:_ | isTyConName a -> DocIdentifier a | otherwise -> DocIdentifier b - -- If an id can refer to multiple things, we give precedence to type - -- constructors. + -- But when there are multiple names available, default to + -- type constructors: somewhat awfully GHC returns the + -- values in the list positionally. + a:b:_ | isTyConName a -> DocIdentifier a + | otherwise -> DocIdentifier b DocWarning doc -> DocWarning (rn doc) DocEmphasis doc -> DocEmphasis (rn doc) @@ -114,21 +138,14 @@ rename dflags gre = rn DocString str -> DocString str DocHeader (Header l t) -> DocHeader $ Header l (rn t) -dataTcOccs' :: RdrName -> [RdrName] --- If the input is a data constructor, return both it and a type --- constructor. This is useful when we aren't sure which we are --- looking at. --- --- We use this definition instead of the GHC's to provide proper linking to --- functions accross modules. See ticket #253 on Haddock Trac. -dataTcOccs' rdr_name - | isDataOcc occ = [rdr_name, rdr_name_tc] - | otherwise = [rdr_name] - where - occ = rdrNameOcc rdr_name - rdr_name_tc = setRdrNameSpace rdr_name tcName - - +-- | Wrap an identifier that's out of scope (i.e. wasn't found in +-- 'GlobalReaderEnv' during 'rename') in an appropriate doc. Currently +-- we simply monospace the identifier in most cases except when the +-- identifier is qualified: if the identifier is qualified then we can +-- still try to guess and generate anchors accross modules but the +-- users shouldn't rely on this doing the right thing. See tickets +-- #253 and #375 on the confusion this causes depending on which +-- default we pick in 'rename'. outOfScope :: DynFlags -> RdrName -> Doc a outOfScope dflags x = case x of From git at git.haskell.org Wed Jul 8 08:37:53 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:37:53 +0000 (UTC) Subject: [commit: haddock] master, wip/api-annots-ghc-7.10-3: Fix Hoogle display of constructors (bb0ecbb) Message-ID: <20150708083753.C6B9A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: master,wip/api-annots-ghc-7.10-3 Link : http://git.haskell.org/haddock.git/commitdiff/bb0ecbb4053a593cc8ef80a277c4ef40b13998d5 >--------------------------------------------------------------- commit bb0ecbb4053a593cc8ef80a277c4ef40b13998d5 Author: Mateusz Kowalczyk Date: Fri Mar 27 01:14:11 2015 +0000 Fix Hoogle display of constructors Fixes #361 >--------------------------------------------------------------- bb0ecbb4053a593cc8ef80a277c4ef40b13998d5 CHANGES | 2 ++ haddock-api/src/Haddock/Backends/Hoogle.hs | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 419a7be..15ab0a2 100644 --- a/CHANGES +++ b/CHANGES @@ -35,6 +35,8 @@ Changes in version 2.16.0 * Don't default to type constructors for out-of-scope names (#253 and #375) + * Fix Hoogle display of constructors (#361) + Changes in version 2.15.0 * Always read in prologue files as UTF8 (#286 and Cabal #1721) diff --git a/haddock-api/src/Haddock/Backends/Hoogle.hs b/haddock-api/src/Haddock/Backends/Hoogle.hs index fe656a4..ef86958 100644 --- a/haddock-api/src/Haddock/Backends/Hoogle.hs +++ b/haddock-api/src/Haddock/Backends/Hoogle.hs @@ -198,7 +198,10 @@ ppCtor dflags dat subdocs con apps = foldl1 (\x y -> reL $ HsAppTy x y) typeSig nm flds = operator nm ++ " :: " ++ outHsType dflags (makeExplicit $ unL $ funs flds) - name = out dflags $ map unL $ con_names con + + -- We print the constructors as comma-separated list. See GHC + -- docs for con_names on why it is a list to begin with. + name = showSDocUnqual dflags . interpp'SP . map unL $ con_names con resType = case con_res con of ResTyH98 -> apps $ map (reL . HsTyVar) $ From git at git.haskell.org Wed Jul 8 08:37:55 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:37:55 +0000 (UTC) Subject: [commit: haddock] master, wip/api-annots-ghc-7.10-3: Fully qualify names in Hoogle instances output (fdc4e8a) Message-ID: <20150708083755.D15923A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: master,wip/api-annots-ghc-7.10-3 Link : http://git.haskell.org/haddock.git/commitdiff/fdc4e8a1cafdb5accb8cef05c60579df9d438fd7 >--------------------------------------------------------------- commit fdc4e8a1cafdb5accb8cef05c60579df9d438fd7 Author: Mateusz Kowalczyk Date: Fri Mar 27 01:45:18 2015 +0000 Fully qualify names in Hoogle instances output Closes #263 >--------------------------------------------------------------- fdc4e8a1cafdb5accb8cef05c60579df9d438fd7 haddock-api/src/Haddock/Backends/Hoogle.hs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/haddock-api/src/Haddock/Backends/Hoogle.hs b/haddock-api/src/Haddock/Backends/Hoogle.hs index ef86958..3ffa582 100644 --- a/haddock-api/src/Haddock/Backends/Hoogle.hs +++ b/haddock-api/src/Haddock/Backends/Hoogle.hs @@ -95,13 +95,15 @@ dropComment (x:xs) = x : dropComment xs dropComment [] = [] -out :: Outputable a => DynFlags -> a -> String -out dflags = f . unwords . map (dropWhile isSpace) . lines . showSDocUnqual dflags . ppr +outWith :: Outputable a => (SDoc -> String) -> a -> [Char] +outWith p = f . unwords . map (dropWhile isSpace) . lines . p . ppr where f xs | " " `isPrefixOf` xs = f $ drop 19 xs f (x:xs) = x : f xs f [] = [] +out :: Outputable a => DynFlags -> a -> String +out dflags = outWith $ showSDocUnqual dflags operator :: String -> String operator (x:xs) | not (isAlphaNum x) && x `notElem` "_' ([{" = '(' : x:xs ++ ")" @@ -156,8 +158,8 @@ ppClass dflags x = out dflags x{tcdSigs=[]} : ppInstance :: DynFlags -> ClsInst -> [String] -ppInstance dflags x = [dropComment $ out dflags x] - +ppInstance dflags x = + [dropComment $ outWith (showSDocForUser dflags alwaysQualify) x] ppSynonym :: DynFlags -> TyClDecl Name -> [String] ppSynonym dflags x = [out dflags x] From git at git.haskell.org Wed Jul 8 08:37:57 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:37:57 +0000 (UTC) Subject: [commit: haddock] master, wip/api-annots-ghc-7.10-3: Update changelog (4999f09) Message-ID: <20150708083757.DDEEF3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: master,wip/api-annots-ghc-7.10-3 Link : http://git.haskell.org/haddock.git/commitdiff/4999f090864463aec6cbcf4f3319015b6601ccef >--------------------------------------------------------------- commit 4999f090864463aec6cbcf4f3319015b6601ccef Author: Mateusz Kowalczyk Date: Fri Mar 27 01:55:01 2015 +0000 Update changelog >--------------------------------------------------------------- 4999f090864463aec6cbcf4f3319015b6601ccef CHANGES | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES b/CHANGES index 15ab0a2..f436cf6 100644 --- a/CHANGES +++ b/CHANGES @@ -37,6 +37,8 @@ Changes in version 2.16.0 * Fix Hoogle display of constructors (#361) + * Fully qualify names in Hoogle instances output (#263) + Changes in version 2.15.0 * Always read in prologue files as UTF8 (#286 and Cabal #1721) From git at git.haskell.org Wed Jul 8 08:37:59 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:37:59 +0000 (UTC) Subject: [commit: haddock] master, wip/api-annots-ghc-7.10-3: Output method documentation in Hoogle backend (1a65ec5) Message-ID: <20150708083759.EAFFC3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: master,wip/api-annots-ghc-7.10-3 Link : http://git.haskell.org/haddock.git/commitdiff/1a65ec54ce8516dc2d09af3b1d20fedd21e64ad6 >--------------------------------------------------------------- commit 1a65ec54ce8516dc2d09af3b1d20fedd21e64ad6 Author: Mateusz Kowalczyk Date: Fri Mar 27 02:43:55 2015 +0000 Output method documentation in Hoogle backend One thing of note is that we no longer preserve grouping of methods and print each method on its own line. We could preserve it if no documentation is present for any methods in the group if someone asks for it though. Fixes #259 >--------------------------------------------------------------- 1a65ec54ce8516dc2d09af3b1d20fedd21e64ad6 CHANGES | 2 ++ haddock-api/src/Haddock/Backends/Hoogle.hs | 32 ++++++++++++++++++++---------- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/CHANGES b/CHANGES index f436cf6..7aba49a 100644 --- a/CHANGES +++ b/CHANGES @@ -39,6 +39,8 @@ Changes in version 2.16.0 * Fully qualify names in Hoogle instances output (#263) + * Output method documentation in Hoogle backend (#259) + Changes in version 2.15.0 * Always read in prologue files as UTF8 (#286 and Cabal #1721) diff --git a/haddock-api/src/Haddock/Backends/Hoogle.hs b/haddock-api/src/Haddock/Backends/Hoogle.hs index 3ffa582..12dfc1f 100644 --- a/haddock-api/src/Haddock/Backends/Hoogle.hs +++ b/haddock-api/src/Haddock/Backends/Hoogle.hs @@ -109,6 +109,8 @@ operator :: String -> String operator (x:xs) | not (isAlphaNum x) && x `notElem` "_' ([{" = '(' : x:xs ++ ")" operator x = x +commaSeparate :: Outputable a => DynFlags -> [a] -> String +commaSeparate dflags = showSDocUnqual dflags . interpp'SP --------------------------------------------------------------------- -- How to print each export @@ -121,30 +123,38 @@ ppExport dflags ExportDecl { expItemDecl = L _ decl where f (TyClD d at DataDecl{}) = ppData dflags d subdocs f (TyClD d at SynDecl{}) = ppSynonym dflags d - f (TyClD d at ClassDecl{}) = ppClass dflags d + f (TyClD d at ClassDecl{}) = ppClass dflags d subdocs f (ForD (ForeignImport name typ _ _)) = ppSig dflags $ TypeSig [name] typ [] f (ForD (ForeignExport name typ _ _)) = ppSig dflags $ TypeSig [name] typ [] f (SigD sig) = ppSig dflags sig f _ = [] ppExport _ _ = [] - -ppSig :: DynFlags -> Sig Name -> [String] -ppSig dflags (TypeSig names sig _) - = [operator prettyNames ++ " :: " ++ outHsType dflags typ] +ppSigWithDoc :: DynFlags -> Sig Name -> [(Name, DocForDecl Name)] -> [String] +ppSigWithDoc dflags (TypeSig names sig _) subdocs + = concatMap mkDocSig names where - prettyNames = intercalate ", " $ map (out dflags) names + mkDocSig n = concatMap (ppDocumentation dflags) (getDoc n) + ++ [mkSig n] + mkSig n = operator (out dflags n) ++ " :: " ++ outHsType dflags typ + + getDoc :: Located Name -> [Documentation Name] + getDoc n = maybe [] (return . fst) (lookup (unL n) subdocs) + typ = case unL sig of HsForAllTy Explicit a b c d -> HsForAllTy Implicit a b c d HsForAllTy Qualified a b c d -> HsForAllTy Implicit a b c d x -> x -ppSig _ _ = [] +ppSigWithDoc _ _ _ = [] + +ppSig :: DynFlags -> Sig Name -> [String] +ppSig dflags x = ppSigWithDoc dflags x [] -- note: does not yet output documentation for class methods -ppClass :: DynFlags -> TyClDecl Name -> [String] -ppClass dflags x = out dflags x{tcdSigs=[]} : - concatMap (ppSig dflags . addContext . unL) (tcdSigs x) +ppClass :: DynFlags -> TyClDecl Name -> [(Name, DocForDecl Name)] -> [String] +ppClass dflags x subdocs = out dflags x{tcdSigs=[]} : + concatMap (flip (ppSigWithDoc dflags) subdocs . addContext . unL) (tcdSigs x) where addContext (TypeSig name (L l sig) nwcs) = TypeSig name (L l $ f sig) nwcs addContext (MinimalSig src sig) = MinimalSig src sig @@ -203,7 +213,7 @@ ppCtor dflags dat subdocs con -- We print the constructors as comma-separated list. See GHC -- docs for con_names on why it is a list to begin with. - name = showSDocUnqual dflags . interpp'SP . map unL $ con_names con + name = commaSeparate dflags . map unL $ con_names con resType = case con_res con of ResTyH98 -> apps $ map (reL . HsTyVar) $ From git at git.haskell.org Wed Jul 8 08:38:02 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:38:02 +0000 (UTC) Subject: [commit: haddock] master, wip/api-annots-ghc-7.10-3: Don't print instance safety information in Hoogle (e49d473) Message-ID: <20150708083802.061683A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: master,wip/api-annots-ghc-7.10-3 Link : http://git.haskell.org/haddock.git/commitdiff/e49d473bf33fa374c60462ad178ac539f026c3ff >--------------------------------------------------------------- commit e49d473bf33fa374c60462ad178ac539f026c3ff Author: Mateusz Kowalczyk Date: Fri Mar 27 03:04:21 2015 +0000 Don't print instance safety information in Hoogle Fixes #168 >--------------------------------------------------------------- e49d473bf33fa374c60462ad178ac539f026c3ff CHANGES | 2 ++ haddock-api/src/Haddock/Backends/Hoogle.hs | 13 +++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 7aba49a..af90b4f 100644 --- a/CHANGES +++ b/CHANGES @@ -41,6 +41,8 @@ Changes in version 2.16.0 * Output method documentation in Hoogle backend (#259) + * Don't print instance safety information in Hoogle (#168) + Changes in version 2.15.0 * Always read in prologue files as UTF8 (#286 and Cabal #1721) diff --git a/haddock-api/src/Haddock/Backends/Hoogle.hs b/haddock-api/src/Haddock/Backends/Hoogle.hs index 12dfc1f..914e346 100644 --- a/haddock-api/src/Haddock/Backends/Hoogle.hs +++ b/haddock-api/src/Haddock/Backends/Hoogle.hs @@ -15,7 +15,8 @@ module Haddock.Backends.Hoogle ( ppHoogle ) where - +import BasicTypes (OverlapFlag(..), OverlapMode(..)) +import InstEnv (ClsInst(..)) import Haddock.GhcUtils import Haddock.Types hiding (Version) import Haddock.Utils hiding (out) @@ -169,7 +170,15 @@ ppClass dflags x subdocs = out dflags x{tcdSigs=[]} : ppInstance :: DynFlags -> ClsInst -> [String] ppInstance dflags x = - [dropComment $ outWith (showSDocForUser dflags alwaysQualify) x] + [dropComment $ outWith (showSDocForUser dflags alwaysQualify) cls] + where + -- As per #168, we don't want safety information about the class + -- in Hoogle output. The easiest way to achieve this is to set the + -- safety information to a state where the Outputable instance + -- produces no output which means no overlap and unsafe (or [safe] + -- is generated). + cls = x { is_flag = OverlapFlag { overlapMode = NoOverlap mempty + , isSafeOverlap = False } } ppSynonym :: DynFlags -> TyClDecl Name -> [String] ppSynonym dflags x = [out dflags x] From git at git.haskell.org Wed Jul 8 08:38:04 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:38:04 +0000 (UTC) Subject: [commit: haddock] wip/orf-reboot: Move PostRn/PostTc family instances for DocName into Haddock.Types (0f08cc2) Message-ID: <20150708083804.120153A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/0f08cc2e1d4f3fb52a7b21829eb168462ef5c20a >--------------------------------------------------------------- commit 0f08cc2e1d4f3fb52a7b21829eb168462ef5c20a Author: Adam Gundry Date: Fri Mar 27 15:26:52 2015 +0000 Move PostRn/PostTc family instances for DocName into Haddock.Types >--------------------------------------------------------------- 0f08cc2e1d4f3fb52a7b21829eb168462ef5c20a haddock-api/src/Haddock/Interface/Rename.hs | 12 ------------ haddock-api/src/Haddock/Types.hs | 12 ++++++++++++ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/haddock-api/src/Haddock/Interface/Rename.hs b/haddock-api/src/Haddock/Interface/Rename.hs index 1234d05..74a11e3 100644 --- a/haddock-api/src/Haddock/Interface/Rename.hs +++ b/haddock-api/src/Haddock/Interface/Rename.hs @@ -1,4 +1,3 @@ -{-# LANGUAGE TypeFamilies #-} ---------------------------------------------------------------------------- -- | -- Module : Haddock.Interface.Rename @@ -21,8 +20,6 @@ import Haddock.Types import Bag (emptyBag) import GHC hiding (NoLink) import Name -import NameSet -import Coercion import Control.Applicative import Control.Monad hiding (mapM) @@ -517,12 +514,3 @@ renameSub (n,doc) = do n' <- rename n doc' <- renameDocForDecl doc return (n', doc') - -type instance PostRn DocName NameSet = PlaceHolder -type instance PostRn DocName Fixity = PlaceHolder -type instance PostRn DocName Bool = PlaceHolder -type instance PostRn DocName [Name] = PlaceHolder - -type instance PostTc DocName Kind = PlaceHolder -type instance PostTc DocName Type = PlaceHolder -type instance PostTc DocName Coercion = PlaceHolder diff --git a/haddock-api/src/Haddock/Types.hs b/haddock-api/src/Haddock/Types.hs index e93294a..8e0ae19 100644 --- a/haddock-api/src/Haddock/Types.hs +++ b/haddock-api/src/Haddock/Types.hs @@ -1,4 +1,5 @@ {-# LANGUAGE DeriveDataTypeable, DeriveFunctor, DeriveFoldable, DeriveTraversable, StandaloneDeriving #-} +{-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -fno-warn-orphans #-} ----------------------------------------------------------------------------- -- | @@ -34,6 +35,8 @@ import GHC hiding (NoLink) import DynFlags (ExtensionFlag, Language) import OccName import Outputable +import NameSet (NameSet) +import Coercion (Coercion) import Control.Applicative (Applicative(..)) import Control.Monad (ap) @@ -279,6 +282,15 @@ data DocName -- documentation, as far as Haddock knows. deriving Eq +type instance PostRn DocName Name = DocName +type instance PostRn DocName NameSet = PlaceHolder +type instance PostRn DocName Fixity = PlaceHolder +type instance PostRn DocName Bool = PlaceHolder +type instance PostRn DocName [Name] = PlaceHolder + +type instance PostTc DocName Kind = PlaceHolder +type instance PostTc DocName Type = PlaceHolder +type instance PostTc DocName Coercion = PlaceHolder instance NamedThing DocName where getName (Documented name _) = name From git at git.haskell.org Wed Jul 8 08:38:06 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:38:06 +0000 (UTC) Subject: [commit: haddock] wip/orf-reboot: Roughly fix up haddock for OverloadedRecordFields GHC API changes (d137dae) Message-ID: <20150708083806.245043A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/d137dae000575e46a2144892329df1dfb5a28980 >--------------------------------------------------------------- commit d137dae000575e46a2144892329df1dfb5a28980 Author: Adam Gundry Date: Fri Mar 27 15:27:20 2015 +0000 Roughly fix up haddock for OverloadedRecordFields GHC API changes This compiles, but it is unlikely to produce good documentation when the OverloadedRecordFields extension is used. >--------------------------------------------------------------- d137dae000575e46a2144892329df1dfb5a28980 haddock-api/src/Haddock/Backends/Hoogle.hs | 4 ++-- haddock-api/src/Haddock/Backends/LaTeX.hs | 4 ++-- haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | 6 +++--- haddock-api/src/Haddock/Convert.hs | 10 +++++++--- haddock-api/src/Haddock/GhcUtils.hs | 2 +- haddock-api/src/Haddock/Interface/Create.hs | 12 +++++++----- haddock-api/src/Haddock/Interface/Rename.hs | 3 ++- haddock-api/src/Haddock/Utils.hs | 3 ++- 8 files changed, 26 insertions(+), 18 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 d137dae000575e46a2144892329df1dfb5a28980 From git at git.haskell.org Wed Jul 8 08:38:08 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:38:08 +0000 (UTC) Subject: [commit: haddock] master, wip/api-annots-ghc-7.10-3: Post-release version bumps and changelog (b44763d) Message-ID: <20150708083808.30FC63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: master,wip/api-annots-ghc-7.10-3 Link : http://git.haskell.org/haddock.git/commitdiff/b44763d0c429d2acce731ea33ed4d5feec7a85a9 >--------------------------------------------------------------- commit b44763d0c429d2acce731ea33ed4d5feec7a85a9 Author: Mateusz Kowalczyk Date: Sat Mar 28 00:11:47 2015 +0000 Post-release version bumps and changelog >--------------------------------------------------------------- b44763d0c429d2acce731ea33ed4d5feec7a85a9 CHANGES | 25 ++++++++++++++----------- haddock-api/haddock-api.cabal | 2 +- haddock-library/haddock-library.cabal | 2 +- haddock.cabal | 2 +- 4 files changed, 17 insertions(+), 14 deletions(-) diff --git a/CHANGES b/CHANGES index af90b4f..19639ef 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,17 @@ +Changes in version 2.16.1 + + * Don't default to type constructors for out-of-scope names (#253 and + #375) + + * Fix Hoogle display of constructors (#361) + + * Fully qualify names in Hoogle instances output (#263) + + * Output method documentation in Hoogle backend (#259) + + * Don't print instance safety information in Hoogle (#168) + + Changes in version 2.16.0 * Experimental collapsible header support (#335) @@ -32,17 +46,6 @@ Changes in version 2.16.0 * Deal better with long synopsis lines (#151) - * Don't default to type constructors for out-of-scope names (#253 and - #375) - - * Fix Hoogle display of constructors (#361) - - * Fully qualify names in Hoogle instances output (#263) - - * Output method documentation in Hoogle backend (#259) - - * Don't print instance safety information in Hoogle (#168) - Changes in version 2.15.0 * Always read in prologue files as UTF8 (#286 and Cabal #1721) diff --git a/haddock-api/haddock-api.cabal b/haddock-api/haddock-api.cabal index 22b3ae5..7ab7d71 100644 --- a/haddock-api/haddock-api.cabal +++ b/haddock-api/haddock-api.cabal @@ -1,5 +1,5 @@ name: haddock-api -version: 2.16.0 +version: 2.16.1 synopsis: A documentation-generation tool for Haskell libraries description: Haddock is a documentation-generation tool for Haskell libraries diff --git a/haddock-library/haddock-library.cabal b/haddock-library/haddock-library.cabal index b0f886c..3d9b755 100644 --- a/haddock-library/haddock-library.cabal +++ b/haddock-library/haddock-library.cabal @@ -1,5 +1,5 @@ name: haddock-library -version: 1.2.0 +version: 1.2.1 synopsis: Library exposing some functionality of Haddock. description: Haddock is a documentation-generation tool for Haskell libraries. These modules expose some functionality of it diff --git a/haddock.cabal b/haddock.cabal index fbb4bfe..ce743d9 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -1,5 +1,5 @@ name: haddock -version: 2.16.0 +version: 2.16.1 synopsis: A documentation-generation tool for Haskell libraries description: Haddock is a documentation-generation tool for Haskell libraries From git at git.haskell.org Wed Jul 8 08:38:10 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:38:10 +0000 (UTC) Subject: [commit: haddock] master, wip/api-annots-ghc-7.10-3: Loosen bounds on haddock-* (8ba7777) Message-ID: <20150708083810.3D8153A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: master,wip/api-annots-ghc-7.10-3 Link : http://git.haskell.org/haddock.git/commitdiff/8ba7777c5db203512263934dfe40d56c1b4199b8 >--------------------------------------------------------------- commit 8ba7777c5db203512263934dfe40d56c1b4199b8 Author: Mateusz Kowalczyk Date: Sat Mar 28 20:07:15 2015 +0000 Loosen bounds on haddock-* >--------------------------------------------------------------- 8ba7777c5db203512263934dfe40d56c1b4199b8 haddock-api/haddock-api.cabal | 2 +- haddock.cabal | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/haddock-api/haddock-api.cabal b/haddock-api/haddock-api.cabal index 7ab7d71..3bc2226 100644 --- a/haddock-api/haddock-api.cabal +++ b/haddock-api/haddock-api.cabal @@ -48,7 +48,7 @@ library , ghc >= 7.10 && < 7.10.2 , ghc-paths - , haddock-library == 1.2.0.* + , haddock-library == 1.2.* hs-source-dirs: src diff --git a/haddock.cabal b/haddock.cabal index ce743d9..03bb28a 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -110,7 +110,7 @@ executable haddock Haddock.GhcUtils Haddock.Convert else - build-depends: haddock-api == 2.16.0 + build-depends: haddock-api == 2.16.* test-suite html-test type: exitcode-stdio-1.0 From git at git.haskell.org Wed Jul 8 08:38:12 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:38:12 +0000 (UTC) Subject: [commit: haddock] master, wip/api-annots-ghc-7.10-3: Expand response files in arguments (d567a12) Message-ID: <20150708083812.485033A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: master,wip/api-annots-ghc-7.10-3 Link : http://git.haskell.org/haddock.git/commitdiff/d567a12b2d24bab610cd7e8f8014d40c7615e24d >--------------------------------------------------------------- commit d567a12b2d24bab610cd7e8f8014d40c7615e24d Author: Mateusz Kowalczyk Date: Sat Mar 28 20:38:10 2015 +0000 Expand response files in arguments Closes #285 >--------------------------------------------------------------- d567a12b2d24bab610cd7e8f8014d40c7615e24d CHANGES | 1 + driver/Main.hs | 28 +++++++++++++++++++++++++--- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 19639ef..e170bc4 100644 --- a/CHANGES +++ b/CHANGES @@ -11,6 +11,7 @@ Changes in version 2.16.1 * Don't print instance safety information in Hoogle (#168) + * Expand response files in arguments (#285) Changes in version 2.16.0 diff --git a/driver/Main.hs b/driver/Main.hs index 42b9986..5097a86 100644 --- a/driver/Main.hs +++ b/driver/Main.hs @@ -1,7 +1,29 @@ +{-# LANGUAGE ScopedTypeVariables #-} module Main where -import Documentation.Haddock (haddock) -import System.Environment (getArgs) +import Control.Exception +import Documentation.Haddock (haddock) +import System.Environment (getArgs) +import System.Exit (exitFailure) +import System.IO main :: IO () -main = getArgs >>= haddock +main = getArgs >>= expandResponse >>= haddock + + +-- | Arguments which look like '@foo' will be replaced with the +-- contents of file @foo at . The contents will be passed through 'words' +-- and blanks filtered out first. +-- +-- We quit if the file is not found or reading somehow fails. +expandResponse :: [String] -> IO [String] +expandResponse = fmap concat . mapM expand + where + expand :: String -> IO [String] + expand ('@':f) = readFileExc f >>= return . filter (not . null) . words + expand x = return [x] + + readFileExc f = + readFile f `catch` \(e :: IOException) -> do + hPutStrLn stderr $ "Error while expanding response file: " ++ show e + exitFailure From git at git.haskell.org Wed Jul 8 08:38:14 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:38:14 +0000 (UTC) Subject: [commit: haddock] T6018-injective-type-families: Follow changes from #6018 (bd3f059) Message-ID: <20150708083814.581DA3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : T6018-injective-type-families Link : http://git.haskell.org/haddock.git/commitdiff/bd3f059a6d8cc66c5053997cbba58b612a992c39 >--------------------------------------------------------------- commit bd3f059a6d8cc66c5053997cbba58b612a992c39 Author: Jan Stolarek Date: Fri Dec 19 08:16:30 2014 +0100 Follow changes from #6018 >--------------------------------------------------------------- bd3f059a6d8cc66c5053997cbba58b612a992c39 haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | 29 ++++++++++++-- haddock-api/src/Haddock/Convert.hs | 55 +++++++++++++++++--------- haddock-api/src/Haddock/Interface/Rename.hs | 34 +++++++++++++--- 3 files changed, 90 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 bd3f059a6d8cc66c5053997cbba58b612a992c39 From git at git.haskell.org Wed Jul 8 08:38:16 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:38:16 +0000 (UTC) Subject: [commit: haddock] wip/10268: HsTyVar now holds a Located name (44c7fdf) Message-ID: <20150708083816.6B5CA3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/10268 Link : http://git.haskell.org/haddock.git/commitdiff/44c7fdf4316348d321f59cfef95ca29c7d7abc63 >--------------------------------------------------------------- commit 44c7fdf4316348d321f59cfef95ca29c7d7abc63 Author: Alan Zimmerman Date: Tue Apr 14 20:38:48 2015 +0200 HsTyVar now holds a Located name >--------------------------------------------------------------- 44c7fdf4316348d321f59cfef95ca29c7d7abc63 haddock-api/src/Haddock/Backends/Hoogle.hs | 4 ++-- haddock-api/src/Haddock/Backends/LaTeX.hs | 22 +++++++++++----------- haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | 26 +++++++++++++------------- haddock-api/src/Haddock/Convert.hs | 4 ++-- haddock-api/src/Haddock/Interface/Create.hs | 4 ++-- haddock-api/src/Haddock/Interface/Rename.hs | 2 +- 6 files changed, 31 insertions(+), 31 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 44c7fdf4316348d321f59cfef95ca29c7d7abc63 From git at git.haskell.org Wed Jul 8 08:38:18 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:38:18 +0000 (UTC) Subject: [commit: haddock] wip/T9840: Handle EmptyClosedSynFamilyTyCon introduced in fix to #9840 (593a775) Message-ID: <20150708083818.75E153A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/T9840 Link : http://git.haskell.org/haddock.git/commitdiff/593a7759606da4c6b7bfeeb91934e6552259792d >--------------------------------------------------------------- commit 593a7759606da4c6b7bfeeb91934e6552259792d Author: Adam Gundry Date: Wed Apr 15 12:48:03 2015 +0100 Handle EmptyClosedSynFamilyTyCon introduced in fix to #9840 >--------------------------------------------------------------- 593a7759606da4c6b7bfeeb91934e6552259792d haddock-api/src/Haddock/Convert.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/haddock-api/src/Haddock/Convert.hs b/haddock-api/src/Haddock/Convert.hs index 8317322..ac477c8 100644 --- a/haddock-api/src/Haddock/Convert.hs +++ b/haddock-api/src/Haddock/Convert.hs @@ -173,6 +173,7 @@ synifyTyCon coax tc (brListMap (noLoc . synifyAxBranch tc) branches) BuiltInSynFamTyCon {} -> return $ ClosedTypeFamily [] AbstractClosedSynFamilyTyCon {} -> return $ ClosedTypeFamily [] + EmptyClosedSynFamilyTyCon {} -> return $ ClosedTypeFamily [] in info >>= \i -> return (FamDecl (FamilyDecl { fdInfo = i From git at git.haskell.org Wed Jul 8 08:38:20 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:38:20 +0000 (UTC) Subject: [commit: haddock] wip/T9840: Alternative representation for empty closed type families (c86a8b2) Message-ID: <20150708083820.801503A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/T9840 Link : http://git.haskell.org/haddock.git/commitdiff/c86a8b2ace6a803f67343e8919a71d53a97a3f13 >--------------------------------------------------------------- commit c86a8b2ace6a803f67343e8919a71d53a97a3f13 Author: Adam Gundry Date: Thu Apr 16 11:02:58 2015 +0100 Alternative representation for empty closed type families >--------------------------------------------------------------- c86a8b2ace6a803f67343e8919a71d53a97a3f13 haddock-api/src/Haddock/Convert.hs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/haddock-api/src/Haddock/Convert.hs b/haddock-api/src/Haddock/Convert.hs index ac477c8..4da108d 100644 --- a/haddock-api/src/Haddock/Convert.hs +++ b/haddock-api/src/Haddock/Convert.hs @@ -168,12 +168,13 @@ synifyTyCon coax tc Just rhs -> let info = case rhs of OpenSynFamilyTyCon -> return OpenTypeFamily - ClosedSynFamilyTyCon (CoAxiom { co_ax_branches = branches }) -> - return $ ClosedTypeFamily - (brListMap (noLoc . synifyAxBranch tc) branches) + ClosedSynFamilyTyCon mb -> case mb of + Just (CoAxiom { co_ax_branches = branches }) + -> return $ ClosedTypeFamily $ + brListMap (noLoc . synifyAxBranch tc) branches + Nothing -> return $ ClosedTypeFamily [] BuiltInSynFamTyCon {} -> return $ ClosedTypeFamily [] AbstractClosedSynFamilyTyCon {} -> return $ ClosedTypeFamily [] - EmptyClosedSynFamilyTyCon {} -> return $ ClosedTypeFamily [] in info >>= \i -> return (FamDecl (FamilyDecl { fdInfo = i From git at git.haskell.org Wed Jul 8 08:38:22 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:38:22 +0000 (UTC) Subject: [commit: haddock] wip/T9840: Closed type family syntax now distinguishes abstract/empty families (714de29) Message-ID: <20150708083822.8CAB73A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/T9840 Link : http://git.haskell.org/haddock.git/commitdiff/714de298860bacda4d5d7c217095665bd757763f >--------------------------------------------------------------- commit 714de298860bacda4d5d7c217095665bd757763f Author: Adam Gundry Date: Fri Apr 17 11:47:33 2015 +0100 Closed type family syntax now distinguishes abstract/empty families >--------------------------------------------------------------- 714de298860bacda4d5d7c217095665bd757763f haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | 4 ++-- haddock-api/src/Haddock/Convert.hs | 12 +++++++----- haddock-api/src/Haddock/Interface/Rename.hs | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs index 2fcc21e..88aa966 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs @@ -265,9 +265,9 @@ ppTyFam summary associated links instances fixities loc doc decl splice unicode ppTyFamHeader summary associated decl unicode qual <+> ppFixities fixities qual instancesBit - | FamilyDecl { fdInfo = ClosedTypeFamily eqns } <- decl + | FamilyDecl { fdInfo = ClosedTypeFamily mb_eqns } <- decl , not summary - = subEquations qual $ map (ppTyFamEqn . unLoc) eqns + = subEquations qual $ map (ppTyFamEqn . unLoc) $ fromMaybe [] mb_eqns | otherwise = ppInstances instances docname unicode qual diff --git a/haddock-api/src/Haddock/Convert.hs b/haddock-api/src/Haddock/Convert.hs index 4da108d..1ef06df 100644 --- a/haddock-api/src/Haddock/Convert.hs +++ b/haddock-api/src/Haddock/Convert.hs @@ -131,7 +131,7 @@ synifyAxiom ax@(CoAxiom { co_ax_tc = tc }) (TyFamInstDecl { tfid_eqn = noLoc $ synifyAxBranch tc branch , tfid_fvs = placeHolderNamesTc })) - | Just ax' <- isClosedSynFamilyTyCon_maybe tc + | Just ax' <- isClosedSynFamilyTyConWithAxiom_maybe tc , getUnique ax' == getUnique ax -- without the getUniques, type error = synifyTyCon (Just ax) tc >>= return . TyClD @@ -170,11 +170,13 @@ synifyTyCon coax tc OpenSynFamilyTyCon -> return OpenTypeFamily ClosedSynFamilyTyCon mb -> case mb of Just (CoAxiom { co_ax_branches = branches }) - -> return $ ClosedTypeFamily $ + -> return $ ClosedTypeFamily $ Just $ brListMap (noLoc . synifyAxBranch tc) branches - Nothing -> return $ ClosedTypeFamily [] - BuiltInSynFamTyCon {} -> return $ ClosedTypeFamily [] - AbstractClosedSynFamilyTyCon {} -> return $ ClosedTypeFamily [] + Nothing -> return $ ClosedTypeFamily $ Just [] + BuiltInSynFamTyCon {} + -> return $ ClosedTypeFamily $ Just [] + AbstractClosedSynFamilyTyCon {} + -> return $ ClosedTypeFamily Nothing in info >>= \i -> return (FamDecl (FamilyDecl { fdInfo = i diff --git a/haddock-api/src/Haddock/Interface/Rename.hs b/haddock-api/src/Haddock/Interface/Rename.hs index 1234d05..56e5b07 100644 --- a/haddock-api/src/Haddock/Interface/Rename.hs +++ b/haddock-api/src/Haddock/Interface/Rename.hs @@ -347,7 +347,7 @@ renameFamilyInfo :: FamilyInfo Name -> RnM (FamilyInfo DocName) renameFamilyInfo DataFamily = return DataFamily renameFamilyInfo OpenTypeFamily = return OpenTypeFamily renameFamilyInfo (ClosedTypeFamily eqns) - = do { eqns' <- mapM renameLTyFamInstEqn eqns + = do { eqns' <- mapM (mapM renameLTyFamInstEqn) eqns ; return $ ClosedTypeFamily eqns' } renameDataDefn :: HsDataDefn Name -> RnM (HsDataDefn DocName) From git at git.haskell.org Wed Jul 8 08:38:24 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:38:24 +0000 (UTC) Subject: [commit: haddock] master, wip/api-annots-ghc-7.10-3: Do not insert anchor for section headings in contents box (5d04e31) Message-ID: <20150708083824.A46DF3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: master,wip/api-annots-ghc-7.10-3 Link : http://git.haskell.org/haddock.git/commitdiff/5d04e313cc52ecf88b0fd0b3d0d39ce6a8dc7406 >--------------------------------------------------------------- commit 5d04e313cc52ecf88b0fd0b3d0d39ce6a8dc7406 Author: watashi Date: Sun Apr 26 16:35:28 2015 -0700 Do not insert anchor for section headings in contents box >--------------------------------------------------------------- 5d04e313cc52ecf88b0fd0b3d0d39ce6a8dc7406 .gitignore | 3 ++ .../src/Haddock/Backends/Xhtml/DocMarkup.hs | 5 ++- html-test/ref/{IgnoreExports.html => Bug387.html} | 52 +++++++++++++--------- html-test/src/Bug387.hs | 12 +++++ 4 files changed, 51 insertions(+), 21 deletions(-) diff --git a/.gitignore b/.gitignore index 6b8d26e..2d3f451 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,6 @@ /doc/configure tags TAGS + +.cabal-sandbox +cabal.sandbox.config diff --git a/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs b/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs index e807eb9..c23f3f0 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs @@ -62,7 +62,10 @@ parHtmlMarkup qual insertAnchors ppId = Markup { then anchor ! [href url] << fromMaybe url mLabel else toHtml $ fromMaybe url mLabel, - markupAName = \aname -> namedAnchor aname << "", + markupAName = \aname + -> if insertAnchors + then namedAnchor aname << "" + else noHtml, markupPic = \(Picture uri t) -> image ! ([src uri] ++ fromMaybe [] (return . title <$> t)), markupProperty = pre . toHtml, markupExample = examplesToHtml, diff --git a/html-test/ref/IgnoreExports.html b/html-test/ref/Bug387.html similarity index 73% copy from html-test/ref/IgnoreExports.html copy to html-test/ref/Bug387.html index c257217..2d2009b 100644 --- a/html-test/ref/IgnoreExports.html +++ b/html-test/ref/Bug387.html @@ -3,13 +3,13 @@ >IgnoreExportsBug387

    IgnoreExports

    Bug387

    Documentation

    Section1

    footest1 :: Int

    documentation for foo

    Section2

    bartest2 :: Int

    documentation for bar

    Produced by Haddock version 2.15.0

    version 2.16.1

    Repository : ssh://git at git.haskell.org/haddock On branches: adamse-D1033,ghc-head,wip/10313,wip/T10483,wip/T9840,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/5bbae8b9bc17d2166c7e03d5f42f2b12fadf70b7 >--------------------------------------------------------------- commit 5bbae8b9bc17d2166c7e03d5f42f2b12fadf70b7 Author: Simon Peyton Jones Date: Fri May 1 09:36:47 2015 +0100 Track change in API of TyCon >--------------------------------------------------------------- 5bbae8b9bc17d2166c7e03d5f42f2b12fadf70b7 haddock-api/src/Haddock/Convert.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/haddock-api/src/Haddock/Convert.hs b/haddock-api/src/Haddock/Convert.hs index 8317322..ce1ef8b 100644 --- a/haddock-api/src/Haddock/Convert.hs +++ b/haddock-api/src/Haddock/Convert.hs @@ -338,8 +338,9 @@ synifyType :: SynifyTypeState -> Type -> LHsType Name synifyType _ (TyVarTy tv) = noLoc $ HsTyVar (getName tv) synifyType _ (TyConApp tc tys) -- Use non-prefix tuple syntax where possible, because it looks nicer. - | isTupleTyCon tc, tyConArity tc == length tys = - noLoc $ HsTupleTy (case tupleTyConSort tc of + | Just sort <- tyConTuple_maybe tc + , tyConArity tc == length tys + = noLoc $ HsTupleTy (case sort of BoxedTuple -> HsBoxedTuple ConstraintTuple -> HsConstraintTuple UnboxedTuple -> HsUnboxedTuple) From git at git.haskell.org Wed Jul 8 08:38:28 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:38:28 +0000 (UTC) Subject: [commit: haddock] wip/T9840: Merge remote-tracking branch 'origin/ghc-head' into wip/T9840 (31d1ed3) Message-ID: <20150708083828.BE6E33A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/T9840 Link : http://git.haskell.org/haddock.git/commitdiff/31d1ed31e8708bcf5c141f200a2609692cbe2c59 >--------------------------------------------------------------- commit 31d1ed31e8708bcf5c141f200a2609692cbe2c59 Merge: 714de29 5bbae8b Author: Adam Gundry Date: Mon May 4 13:53:39 2015 +0100 Merge remote-tracking branch 'origin/ghc-head' into wip/T9840 >--------------------------------------------------------------- 31d1ed31e8708bcf5c141f200a2609692cbe2c59 haddock-api/src/Haddock/Convert.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) From git at git.haskell.org Wed Jul 8 08:38:30 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:38:30 +0000 (UTC) Subject: [commit: haddock] adamse-D1033, ghc-head, wip/10313, wip/T10483, wip/orf-reboot: Track API changes to support empty closed type familes (26a590c) Message-ID: <20150708083830.CC0A93A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: adamse-D1033,ghc-head,wip/10313,wip/T10483,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/26a590c009005d77fbee9e2c79286bd93f7955f5 >--------------------------------------------------------------- commit 26a590c009005d77fbee9e2c79286bd93f7955f5 Author: Adam Gundry Date: Mon May 4 15:32:59 2015 +0100 Track API changes to support empty closed type familes >--------------------------------------------------------------- 26a590c009005d77fbee9e2c79286bd93f7955f5 haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | 4 ++-- haddock-api/src/Haddock/Convert.hs | 16 ++++++++++------ haddock-api/src/Haddock/Interface/Rename.hs | 2 +- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs index 2fcc21e..88aa966 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs @@ -265,9 +265,9 @@ ppTyFam summary associated links instances fixities loc doc decl splice unicode ppTyFamHeader summary associated decl unicode qual <+> ppFixities fixities qual instancesBit - | FamilyDecl { fdInfo = ClosedTypeFamily eqns } <- decl + | FamilyDecl { fdInfo = ClosedTypeFamily mb_eqns } <- decl , not summary - = subEquations qual $ map (ppTyFamEqn . unLoc) eqns + = subEquations qual $ map (ppTyFamEqn . unLoc) $ fromMaybe [] mb_eqns | otherwise = ppInstances instances docname unicode qual diff --git a/haddock-api/src/Haddock/Convert.hs b/haddock-api/src/Haddock/Convert.hs index ce1ef8b..d841aec 100644 --- a/haddock-api/src/Haddock/Convert.hs +++ b/haddock-api/src/Haddock/Convert.hs @@ -131,7 +131,7 @@ synifyAxiom ax@(CoAxiom { co_ax_tc = tc }) (TyFamInstDecl { tfid_eqn = noLoc $ synifyAxBranch tc branch , tfid_fvs = placeHolderNamesTc })) - | Just ax' <- isClosedSynFamilyTyCon_maybe tc + | Just ax' <- isClosedSynFamilyTyConWithAxiom_maybe tc , getUnique ax' == getUnique ax -- without the getUniques, type error = synifyTyCon (Just ax) tc >>= return . TyClD @@ -168,11 +168,15 @@ synifyTyCon coax tc Just rhs -> let info = case rhs of OpenSynFamilyTyCon -> return OpenTypeFamily - ClosedSynFamilyTyCon (CoAxiom { co_ax_branches = branches }) -> - return $ ClosedTypeFamily - (brListMap (noLoc . synifyAxBranch tc) branches) - BuiltInSynFamTyCon {} -> return $ ClosedTypeFamily [] - AbstractClosedSynFamilyTyCon {} -> return $ ClosedTypeFamily [] + ClosedSynFamilyTyCon mb -> case mb of + Just (CoAxiom { co_ax_branches = branches }) + -> return $ ClosedTypeFamily $ Just $ + brListMap (noLoc . synifyAxBranch tc) branches + Nothing -> return $ ClosedTypeFamily $ Just [] + BuiltInSynFamTyCon {} + -> return $ ClosedTypeFamily $ Just [] + AbstractClosedSynFamilyTyCon {} + -> return $ ClosedTypeFamily Nothing in info >>= \i -> return (FamDecl (FamilyDecl { fdInfo = i diff --git a/haddock-api/src/Haddock/Interface/Rename.hs b/haddock-api/src/Haddock/Interface/Rename.hs index 1234d05..56e5b07 100644 --- a/haddock-api/src/Haddock/Interface/Rename.hs +++ b/haddock-api/src/Haddock/Interface/Rename.hs @@ -347,7 +347,7 @@ renameFamilyInfo :: FamilyInfo Name -> RnM (FamilyInfo DocName) renameFamilyInfo DataFamily = return DataFamily renameFamilyInfo OpenTypeFamily = return OpenTypeFamily renameFamilyInfo (ClosedTypeFamily eqns) - = do { eqns' <- mapM renameLTyFamInstEqn eqns + = do { eqns' <- mapM (mapM renameLTyFamInstEqn) eqns ; return $ ClosedTypeFamily eqns' } renameDataDefn :: HsDataDefn Name -> RnM (HsDataDefn DocName) From git at git.haskell.org Wed Jul 8 08:38:32 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:38:32 +0000 (UTC) Subject: [commit: haddock] master, wip/api-annots-ghc-7.10-3: Ignore doc/haddock.{ps, pdf} (319bf20) Message-ID: <20150708083832.D934B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: master,wip/api-annots-ghc-7.10-3 Link : http://git.haskell.org/haddock.git/commitdiff/319bf20d44589545e6850db3e676e30216dd3cc2 >--------------------------------------------------------------- commit 319bf20d44589545e6850db3e676e30216dd3cc2 Author: Ben Gamari Date: Wed May 6 14:55:21 2015 -0400 Ignore doc/haddock.{ps,pdf} >--------------------------------------------------------------- 319bf20d44589545e6850db3e676e30216dd3cc2 .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 2d3f451..f07c758 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,8 @@ /latex-test/out/ /doc/haddock +/doc/haddock.ps +/doc/haddock.pdf /doc/autom4te.cache/ /doc/config.log /doc/config.mk From git at git.haskell.org Wed Jul 8 08:38:34 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:38:34 +0000 (UTC) Subject: [commit: haddock] adamse-D1033, ghc-head, wip/10313, wip/T10483, wip/orf-reboot: Change ModuleTree Node to carry PackageKey and SourcePackageId to resolve #385 (2380f07) Message-ID: <20150708083834.E6D113A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: adamse-D1033,ghc-head,wip/10313,wip/T10483,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/2380f07c430c525b205ce2eae6dab23c8388d899 >--------------------------------------------------------------- commit 2380f07c430c525b205ce2eae6dab23c8388d899 Author: Murray Campbell Date: Sun Apr 26 13:49:01 2015 -0700 Change ModuleTree Node to carry PackageKey and SourcePackageId to resolve #385 Signed-off-by: Austin Seipp >--------------------------------------------------------------- 2380f07c430c525b205ce2eae6dab23c8388d899 haddock-api/src/Haddock/Backends/Xhtml.hs | 4 +-- haddock-api/src/Haddock/ModuleTree.hs | 41 +++++++++++++++++-------------- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/haddock-api/src/Haddock/Backends/Xhtml.hs b/haddock-api/src/Haddock/Backends/Xhtml.hs index 65a7e6c..6ef1e86 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml.hs @@ -289,7 +289,7 @@ mkNodeList qual ss p ts = case ts of mkNode :: Qualification -> [String] -> String -> ModuleTree -> Html -mkNode qual ss p (Node s leaf pkg short ts) = +mkNode qual ss p (Node s leaf pkg srcPkg short ts) = htmlModule <+> shortDescr +++ htmlPkg +++ subtree where modAttrs = case (ts, leaf) of @@ -313,7 +313,7 @@ mkNode qual ss p (Node s leaf pkg short ts) = mdl = intercalate "." (reverse (s:ss)) shortDescr = maybe noHtml (origDocToHtml qual) short - htmlPkg = maybe noHtml (thespan ! [theclass "package"] <<) pkg + htmlPkg = maybe noHtml (thespan ! [theclass "package"] <<) srcPkg subtree = mkNodeList qual (s:ss) p ts ! collapseSection p True "" diff --git a/haddock-api/src/Haddock/ModuleTree.hs b/haddock-api/src/Haddock/ModuleTree.hs index eec1342..2f73121 100644 --- a/haddock-api/src/Haddock/ModuleTree.hs +++ b/haddock-api/src/Haddock/ModuleTree.hs @@ -15,41 +15,44 @@ module Haddock.ModuleTree ( ModuleTree(..), mkModuleTree ) where import Haddock.Types ( MDoc ) import GHC ( Name ) -import Module ( Module, moduleNameString, moduleName, modulePackageKey ) +import Module ( Module, moduleNameString, moduleName, modulePackageKey, packageKeyString ) import DynFlags ( DynFlags ) import Packages ( lookupPackage ) import PackageConfig ( sourcePackageIdString ) -data ModuleTree = Node String Bool (Maybe String) (Maybe (MDoc Name)) [ModuleTree] +data ModuleTree = Node String Bool (Maybe String) (Maybe String) (Maybe (MDoc Name)) [ModuleTree] mkModuleTree :: DynFlags -> Bool -> [(Module, Maybe (MDoc Name))] -> [ModuleTree] mkModuleTree dflags showPkgs mods = - foldr fn [] [ (splitModule mdl, modPkg mdl, short) | (mdl, short) <- mods ] + foldr fn [] [ (splitModule mdl, modPkg mdl, modSrcPkg mdl, short) | (mdl, short) <- mods ] where - modPkg mod_ | showPkgs = fmap sourcePackageIdString - (lookupPackage dflags (modulePackageKey mod_)) + modPkg mod_ | showPkgs = Just (packageKeyString (modulePackageKey mod_)) | otherwise = Nothing - fn (mod_,pkg,short) = addToTrees mod_ pkg short - - -addToTrees :: [String] -> Maybe String -> Maybe (MDoc Name) -> [ModuleTree] -> [ModuleTree] -addToTrees [] _ _ ts = ts -addToTrees ss pkg short [] = mkSubTree ss pkg short -addToTrees (s1:ss) pkg short (t@(Node s2 leaf node_pkg node_short subs) : ts) - | s1 > s2 = t : addToTrees (s1:ss) pkg short ts - | s1 == s2 = Node s2 (leaf || null ss) this_pkg this_short (addToTrees ss pkg short subs) : ts - | otherwise = mkSubTree (s1:ss) pkg short ++ t : ts + modSrcPkg mod_ | showPkgs = fmap sourcePackageIdString + (lookupPackage dflags (modulePackageKey mod_)) + | otherwise = Nothing + fn (mod_,pkg,srcPkg,short) = addToTrees mod_ pkg srcPkg short + + +addToTrees :: [String] -> Maybe String -> Maybe String -> Maybe (MDoc Name) -> [ModuleTree] -> [ModuleTree] +addToTrees [] _ _ _ ts = ts +addToTrees ss pkg srcPkg short [] = mkSubTree ss pkg srcPkg short +addToTrees (s1:ss) pkg srcPkg short (t@(Node s2 leaf node_pkg node_srcPkg node_short subs) : ts) + | s1 > s2 = t : addToTrees (s1:ss) pkg srcPkg short ts + | s1 == s2 = Node s2 (leaf || null ss) this_pkg this_srcPkg this_short (addToTrees ss pkg srcPkg short subs) : ts + | otherwise = mkSubTree (s1:ss) pkg srcPkg short ++ t : ts where this_pkg = if null ss then pkg else node_pkg + this_srcPkg = if null ss then srcPkg else node_srcPkg this_short = if null ss then short else node_short -mkSubTree :: [String] -> Maybe String -> Maybe (MDoc Name) -> [ModuleTree] -mkSubTree [] _ _ = [] -mkSubTree [s] pkg short = [Node s True pkg short []] -mkSubTree (s:ss) pkg short = [Node s (null ss) Nothing Nothing (mkSubTree ss pkg short)] +mkSubTree :: [String] -> Maybe String -> Maybe String -> Maybe (MDoc Name) -> [ModuleTree] +mkSubTree [] _ _ _ = [] +mkSubTree [s] pkg srcPkg short = [Node s True pkg srcPkg short []] +mkSubTree (s:ss) pkg srcPkg short = [Node s (null ss) Nothing Nothing Nothing (mkSubTree ss pkg srcPkg short)] splitModule :: Module -> [String] From git at git.haskell.org Wed Jul 8 08:38:37 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:38:37 +0000 (UTC) Subject: [commit: haddock] master, wip/api-annots-ghc-7.10-3: Change ModuleTree Node to carry PackageKey and SourcePackageId to resolve #385 (bf31846) Message-ID: <20150708083837.00F1A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: master,wip/api-annots-ghc-7.10-3 Link : http://git.haskell.org/haddock.git/commitdiff/bf31846b9f7280b5e75f09e91ca18c4ced37af08 >--------------------------------------------------------------- commit bf31846b9f7280b5e75f09e91ca18c4ced37af08 Author: Murray Campbell Date: Sun Apr 26 13:49:01 2015 -0700 Change ModuleTree Node to carry PackageKey and SourcePackageId to resolve #385 Signed-off-by: Austin Seipp (cherry picked from commit 2380f07c430c525b205ce2eae6dab23c8388d899) >--------------------------------------------------------------- bf31846b9f7280b5e75f09e91ca18c4ced37af08 haddock-api/src/Haddock/Backends/Xhtml.hs | 4 +-- haddock-api/src/Haddock/ModuleTree.hs | 41 +++++++++++++++++-------------- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/haddock-api/src/Haddock/Backends/Xhtml.hs b/haddock-api/src/Haddock/Backends/Xhtml.hs index 948ef64..90cb9fa 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml.hs @@ -288,7 +288,7 @@ mkNodeList qual ss p ts = case ts of mkNode :: Qualification -> [String] -> String -> ModuleTree -> Html -mkNode qual ss p (Node s leaf pkg short ts) = +mkNode qual ss p (Node s leaf pkg srcPkg short ts) = htmlModule <+> shortDescr +++ htmlPkg +++ subtree where modAttrs = case (ts, leaf) of @@ -312,7 +312,7 @@ mkNode qual ss p (Node s leaf pkg short ts) = mdl = intercalate "." (reverse (s:ss)) shortDescr = maybe noHtml (origDocToHtml qual) short - htmlPkg = maybe noHtml (thespan ! [theclass "package"] <<) pkg + htmlPkg = maybe noHtml (thespan ! [theclass "package"] <<) srcPkg subtree = mkNodeList qual (s:ss) p ts ! collapseSection p True "" diff --git a/haddock-api/src/Haddock/ModuleTree.hs b/haddock-api/src/Haddock/ModuleTree.hs index eec1342..2f73121 100644 --- a/haddock-api/src/Haddock/ModuleTree.hs +++ b/haddock-api/src/Haddock/ModuleTree.hs @@ -15,41 +15,44 @@ module Haddock.ModuleTree ( ModuleTree(..), mkModuleTree ) where import Haddock.Types ( MDoc ) import GHC ( Name ) -import Module ( Module, moduleNameString, moduleName, modulePackageKey ) +import Module ( Module, moduleNameString, moduleName, modulePackageKey, packageKeyString ) import DynFlags ( DynFlags ) import Packages ( lookupPackage ) import PackageConfig ( sourcePackageIdString ) -data ModuleTree = Node String Bool (Maybe String) (Maybe (MDoc Name)) [ModuleTree] +data ModuleTree = Node String Bool (Maybe String) (Maybe String) (Maybe (MDoc Name)) [ModuleTree] mkModuleTree :: DynFlags -> Bool -> [(Module, Maybe (MDoc Name))] -> [ModuleTree] mkModuleTree dflags showPkgs mods = - foldr fn [] [ (splitModule mdl, modPkg mdl, short) | (mdl, short) <- mods ] + foldr fn [] [ (splitModule mdl, modPkg mdl, modSrcPkg mdl, short) | (mdl, short) <- mods ] where - modPkg mod_ | showPkgs = fmap sourcePackageIdString - (lookupPackage dflags (modulePackageKey mod_)) + modPkg mod_ | showPkgs = Just (packageKeyString (modulePackageKey mod_)) | otherwise = Nothing - fn (mod_,pkg,short) = addToTrees mod_ pkg short - - -addToTrees :: [String] -> Maybe String -> Maybe (MDoc Name) -> [ModuleTree] -> [ModuleTree] -addToTrees [] _ _ ts = ts -addToTrees ss pkg short [] = mkSubTree ss pkg short -addToTrees (s1:ss) pkg short (t@(Node s2 leaf node_pkg node_short subs) : ts) - | s1 > s2 = t : addToTrees (s1:ss) pkg short ts - | s1 == s2 = Node s2 (leaf || null ss) this_pkg this_short (addToTrees ss pkg short subs) : ts - | otherwise = mkSubTree (s1:ss) pkg short ++ t : ts + modSrcPkg mod_ | showPkgs = fmap sourcePackageIdString + (lookupPackage dflags (modulePackageKey mod_)) + | otherwise = Nothing + fn (mod_,pkg,srcPkg,short) = addToTrees mod_ pkg srcPkg short + + +addToTrees :: [String] -> Maybe String -> Maybe String -> Maybe (MDoc Name) -> [ModuleTree] -> [ModuleTree] +addToTrees [] _ _ _ ts = ts +addToTrees ss pkg srcPkg short [] = mkSubTree ss pkg srcPkg short +addToTrees (s1:ss) pkg srcPkg short (t@(Node s2 leaf node_pkg node_srcPkg node_short subs) : ts) + | s1 > s2 = t : addToTrees (s1:ss) pkg srcPkg short ts + | s1 == s2 = Node s2 (leaf || null ss) this_pkg this_srcPkg this_short (addToTrees ss pkg srcPkg short subs) : ts + | otherwise = mkSubTree (s1:ss) pkg srcPkg short ++ t : ts where this_pkg = if null ss then pkg else node_pkg + this_srcPkg = if null ss then srcPkg else node_srcPkg this_short = if null ss then short else node_short -mkSubTree :: [String] -> Maybe String -> Maybe (MDoc Name) -> [ModuleTree] -mkSubTree [] _ _ = [] -mkSubTree [s] pkg short = [Node s True pkg short []] -mkSubTree (s:ss) pkg short = [Node s (null ss) Nothing Nothing (mkSubTree ss pkg short)] +mkSubTree :: [String] -> Maybe String -> Maybe String -> Maybe (MDoc Name) -> [ModuleTree] +mkSubTree [] _ _ _ = [] +mkSubTree [s] pkg srcPkg short = [Node s True pkg srcPkg short []] +mkSubTree (s:ss) pkg srcPkg short = [Node s (null ss) Nothing Nothing Nothing (mkSubTree ss pkg srcPkg short)] splitModule :: Module -> [String] From git at git.haskell.org Wed Jul 8 08:38:39 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:38:39 +0000 (UTC) Subject: [commit: haddock] master, wip/api-annots-ghc-7.10-3: haddock-library: require GHC >= 7.4 (3fee88b) Message-ID: <20150708083839.0C8F23A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: master,wip/api-annots-ghc-7.10-3 Link : http://git.haskell.org/haddock.git/commitdiff/3fee88b2891683eeb56db3d7b79e890070530c8f >--------------------------------------------------------------- commit 3fee88b2891683eeb56db3d7b79e890070530c8f Author: Adam Bergmark Date: Sun May 10 13:05:51 2015 +0200 haddock-library: require GHC >= 7.4 `Data.Monoid.<>` was added in base-4.5/GHC-7.4 Closes #394 Signed-off-by: Mateusz Kowalczyk >--------------------------------------------------------------- 3fee88b2891683eeb56db3d7b79e890070530c8f haddock-library/haddock-library.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haddock-library/haddock-library.cabal b/haddock-library/haddock-library.cabal index 3d9b755..c2ea73b 100644 --- a/haddock-library/haddock-library.cabal +++ b/haddock-library/haddock-library.cabal @@ -21,7 +21,7 @@ library default-language: Haskell2010 build-depends: - base >= 4.3 && < 4.9 + base >= 4.5 && < 4.9 , bytestring , transformers , deepseq From git at git.haskell.org Wed Jul 8 08:38:41 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:38:41 +0000 (UTC) Subject: [commit: haddock] adamse-D1033, ghc-head, wip/10313, wip/T10483, wip/orf-reboot: Track the new location of setRdrNameSpace (5a57a24) Message-ID: <20150708083841.16E4A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: adamse-D1033,ghc-head,wip/10313,wip/T10483,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/5a57a24c44e06e964c4ea2276c842c722c4e93d9 >--------------------------------------------------------------- commit 5a57a24c44e06e964c4ea2276c842c722c4e93d9 Author: Simon Peyton Jones Date: Wed May 13 12:04:21 2015 +0100 Track the new location of setRdrNameSpace >--------------------------------------------------------------- 5a57a24c44e06e964c4ea2276c842c722c4e93d9 haddock-api/src/Haddock/Interface/LexParseRn.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/haddock-api/src/Haddock/Interface/LexParseRn.hs b/haddock-api/src/Haddock/Interface/LexParseRn.hs index 35abf8a..ac823da 100644 --- a/haddock-api/src/Haddock/Interface/LexParseRn.hs +++ b/haddock-api/src/Haddock/Interface/LexParseRn.hs @@ -29,7 +29,8 @@ import Haddock.Interface.ParseModuleHeader import Haddock.Parser import Haddock.Types import Name -import Outputable (showPpr) +import RdrHsSyn ( setRdrNameSpace ) +import Outputable ( showPpr ) import RdrName processDocStrings :: DynFlags -> GlobalRdrEnv -> [HsDocString] From git at git.haskell.org Wed Jul 8 08:38:43 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:38:43 +0000 (UTC) Subject: [commit: haddock] adamse-D1033, ghc-head, wip/10313, wip/T10483, wip/orf-reboot: ApiAnnotations : strings in warnings do not return SourceText (45df734) Message-ID: <20150708083843.22A523A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: adamse-D1033,ghc-head,wip/10313,wip/T10483,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/45df734c8e0242ca2e88fba5359207e49d7bf158 >--------------------------------------------------------------- commit 45df734c8e0242ca2e88fba5359207e49d7bf158 Author: Alan Zimmerman Date: Mon May 25 17:14:01 2015 +0200 ApiAnnotations : strings in warnings do not return SourceText The strings used in a WARNING pragma are captured via strings :: { Located ([AddAnn],[Located FastString]) } : STRING { sL1 $1 ([],[L (gl $1) (getSTRING $1)]) } .. The STRING token has a method getSTRINGs that returns the original source text for a string. A warning of the form {-# WARNING Logic , mkSolver , mkSimpleSolver , mkSolverForLogic , solverSetParams , solverPush , solverPop , solverReset , solverGetNumScopes , solverAssertCnstr , solverAssertAndTrack , solverCheck , solverCheckAndGetModel , solverGetReasonUnknown "New Z3 API support is still incomplete and fragile: \ \you may experience segmentation faults!" #-} returns the concatenated warning string rather than the original source. >--------------------------------------------------------------- 45df734c8e0242ca2e88fba5359207e49d7bf158 haddock-api/src/Haddock/Interface/Create.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/haddock-api/src/Haddock/Interface/Create.hs b/haddock-api/src/Haddock/Interface/Create.hs index 9ef3d1b..5adaef6 100644 --- a/haddock-api/src/Haddock/Interface/Create.hs +++ b/haddock-api/src/Haddock/Interface/Create.hs @@ -158,7 +158,7 @@ mkAliasMap dflags mRenamedSource = return $ (lookupModuleDyn dflags (fmap Module.fsToPackageKey $ - ideclPkgQual impDecl) + fmap snd $ ideclPkgQual impDecl) (case ideclName impDecl of SrcLoc.L _ name -> name), alias)) impDecls @@ -194,8 +194,8 @@ moduleWarning dflags gre (WarnAll w) = Just $ parseWarning dflags gre w parseWarning :: DynFlags -> GlobalRdrEnv -> WarningTxt -> Doc Name parseWarning dflags gre w = force $ case w of - DeprecatedTxt _ msg -> format "Deprecated: " (concatFS $ map unLoc msg) - WarningTxt _ msg -> format "Warning: " (concatFS $ map unLoc msg) + DeprecatedTxt _ msg -> format "Deprecated: " (concatFS $ map (snd . unLoc) msg) + WarningTxt _ msg -> format "Warning: " (concatFS $ map (snd . unLoc) msg) where format x xs = DocWarning . DocParagraph . DocAppend (DocString x) . processDocString dflags gre $ HsDocString xs From git at git.haskell.org Wed Jul 8 08:38:45 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:38:45 +0000 (UTC) Subject: [commit: haddock] master: Create simple method for indentation parsing. (39a7a1b) Message-ID: <20150708083845.2EB6D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/39a7a1b9e344bfa3258a6414e75f19c1eabc30de >--------------------------------------------------------------- commit 39a7a1b9e344bfa3258a6414e75f19c1eabc30de Author: ?ukasz Hanuszczak Date: Wed May 27 11:51:31 2015 +0200 Create simple method for indentation parsing. >--------------------------------------------------------------- 39a7a1b9e344bfa3258a6414e75f19c1eabc30de haddock-library/src/Documentation/Haddock/Parser.hs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/haddock-library/src/Documentation/Haddock/Parser.hs b/haddock-library/src/Documentation/Haddock/Parser.hs index 5c607a1..6bb8803 100644 --- a/haddock-library/src/Documentation/Haddock/Parser.hs +++ b/haddock-library/src/Documentation/Haddock/Parser.hs @@ -382,6 +382,15 @@ takeNonEmptyLine :: Parser String takeNonEmptyLine = do (++ "\n") . decodeUtf8 <$> (takeWhile1 (/= '\n') >>= nonSpace) <* "\n" +-- | Takes indentation of first non-empty line. +-- +-- More precisely: skips all whitespace-only lines and returns indentation +-- (horizontal space, might be empty) of that non-empty line. +takeIndent :: Parser BS.ByteString +takeIndent = do + indent <- takeHorizontalSpace + "\n" *> takeIndent <|> return indent + -- | Blocks of text of the form: -- -- >> foo From git at git.haskell.org Wed Jul 8 08:38:47 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:38:47 +0000 (UTC) Subject: [commit: haddock] master: Make nested lists count indentation according to first item. (7649798) Message-ID: <20150708083847.3A3893A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/76497980a6746be8bbcfa45341c261ffb68ecd81 >--------------------------------------------------------------- commit 76497980a6746be8bbcfa45341c261ffb68ecd81 Author: ?ukasz Hanuszczak Date: Wed May 27 21:36:13 2015 +0200 Make nested lists count indentation according to first item. >--------------------------------------------------------------- 76497980a6746be8bbcfa45341c261ffb68ecd81 .../src/Documentation/Haddock/Parser.hs | 81 ++++++++++++---------- 1 file changed, 46 insertions(+), 35 deletions(-) diff --git a/haddock-library/src/Documentation/Haddock/Parser.hs b/haddock-library/src/Documentation/Haddock/Parser.hs index 6bb8803..ca9e9d8 100644 --- a/haddock-library/src/Documentation/Haddock/Parser.hs +++ b/haddock-library/src/Documentation/Haddock/Parser.hs @@ -231,18 +231,20 @@ markdownImage = fromHyperlink <$> ("!" *> linkParser) -- | Paragraph parser, called by 'parseParas'. paragraph :: Parser (DocH mod Identifier) -paragraph = examples <|> skipSpace *> ( - since - <|> unorderedList - <|> orderedList - <|> birdtracks - <|> codeblock - <|> property - <|> header - <|> textParagraphThatStartsWithMarkdownLink - <|> definitionList - <|> docParagraph <$> textParagraph - ) +paragraph = examples <|> do + indent <- takeIndent + choice + [ since + , unorderedList indent + , orderedList indent + , birdtracks + , codeblock + , property + , header + , textParagraphThatStartsWithMarkdownLink + , definitionList indent + , docParagraph <$> textParagraph + ] since :: Parser (DocH mod a) since = ("@since " *> version <* skipHorizontalSpace <* endOfLine) >>= setSince >> return DocEmpty @@ -283,16 +285,16 @@ textParagraphThatStartsWithMarkdownLink = docParagraph <$> (docAppend <$> markdo | otherwise = " " -- | Parses unordered (bullet) lists. -unorderedList :: Parser (DocH mod Identifier) -unorderedList = DocUnorderedList <$> p +unorderedList :: BS.ByteString -> Parser (DocH mod Identifier) +unorderedList indent = DocUnorderedList <$> p where - p = ("*" <|> "-") *> innerList p + p = ("*" <|> "-") *> innerList indent p -- | Parses ordered lists (numbered or dashed). -orderedList :: Parser (DocH mod Identifier) -orderedList = DocOrderedList <$> p +orderedList :: BS.ByteString -> Parser (DocH mod Identifier) +orderedList indent = DocOrderedList <$> p where - p = (paren <|> dot) *> innerList p + p = (paren <|> dot) *> innerList indent p dot = (decimal :: Parser Int) <* "." paren = "(" *> decimal <* ")" @@ -301,23 +303,24 @@ orderedList = DocOrderedList <$> p -- same paragraph. Usually used as -- -- > someListFunction = listBeginning *> innerList someListFunction -innerList :: Parser [DocH mod Identifier] -> Parser [DocH mod Identifier] -innerList item = do +innerList :: BS.ByteString -> Parser [DocH mod Identifier] + -> Parser [DocH mod Identifier] +innerList indent item = do c <- takeLine - (cs, items) <- more item + (cs, items) <- more indent item let contents = docParagraph . parseString . dropNLs . unlines $ c : cs return $ case items of Left p -> [contents `docAppend` p] Right i -> contents : i -- | Parses definition lists. -definitionList :: Parser (DocH mod Identifier) -definitionList = DocDefList <$> p +definitionList :: BS.ByteString -> Parser (DocH mod Identifier) +definitionList indent = DocDefList <$> p where p = do label <- "[" *> (parseStringBS <$> takeWhile1 (`notElem` ("]\n" :: String))) <* ("]" <* optional ":") c <- takeLine - (cs, items) <- more p + (cs, items) <- more indent p let contents = parseString . dropNLs . unlines $ c : cs return $ case items of Left x -> [(label, contents `docAppend` x)] @@ -330,32 +333,40 @@ dropNLs = reverse . dropWhile (== '\n') . reverse -- | Main worker for 'innerList' and 'definitionList'. -- We need the 'Either' here to be able to tell in the respective functions -- whether we're dealing with the next list or a nested paragraph. -more :: Monoid a => Parser a +more :: Monoid a => BS.ByteString -> Parser a -> Parser ([String], Either (DocH mod Identifier) a) -more item = innerParagraphs <|> moreListItems item - <|> moreContent item <|> pure ([], Right mempty) +more indent item = innerParagraphs indent + <|> moreListItems indent item + <|> moreContent indent item + <|> pure ([], Right mempty) -- | Used by 'innerList' and 'definitionList' to parse any nested paragraphs. -innerParagraphs :: Parser ([String], Either (DocH mod Identifier) a) -innerParagraphs = (,) [] . Left <$> ("\n" *> indentedParagraphs) +innerParagraphs :: BS.ByteString + -> Parser ([String], Either (DocH mod Identifier) a) +innerParagraphs indent = (,) [] . Left <$> ("\n" *> indentedParagraphs indent) -- | Attempts to fetch the next list if possibly. Used by 'innerList' and -- 'definitionList' to recursively grab lists that aren't separated by a whole -- paragraph. -moreListItems :: Parser a +moreListItems :: BS.ByteString -> Parser a -> Parser ([String], Either (DocH mod Identifier) a) -moreListItems item = (,) [] . Right <$> (skipSpace *> item) +moreListItems indent item = (,) [] . Right <$> indentedItem + where + indentedItem = string indent *> skipSpace *> item -- | Helper for 'innerList' and 'definitionList' which simply takes -- a line of text and attempts to parse more list content with 'more'. -moreContent :: Monoid a => Parser a +moreContent :: Monoid a => BS.ByteString -> Parser a -> Parser ([String], Either (DocH mod Identifier) a) -moreContent item = first . (:) <$> nonEmptyLine <*> more item +moreContent indent item = first . (:) <$> nonEmptyLine <*> more indent item -- | Parses an indented paragraph. -- The indentation is 4 spaces. -indentedParagraphs :: Parser (DocH mod Identifier) -indentedParagraphs = (concat <$> dropFrontOfPara " ") >>= parseParagraphs +indentedParagraphs :: BS.ByteString -> Parser (DocH mod Identifier) +indentedParagraphs indent = + (concat <$> dropFrontOfPara indent') >>= parseParagraphs + where + indent' = string $ BS.append indent " " -- | Grab as many fully indented paragraphs as we can. dropFrontOfPara :: Parser BS.ByteString -> Parser [String] From git at git.haskell.org Wed Jul 8 08:38:49 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:38:49 +0000 (UTC) Subject: [commit: haddock] master: Add simple test case for arbitrary-depth list nesting. (c4a73b5) Message-ID: <20150708083849.449F93A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/c4a73b5b0fb7574bd519584c16b5be0675f3f430 >--------------------------------------------------------------- commit c4a73b5b0fb7574bd519584c16b5be0675f3f430 Author: ?ukasz Hanuszczak Date: Wed May 27 22:46:13 2015 +0200 Add simple test case for arbitrary-depth list nesting. >--------------------------------------------------------------- c4a73b5b0fb7574bd519584c16b5be0675f3f430 html-test/ref/Nesting.html | 49 ++++++++++++++++++++++++++++++++++++---------- html-test/src/Nesting.hs | 15 ++++++++++++++ 2 files changed, 54 insertions(+), 10 deletions(-) diff --git a/html-test/ref/Nesting.html b/html-test/ref/Nesting.html index 37ee7af..542d6db 100644 --- a/html-test/ref/Nesting.html +++ b/html-test/ref/Nesting.html @@ -73,6 +73,10 @@ window.onload = function () {pageLoad();setSynopsis("mini_Nesting.html");}; >j :: t
  • k :: t
  • No newline separation even in indented lists. We can have any paragraph level element that we normally - can, like headers

    Level 3 header

    with some content…

    • and even more lists inside

    Level 3 header

    with some content…

    • and even more lists inside

    k :: t

    • list may start at arbitrary depth
    • and consecutive items at that depth + belong to the same list
    • of course we can still

      • nest items like we are used to
    • and then get back to initial list
    Repository : ssh://git at git.haskell.org/haddock On branch : wip/api-annots-ghc-7.10-3 Link : http://git.haskell.org/haddock.git/commitdiff/81affaaf19ea33ad07bc7d5c15a949644a10c76a >--------------------------------------------------------------- commit 81affaaf19ea33ad07bc7d5c15a949644a10c76a Author: Alan Zimmerman Date: Mon May 25 17:14:01 2015 +0200 ApiAnnotations : strings in warnings do not return SourceText The strings used in a WARNING pragma are captured via strings :: { Located ([AddAnn],[Located FastString]) } : STRING { sL1 $1 ([],[L (gl $1) (getSTRING $1)]) } .. The STRING token has a method getSTRINGs that returns the original source text for a string. A warning of the form {-# WARNING Logic , mkSolver , mkSimpleSolver , mkSolverForLogic , solverSetParams , solverPush , solverPop , solverReset , solverGetNumScopes , solverAssertCnstr , solverAssertAndTrack , solverCheck , solverCheckAndGetModel , solverGetReasonUnknown "New Z3 API support is still incomplete and fragile: \ \you may experience segmentation faults!" #-} returns the concatenated warning string rather than the original source. (cherry picked from commit 45df734c8e0242ca2e88fba5359207e49d7bf158) >--------------------------------------------------------------- 81affaaf19ea33ad07bc7d5c15a949644a10c76a haddock-api/src/Haddock/Interface/Create.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/haddock-api/src/Haddock/Interface/Create.hs b/haddock-api/src/Haddock/Interface/Create.hs index 9ef3d1b..5adaef6 100644 --- a/haddock-api/src/Haddock/Interface/Create.hs +++ b/haddock-api/src/Haddock/Interface/Create.hs @@ -158,7 +158,7 @@ mkAliasMap dflags mRenamedSource = return $ (lookupModuleDyn dflags (fmap Module.fsToPackageKey $ - ideclPkgQual impDecl) + fmap snd $ ideclPkgQual impDecl) (case ideclName impDecl of SrcLoc.L _ name -> name), alias)) impDecls @@ -194,8 +194,8 @@ moduleWarning dflags gre (WarnAll w) = Just $ parseWarning dflags gre w parseWarning :: DynFlags -> GlobalRdrEnv -> WarningTxt -> Doc Name parseWarning dflags gre w = force $ case w of - DeprecatedTxt _ msg -> format "Deprecated: " (concatFS $ map unLoc msg) - WarningTxt _ msg -> format "Warning: " (concatFS $ map unLoc msg) + DeprecatedTxt _ msg -> format "Deprecated: " (concatFS $ map (snd . unLoc) msg) + WarningTxt _ msg -> format "Warning: " (concatFS $ map (snd . unLoc) msg) where format x xs = DocWarning . DocParagraph . DocAppend (DocString x) . processDocString dflags gre $ HsDocString xs From git at git.haskell.org Wed Jul 8 08:38:53 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:38:53 +0000 (UTC) Subject: [commit: haddock] master: Add arbitrary-indent spec test for parser. (3536512) Message-ID: <20150708083853.5E59A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/3536512c4658a51b72a9b879f372fa08ed402d9c >--------------------------------------------------------------- commit 3536512c4658a51b72a9b879f372fa08ed402d9c Author: ?ukasz Hanuszczak Date: Wed Jun 3 02:11:31 2015 +0200 Add arbitrary-indent spec test for parser. >--------------------------------------------------------------- 3536512c4658a51b72a9b879f372fa08ed402d9c .../test/Documentation/Haddock/ParserSpec.hs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/haddock-library/test/Documentation/Haddock/ParserSpec.hs b/haddock-library/test/Documentation/Haddock/ParserSpec.hs index 9161160..2ef414f 100644 --- a/haddock-library/test/Documentation/Haddock/ParserSpec.hs +++ b/haddock-library/test/Documentation/Haddock/ParserSpec.hs @@ -696,6 +696,23 @@ spec = do ] <> DocOrderedList [ DocParagraph "baz" ] + it "allows arbitrary initial indent of a list" $ do + unlines + [ " * foo" + , " * bar" + , "" + , " * quux" + , "" + , " * baz" + ] + `shouldParseTo` + DocUnorderedList + [ DocParagraph "foo" + , DocParagraph "bar" + <> DocUnorderedList [ DocParagraph "quux" ] + , DocParagraph "baz" + ] + it "definition lists can come back to top level with a different list" $ do "[foo]: foov\n\n [bar]: barv\n\n1. baz" `shouldParseTo` DocDefList [ ("foo", "foov" From git at git.haskell.org Wed Jul 8 08:38:55 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:38:55 +0000 (UTC) Subject: [commit: haddock] master: Update docs with info on new list nesting rule (194f382) Message-ID: <20150708083855.6A3A03A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/194f382f84a401a82464438820f074aa7851b725 >--------------------------------------------------------------- commit 194f382f84a401a82464438820f074aa7851b725 Author: Mateusz Kowalczyk Date: Wed Jun 3 05:25:29 2015 +0100 Update docs with info on new list nesting rule Fixes #278 through commits from PR #401 >--------------------------------------------------------------- 194f382f84a401a82464438820f074aa7851b725 doc/haddock.xml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/doc/haddock.xml b/doc/haddock.xml index 2ffd7d7..f6cd4d4 100644 --- a/doc/haddock.xml +++ b/doc/haddock.xml @@ -2029,7 +2029,18 @@ This belongs to the list above! 2. No newline separation even in indented lists. -} + The indentation of the first list item is honoured. That is, + in the following example the items are on the same level. Before + Haddock 2.16.1, the second item would have been nested under the + first item which was unexpected. + + +{-| + * foo + * bar +-} +
    From git at git.haskell.org Wed Jul 8 08:38:57 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:38:57 +0000 (UTC) Subject: [commit: haddock] master: Update some meta data at the top of the docs (d50967d) Message-ID: <20150708083857.759F83A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/d50967d6a20ec43b048b69122590b410ea872dc4 >--------------------------------------------------------------- commit d50967d6a20ec43b048b69122590b410ea872dc4 Author: Mateusz Kowalczyk Date: Wed Jun 3 05:29:26 2015 +0100 Update some meta data at the top of the docs >--------------------------------------------------------------- d50967d6a20ec43b048b69122590b410ea872dc4 doc/haddock.xml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/doc/haddock.xml b/doc/haddock.xml index f6cd4d4..b528fdb 100644 --- a/doc/haddock.xml +++ b/doc/haddock.xml @@ -12,7 +12,7 @@ - 2004-08-02 + 2015-06-02 Haddock User Guide Simon @@ -24,12 +24,21 @@ Waern
    david.waern at gmail.com
    + + Mateusz + Kowalczyk + +
    fuuzetsu at fuuzetsu.co.uk
    2010 Simon Marlow, David Waern + + 2013-2015 + Mateusz Kowalczyk + - This document describes Haddock version 2.15.1, a Haskell + This document describes Haddock version 2.16.1, a Haskell documentation tool.
    From git at git.haskell.org Wed Jul 8 08:38:59 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:38:59 +0000 (UTC) Subject: [commit: haddock] wip/T10483: Track change to HsForAllTy (cb2efca) Message-ID: <20150708083859.84C0D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/T10483 Link : http://git.haskell.org/haddock.git/commitdiff/cb2efca2ec78c8245e70d15b1d9df14a82b70feb >--------------------------------------------------------------- commit cb2efca2ec78c8245e70d15b1d9df14a82b70feb Author: Simon Peyton Jones Date: Thu Jun 4 11:10:15 2015 +0100 Track change to HsForAllTy For Trac #10483 >--------------------------------------------------------------- cb2efca2ec78c8245e70d15b1d9df14a82b70feb haddock-api/src/Haddock/Backends/Hoogle.hs | 13 +++++++------ haddock-api/src/Haddock/Backends/LaTeX.hs | 15 ++++++++++----- haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | 7 +++++-- haddock-api/src/Haddock/Convert.hs | 3 ++- haddock-api/src/Haddock/Interface/Create.hs | 11 ++++++----- haddock-api/src/Haddock/Interface/Rename.hs | 6 ++++-- 6 files changed, 34 insertions(+), 21 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 cb2efca2ec78c8245e70d15b1d9df14a82b70feb From git at git.haskell.org Wed Jul 8 08:39:01 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:39:01 +0000 (UTC) Subject: [commit: haddock] master: Add some Hacking docs for getting started (fb5d858) Message-ID: <20150708083901.91D293A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/fb5d8584779da51521e8bf745e8627b5ddf3724d >--------------------------------------------------------------- commit fb5d8584779da51521e8bf745e8627b5ddf3724d Author: Bartosz Nitka Date: Sun Jun 7 08:40:59 2015 -0700 Add some Hacking docs for getting started >--------------------------------------------------------------- fb5d8584779da51521e8bf745e8627b5ddf3724d README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index b85d99b..fba02bd 100644 --- a/README.md +++ b/README.md @@ -45,3 +45,22 @@ format. #### Contributing Please create issues when you have any problems and pull requests if you have some code. + +###### Hacking + +To get started you'll need a latest GHC release installed. + + git clone https://github.com/haskell/haddock.git + cd haddock + cabal sandbox init + cabal sandbox add-source haddock-library + cabal sandbox add-source haddock-api + # adjust -j to the number of cores you want to use + cabal install -j4 --dependencies-only --enable-tests + cabal configure --enable-tests + cabal build -j4 + # run the test suite + cabal test + +If you want to build against `GHC HEAD`, `ghc-head` is the corresponding branch. +Note that it doesn't have to be up to date. From git at git.haskell.org Wed Jul 8 08:39:03 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:39:03 +0000 (UTC) Subject: [commit: haddock] master: Fix markdown (2d1b63e) Message-ID: <20150708083903.9F8743A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/2d1b63e9f01b0a926ef4f8ca8de800bc8a4f27cc >--------------------------------------------------------------- commit 2d1b63e9f01b0a926ef4f8ca8de800bc8a4f27cc Author: Bartosz Nitka Date: Sun Jun 7 08:44:30 2015 -0700 Fix markdown >--------------------------------------------------------------- 2d1b63e9f01b0a926ef4f8ca8de800bc8a4f27cc README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index fba02bd..f6dd00d 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ Please create issues when you have any problems and pull requests if you have so To get started you'll need a latest GHC release installed. +```bash git clone https://github.com/haskell/haddock.git cd haddock cabal sandbox init @@ -61,6 +62,7 @@ To get started you'll need a latest GHC release installed. cabal build -j4 # run the test suite cabal test +``` If you want to build against `GHC HEAD`, `ghc-head` is the corresponding branch. Note that it doesn't have to be up to date. From git at git.haskell.org Wed Jul 8 08:39:05 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:39:05 +0000 (UTC) Subject: [commit: haddock] master: Refine hacking instructions slightly (a65953d) Message-ID: <20150708083905.ADB923A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/a65953de929fd9488250f8e0257c918465193e43 >--------------------------------------------------------------- commit a65953de929fd9488250f8e0257c918465193e43 Author: Mateusz Kowalczyk Date: Mon Jun 8 15:08:36 2015 +0100 Refine hacking instructions slightly >--------------------------------------------------------------- a65953de929fd9488250f8e0257c918465193e43 README.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f6dd00d..31015e9 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,8 @@ Please create issues when you have any problems and pull requests if you have so ###### Hacking -To get started you'll need a latest GHC release installed. +To get started you'll need a latest GHC release installed. Below is an +example setup using cabal sandboxes. ```bash git clone https://github.com/haskell/haddock.git @@ -64,5 +65,8 @@ To get started you'll need a latest GHC release installed. cabal test ``` -If you want to build against `GHC HEAD`, `ghc-head` is the corresponding branch. -Note that it doesn't have to be up to date. +If you're a GHC developer and want to update Haddock to work with your +changes, you should be working on `ghc-head` branch instead of master. +See instructions at +https://ghc.haskell.org/trac/ghc/wiki/WorkingConventions/Git/Submodules +for an example workflow. From git at git.haskell.org Wed Jul 8 08:39:07 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:39:07 +0000 (UTC) Subject: [commit: haddock] adamse-D1033, ghc-head, wip/orf-reboot: Update after wild card renaming refactoring in D613 (553c719) Message-ID: <20150708083907.BF3C63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branches: adamse-D1033,ghc-head,wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/553c719236972f3a1d445146352ec94614979b63 >--------------------------------------------------------------- commit 553c719236972f3a1d445146352ec94614979b63 Author: Thomas Winant Date: Mon Jun 8 23:47:28 2015 -0500 Update after wild card renaming refactoring in D613 Summary: * Move `Post*` type instances to `Haddock.Types` as other modules than `Haddock.Interface.Rename` will rely on these type instances. * Update after wild card renaming refactoring in D613. Reviewers: simonpj, austin Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D954 GHC Trac Issues: #10098 >--------------------------------------------------------------- 553c719236972f3a1d445146352ec94614979b63 haddock-api/src/Haddock/Backends/LaTeX.hs | 12 +++++++----- haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | 12 +++++++----- haddock-api/src/Haddock/Interface/Rename.hs | 19 +++++-------------- haddock-api/src/Haddock/Types.hs | 19 ++++++++++++++++++- 4 files changed, 37 insertions(+), 25 deletions(-) diff --git a/haddock-api/src/Haddock/Backends/LaTeX.hs b/haddock-api/src/Haddock/Backends/LaTeX.hs index c9262c7..e1090a0 100644 --- a/haddock-api/src/Haddock/Backends/LaTeX.hs +++ b/haddock-api/src/Haddock/Backends/LaTeX.hs @@ -898,9 +898,11 @@ ppr_mono_ty :: Int -> HsType DocName -> Bool -> LaTeX ppr_mono_ty ctxt_prec (HsForAllTy expl extra tvs ctxt ty) unicode = maybeParen ctxt_prec pREC_FUN $ hsep [ppForAll expl tvs ctxt' unicode, ppr_mono_lty pREC_TOP ty unicode] - where ctxt' = case extra of - Just loc -> (++ [L loc HsWildcardTy]) `fmap` ctxt - Nothing -> ctxt + where + anonWC = HsWildCardTy (AnonWildCard PlaceHolder) + ctxt' + | Just loc <- extra = (++ [L loc anonWC]) `fmap` ctxt + | otherwise = ctxt ppr_mono_ty _ (HsBangTy b ty) u = ppBang b <> ppLParendType u ty ppr_mono_ty _ (HsTyVar name) _ = ppDocName name @@ -939,9 +941,9 @@ ppr_mono_ty ctxt_prec (HsParTy ty) unicode ppr_mono_ty ctxt_prec (HsDocTy ty _) unicode = ppr_mono_lty ctxt_prec ty unicode -ppr_mono_ty _ HsWildcardTy _ = char '_' +ppr_mono_ty _ (HsWildCardTy (AnonWildCard _)) _ = char '_' -ppr_mono_ty _ (HsNamedWildcardTy name) _ = ppDocName name +ppr_mono_ty _ (HsWildCardTy (NamedWildCard name)) _ = ppDocName name ppr_mono_ty _ (HsTyLit t) u = ppr_tylit t u diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs index 88aa966..c0be973 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs @@ -852,9 +852,11 @@ ppr_mono_ty :: Int -> HsType DocName -> Unicode -> Qualification -> Html ppr_mono_ty ctxt_prec (HsForAllTy expl extra tvs ctxt ty) unicode qual = maybeParen ctxt_prec pREC_FUN $ ppForAllCon expl tvs ctxt' unicode qual <+> ppr_mono_lty pREC_TOP ty unicode qual - where ctxt' = case extra of - Just loc -> (++ [L loc HsWildcardTy]) `fmap` ctxt - Nothing -> ctxt + where + anonWC = HsWildCardTy (AnonWildCard PlaceHolder) + ctxt' + | Just loc <- extra = (++ [L loc anonWC]) `fmap` ctxt + | otherwise = ctxt -- UnicodeSyntax alternatives ppr_mono_ty _ (HsTyVar name) True _ @@ -899,9 +901,9 @@ ppr_mono_ty ctxt_prec (HsParTy ty) unicode qual ppr_mono_ty ctxt_prec (HsDocTy ty _) unicode qual = ppr_mono_lty ctxt_prec ty unicode qual -ppr_mono_ty _ HsWildcardTy _ _ = char '_' +ppr_mono_ty _ (HsWildCardTy (AnonWildCard _)) _ _ = char '_' -ppr_mono_ty _ (HsNamedWildcardTy name) _ q = ppDocName q Prefix True name +ppr_mono_ty _ (HsWildCardTy (NamedWildCard name)) _ q = ppDocName q Prefix True name ppr_mono_ty _ (HsTyLit n) _ _ = ppr_tylit n diff --git a/haddock-api/src/Haddock/Interface/Rename.hs b/haddock-api/src/Haddock/Interface/Rename.hs index 56e5b07..2b50ce9 100644 --- a/haddock-api/src/Haddock/Interface/Rename.hs +++ b/haddock-api/src/Haddock/Interface/Rename.hs @@ -1,4 +1,3 @@ -{-# LANGUAGE TypeFamilies #-} ---------------------------------------------------------------------------- -- | -- Module : Haddock.Interface.Rename @@ -21,8 +20,6 @@ import Haddock.Types import Bag (emptyBag) import GHC hiding (NoLink) import Name -import NameSet -import Coercion import Control.Applicative import Control.Monad hiding (mapM) @@ -234,8 +231,7 @@ renameType t = case t of HsExplicitListTy a b -> HsExplicitListTy a <$> mapM renameLType b HsExplicitTupleTy a b -> HsExplicitTupleTy a <$> mapM renameLType b HsSpliceTy _ _ -> error "renameType: HsSpliceTy" - HsWildcardTy -> pure HsWildcardTy - HsNamedWildcardTy a -> HsNamedWildcardTy <$> rename a + HsWildCardTy a -> HsWildCardTy <$> renameWildCardInfo a renameLTyVarBndrs :: LHsTyVarBndrs Name -> RnM (LHsTyVarBndrs DocName) renameLTyVarBndrs (HsQTvs { hsq_kvs = _, hsq_tvs = tvs }) @@ -257,6 +253,10 @@ renameLContext (L loc context) = do context' <- mapM renameLType context return (L loc context') +renameWildCardInfo :: HsWildCardInfo Name -> RnM (HsWildCardInfo DocName) +renameWildCardInfo (AnonWildCard _) = pure (AnonWildCard PlaceHolder) +renameWildCardInfo (NamedWildCard name) = NamedWildCard <$> rename name + renameInstHead :: InstHead Name -> RnM (InstHead DocName) renameInstHead (className, k, types, rest) = do className' <- rename className @@ -517,12 +517,3 @@ renameSub (n,doc) = do n' <- rename n doc' <- renameDocForDecl doc return (n', doc') - -type instance PostRn DocName NameSet = PlaceHolder -type instance PostRn DocName Fixity = PlaceHolder -type instance PostRn DocName Bool = PlaceHolder -type instance PostRn DocName [Name] = PlaceHolder - -type instance PostTc DocName Kind = PlaceHolder -type instance PostTc DocName Type = PlaceHolder -type instance PostTc DocName Coercion = PlaceHolder diff --git a/haddock-api/src/Haddock/Types.hs b/haddock-api/src/Haddock/Types.hs index e93294a..847320a 100644 --- a/haddock-api/src/Haddock/Types.hs +++ b/haddock-api/src/Haddock/Types.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE DeriveDataTypeable, DeriveFunctor, DeriveFoldable, DeriveTraversable, StandaloneDeriving #-} +{-# LANGUAGE DeriveDataTypeable, DeriveFunctor, DeriveFoldable, DeriveTraversable, StandaloneDeriving, TypeFamilies #-} {-# OPTIONS_GHC -fno-warn-orphans #-} ----------------------------------------------------------------------------- -- | @@ -34,6 +34,8 @@ import GHC hiding (NoLink) import DynFlags (ExtensionFlag, Language) import OccName import Outputable +import NameSet (NameSet) +import Coercion (Coercion) import Control.Applicative (Applicative(..)) import Control.Monad (ap) @@ -551,3 +553,18 @@ instance Monad ErrMsgGhc where return a = WriterGhc (return (a, [])) m >>= k = WriterGhc $ runWriterGhc m >>= \ (a, msgs1) -> fmap (second (msgs1 ++)) (runWriterGhc (k a)) + + +----------------------------------------------------------------------------- +-- * Pass sensitive types +----------------------------------------------------------------------------- + +type instance PostRn DocName NameSet = PlaceHolder +type instance PostRn DocName Fixity = PlaceHolder +type instance PostRn DocName Bool = PlaceHolder +type instance PostRn DocName Name = PlaceHolder +type instance PostRn DocName [Name] = PlaceHolder + +type instance PostTc DocName Kind = PlaceHolder +type instance PostTc DocName Type = PlaceHolder +type instance PostTc DocName Coercion = PlaceHolder From git at git.haskell.org Wed Jul 8 08:39:09 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:39:09 +0000 (UTC) Subject: [commit: haddock] master: Build executable with '-threaded' (fixes #399) (2b467a7) Message-ID: <20150708083909.D678C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/2b467a747df246090d1fd0270ea9bd4192ebe3df >--------------------------------------------------------------- commit 2b467a747df246090d1fd0270ea9bd4192ebe3df Author: Emanuel Borsboom Date: Sat May 23 04:56:18 2015 -0700 Build executable with '-threaded' (fixes #399) >--------------------------------------------------------------- 2b467a747df246090d1fd0270ea9bd4192ebe3df haddock.cabal | 2 +- html-test/ref/{Bug253.html => Threaded.html} | 47 +++++++++++++--------------- html-test/src/Threaded.hs | 10 ++++++ html-test/src/Threaded_TH.hs | 13 ++++++++ 4 files changed, 45 insertions(+), 27 deletions(-) diff --git a/haddock.cabal b/haddock.cabal index 03bb28a..ed570f5 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -42,7 +42,7 @@ executable haddock default-language: Haskell2010 main-is: Main.hs hs-source-dirs: driver - ghc-options: -funbox-strict-fields -Wall -fwarn-tabs -O2 + ghc-options: -funbox-strict-fields -Wall -fwarn-tabs -O2 -threaded build-depends: base >= 4.3 && < 4.9 diff --git a/html-test/ref/Bug253.html b/html-test/ref/Threaded.html similarity index 68% copy from html-test/ref/Bug253.html copy to html-test/ref/Threaded.html index 0802d91..95a1893 100644 --- a/html-test/ref/Bug253.html +++ b/html-test/ref/Threaded.html @@ -3,13 +3,13 @@ >Bug253ThreadedSafe HaskellSafeNone

    Bug253

    Threaded

    Description

    This module tests that if we're trying to link to a qualified - identifier that's not in scope, we get an anchor as if it was a - variable. Previous behaviour was to treat it as a type constructor - so issue like #253 arose. Also see rename function comments in - source.

    Ensures haddock built with -threaded.

    Synopsis

    Documentation

    foo :: ()

    f :: Integer

    This link should generate #v anchor: fakeFakeFake

    $(forkTH) fails at compile time if haddock isn't using the + threaded RTS.

    Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/3d9e8134829c62448d1988813f9565d09be69f30 >--------------------------------------------------------------- commit 3d9e8134829c62448d1988813f9565d09be69f30 Author: Mateusz Kowalczyk Date: Fri Jun 12 02:59:19 2015 +0100 Update changelog for -threaded Closes #400 >--------------------------------------------------------------- 3d9e8134829c62448d1988813f9565d09be69f30 CHANGES | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES b/CHANGES index e170bc4..ef3c2f9 100644 --- a/CHANGES +++ b/CHANGES @@ -13,6 +13,8 @@ Changes in version 2.16.1 * Expand response files in arguments (#285) + * Build the main executable with -threaded (#399) + Changes in version 2.16.0 * Experimental collapsible header support (#335) From git at git.haskell.org Wed Jul 8 08:39:13 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:39:13 +0000 (UTC) Subject: [commit: haddock] master: Fix haddock: internal error: spliceURL UnhelpfulSpan (#207) (a7c6a56) Message-ID: <20150708083913.F02543A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/a7c6a56b1ec1481250b962ecf603a10b0720b1c7 >--------------------------------------------------------------- commit a7c6a56b1ec1481250b962ecf603a10b0720b1c7 Author: Bartosz Nitka Date: Sat Jun 6 08:12:18 2015 -0700 Fix haddock: internal error: spliceURL UnhelpfulSpan (#207) Inferred type signatures don't have SrcSpans, so let's use the one from the declaration. I've tested this manually on the test-case from #207, but I got stuck at trying to run the test-suite. >--------------------------------------------------------------- a7c6a56b1ec1481250b962ecf603a10b0720b1c7 haddock-api/src/Haddock/Interface/Create.hs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/haddock-api/src/Haddock/Interface/Create.hs b/haddock-api/src/Haddock/Interface/Create.hs index 9ef3d1b..7491a01 100644 --- a/haddock-api/src/Haddock/Interface/Create.hs +++ b/haddock-api/src/Haddock/Interface/Create.hs @@ -517,7 +517,7 @@ mkExportItems case findDecl t of ([L l (ValD _)], (doc, _)) -> do -- Top-level binding without type signature - export <- hiValExportItem dflags t doc (l `elem` splices) $ M.lookup t fixMap + export <- hiValExportItem dflags t l doc (l `elem` splices) $ M.lookup t fixMap return [export] (ds, docs_) | decl : _ <- filter (not . isValD . unLoc) ds -> let declNames = getMainDeclBinder (unL decl) @@ -620,13 +620,19 @@ hiDecl dflags t = do O.text "-- Please report this on Haddock issue tracker!" bugWarn = O.showSDoc dflags . warnLine -hiValExportItem :: DynFlags -> Name -> DocForDecl Name -> Bool -> Maybe Fixity -> ErrMsgGhc (ExportItem Name) -hiValExportItem dflags name doc splice fixity = do +-- | This function is called for top-level bindings without type signatures. +-- It gets the type signature from GHC and that means it's not going to +-- have a meaningful 'SrcSpan'. So we pass down 'SrcSpan' for the +-- declaration and use it instead - 'nLoc' here. +hiValExportItem :: DynFlags -> Name -> SrcSpan -> DocForDecl Name -> Bool + -> Maybe Fixity -> ErrMsgGhc (ExportItem Name) +hiValExportItem dflags name nLoc doc splice fixity = do mayDecl <- hiDecl dflags name case mayDecl of Nothing -> return (ExportNoDecl name []) - Just decl -> return (ExportDecl decl doc [] [] fixities splice) + Just decl -> return (ExportDecl (fixSpan decl) doc [] [] fixities splice) where + fixSpan (L l t) = L (SrcLoc.combineSrcSpans l nLoc) t fixities = case fixity of Just f -> [(name, f)] Nothing -> [] @@ -737,7 +743,7 @@ fullModuleContents dflags warnings gre (docMap, argMap, subMap, declMap, instMap | name:_ <- collectHsBindBinders d, Just [L _ (ValD _)] <- M.lookup name declMap = -- Top-level binding without type signature. let (doc, _) = lookupDocs name warnings docMap argMap subMap in - fmap Just (hiValExportItem dflags name doc (l `elem` splices) $ M.lookup name fixMap) + fmap Just (hiValExportItem dflags name l doc (l `elem` splices) $ M.lookup name fixMap) | otherwise = return Nothing mkExportItem decl@(L l (InstD d)) | Just name <- M.lookup (getInstLoc d) instMap = From git at git.haskell.org Wed Jul 8 08:39:16 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:39:16 +0000 (UTC) Subject: [commit: haddock] master: Changelog for #207 (5aaa14f) Message-ID: <20150708083916.089213A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/5aaa14fa020da56be7fdf943f6da3310d11a3593 >--------------------------------------------------------------- commit 5aaa14fa020da56be7fdf943f6da3310d11a3593 Author: Mateusz Kowalczyk Date: Fri Jun 12 03:01:50 2015 +0100 Changelog for #207 Fixes #207, closes #402 >--------------------------------------------------------------- 5aaa14fa020da56be7fdf943f6da3310d11a3593 CHANGES | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES b/CHANGES index ef3c2f9..adcb6ca 100644 --- a/CHANGES +++ b/CHANGES @@ -15,6 +15,8 @@ Changes in version 2.16.1 * Build the main executable with -threaded (#399) + * Use SrcSpan of declarations for inferred type sigs (#207) + Changes in version 2.16.0 * Experimental collapsible header support (#335) From git at git.haskell.org Wed Jul 8 08:39:18 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:39:18 +0000 (UTC) Subject: [commit: haddock] master: Attach to instance location the name that has the same location file (3d11080) Message-ID: <20150708083918.196193A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/3d11080b9f56a901593b6237d674d617a429e64a >--------------------------------------------------------------- commit 3d11080b9f56a901593b6237d674d617a429e64a Author: jpmoresmau Date: Sun May 17 15:31:03 2015 +0200 Attach to instance location the name that has the same location file Fixes #383 >--------------------------------------------------------------- 3d11080b9f56a901593b6237d674d617a429e64a haddock-api/src/Haddock/Backends/LaTeX.hs | 4 ++-- haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | 6 +++--- haddock-api/src/Haddock/Backends/Xhtml/Layout.hs | 24 +++++++++++----------- .../src/Haddock/Interface/AttachInstances.hs | 23 ++++++++++++++++----- haddock-api/src/Haddock/Interface/Rename.hs | 5 +++-- haddock-api/src/Haddock/Types.hs | 2 +- 6 files changed, 39 insertions(+), 25 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 3d11080b9f56a901593b6237d674d617a429e64a From git at git.haskell.org Wed Jul 8 08:39:20 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:39:20 +0000 (UTC) Subject: [commit: haddock] master: Update changelog (f48474f) Message-ID: <20150708083920.2552E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/f48474f640387dca4b42182c1ac78ba30865742d >--------------------------------------------------------------- commit f48474f640387dca4b42182c1ac78ba30865742d Author: Mateusz Kowalczyk Date: Fri Jun 12 16:08:27 2015 +0100 Update changelog Closes #398 >--------------------------------------------------------------- f48474f640387dca4b42182c1ac78ba30865742d CHANGES | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES b/CHANGES index adcb6ca..368002d 100644 --- a/CHANGES +++ b/CHANGES @@ -17,6 +17,8 @@ Changes in version 2.16.1 * Use SrcSpan of declarations for inferred type sigs (#207) + * Fix cross-module instance locations (#383) + Changes in version 2.16.0 * Experimental collapsible header support (#335) From git at git.haskell.org Wed Jul 8 08:39:22 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:39:22 +0000 (UTC) Subject: [commit: haddock] master: Fix alignment of Source links in instance table in Firefox (a476b25) Message-ID: <20150708083922.315BF3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/a476b251e363b3b0ed30c75cf72a19fc275d6440 >--------------------------------------------------------------- commit a476b251e363b3b0ed30c75cf72a19fc275d6440 Author: Phil Ruffwind Date: Fri Jun 12 12:59:24 2015 -0400 Fix alignment of Source links in instance table in Firefox Due to a Firefox bug [1], a combination of 'whitespace: nowrap' on the parent element with 'float: right' on the inner element can cause the floated element to be displaced downwards for no apparent reason. To work around this, the left side is wrapped in its own and set to 'float: left'. As a precautionary measure to prevent the parent element from collapsing entirely, we also add the classic "clearfix" hack. The latter is not strictly needed but it helps prevent bugs if the layout is altered again in the future. Fixes #384. Remark: line 159 of src/Haddock/Backends/Xhtml/Layout.hs was indented to prevent confusion over the operator precedence of (<+>) vs (<<). [1]: https://bugzilla.mozilla.org/show_bug.cgi?id=488725 >--------------------------------------------------------------- a476b251e363b3b0ed30c75cf72a19fc275d6440 haddock-api/resources/html/Ocean.std-theme/ocean.css | 13 +++++++++++++ haddock-api/src/Haddock/Backends/Xhtml/Layout.hs | 5 +++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/haddock-api/resources/html/Ocean.std-theme/ocean.css b/haddock-api/resources/html/Ocean.std-theme/ocean.css index ef652a2..1110b40 100644 --- a/haddock-api/resources/html/Ocean.std-theme/ocean.css +++ b/haddock-api/resources/html/Ocean.std-theme/ocean.css @@ -416,6 +416,14 @@ div#style-menu-holder { margin-top: 0.8em; } +.clearfix:after { + clear: both; + content: " "; + display: block; + height: 0; + visibility: hidden; +} + .subs dl { margin: 0; } @@ -455,6 +463,11 @@ div#style-menu-holder { margin-left: 1em; } +/* Workaround for bug in Firefox (issue #384) */ +.inst-left { + float: left; +} + .top p.src { border-top: 1px solid #ccc; } diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs b/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs index e686d64..914a7a7 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs @@ -154,8 +154,9 @@ subTableSrc _ _ _ [] = Nothing subTableSrc qual lnks splice decls = Just $ table << aboves (concatMap subRow decls) where subRow ((decl, mdoc, subs),L loc dn) = - (td ! [theclass "src"] << decl - <+> linkHtml loc dn + (td ! [theclass "src clearfix"] << + (thespan ! [theclass "inst-left"] << decl) + <+> linkHtml loc dn <-> docElement td << fmap (docToHtml Nothing qual) mdoc ) From git at git.haskell.org Wed Jul 8 08:39:24 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:39:24 +0000 (UTC) Subject: [commit: haddock] master: Update tests for the CSS changes (4343f6c) Message-ID: <20150708083924.419933A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/4343f6c86225b6e283c73afcd8adc007fafebeff >--------------------------------------------------------------- commit 4343f6c86225b6e283c73afcd8adc007fafebeff Author: Mateusz Kowalczyk Date: Sun Jun 14 10:31:18 2015 +0100 Update tests for the CSS changes >--------------------------------------------------------------- 4343f6c86225b6e283c73afcd8adc007fafebeff CHANGES | 2 + html-test/ref/Bug26.html | 12 +- html-test/ref/Bug294.html | 70 +- html-test/ref/Bug7.html | 34 +- html-test/ref/Hash.html | 44 +- html-test/ref/HiddenInstances.html | 50 +- html-test/ref/HiddenInstancesB.html | 26 +- html-test/ref/QuasiExpr.html | 26 +- html-test/ref/SpuriousSuperclassConstraints.html | 34 +- html-test/ref/Test.html | 26 +- html-test/ref/TypeFamilies.html | 834 ++++++++++++----------- html-test/ref/TypeFamilies2.html | 114 ++-- html-test/ref/ocean.css | 23 + 13 files changed, 719 insertions(+), 576 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 4343f6c86225b6e283c73afcd8adc007fafebeff From git at git.haskell.org Wed Jul 8 08:39:26 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:39:26 +0000 (UTC) Subject: [commit: haddock] wip/orf-reboot: Merge remote-tracking branch 'github/ghc-head' into wip/orf-reboot (637b695) Message-ID: <20150708083926.539513A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/637b695e6a72083d81748af56c667b8e83d977fd >--------------------------------------------------------------- commit 637b695e6a72083d81748af56c667b8e83d977fd Merge: d137dae 553c719 Author: Adam Gundry Date: Mon Jun 15 16:59:56 2015 +0100 Merge remote-tracking branch 'github/ghc-head' into wip/orf-reboot Conflicts: haddock-api/src/Haddock/Types.hs >--------------------------------------------------------------- 637b695e6a72083d81748af56c667b8e83d977fd haddock-api/src/Haddock/Backends/LaTeX.hs | 12 +++++--- haddock-api/src/Haddock/Backends/Xhtml.hs | 4 +-- haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | 16 +++++----- haddock-api/src/Haddock/Convert.hs | 21 ++++++++----- haddock-api/src/Haddock/Interface/Create.hs | 6 ++-- haddock-api/src/Haddock/Interface/LexParseRn.hs | 3 +- haddock-api/src/Haddock/Interface/Rename.hs | 9 ++++-- haddock-api/src/Haddock/ModuleTree.hs | 41 +++++++++++++------------ haddock-api/src/Haddock/Types.hs | 28 +++++++++-------- 9 files changed, 80 insertions(+), 60 deletions(-) diff --cc haddock-api/src/Haddock/Backends/LaTeX.hs index 08f94db,e1090a0..6b4c541 --- a/haddock-api/src/Haddock/Backends/LaTeX.hs +++ b/haddock-api/src/Haddock/Backends/LaTeX.hs @@@ -898,9 -898,11 +898,11 @@@ ppr_mono_ty :: Int -> HsType DocName - ppr_mono_ty ctxt_prec (HsForAllTy expl extra tvs ctxt ty) unicode = maybeParen ctxt_prec pREC_FUN $ hsep [ppForAll expl tvs ctxt' unicode, ppr_mono_lty pREC_TOP ty unicode] - where ctxt' = case extra of - Just loc -> (++ [L loc HsWildcardTy]) `fmap` ctxt - Nothing -> ctxt + where - anonWC = HsWildCardTy (AnonWildCard PlaceHolder) ++ anonWC = HsWildCardTy (AnonWildCard (error "ppr_mono_ty: anonWC")) -- AMG TODO is this okay? + ctxt' + | Just loc <- extra = (++ [L loc anonWC]) `fmap` ctxt + | otherwise = ctxt ppr_mono_ty _ (HsBangTy b ty) u = ppBang b <> ppLParendType u ty ppr_mono_ty _ (HsTyVar name) _ = ppDocName name diff --cc haddock-api/src/Haddock/Backends/Xhtml/Decl.hs index aadfd7a,c0be973..fd3f534 --- a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs @@@ -852,9 -852,11 +852,11 @@@ ppr_mono_ty :: Int -> HsType DocName - ppr_mono_ty ctxt_prec (HsForAllTy expl extra tvs ctxt ty) unicode qual = maybeParen ctxt_prec pREC_FUN $ ppForAllCon expl tvs ctxt' unicode qual <+> ppr_mono_lty pREC_TOP ty unicode qual - where ctxt' = case extra of - Just loc -> (++ [L loc HsWildcardTy]) `fmap` ctxt - Nothing -> ctxt + where - anonWC = HsWildCardTy (AnonWildCard PlaceHolder) ++ anonWC = HsWildCardTy (AnonWildCard (error "ppr_mono_ty: anonWC")) -- AMG TODO ? + ctxt' + | Just loc <- extra = (++ [L loc anonWC]) `fmap` ctxt + | otherwise = ctxt -- UnicodeSyntax alternatives ppr_mono_ty _ (HsTyVar name) True _ diff --cc haddock-api/src/Haddock/Interface/Rename.hs index 5b1788f,2b50ce9..1b01b71 --- a/haddock-api/src/Haddock/Interface/Rename.hs +++ b/haddock-api/src/Haddock/Interface/Rename.hs @@@ -254,6 -253,10 +253,10 @@@ renameLContext (L loc context) = d context' <- mapM renameLType context return (L loc context') + renameWildCardInfo :: HsWildCardInfo Name -> RnM (HsWildCardInfo DocName) -renameWildCardInfo (AnonWildCard _) = pure (AnonWildCard PlaceHolder) ++renameWildCardInfo (AnonWildCard name) = AnonWildCard <$> rename name + renameWildCardInfo (NamedWildCard name) = NamedWildCard <$> rename name + renameInstHead :: InstHead Name -> RnM (InstHead DocName) renameInstHead (className, k, types, rest) = do className' <- rename className diff --cc haddock-api/src/Haddock/Types.hs index 8e0ae19,847320a..63dd666 --- a/haddock-api/src/Haddock/Types.hs +++ b/haddock-api/src/Haddock/Types.hs @@@ -282,16 -281,7 +281,6 @@@ data DocNam -- documentation, as far as Haddock knows. deriving Eq - type instance PostRn DocName Name = DocName - type instance PostRn DocName NameSet = PlaceHolder - type instance PostRn DocName Fixity = PlaceHolder - type instance PostRn DocName Bool = PlaceHolder - type instance PostRn DocName [Name] = PlaceHolder - - type instance PostTc DocName Kind = PlaceHolder - type instance PostTc DocName Type = PlaceHolder - type instance PostTc DocName Coercion = PlaceHolder -- instance NamedThing DocName where getName (Documented name _) = name getName (Undocumented name) = name @@@ -563,3 -553,18 +552,18 @@@ instance Monad ErrMsgGhc wher return a = WriterGhc (return (a, [])) m >>= k = WriterGhc $ runWriterGhc m >>= \ (a, msgs1) -> fmap (second (msgs1 ++)) (runWriterGhc (k a)) + + + ----------------------------------------------------------------------------- + -- * Pass sensitive types + ----------------------------------------------------------------------------- + + type instance PostRn DocName NameSet = PlaceHolder + type instance PostRn DocName Fixity = PlaceHolder + type instance PostRn DocName Bool = PlaceHolder -type instance PostRn DocName Name = PlaceHolder ++type instance PostRn DocName Name = DocName + type instance PostRn DocName [Name] = PlaceHolder + + type instance PostTc DocName Kind = PlaceHolder + type instance PostTc DocName Type = PlaceHolder + type instance PostTc DocName Coercion = PlaceHolder From git at git.haskell.org Wed Jul 8 08:39:28 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:39:28 +0000 (UTC) Subject: [commit: haddock] master: Fix identifier recognition in Haskell source parser. (01a2e7c) Message-ID: <20150708083928.5E2F13A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/01a2e7c5ab873c0041624a6ec0b0a54eb7da60cc >--------------------------------------------------------------- commit 01a2e7c5ab873c0041624a6ec0b0a54eb7da60cc Author: ?ukasz Hanuszczak Date: Fri Jun 5 14:39:28 2015 +0200 Fix identifier recognition in Haskell source parser. >--------------------------------------------------------------- 01a2e7c5ab873c0041624a6ec0b0a54eb7da60cc haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs index 7a162f6..9d58728 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs @@ -163,6 +163,9 @@ symbols :: [Char] symbols = "!#$%&*+./<=>?@\\^|-~:" isIdentifier :: String -> Bool -isIdentifier (c:str) - | isLetter c = all (\c' -> isAlphaNum c' || c == '\'') str +isIdentifier (s:str) + | (isLower' s || isUpper s) && all isAlphaNum' str = True + where + isLower' c = isLower c || c == '_' + isAlphaNum' c = isAlphaNum c || c == '_' || c == '\'' isIdentifier _ = False From git at git.haskell.org Wed Jul 8 08:39:30 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:39:30 +0000 (UTC) Subject: [commit: haddock] master: Fix span matcher bug causing wrong items being hyperlinked. (7d43b8a) Message-ID: <20150708083930.691A13A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/7d43b8a8c9538692beb91a4c3a485e82b40559ab >--------------------------------------------------------------- commit 7d43b8a8c9538692beb91a4c3a485e82b40559ab Author: ?ukasz Hanuszczak Date: Sat Jun 6 22:37:28 2015 +0200 Fix span matcher bug causing wrong items being hyperlinked. >--------------------------------------------------------------- 7d43b8a8c9538692beb91a4c3a485e82b40559ab haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs index 031ddd5..7d88b7f 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs @@ -48,5 +48,5 @@ matches tspan (GHC.RealSrcSpan aspan) rs = (posRow . spStart) tspan == GHC.srcSpanStartLine aspan cs = (posCol . spStart) tspan == GHC.srcSpanStartCol aspan re = (posRow . spEnd) tspan == GHC.srcSpanEndLine aspan - ce = (posCol . spEnd) tspan == GHC.srcSpanStartLine aspan + ce = (posCol . spEnd) tspan == GHC.srcSpanEndCol aspan matches _ _ = False From git at git.haskell.org Wed Jul 8 08:39:32 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:39:32 +0000 (UTC) Subject: [commit: haddock] master: Adapt source span tagging to work with current whitespace handling. (57d4c9c) Message-ID: <20150708083932.74AEE3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/57d4c9cff1d60f7dd0f8dafae5537218b63da90f >--------------------------------------------------------------- commit 57d4c9cff1d60f7dd0f8dafae5537218b63da90f Author: ?ukasz Hanuszczak Date: Fri Jun 5 00:07:52 2015 +0200 Adapt source span tagging to work with current whitespace handling. >--------------------------------------------------------------- 57d4c9cff1d60f7dd0f8dafae5537218b63da90f haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs index be6b7ce..53ff1f6 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs @@ -67,10 +67,13 @@ tag = reverse . snd . foldl aux (Position 1 1, []) where aux (pos, cs) c = - let pos' = if c == "\n" - then pos { posRow = posRow pos + 1, posCol = 1 } - else pos { posCol = posCol pos + length c } - in (pos', (Span pos pos', c):cs) + let pos' = move pos c + in (pos', ((Span pos pos', c):cs)) + move pos str@(c:_) + | isSpace c = foldl move' pos str + move pos str = pos { posCol = posCol pos + length str } + move' pos '\n' = pos { posRow = posRow pos + 1, posCol = 1 } + move' pos _ = pos { posCol = posCol pos + 1 } tokenize :: [(Span, String)] -> [Token] tokenize = From git at git.haskell.org Wed Jul 8 08:39:34 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:39:34 +0000 (UTC) Subject: [commit: haddock] master: Add support for recognizing compiler pragmas in source parser. (e5bd5d3) Message-ID: <20150708083934.805763A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/e5bd5d39550692f936c973637f8ec8d314919359 >--------------------------------------------------------------- commit e5bd5d39550692f936c973637f8ec8d314919359 Author: ?ukasz Hanuszczak Date: Fri Jun 5 15:12:40 2015 +0200 Add support for recognizing compiler pragmas in source parser. >--------------------------------------------------------------- e5bd5d39550692f936c973637f8ec8d314919359 haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs | 2 ++ haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs | 1 + 2 files changed, 3 insertions(+) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs index 29edb4c..0e1ad5b 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs @@ -35,6 +35,7 @@ data TokenType | TkSpace | TkComment | TkCpp + | TkPragma | TkUnknown parse :: String -> [Token] @@ -92,6 +93,7 @@ tokenize = classify :: String -> TokenType classify str | "--" `isPrefixOf` str = TkComment + | "{-#" `isPrefixOf` str = TkPragma | "{-" `isPrefixOf` str = TkComment classify (c:_) | isSpace c = TkSpace diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs index 9ebb870..39d7d18 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs @@ -38,4 +38,5 @@ tokenAttrs TkSpecial = [Html.theclass "hs-special"] tokenAttrs TkSpace = [] tokenAttrs TkComment = [Html.theclass "hs-comment"] tokenAttrs TkCpp = [Html.theclass "hs-cpp"] +tokenAttrs TkPragma = [Html.theclass "hs-pragma"] tokenAttrs TkUnknown = [] From git at git.haskell.org Wed Jul 8 08:39:36 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:39:36 +0000 (UTC) Subject: [commit: haddock] master: Implement simple string chunking based on HsColour library. (413f7f3) Message-ID: <20150708083936.8B61E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/413f7f322cd174e2ba4116dbf53c1b3c0d6a4f77 >--------------------------------------------------------------- commit 413f7f322cd174e2ba4116dbf53c1b3c0d6a4f77 Author: ?ukasz Hanuszczak Date: Thu Jun 4 21:10:26 2015 +0200 Implement simple string chunking based on HsColour library. >--------------------------------------------------------------- 413f7f322cd174e2ba4116dbf53c1b3c0d6a4f77 .../src/Haddock/Backends/Hyperlinker/Parser.hs | 28 +++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs index 4bcc0c8..4e0d738 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs @@ -1,5 +1,8 @@ module Haddock.Backends.Hyperlinker.Parser (parse) where +import Data.Char +import Data.List + data Token = Token { tkType :: TokenType , tkValue :: String @@ -27,7 +30,30 @@ parse :: String -> [Token] parse = tokenize . tag . chunk chunk :: String -> [String] -chunk = undefined +chunk [] = [] +chunk str@(c:_) + | isSpace c = chunk' $ span isSpace str +chunk str + | "--" `isPrefixOf` str = chunk' $ span (not . (== '\n')) str + | "{-" `isPrefixOf` str = chunk' $ chunkComment 0 str + | otherwise = chunk' $ head $ lex str + +chunk' :: (String, String) -> [String] +chunk' (c, rest) = c:(chunk rest) + +chunkComment :: Int -> String -> (String, String) +chunkComment _ [] = ("", "") +chunkComment depth ('{':'-':str) = + let (c, rest) = chunkComment (depth + 1) str + in ("{-" ++ c, rest) +chunkComment depth ('-':'}':str) + | depth == 1 = ("-}", str) + | otherwise = + let (c, rest) = chunkComment (depth - 1) str + in ("-}" ++ c, rest) +chunkComment depth (e:str) = + let (c, rest) = chunkComment depth str + in (e:c, rest) tag :: [String] -> [(Span, String)] tag = From git at git.haskell.org Wed Jul 8 08:39:38 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:39:38 +0000 (UTC) Subject: [commit: haddock] master: Create basic token classification method. (6fb8d5a) Message-ID: <20150708083938.9574B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/6fb8d5abbcc92f5155fdc9596ca1c87fe87f6187 >--------------------------------------------------------------- commit 6fb8d5abbcc92f5155fdc9596ca1c87fe87f6187 Author: ?ukasz Hanuszczak Date: Thu Jun 4 23:21:17 2015 +0200 Create basic token classification method. >--------------------------------------------------------------- 6fb8d5abbcc92f5155fdc9596ca1c87fe87f6187 .../src/Haddock/Backends/Hyperlinker/Parser.hs | 104 +++++++++++++++++++-- 1 file changed, 98 insertions(+), 6 deletions(-) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs index 4e0d738..be6b7ce 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs @@ -20,11 +20,18 @@ data Span = Span } data TokenType - = Identifier - | Comment - | Whitespace - | Operator - | Symbol + = TkIdentifier + | TkKeyword + | TkString + | TkChar + | TkNumber + | TkOperator + | TkGlyph + | TkSpecial + | TkSpace + | TkComment + | TkCpp + | TkUnknown parse :: String -> [Token] parse = tokenize . tag . chunk @@ -66,4 +73,89 @@ tag = in (pos', (Span pos pos', c):cs) tokenize :: [(Span, String)] -> [Token] -tokenize = undefined +tokenize = + map aux + where + aux (sp, str) = Token + { tkType = classify str + , tkValue = str + , tkSpan = sp + } + +classify :: String -> TokenType +classify (c:_) + | isSpace c = TkSpace + | isDigit c = TkNumber + | c `elem` special = TkSpecial + | c == '#' = TkCpp + | c == '"' = TkString + | c == '\'' = TkChar +classify str + | str `elem` keywords = TkKeyword + | str `elem` glyphs = TkGlyph + | all (`elem` symbols) str = TkOperator + | "--" `isPrefixOf` str = TkComment + | "{-" `isPrefixOf` str = TkComment + | isIdentifier str = TkIdentifier + | otherwise = TkUnknown + +keywords :: [String] +keywords = + [ "as" + , "case" + , "class" + , "data" + , "default" + , "deriving" + , "do" + , "else" + , "hiding" + , "if" + , "import" + , "in" + , "infix" + , "infixl" + , "infixr" + , "instance" + , "let" + , "module" + , "newtype" + , "of" + , "qualified" + , "then" + , "type" + , "where" + , "forall" + , "mdo" + ] + +glyphs :: [String] +glyphs = + [ ".." + , ":" + , "::" + , "=" + , "\\" + , "|" + , "<-" + , "->" + , "@" + , "~" + , "~#" + , "=>" + , "-" + , "!" + ] + +special :: [Char] +special = "()[]{},;`" + +-- TODO: Add support for any Unicode symbol or punctuation. +-- source: http://stackoverflow.com/questions/10548170/what-characters-are-permitted-for-haskell-operators +symbols :: [Char] +symbols = "!#$%&*+./<=>?@\\^|-~:" + +isIdentifier :: String -> Bool +isIdentifier (c:str) + | isLetter c = all (\c' -> isAlphaNum c' || c == '\'') str +isIdentifier _ = False From git at git.haskell.org Wed Jul 8 08:39:40 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:39:40 +0000 (UTC) Subject: [commit: haddock] master: Create simple HTML renderer for parsed source file. (5e904cb) Message-ID: <20150708083940.A76923A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/5e904cb1c3d769d5b99d459838b4b5368c8c1fb7 >--------------------------------------------------------------- commit 5e904cb1c3d769d5b99d459838b4b5368c8c1fb7 Author: ?ukasz Hanuszczak Date: Fri Jun 5 12:59:10 2015 +0200 Create simple HTML renderer for parsed source file. >--------------------------------------------------------------- 5e904cb1c3d769d5b99d459838b4b5368c8c1fb7 haddock-api/haddock-api.cabal | 3 ++- .../src/Haddock/Backends/Hyperlinker/Renderer.hs | 26 ++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/haddock-api/haddock-api.cabal b/haddock-api/haddock-api.cabal index b90e3bf..6c6dc81 100644 --- a/haddock-api/haddock-api.cabal +++ b/haddock-api/haddock-api.cabal @@ -57,6 +57,8 @@ library exposed-modules: Documentation.Haddock + Haddock.Backends.Hyperlinker.Parser + Haddock.Backends.Hyperlinker.Renderer other-modules: Haddock @@ -79,7 +81,6 @@ library Haddock.Backends.LaTeX Haddock.Backends.HaddockDB Haddock.Backends.Hoogle - Haddock.Backends.Hyperlinker.Parser Haddock.ModuleTree Haddock.Types Haddock.Doc diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs new file mode 100644 index 0000000..eaf5b37 --- /dev/null +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs @@ -0,0 +1,26 @@ +module Haddock.Backends.Hyperlinker.Renderer where + +import Haddock.Backends.Hyperlinker.Parser + +import Data.Monoid +import Text.XHtml + +render :: [Token] -> Html +render = body . pre . foldr (<>) noHtml . map renderToken + +renderToken :: Token -> Html +renderToken (Token t v _) = thespan (toHtml v) ! tokenAttrs t + +tokenAttrs :: TokenType -> [HtmlAttr] +tokenAttrs TkIdentifier = [theclass "hs-identifier"] +tokenAttrs TkKeyword = [theclass "hs-keyword"] +tokenAttrs TkString = [theclass "hs-string"] +tokenAttrs TkChar = [theclass "hs-char"] +tokenAttrs TkNumber = [theclass "hs-number"] +tokenAttrs TkOperator = [theclass "hs-operator"] +tokenAttrs TkGlyph = [theclass "hs-glyph"] +tokenAttrs TkSpecial = [theclass "hs-special"] +tokenAttrs TkSpace = [] +tokenAttrs TkComment = [theclass "hs-comment"] +tokenAttrs TkCpp = [theclass "hs-cpp"] +tokenAttrs TkUnknown = [] From git at git.haskell.org Wed Jul 8 08:39:42 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:39:42 +0000 (UTC) Subject: [commit: haddock] master: Add support for specifying the CSS file path in HTML source renderer. (1a43f35) Message-ID: <20150708083942.B28E83A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/1a43f35e2dacc9837f9762fd211d63ae6cc7b4a3 >--------------------------------------------------------------- commit 1a43f35e2dacc9837f9762fd211d63ae6cc7b4a3 Author: ?ukasz Hanuszczak Date: Fri Jun 5 13:58:47 2015 +0200 Add support for specifying the CSS file path in HTML source renderer. >--------------------------------------------------------------- 1a43f35e2dacc9837f9762fd211d63ae6cc7b4a3 .../src/Haddock/Backends/Hyperlinker/Renderer.hs | 45 ++++++++++++++-------- 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs index eaf5b37..9ebb870 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs @@ -3,24 +3,39 @@ module Haddock.Backends.Hyperlinker.Renderer where import Haddock.Backends.Hyperlinker.Parser import Data.Monoid -import Text.XHtml +import Text.XHtml (Html, HtmlAttr, (!)) +import qualified Text.XHtml as Html -render :: [Token] -> Html -render = body . pre . foldr (<>) noHtml . map renderToken +render :: Maybe FilePath -> [Token] -> Html +render css tokens = header css <> body tokens -renderToken :: Token -> Html -renderToken (Token t v _) = thespan (toHtml v) ! tokenAttrs t +body :: [Token] -> Html +body = Html.body . Html.pre . mconcat . map token + +header :: Maybe FilePath -> Html +header Nothing = Html.noHtml +header (Just css) = + Html.header $ Html.thelink Html.noHtml ! attrs + where + attrs = + [ Html.rel "stylesheet" + , Html.href css + , Html.thetype "text/css" + ] + +token :: Token -> Html +token (Token t v _) = Html.thespan (Html.toHtml v) ! tokenAttrs t tokenAttrs :: TokenType -> [HtmlAttr] -tokenAttrs TkIdentifier = [theclass "hs-identifier"] -tokenAttrs TkKeyword = [theclass "hs-keyword"] -tokenAttrs TkString = [theclass "hs-string"] -tokenAttrs TkChar = [theclass "hs-char"] -tokenAttrs TkNumber = [theclass "hs-number"] -tokenAttrs TkOperator = [theclass "hs-operator"] -tokenAttrs TkGlyph = [theclass "hs-glyph"] -tokenAttrs TkSpecial = [theclass "hs-special"] +tokenAttrs TkIdentifier = [Html.theclass "hs-identifier"] +tokenAttrs TkKeyword = [Html.theclass "hs-keyword"] +tokenAttrs TkString = [Html.theclass "hs-string"] +tokenAttrs TkChar = [Html.theclass "hs-char"] +tokenAttrs TkNumber = [Html.theclass "hs-number"] +tokenAttrs TkOperator = [Html.theclass "hs-operator"] +tokenAttrs TkGlyph = [Html.theclass "hs-glyph"] +tokenAttrs TkSpecial = [Html.theclass "hs-special"] tokenAttrs TkSpace = [] -tokenAttrs TkComment = [theclass "hs-comment"] -tokenAttrs TkCpp = [theclass "hs-cpp"] +tokenAttrs TkComment = [Html.theclass "hs-comment"] +tokenAttrs TkCpp = [Html.theclass "hs-cpp"] tokenAttrs TkUnknown = [] From git at git.haskell.org Wed Jul 8 08:39:44 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:39:44 +0000 (UTC) Subject: [commit: haddock] master: Implement utility method for extracting variable identifiers from AST. (74de002) Message-ID: <20150708083944.BCF9A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/74de0021815f0642a89017fbb1fbdf18064cb5ea >--------------------------------------------------------------- commit 74de0021815f0642a89017fbb1fbdf18064cb5ea Author: ?ukasz Hanuszczak Date: Sat Jun 6 19:36:53 2015 +0200 Implement utility method for extracting variable identifiers from AST. >--------------------------------------------------------------- 74de0021815f0642a89017fbb1fbdf18064cb5ea haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs index abd3ca2..62c0d43 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs @@ -1,6 +1,10 @@ +{-# LANGUAGE RankNTypes #-} + module Haddock.Backends.Hyperlinker.Ast where import qualified GHC +import Data.Data +import Control.Applicative import Haddock.Backends.Hyperlinker.Parser @@ -18,3 +22,15 @@ enrich src = lookupName :: GHC.RenamedSource -> Span -> Maybe GHC.Name lookupName = undefined + +everything :: (r -> r -> r) -> (forall a. Data a => a -> r) + -> (forall a. Data a => a -> r) +everything k f x = foldl k (f x) (gmapQ (everything k f) x) + +variables :: GHC.RenamedSource -> [(GHC.SrcSpan, GHC.Name)] +variables = + everything (<|>) var + where + var term = case cast term of + (Just (GHC.L sspan (GHC.HsVar sid))) -> pure (sspan, sid) + _ -> empty From git at git.haskell.org Wed Jul 8 08:39:46 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:39:46 +0000 (UTC) Subject: [commit: haddock] master: Create scaffolding for Haskell source parser module. (ce0237f) Message-ID: <20150708083946.CD4253A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/ce0237fa8f482a64dc8ea3ec409a1482ac89e6ac >--------------------------------------------------------------- commit ce0237fa8f482a64dc8ea3ec409a1482ac89e6ac Author: ?ukasz Hanuszczak Date: Thu Jun 4 19:27:34 2015 +0200 Create scaffolding for Haskell source parser module. >--------------------------------------------------------------- ce0237fa8f482a64dc8ea3ec409a1482ac89e6ac haddock-api/haddock-api.cabal | 1 + .../src/Haddock/Backends/Hyperlinker/Parser.hs | 36 ++++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/haddock-api/haddock-api.cabal b/haddock-api/haddock-api.cabal index 3bc2226..b90e3bf 100644 --- a/haddock-api/haddock-api.cabal +++ b/haddock-api/haddock-api.cabal @@ -79,6 +79,7 @@ library Haddock.Backends.LaTeX Haddock.Backends.HaddockDB Haddock.Backends.Hoogle + Haddock.Backends.Hyperlinker.Parser Haddock.ModuleTree Haddock.Types Haddock.Doc diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs new file mode 100644 index 0000000..11a92b5 --- /dev/null +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs @@ -0,0 +1,36 @@ +module Haddock.Backends.Hyperlinker.Parser (parse) where + +data Token = Token + { tkType :: TokenType + , tkValue :: String + , tkSpan :: Span + } + +data Position = Position + { posRow :: !Int + , posCol :: !Int + } + +data Span = Span + { spStart :: Position + , spEnd :: Position + } + +data TokenType + = Identifier + | Comment + | Whitespace + | Operator + | Symbol + +parse :: String -> [Token] +parse = tokenize . tag . chunk + +chunk :: String -> [String] +chunk = undefined + +tag :: [String] -> [(Span, String)] +tag = undefined + +tokenize :: [(Span, String)] -> [Token] +tokenize = undefined From git at git.haskell.org Wed Jul 8 08:39:48 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:39:48 +0000 (UTC) Subject: [commit: haddock] master: Add dummy support for hyperlinking named tokens. (cb3ece1) Message-ID: <20150708083948.D7AFA3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/cb3ece1a493eb444ccb61b6ad3c74e922184b63e >--------------------------------------------------------------- commit cb3ece1a493eb444ccb61b6ad3c74e922184b63e Author: ?ukasz Hanuszczak Date: Sat Jun 6 21:43:15 2015 +0200 Add dummy support for hyperlinking named tokens. >--------------------------------------------------------------- cb3ece1a493eb444ccb61b6ad3c74e922184b63e .../src/Haddock/Backends/Hyperlinker/Renderer.hs | 23 +++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs index 39d7d18..32d2c86 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs @@ -1,16 +1,20 @@ module Haddock.Backends.Hyperlinker.Renderer where import Haddock.Backends.Hyperlinker.Parser +import Haddock.Backends.Hyperlinker.Ast + +import qualified GHC +import qualified Name as GHC import Data.Monoid import Text.XHtml (Html, HtmlAttr, (!)) import qualified Text.XHtml as Html -render :: Maybe FilePath -> [Token] -> Html +render :: Maybe FilePath -> [RichToken] -> Html render css tokens = header css <> body tokens -body :: [Token] -> Html -body = Html.body . Html.pre . mconcat . map token +body :: [RichToken] -> Html +body = Html.body . Html.pre . mconcat . map richToken header :: Maybe FilePath -> Html header Nothing = Html.noHtml @@ -23,6 +27,10 @@ header (Just css) = , Html.thetype "text/css" ] +richToken :: RichToken -> Html +richToken (RichToken t Nothing) = token t +richToken (RichToken t (Just name)) = Html.anchor (token t) ! nameAttrs name + token :: Token -> Html token (Token t v _) = Html.thespan (Html.toHtml v) ! tokenAttrs t @@ -40,3 +48,12 @@ tokenAttrs TkComment = [Html.theclass "hs-comment"] tokenAttrs TkCpp = [Html.theclass "hs-cpp"] tokenAttrs TkPragma = [Html.theclass "hs-pragma"] tokenAttrs TkUnknown = [] + +nameAttrs :: GHC.Name -> [HtmlAttr] +nameAttrs name = + [ Html.href (maybe "" id mmod ++ "#" ++ ident) + , Html.theclass "varid-reference" + ] + where + mmod = GHC.moduleNameString . GHC.moduleName <$> GHC.nameModule_maybe name + ident = GHC.occNameString . GHC.nameOccName $ name From git at git.haskell.org Wed Jul 8 08:39:50 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:39:50 +0000 (UTC) Subject: [commit: haddock] master: Constrain elements exported by hyperlinker modules. (9a51a6d) Message-ID: <20150708083950.E27103A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/9a51a6d3f686736354e26137363ea979a5e38076 >--------------------------------------------------------------- commit 9a51a6d3f686736354e26137363ea979a5e38076 Author: ?ukasz Hanuszczak Date: Sat Jun 6 23:40:36 2015 +0200 Constrain elements exported by hyperlinker modules. >--------------------------------------------------------------- 9a51a6d3f686736354e26137363ea979a5e38076 haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs | 5 ++++- haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs index 7d88b7f..a24945e 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs @@ -1,6 +1,9 @@ {-# LANGUAGE RankNTypes #-} -module Haddock.Backends.Hyperlinker.Ast where +module Haddock.Backends.Hyperlinker.Ast + ( enrich + , RichToken(..) + ) where import Haddock.Backends.Hyperlinker.Parser diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs index 32d2c86..3c6fe14 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs @@ -1,4 +1,4 @@ -module Haddock.Backends.Hyperlinker.Renderer where +module Haddock.Backends.Hyperlinker.Renderer (render) where import Haddock.Backends.Hyperlinker.Parser import Haddock.Backends.Hyperlinker.Ast From git at git.haskell.org Wed Jul 8 08:39:52 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:39:52 +0000 (UTC) Subject: [commit: haddock] master: Implement function for tagging parsed chunks with source spans. (e17f625) Message-ID: <20150708083952.EE35C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/e17f62506ecf20d61781c610d6fbb5f3c8cd132e >--------------------------------------------------------------- commit e17f62506ecf20d61781c610d6fbb5f3c8cd132e Author: ?ukasz Hanuszczak Date: Thu Jun 4 19:59:27 2015 +0200 Implement function for tagging parsed chunks with source spans. >--------------------------------------------------------------- e17f62506ecf20d61781c610d6fbb5f3c8cd132e haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs index 11a92b5..4bcc0c8 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs @@ -30,7 +30,14 @@ chunk :: String -> [String] chunk = undefined tag :: [String] -> [(Span, String)] -tag = undefined +tag = + reverse . snd . foldl aux (Position 1 1, []) + where + aux (pos, cs) c = + let pos' = if c == "\n" + then pos { posRow = posRow pos + 1, posCol = 1 } + else pos { posCol = posCol pos + length c } + in (pos', (Span pos pos', c):cs) tokenize :: [(Span, String)] -> [Token] tokenize = undefined From git at git.haskell.org Wed Jul 8 08:39:55 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:39:55 +0000 (UTC) Subject: [commit: haddock] master: Make parser module export all types and associated accessors. (7b60788) Message-ID: <20150708083955.04BCC3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/7b607883d0cea7a795275a2484a33bd89a3b4fc6 >--------------------------------------------------------------- commit 7b607883d0cea7a795275a2484a33bd89a3b4fc6 Author: ?ukasz Hanuszczak Date: Fri Jun 5 11:56:01 2015 +0200 Make parser module export all types and associated accessors. >--------------------------------------------------------------- 7b607883d0cea7a795275a2484a33bd89a3b4fc6 haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs index 4130ab6..7a162f6 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs @@ -1,8 +1,7 @@ module Haddock.Backends.Hyperlinker.Parser ( parse - , tkType, tkValue, tkSpan - , posRow, posCol - , spStart, spEnd + , Token(..), TokenType(..) + , Position(..), Span(..) ) where import Data.Char From git at git.haskell.org Wed Jul 8 08:39:57 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:39:57 +0000 (UTC) Subject: [commit: haddock] master: Implement module export- and import-list item hyperlinking. (c84a3ef) Message-ID: <20150708083957.0FE223A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/c84a3ef8ebca5fb396ee9dc8cb2654f7891f5c0e >--------------------------------------------------------------- commit c84a3ef8ebca5fb396ee9dc8cb2654f7891f5c0e Author: ?ukasz Hanuszczak Date: Mon Jun 8 14:12:58 2015 +0200 Implement module export- and import-list item hyperlinking. >--------------------------------------------------------------- c84a3ef8ebca5fb396ee9dc8cb2654f7891f5c0e haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs index 19ebbe7..2325aa2 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs @@ -36,7 +36,12 @@ enrich src = , rtkDetails = lookupBySpan (tkSpan token) detailsMap } where - detailsMap = variables src ++ types src ++ binds src + detailsMap = concat + [ variables src + , types src + , binds src + , imports src + ] type DetailsMap = [(GHC.SrcSpan, TokenDetails)] @@ -81,6 +86,19 @@ binds = pure (sspan, TokenDetails RtkBind name) _ -> empty +imports :: GHC.RenamedSource -> DetailsMap +imports = + everything (<|>) ie + where + ie term = case cast term of + (Just (GHC.IEVar v)) -> pure $ var v + (Just (GHC.IEThingAbs t)) -> pure $ typ t + (Just (GHC.IEThingAll t)) -> pure $ typ t + (Just (GHC.IEThingWith t vs)) -> [typ t] ++ map var vs + _ -> empty + typ (GHC.L sspan name) = (sspan, TokenDetails RtkType name) + var (GHC.L sspan name) = (sspan, TokenDetails RtkVar name) + matches :: Span -> GHC.SrcSpan -> Bool matches tspan (GHC.RealSrcSpan aspan) | rs && cs && re && ce = True From git at git.haskell.org Wed Jul 8 08:39:59 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:39:59 +0000 (UTC) Subject: [commit: haddock] master: Add record accessors to exports of hyperlinker parser module. (c7ecc59) Message-ID: <20150708083959.1B3023A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/c7ecc590090d7f1a4ce8e6d0233c41350202a4bd >--------------------------------------------------------------- commit c7ecc590090d7f1a4ce8e6d0233c41350202a4bd Author: ?ukasz Hanuszczak Date: Fri Jun 5 00:16:15 2015 +0200 Add record accessors to exports of hyperlinker parser module. >--------------------------------------------------------------- c7ecc590090d7f1a4ce8e6d0233c41350202a4bd haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs index 53ff1f6..4130ab6 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs @@ -1,4 +1,9 @@ -module Haddock.Backends.Hyperlinker.Parser (parse) where +module Haddock.Backends.Hyperlinker.Parser + ( parse + , tkType, tkValue, tkSpan + , posRow, posCol + , spStart, spEnd + ) where import Data.Char import Data.List From git at git.haskell.org Wed Jul 8 08:40:01 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:40:01 +0000 (UTC) Subject: [commit: haddock] master: Create simple mechanism for associating tokens with AST names. (d06a2b5) Message-ID: <20150708084001.26A7A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/d06a2b502e7909dff517a7c825e772b493bade24 >--------------------------------------------------------------- commit d06a2b502e7909dff517a7c825e772b493bade24 Author: ?ukasz Hanuszczak Date: Sat Jun 6 20:04:02 2015 +0200 Create simple mechanism for associating tokens with AST names. >--------------------------------------------------------------- d06a2b502e7909dff517a7c825e772b493bade24 .../src/Haddock/Backends/Hyperlinker/Ast.hs | 30 +++++++++++++++++----- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs index 62c0d43..031ddd5 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs @@ -2,11 +2,13 @@ module Haddock.Backends.Hyperlinker.Ast where +import Haddock.Backends.Hyperlinker.Parser + import qualified GHC -import Data.Data -import Control.Applicative -import Haddock.Backends.Hyperlinker.Parser +import Control.Applicative +import Data.Data +import Data.Maybe data RichToken = RichToken { rtkToken :: Token @@ -17,20 +19,34 @@ enrich :: GHC.RenamedSource -> [Token] -> [RichToken] enrich src = map $ \token -> RichToken { rtkToken = token - , rtkName = lookupName src $ tkSpan token + , rtkName = lookupBySpan (tkSpan token) nameMap } + where + nameMap = variables src + +type NameMap = [(GHC.SrcSpan, GHC.Name)] -lookupName :: GHC.RenamedSource -> Span -> Maybe GHC.Name -lookupName = undefined +lookupBySpan :: Span -> NameMap -> Maybe GHC.Name +lookupBySpan tspan = listToMaybe . map snd . filter (matches tspan . fst) everything :: (r -> r -> r) -> (forall a. Data a => a -> r) -> (forall a. Data a => a -> r) everything k f x = foldl k (f x) (gmapQ (everything k f) x) -variables :: GHC.RenamedSource -> [(GHC.SrcSpan, GHC.Name)] +variables :: GHC.RenamedSource -> NameMap variables = everything (<|>) var where var term = case cast term of (Just (GHC.L sspan (GHC.HsVar sid))) -> pure (sspan, sid) _ -> empty + +matches :: Span -> GHC.SrcSpan -> Bool +matches tspan (GHC.RealSrcSpan aspan) + | rs && cs && re && ce = True + where + rs = (posRow . spStart) tspan == GHC.srcSpanStartLine aspan + cs = (posCol . spStart) tspan == GHC.srcSpanStartCol aspan + re = (posRow . spEnd) tspan == GHC.srcSpanEndLine aspan + ce = (posCol . spEnd) tspan == GHC.srcSpanStartLine aspan +matches _ _ = False From git at git.haskell.org Wed Jul 8 08:40:03 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:40:03 +0000 (UTC) Subject: [commit: haddock] master: Add support for type token recognition. (666af8d) Message-ID: <20150708084003.30E7E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/666af8d2f29c05d22bb5930d115c42509528bb90 >--------------------------------------------------------------- commit 666af8d2f29c05d22bb5930d115c42509528bb90 Author: ?ukasz Hanuszczak Date: Sun Jun 7 21:35:55 2015 +0200 Add support for type token recognition. >--------------------------------------------------------------- 666af8d2f29c05d22bb5930d115c42509528bb90 .../src/Haddock/Backends/Hyperlinker/Ast.hs | 35 +++++++++--- .../src/Haddock/Backends/Hyperlinker/Renderer.hs | 64 ++++++++++++++-------- 2 files changed, 68 insertions(+), 31 deletions(-) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs index a24945e..0ccf010 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs @@ -2,7 +2,7 @@ module Haddock.Backends.Hyperlinker.Ast ( enrich - , RichToken(..) + , RichToken(..), RichTokenType(..), TokenDetails(..) ) where import Haddock.Backends.Hyperlinker.Parser @@ -15,33 +15,52 @@ import Data.Maybe data RichToken = RichToken { rtkToken :: Token - , rtkName :: Maybe GHC.Name + , rtkDetails :: Maybe TokenDetails } +data TokenDetails = TokenDetails + { rtkType :: RichTokenType + , rtkName :: GHC.Name + } + +data RichTokenType + = RtkVar + | RtkType + enrich :: GHC.RenamedSource -> [Token] -> [RichToken] enrich src = map $ \token -> RichToken { rtkToken = token - , rtkName = lookupBySpan (tkSpan token) nameMap + , rtkDetails = lookupBySpan (tkSpan token) detailsMap } where - nameMap = variables src + detailsMap = variables src ++ types src -type NameMap = [(GHC.SrcSpan, GHC.Name)] +type DetailsMap = [(GHC.SrcSpan, TokenDetails)] -lookupBySpan :: Span -> NameMap -> Maybe GHC.Name +lookupBySpan :: Span -> DetailsMap -> Maybe TokenDetails lookupBySpan tspan = listToMaybe . map snd . filter (matches tspan . fst) everything :: (r -> r -> r) -> (forall a. Data a => a -> r) -> (forall a. Data a => a -> r) everything k f x = foldl k (f x) (gmapQ (everything k f) x) -variables :: GHC.RenamedSource -> NameMap +variables :: GHC.RenamedSource -> DetailsMap variables = everything (<|>) var where var term = case cast term of - (Just (GHC.L sspan (GHC.HsVar sid))) -> pure (sspan, sid) + (Just (GHC.L sspan (GHC.HsVar name))) -> + pure (sspan, TokenDetails RtkVar name) + _ -> empty + +types :: GHC.RenamedSource -> DetailsMap +types = + everything (<|>) ty + where + ty term = case cast term of + (Just (GHC.L sspan (GHC.HsTyVar name))) -> + pure (sspan, TokenDetails RtkType name) _ -> empty matches :: Span -> GHC.SrcSpan -> Bool diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs index 3c6fe14..c2bca43 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs @@ -6,10 +6,14 @@ import Haddock.Backends.Hyperlinker.Ast import qualified GHC import qualified Name as GHC +import Data.List import Data.Monoid + import Text.XHtml (Html, HtmlAttr, (!)) import qualified Text.XHtml as Html +type StyleClass = String + render :: Maybe FilePath -> [RichToken] -> Html render css tokens = header css <> body tokens @@ -28,29 +32,43 @@ header (Just css) = ] richToken :: RichToken -> Html -richToken (RichToken t Nothing) = token t -richToken (RichToken t (Just name)) = Html.anchor (token t) ! nameAttrs name - -token :: Token -> Html -token (Token t v _) = Html.thespan (Html.toHtml v) ! tokenAttrs t - -tokenAttrs :: TokenType -> [HtmlAttr] -tokenAttrs TkIdentifier = [Html.theclass "hs-identifier"] -tokenAttrs TkKeyword = [Html.theclass "hs-keyword"] -tokenAttrs TkString = [Html.theclass "hs-string"] -tokenAttrs TkChar = [Html.theclass "hs-char"] -tokenAttrs TkNumber = [Html.theclass "hs-number"] -tokenAttrs TkOperator = [Html.theclass "hs-operator"] -tokenAttrs TkGlyph = [Html.theclass "hs-glyph"] -tokenAttrs TkSpecial = [Html.theclass "hs-special"] -tokenAttrs TkSpace = [] -tokenAttrs TkComment = [Html.theclass "hs-comment"] -tokenAttrs TkCpp = [Html.theclass "hs-cpp"] -tokenAttrs TkPragma = [Html.theclass "hs-pragma"] -tokenAttrs TkUnknown = [] - -nameAttrs :: GHC.Name -> [HtmlAttr] -nameAttrs name = +richToken (RichToken tok Nothing) = + tokenSpan tok ! attrs + where + attrs = [ multiclass . tokenStyle . tkType $ tok ] +richToken (RichToken tok (Just det)) = + Html.anchor content ! (anchorAttrs . rtkName) det + where + content = tokenSpan tok ! [ multiclass style] + style = (tokenStyle . tkType) tok ++ (richTokenStyle . rtkType) det + +tokenSpan :: Token -> Html +tokenSpan = Html.thespan . Html.toHtml . tkValue + +richTokenStyle :: RichTokenType -> [StyleClass] +richTokenStyle RtkVar = ["hs-var"] +richTokenStyle RtkType = ["hs-type"] + +tokenStyle :: TokenType -> [StyleClass] +tokenStyle TkIdentifier = ["hs-identifier"] +tokenStyle TkKeyword = ["hs-keyword"] +tokenStyle TkString = ["hs-string"] +tokenStyle TkChar = ["hs-char"] +tokenStyle TkNumber = ["hs-number"] +tokenStyle TkOperator = ["hs-operator"] +tokenStyle TkGlyph = ["hs-glyph"] +tokenStyle TkSpecial = ["hs-special"] +tokenStyle TkSpace = [] +tokenStyle TkComment = ["hs-comment"] +tokenStyle TkCpp = ["hs-cpp"] +tokenStyle TkPragma = ["hs-pragma"] +tokenStyle TkUnknown = [] + +multiclass :: [StyleClass] -> HtmlAttr +multiclass = Html.theclass . intercalate " " + +anchorAttrs :: GHC.Name -> [HtmlAttr] +anchorAttrs name = [ Html.href (maybe "" id mmod ++ "#" ++ ident) , Html.theclass "varid-reference" ] From git at git.haskell.org Wed Jul 8 08:40:05 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:40:05 +0000 (UTC) Subject: [commit: haddock] master: Implement go-to-definition mechanism for local bindings. (21984e4) Message-ID: <20150708084005.3CE483A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/21984e4cfcc076ce8cbee934028a1b37aaca930b >--------------------------------------------------------------- commit 21984e4cfcc076ce8cbee934028a1b37aaca930b Author: ?ukasz Hanuszczak Date: Mon Jun 8 00:54:58 2015 +0200 Implement go-to-definition mechanism for local bindings. >--------------------------------------------------------------- 21984e4cfcc076ce8cbee934028a1b37aaca930b .../src/Haddock/Backends/Hyperlinker/Renderer.hs | 30 +++++++++++++++++----- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs index 57851c2..995e24e 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs @@ -5,6 +5,7 @@ import Haddock.Backends.Hyperlinker.Ast import qualified GHC import qualified Name as GHC +import qualified Unique as GHC import Data.List import Data.Monoid @@ -37,7 +38,7 @@ richToken (RichToken tok Nothing) = where attrs = [ multiclass . tokenStyle . tkType $ tok ] richToken (RichToken tok (Just det)) = - Html.anchor content ! (anchorAttrs . rtkName) det + internalAnchor det . hyperlink det $ content where content = tokenSpan tok ! [ multiclass style] style = (tokenStyle . tkType) tok ++ (richTokenStyle . rtkType) det @@ -48,7 +49,7 @@ tokenSpan = Html.thespan . Html.toHtml . tkValue richTokenStyle :: RichTokenType -> [StyleClass] richTokenStyle RtkVar = ["hs-var"] richTokenStyle RtkType = ["hs-type"] -richTokenStyle RtkBind = ["hs-bind"] +richTokenStyle RtkBind = [] tokenStyle :: TokenType -> [StyleClass] tokenStyle TkIdentifier = ["hs-identifier"] @@ -68,11 +69,26 @@ tokenStyle TkUnknown = [] multiclass :: [StyleClass] -> HtmlAttr multiclass = Html.theclass . intercalate " " -anchorAttrs :: GHC.Name -> [HtmlAttr] -anchorAttrs name = - [ Html.href (maybe "" id mmod ++ "#" ++ ident) - , Html.theclass "varid-reference" - ] +internalAnchor :: TokenDetails -> Html -> Html +internalAnchor (TokenDetails RtkBind name) content = + Html.anchor content ! [ Html.name $ internalAnchorIdent name ] +internalAnchor _ content = content + +internalAnchorIdent :: GHC.Name -> String +internalAnchorIdent = ("local-" ++) . show . GHC.getKey . GHC.nameUnique + +hyperlink :: TokenDetails -> Html -> Html +hyperlink (TokenDetails _ name) = if GHC.isInternalName name + then internalHyperlink name + else externalHyperlink name + +internalHyperlink :: GHC.Name -> Html -> Html +internalHyperlink name content = + Html.anchor content ! [ Html.href $ "#" ++ internalAnchorIdent name ] + +externalHyperlink :: GHC.Name -> Html -> Html +externalHyperlink name content = + Html.anchor content ! [ Html.href $ maybe "" id mmod ++ "#" ++ ident ] where mmod = GHC.moduleNameString . GHC.moduleName <$> GHC.nameModule_maybe name ident = GHC.occNameString . GHC.nameOccName $ name From git at git.haskell.org Wed Jul 8 08:40:07 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:40:07 +0000 (UTC) Subject: [commit: haddock] master: Add support for binding token recognition. (7065693) Message-ID: <20150708084007.4B3E23A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/70656933ca6935bde0a00310f37440e02c3f21ff >--------------------------------------------------------------- commit 70656933ca6935bde0a00310f37440e02c3f21ff Author: ?ukasz Hanuszczak Date: Mon Jun 8 00:13:12 2015 +0200 Add support for binding token recognition. >--------------------------------------------------------------- 70656933ca6935bde0a00310f37440e02c3f21ff haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs | 20 +++++++++++++++++++- .../src/Haddock/Backends/Hyperlinker/Renderer.hs | 1 + 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs index 0ccf010..19ebbe7 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs @@ -1,4 +1,5 @@ {-# LANGUAGE RankNTypes #-} +{-# LANGUAGE ScopedTypeVariables #-} module Haddock.Backends.Hyperlinker.Ast ( enrich @@ -26,6 +27,7 @@ data TokenDetails = TokenDetails data RichTokenType = RtkVar | RtkType + | RtkBind enrich :: GHC.RenamedSource -> [Token] -> [RichToken] enrich src = @@ -34,7 +36,7 @@ enrich src = , rtkDetails = lookupBySpan (tkSpan token) detailsMap } where - detailsMap = variables src ++ types src + detailsMap = variables src ++ types src ++ binds src type DetailsMap = [(GHC.SrcSpan, TokenDetails)] @@ -45,6 +47,9 @@ everything :: (r -> r -> r) -> (forall a. Data a => a -> r) -> (forall a. Data a => a -> r) everything k f x = foldl k (f x) (gmapQ (everything k f) x) +combine :: Alternative f => (forall a. Data a => a -> f r) -> (forall a. Data a => a -> f r) -> (forall a. Data a => a -> f r) +combine f g x = f x <|> g x + variables :: GHC.RenamedSource -> DetailsMap variables = everything (<|>) var @@ -63,6 +68,19 @@ types = pure (sspan, TokenDetails RtkType name) _ -> empty +binds :: GHC.RenamedSource -> DetailsMap +binds = + everything (<|>) (fun `combine` pat) + where + fun term = case cast term of + (Just (GHC.FunBind (GHC.L sspan name) _ _ _ _ _ :: GHC.HsBind GHC.Name)) -> + pure (sspan, TokenDetails RtkBind name) + _ -> empty + pat term = case cast term of + (Just (GHC.L sspan (GHC.VarPat name))) -> + pure (sspan, TokenDetails RtkBind name) + _ -> empty + matches :: Span -> GHC.SrcSpan -> Bool matches tspan (GHC.RealSrcSpan aspan) | rs && cs && re && ce = True diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs index c2bca43..57851c2 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs @@ -48,6 +48,7 @@ tokenSpan = Html.thespan . Html.toHtml . tkValue richTokenStyle :: RichTokenType -> [StyleClass] richTokenStyle RtkVar = ["hs-var"] richTokenStyle RtkType = ["hs-type"] +richTokenStyle RtkBind = ["hs-bind"] tokenStyle :: TokenType -> [StyleClass] tokenStyle TkIdentifier = ["hs-identifier"] From git at git.haskell.org Wed Jul 8 08:40:09 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:40:09 +0000 (UTC) Subject: [commit: haddock] master: Fix comment recognition in Haskell source parser. (ffd0e80) Message-ID: <20150708084009.5485A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/ffd0e8028f15f3616f1b3eaaf98459c0c75c6313 >--------------------------------------------------------------- commit ffd0e8028f15f3616f1b3eaaf98459c0c75c6313 Author: ?ukasz Hanuszczak Date: Fri Jun 5 14:56:59 2015 +0200 Fix comment recognition in Haskell source parser. >--------------------------------------------------------------- ffd0e8028f15f3616f1b3eaaf98459c0c75c6313 haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs index 9d58728..29edb4c 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs @@ -90,6 +90,9 @@ tokenize = } classify :: String -> TokenType +classify str + | "--" `isPrefixOf` str = TkComment + | "{-" `isPrefixOf` str = TkComment classify (c:_) | isSpace c = TkSpace | isDigit c = TkNumber @@ -101,8 +104,6 @@ classify str | str `elem` keywords = TkKeyword | str `elem` glyphs = TkGlyph | all (`elem` symbols) str = TkOperator - | "--" `isPrefixOf` str = TkComment - | "{-" `isPrefixOf` str = TkComment | isIdentifier str = TkIdentifier | otherwise = TkUnknown From git at git.haskell.org Wed Jul 8 08:40:11 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:40:11 +0000 (UTC) Subject: [commit: haddock] master: Create scaffolding of module for associating tokens with AST names. (d275f87) Message-ID: <20150708084011.663CD3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/d275f87c4cfa1e8da042f70659331121afa9a15c >--------------------------------------------------------------- commit d275f87c4cfa1e8da042f70659331121afa9a15c Author: ?ukasz Hanuszczak Date: Sat Jun 6 19:27:37 2015 +0200 Create scaffolding of module for associating tokens with AST names. >--------------------------------------------------------------- d275f87c4cfa1e8da042f70659331121afa9a15c haddock-api/haddock-api.cabal | 1 + haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/haddock-api/haddock-api.cabal b/haddock-api/haddock-api.cabal index 6c6dc81..109e5f9 100644 --- a/haddock-api/haddock-api.cabal +++ b/haddock-api/haddock-api.cabal @@ -59,6 +59,7 @@ library Documentation.Haddock Haddock.Backends.Hyperlinker.Parser Haddock.Backends.Hyperlinker.Renderer + Haddock.Backends.Hyperlinker.Ast other-modules: Haddock diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs new file mode 100644 index 0000000..abd3ca2 --- /dev/null +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs @@ -0,0 +1,20 @@ +module Haddock.Backends.Hyperlinker.Ast where + +import qualified GHC + +import Haddock.Backends.Hyperlinker.Parser + +data RichToken = RichToken + { rtkToken :: Token + , rtkName :: Maybe GHC.Name + } + +enrich :: GHC.RenamedSource -> [Token] -> [RichToken] +enrich src = + map $ \token -> RichToken + { rtkToken = token + , rtkName = lookupName src $ tkSpan token + } + +lookupName :: GHC.RenamedSource -> Span -> Maybe GHC.Name +lookupName = undefined From git at git.haskell.org Wed Jul 8 08:40:13 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:40:13 +0000 (UTC) Subject: [commit: haddock] master: Fix weird hyperlinking of parenthesized operators. (b31513d) Message-ID: <20150708084013.73F193A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/b31513dbacb48102b4c5d2fd6de1982161d81fae >--------------------------------------------------------------- commit b31513dbacb48102b4c5d2fd6de1982161d81fae Author: ?ukasz Hanuszczak Date: Mon Jun 8 15:16:06 2015 +0200 Fix weird hyperlinking of parenthesized operators. >--------------------------------------------------------------- b31513dbacb48102b4c5d2fd6de1982161d81fae haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs | 7 ++++++- haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs index 05d6a52..2749096 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs @@ -33,7 +33,7 @@ enrich :: GHC.RenamedSource -> [Token] -> [RichToken] enrich src = map $ \token -> RichToken { rtkToken = token - , rtkDetails = lookupBySpan (tkSpan token) detailsMap + , rtkDetails = enrichToken token detailsMap } where detailsMap = concat @@ -45,6 +45,11 @@ enrich src = type DetailsMap = [(GHC.SrcSpan, TokenDetails)] +enrichToken :: Token -> DetailsMap -> Maybe TokenDetails +enrichToken (Token typ _ spn) dm + | typ `elem` [TkIdentifier, TkOperator] = lookupBySpan spn dm +enrichToken _ _ = Nothing + lookupBySpan :: Span -> DetailsMap -> Maybe TokenDetails lookupBySpan tspan = listToMaybe . map snd . filter (matches tspan . fst) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs index 0e1ad5b..70a6927 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs @@ -37,6 +37,7 @@ data TokenType | TkCpp | TkPragma | TkUnknown + deriving (Eq) parse :: String -> [Token] parse = tokenize . tag . chunk From git at git.haskell.org Wed Jul 8 08:40:15 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:40:15 +0000 (UTC) Subject: [commit: haddock] master: Fix span matching to allow parenthesized operators hyperlinking. (fab61bb) Message-ID: <20150708084015.7E1F03A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/fab61bb80c2d8059e91aece7677cf349cd34a8db >--------------------------------------------------------------- commit fab61bb80c2d8059e91aece7677cf349cd34a8db Author: ?ukasz Hanuszczak Date: Mon Jun 8 15:05:35 2015 +0200 Fix span matching to allow parenthesized operators hyperlinking. >--------------------------------------------------------------- fab61bb80c2d8059e91aece7677cf349cd34a8db haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs index 2325aa2..05d6a52 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs @@ -101,10 +101,10 @@ imports = matches :: Span -> GHC.SrcSpan -> Bool matches tspan (GHC.RealSrcSpan aspan) - | rs && cs && re && ce = True + | saspan <= stspan && etspan <= easpan = True where - rs = (posRow . spStart) tspan == GHC.srcSpanStartLine aspan - cs = (posCol . spStart) tspan == GHC.srcSpanStartCol aspan - re = (posRow . spEnd) tspan == GHC.srcSpanEndLine aspan - ce = (posCol . spEnd) tspan == GHC.srcSpanEndCol aspan + stspan = (posRow . spStart $ tspan, posCol . spStart $ tspan) + etspan = (posRow . spEnd $ tspan, posCol . spEnd $ tspan) + saspan = (GHC.srcSpanStartLine aspan, GHC.srcSpanStartCol aspan) + easpan = (GHC.srcSpanEndLine aspan, GHC.srcSpanEndCol aspan) matches _ _ = False From git at git.haskell.org Wed Jul 8 08:40:17 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:40:17 +0000 (UTC) Subject: [commit: haddock] master: Add support for parsing C preprocessor macros. (61942ce) Message-ID: <20150708084017.8970D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/61942ce564edcb3c0a64051042c8ed850f2090bd >--------------------------------------------------------------- commit 61942ce564edcb3c0a64051042c8ed850f2090bd Author: ?ukasz Hanuszczak Date: Thu Jun 18 15:19:59 2015 +0200 Add support for parsing C preprocessor macros. >--------------------------------------------------------------- 61942ce564edcb3c0a64051042c8ed850f2090bd .../src/Haddock/Backends/Hyperlinker/Parser.hs | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs index fa5a58b..7f40816 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs @@ -6,6 +6,7 @@ module Haddock.Backends.Hyperlinker.Parser import Data.Char import Data.List +import Data.Maybe data Token = Token { tkType :: TokenType @@ -45,14 +46,15 @@ parse = tokenize . tag . chunk chunk :: String -> [String] chunk [] = [] chunk str@(c:_) - | isSpace c = chunk' $ span isSpace str + | isSpace c = + let (space, mcpp, rest) = spanSpaceOrCpp str + in [space] ++ maybeToList mcpp ++ chunk rest chunk str | "--" `isPrefixOf` str = chunk' $ spanToNewline str | "{-" `isPrefixOf` str = chunk' $ chunkComment 0 str | otherwise = chunk' $ head $ lex str - -chunk' :: (String, String) -> [String] -chunk' (c, rest) = c:(chunk rest) + where + chunk' (c, rest) = c:(chunk rest) spanToNewline :: String -> (String, String) spanToNewline [] = ([], []) @@ -64,6 +66,16 @@ spanToNewline (c:str) = let (str', rest) = spanToNewline str in (c:str', rest) +spanSpaceOrCpp :: String -> (String, Maybe String, String) +spanSpaceOrCpp ('\n':'#':str) = + let (str', rest) = spanToNewline str + in ("\n", Just $ '#':str', rest) +spanSpaceOrCpp (c:str') + | isSpace c = + let (space, mcpp, rest) = spanSpaceOrCpp str' + in (c:space, mcpp, rest) +spanSpaceOrCpp str = ("", Nothing, str) + chunkComment :: Int -> String -> (String, String) chunkComment _ [] = ("", "") chunkComment depth ('{':'-':str) = From git at git.haskell.org Wed Jul 8 08:40:19 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:40:19 +0000 (UTC) Subject: [commit: haddock] master: Extend module interface with rich source token stream field. (3eb96a6) Message-ID: <20150708084019.98D253A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/3eb96a6bbc1f61b81c20df882e243c4d9f4a9404 >--------------------------------------------------------------- commit 3eb96a6bbc1f61b81c20df882e243c4d9f4a9404 Author: ?ukasz Hanuszczak Date: Mon Jun 22 12:51:49 2015 +0200 Extend module interface with rich source token stream field. >--------------------------------------------------------------- 3eb96a6bbc1f61b81c20df882e243c4d9f4a9404 haddock-api/src/Haddock/Interface/Create.hs | 1 + haddock-api/src/Haddock/Types.hs | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/haddock-api/src/Haddock/Interface/Create.hs b/haddock-api/src/Haddock/Interface/Create.hs index 7491a01..63d4436 100644 --- a/haddock-api/src/Haddock/Interface/Create.hs +++ b/haddock-api/src/Haddock/Interface/Create.hs @@ -145,6 +145,7 @@ createInterface tm flags modMap instIfaceMap = do , ifaceFamInstances = fam_instances , ifaceHaddockCoverage = coverage , ifaceWarningMap = warningMap + , ifaceTokenizedSrc = Nothing } mkAliasMap :: DynFlags -> Maybe RenamedSource -> M.Map Module ModuleName diff --git a/haddock-api/src/Haddock/Types.hs b/haddock-api/src/Haddock/Types.hs index 1499509..fbb5f44 100644 --- a/haddock-api/src/Haddock/Types.hs +++ b/haddock-api/src/Haddock/Types.hs @@ -35,6 +35,7 @@ import DynFlags (ExtensionFlag, Language) import OccName import Outputable import Control.Monad (ap) +import Haddock.Backends.Hyperlinker.Ast ----------------------------------------------------------------------------- -- * Convenient synonyms @@ -125,6 +126,10 @@ data Interface = Interface -- | Warnings for things defined in this module. , ifaceWarningMap :: !WarningMap + + -- | Tokenized source code of module (avaliable if Haddock is invoked with + -- source generation flag). + , ifaceTokenizedSrc :: !(Maybe [RichToken]) } type WarningMap = Map Name (Doc Name) From git at git.haskell.org Wed Jul 8 08:40:21 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:40:21 +0000 (UTC) Subject: [commit: haddock] master: Fix external anchors to contain HTML file extension. (1064953) Message-ID: <20150708084021.A269E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/1064953c6590c05303c6cbd2230b9e13d3ba1376 >--------------------------------------------------------------- commit 1064953c6590c05303c6cbd2230b9e13d3ba1376 Author: ?ukasz Hanuszczak Date: Fri Jun 12 10:57:30 2015 +0200 Fix external anchors to contain HTML file extension. >--------------------------------------------------------------- 1064953c6590c05303c6cbd2230b9e13d3ba1376 haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs index b7cc5ae..99a0f33 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs @@ -96,7 +96,7 @@ internalHyperlink name content = externalHyperlink :: GHC.Name -> Html -> Html externalHyperlink name content = - Html.anchor content ! [ Html.href $ maybe "" id mmod ++ "#" ++ ident ] + Html.anchor content ! [ Html.href $ maybe "" id mmod ++ ".html#" ++ ident ] where mmod = GHC.moduleNameString . GHC.moduleName <$> GHC.nameModule_maybe name ident = externalAnchorIdent name From git at git.haskell.org Wed Jul 8 08:40:23 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:40:23 +0000 (UTC) Subject: [commit: haddock] master: Fix issue with hyperlink highlight styling in Chrome browser. (671e7dc) Message-ID: <20150708084023.AE5523A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/671e7dc60266d1e0fdabd34956719961c1333fb3 >--------------------------------------------------------------- commit 671e7dc60266d1e0fdabd34956719961c1333fb3 Author: ?ukasz Hanuszczak Date: Mon Jun 29 20:33:18 2015 +0200 Fix issue with hyperlink highlight styling in Chrome browser. >--------------------------------------------------------------- 671e7dc60266d1e0fdabd34956719961c1333fb3 haddock-api/resources/html/highlight.js | 57 ++++++++------------------------ haddock-api/resources/html/solarized.css | 2 +- 2 files changed, 15 insertions(+), 44 deletions(-) diff --git a/haddock-api/resources/html/highlight.js b/haddock-api/resources/html/highlight.js index a538fea..1e903bd 100644 --- a/haddock-api/resources/html/highlight.js +++ b/haddock-api/resources/html/highlight.js @@ -1,48 +1,19 @@ -var styleForRule = function (rule) { - var sheets = document.styleSheets; - for (var s = 0; s < sheets.length; s++) { - var rules = sheets[s].cssRules; - if (rules === null) { - return null; - } +var highlight = function (on) { + return function () { + var links = document.getElementsByTagName('a'); + for (var i = 0; i < links.length; i++) { + var that = links[i]; - for (var r = 0; r < rules.length; r++) { - if (rules[r].selectorText == rule) { - return rules[r].style; + if (this.href != that.href) { + continue; } - } - } -}; - -var highlight = function () { - /* - * Chrome for security reasons disallows to read .cssRules property. - * So, we are forced to pick some color and set it as a highlight. - */ - var style = styleForRule("a:hover"); - var color = style !== null ? style["background-color"] : "#808080"; - - var links = document.getElementsByTagName('a'); - for (var i = 0; i < links.length; i++) { - var that = links[i]; - if (this.href == that.href) { - that.style["background-color"] = color; - } - } -}; -/* - * I have no idea what is the proper antonym for "highlight" in this - * context. "Diminish"? "Unhighlight"? "Lowlight" sounds ridiculously - * so I like it. - */ -var lowlight = function () { - var links = document.getElementsByTagName('a'); - for (var i = 0; i < links.length; i++) { - var that = links[i]; - if (this.href == that.href) { - that.style["background-color"] = ""; + if (on) { + that.classList.add("hover-highlight"); + } else { + that.classList.remove("hover-highlight"); + } } } }; @@ -50,7 +21,7 @@ var lowlight = function () { window.onload = function () { var links = document.getElementsByTagName('a'); for (var i = 0; i < links.length; i++) { - links[i].onmouseover = highlight; - links[i].onmouseout = lowlight; + links[i].onmouseover = highlight(true); + links[i].onmouseout = highlight(false); } }; diff --git a/haddock-api/resources/html/solarized.css b/haddock-api/resources/html/solarized.css index e4bff38..e83dc5e 100644 --- a/haddock-api/resources/html/solarized.css +++ b/haddock-api/resources/html/solarized.css @@ -50,6 +50,6 @@ a:link, a:visited { border-bottom: 1px solid #eee8d5; } -a:hover { +a:hover, a.hover-highlight { background-color: #eee8d5; } From git at git.haskell.org Wed Jul 8 08:40:25 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:40:25 +0000 (UTC) Subject: [commit: haddock] master: Fix parsing of single line comments with broken up newlines. (ebd60c5) Message-ID: <20150708084025.BAF443A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/ebd60c5cd0c3642c2d5542c0e126be0a4ec111d9 >--------------------------------------------------------------- commit ebd60c5cd0c3642c2d5542c0e126be0a4ec111d9 Author: ?ukasz Hanuszczak Date: Wed Jun 17 23:43:31 2015 +0200 Fix parsing of single line comments with broken up newlines. >--------------------------------------------------------------- ebd60c5cd0c3642c2d5542c0e126be0a4ec111d9 haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs index 70a6927..3ecfc7e 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs @@ -47,13 +47,23 @@ chunk [] = [] chunk str@(c:_) | isSpace c = chunk' $ span isSpace str chunk str - | "--" `isPrefixOf` str = chunk' $ span (not . (== '\n')) str + | "--" `isPrefixOf` str = chunk' $ spanToNewline str | "{-" `isPrefixOf` str = chunk' $ chunkComment 0 str | otherwise = chunk' $ head $ lex str chunk' :: (String, String) -> [String] chunk' (c, rest) = c:(chunk rest) +spanToNewline :: String -> (String, String) +spanToNewline [] = ([], []) +spanToNewline ('\\':'\n':str) = + let (str', rest) = spanToNewline str + in ('\\':'\n':str', rest) +spanToNewline ('\n':str) = ("\n", str) +spanToNewline (c:str) = + let (str', rest) = spanToNewline str + in (c:str', rest) + chunkComment :: Int -> String -> (String, String) chunkComment _ [] = ("", "") chunkComment depth ('{':'-':str) = From git at git.haskell.org Wed Jul 8 08:40:27 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:40:27 +0000 (UTC) Subject: [commit: haddock] master: Refactor the way AST names are handled within detailed tokens. (60db149) Message-ID: <20150708084027.C65473A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/60db14903e01f4c26f179230c7b6190a7b99fb51 >--------------------------------------------------------------- commit 60db14903e01f4c26f179230c7b6190a7b99fb51 Author: ?ukasz Hanuszczak Date: Wed Jun 17 21:49:46 2015 +0200 Refactor the way AST names are handled within detailed tokens. >--------------------------------------------------------------- 60db14903e01f4c26f179230c7b6190a7b99fb51 .../src/Haddock/Backends/Hyperlinker/Ast.hs | 37 +++++++++++----------- .../src/Haddock/Backends/Hyperlinker/Renderer.hs | 17 ++++++---- 2 files changed, 29 insertions(+), 25 deletions(-) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs index cb9508e..3c07ff3 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs @@ -3,7 +3,7 @@ module Haddock.Backends.Hyperlinker.Ast ( enrich - , RichToken(..), RichTokenType(..), TokenDetails(..) + , RichToken(..), TokenDetails(..), rtkName ) where import Haddock.Backends.Hyperlinker.Parser @@ -19,16 +19,17 @@ data RichToken = RichToken , rtkDetails :: Maybe TokenDetails } -data TokenDetails = TokenDetails - { rtkType :: RichTokenType - , rtkName :: GHC.Name - } +data TokenDetails + = RtkVar GHC.Name + | RtkType GHC.Name + | RtkBind GHC.Name + | RtkDecl GHC.Name -data RichTokenType - = RtkVar - | RtkType - | RtkBind - | RtkDecl +rtkName :: TokenDetails -> GHC.Name +rtkName (RtkVar name) = name +rtkName (RtkType name) = name +rtkName (RtkBind name) = name +rtkName (RtkDecl name) = name enrich :: GHC.RenamedSource -> [Token] -> [RichToken] enrich src = @@ -68,7 +69,7 @@ variables = where var term = case cast term of (Just (GHC.L sspan (GHC.HsVar name))) -> - pure (sspan, TokenDetails RtkVar name) + pure (sspan, RtkVar name) _ -> empty types :: GHC.RenamedSource -> DetailsMap @@ -77,7 +78,7 @@ types = where ty term = case cast term of (Just (GHC.L sspan (GHC.HsTyVar name))) -> - pure (sspan, TokenDetails RtkType name) + pure (sspan, RtkType name) _ -> empty binds :: GHC.RenamedSource -> DetailsMap @@ -86,11 +87,11 @@ binds = where fun term = case cast term of (Just (GHC.FunBind (GHC.L sspan name) _ _ _ _ _ :: GHC.HsBind GHC.Name)) -> - pure (sspan, TokenDetails RtkBind name) + pure (sspan, RtkBind name) _ -> empty pat term = case cast term of (Just (GHC.L sspan (GHC.VarPat name))) -> - pure (sspan, TokenDetails RtkBind name) + pure (sspan, RtkBind name) _ -> empty decls :: GHC.RenamedSource -> DetailsMap @@ -101,10 +102,10 @@ decls (group, _, _, _) = concatMap ($ group) where typ (GHC.L _ t) = let (GHC.L sspan name) = GHC.tcdLName t - in (sspan, TokenDetails RtkDecl name) + in (sspan, RtkDecl name) fun term = case cast term of (Just (GHC.FunBind (GHC.L sspan name) _ _ _ _ _ :: GHC.HsBind GHC.Name)) - | GHC.isExternalName name -> pure (sspan, TokenDetails RtkDecl name) + | GHC.isExternalName name -> pure (sspan, RtkDecl name) _ -> empty imports :: GHC.RenamedSource -> DetailsMap @@ -117,8 +118,8 @@ imports = (Just (GHC.IEThingAll t)) -> pure $ typ t (Just (GHC.IEThingWith t vs)) -> [typ t] ++ map var vs _ -> empty - typ (GHC.L sspan name) = (sspan, TokenDetails RtkType name) - var (GHC.L sspan name) = (sspan, TokenDetails RtkVar name) + typ (GHC.L sspan name) = (sspan, RtkType name) + var (GHC.L sspan name) = (sspan, RtkVar name) matches :: Span -> GHC.SrcSpan -> Bool matches tspan (GHC.RealSrcSpan aspan) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs index 99a0f33..e08d897 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs @@ -41,14 +41,14 @@ richToken (RichToken tok (Just det)) = externalAnchor det . internalAnchor det . hyperlink det $ content where content = tokenSpan tok ! [ multiclass style] - style = (tokenStyle . tkType) tok ++ (richTokenStyle . rtkType) det + style = (tokenStyle . tkType) tok ++ richTokenStyle det tokenSpan :: Token -> Html tokenSpan = Html.thespan . Html.toHtml . tkValue -richTokenStyle :: RichTokenType -> [StyleClass] -richTokenStyle RtkVar = ["hs-var"] -richTokenStyle RtkType = ["hs-type"] +richTokenStyle :: TokenDetails -> [StyleClass] +richTokenStyle (RtkVar _) = ["hs-var"] +richTokenStyle (RtkType _) = ["hs-type"] richTokenStyle _ = [] tokenStyle :: TokenType -> [StyleClass] @@ -70,12 +70,12 @@ multiclass :: [StyleClass] -> HtmlAttr multiclass = Html.theclass . intercalate " " externalAnchor :: TokenDetails -> Html -> Html -externalAnchor (TokenDetails RtkDecl name) content = +externalAnchor (RtkDecl name) content = Html.anchor content ! [ Html.name $ externalAnchorIdent name ] externalAnchor _ content = content internalAnchor :: TokenDetails -> Html -> Html -internalAnchor (TokenDetails RtkBind name) content = +internalAnchor (RtkBind name) content = Html.anchor content ! [ Html.name $ internalAnchorIdent name ] internalAnchor _ content = content @@ -86,9 +86,12 @@ internalAnchorIdent :: GHC.Name -> String internalAnchorIdent = ("local-" ++) . show . GHC.getKey . GHC.nameUnique hyperlink :: TokenDetails -> Html -> Html -hyperlink (TokenDetails _ name) = if GHC.isInternalName name +hyperlink details = + if GHC.isInternalName $ name then internalHyperlink name else externalHyperlink name + where + name = rtkName details internalHyperlink :: GHC.Name -> Html -> Html internalHyperlink name content = From git at git.haskell.org Wed Jul 8 08:40:29 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:40:29 +0000 (UTC) Subject: [commit: haddock] master: Make hyperlinker generate correct anchors for data constructors. (5a86381) Message-ID: <20150708084029.D21B63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/5a86381db3d73b4b68fdaae5c150a84e91e80c09 >--------------------------------------------------------------- commit 5a86381db3d73b4b68fdaae5c150a84e91e80c09 Author: ?ukasz Hanuszczak Date: Mon Jun 29 16:10:03 2015 +0200 Make hyperlinker generate correct anchors for data constructors. >--------------------------------------------------------------- 5a86381db3d73b4b68fdaae5c150a84e91e80c09 haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs index 275f10e..c32bb72 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs @@ -107,17 +107,22 @@ binds = -- | Obtain details map for top-level declarations. decls :: GHC.RenamedSource -> DetailsMap decls (group, _, _, _) = concatMap ($ group) - [ map typ . concat . map GHC.group_tyclds . GHC.hs_tyclds + [ concat . map typ . concat . map GHC.group_tyclds . GHC.hs_tyclds , everything (<|>) fun ] where - typ (GHC.L _ t) = - let (GHC.L sspan name) = GHC.tcdLName t - in (sspan, RtkDecl name) + typ (GHC.L _ t) = case t of + GHC.DataDecl (GHC.L sspan name) _ defn _ -> + [(sspan, RtkDecl name)] ++ concatMap con (GHC.dd_cons defn) + _ -> + let (GHC.L sspan name) = GHC.tcdLName t + in pure (sspan, RtkDecl name) fun term = case cast term of (Just (GHC.FunBind (GHC.L sspan name) _ _ _ _ _ :: GHC.HsBind GHC.Name)) | GHC.isExternalName name -> pure (sspan, RtkDecl name) _ -> empty + con (GHC.L _ t) = flip map (GHC.con_names t) $ + \(GHC.L sspan name) -> (sspan, RtkDecl name) -- | Obtain details map for import declarations. -- From git at git.haskell.org Wed Jul 8 08:40:31 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:40:31 +0000 (UTC) Subject: [commit: haddock] master: Create module with hyperlinker utility functions. (844c09d) Message-ID: <20150708084031.E376C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/844c09d0c1d724e0f0f0698654f2f85f5f58be19 >--------------------------------------------------------------- commit 844c09d0c1d724e0f0f0698654f2f85f5f58be19 Author: ?ukasz Hanuszczak Date: Fri Jun 26 22:24:57 2015 +0200 Create module with hyperlinker utility functions. >--------------------------------------------------------------- 844c09d0c1d724e0f0f0698654f2f85f5f58be19 haddock-api/haddock-api.cabal | 1 + haddock-api/src/Haddock/Backends/Hyperlinker/Utils.hs | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/haddock-api/haddock-api.cabal b/haddock-api/haddock-api.cabal index 216627c..7670f88 100644 --- a/haddock-api/haddock-api.cabal +++ b/haddock-api/haddock-api.cabal @@ -85,6 +85,7 @@ library Haddock.Backends.HaddockDB Haddock.Backends.Hoogle Haddock.Backends.Hyperlinker + Haddock.Backends.Hyperlinker.Utils Haddock.ModuleTree Haddock.Types Haddock.Doc diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Utils.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Utils.hs new file mode 100644 index 0000000..25ed942 --- /dev/null +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Utils.hs @@ -0,0 +1,18 @@ +module Haddock.Backends.Hyperlinker.Utils + ( srcModUrl + , srcNameUrlMap + ) where + +import Haddock.Utils +import Haddock.Backends.Xhtml.Types + +import GHC + +import Data.Maybe +import Data.Map (Map) + +srcModUrl :: SourceURLs -> String +srcModUrl (_, mModUrl, _, _) = fromMaybe defaultModuleSourceUrl mModUrl + +srcNameUrlMap :: SourceURLs -> Map PackageKey FilePath +srcNameUrlMap (_, _, nameUrlMap, _) = nameUrlMap From git at git.haskell.org Wed Jul 8 08:40:33 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:40:33 +0000 (UTC) Subject: [commit: haddock] master: Implement workaround for Chrome highlighting issues. (6cf5e45) Message-ID: <20150708084033.F02A53A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/6cf5e45135ad48f140a76054b38e13eb83491d2a >--------------------------------------------------------------- commit 6cf5e45135ad48f140a76054b38e13eb83491d2a Author: ?ukasz Hanuszczak Date: Sun Jun 28 23:13:05 2015 +0200 Implement workaround for Chrome highlighting issues. >--------------------------------------------------------------- 6cf5e45135ad48f140a76054b38e13eb83491d2a haddock-api/resources/html/highlight.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/haddock-api/resources/html/highlight.js b/haddock-api/resources/html/highlight.js index 639cf5d..a538fea 100644 --- a/haddock-api/resources/html/highlight.js +++ b/haddock-api/resources/html/highlight.js @@ -3,6 +3,10 @@ var styleForRule = function (rule) { var sheets = document.styleSheets; for (var s = 0; s < sheets.length; s++) { var rules = sheets[s].cssRules; + if (rules === null) { + return null; + } + for (var r = 0; r < rules.length; r++) { if (rules[r].selectorText == rule) { return rules[r].style; @@ -12,7 +16,13 @@ var styleForRule = function (rule) { }; var highlight = function () { - var color = styleForRule("a:hover")["background-color"]; + /* + * Chrome for security reasons disallows to read .cssRules property. + * So, we are forced to pick some color and set it as a highlight. + */ + var style = styleForRule("a:hover"); + var color = style !== null ? style["background-color"] : "#808080"; + var links = document.getElementsByTagName('a'); for (var i = 0; i < links.length; i++) { var that = links[i]; From git at git.haskell.org Wed Jul 8 08:40:36 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:40:36 +0000 (UTC) Subject: [commit: haddock] master: Add support for type declaration anchors. (162b02e) Message-ID: <20150708084036.09C163A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/162b02ed6f50709ea203bf7706eee5804e455419 >--------------------------------------------------------------- commit 162b02ed6f50709ea203bf7706eee5804e455419 Author: ?ukasz Hanuszczak Date: Fri Jun 12 01:03:13 2015 +0200 Add support for type declaration anchors. >--------------------------------------------------------------- 162b02ed6f50709ea203bf7706eee5804e455419 haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs | 21 ++++++++++++++++----- .../src/Haddock/Backends/Hyperlinker/Renderer.hs | 14 +++++++++++--- 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs index 2749096..39bbacf 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs @@ -28,6 +28,7 @@ data RichTokenType = RtkVar | RtkType | RtkBind + | RtkDecl enrich :: GHC.RenamedSource -> [Token] -> [RichToken] enrich src = @@ -36,11 +37,12 @@ enrich src = , rtkDetails = enrichToken token detailsMap } where - detailsMap = concat - [ variables src - , types src - , binds src - , imports src + detailsMap = concatMap ($ src) + [ variables + , types + , binds + , imports + , decls ] type DetailsMap = [(GHC.SrcSpan, TokenDetails)] @@ -91,6 +93,15 @@ binds = pure (sspan, TokenDetails RtkBind name) _ -> empty +decls :: GHC.RenamedSource -> DetailsMap +decls (group, _, _, _) = concatMap ($ group) + [ map typ . concat . map GHC.group_tyclds . GHC.hs_tyclds + ] + where + typ (GHC.L _ t) = + let (GHC.L sspan name) = GHC.tcdLName t + in (sspan, TokenDetails RtkDecl name) + imports :: GHC.RenamedSource -> DetailsMap imports = everything (<|>) ie diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs index 995e24e..b7cc5ae 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs @@ -38,7 +38,7 @@ richToken (RichToken tok Nothing) = where attrs = [ multiclass . tokenStyle . tkType $ tok ] richToken (RichToken tok (Just det)) = - internalAnchor det . hyperlink det $ content + externalAnchor det . internalAnchor det . hyperlink det $ content where content = tokenSpan tok ! [ multiclass style] style = (tokenStyle . tkType) tok ++ (richTokenStyle . rtkType) det @@ -49,7 +49,7 @@ tokenSpan = Html.thespan . Html.toHtml . tkValue richTokenStyle :: RichTokenType -> [StyleClass] richTokenStyle RtkVar = ["hs-var"] richTokenStyle RtkType = ["hs-type"] -richTokenStyle RtkBind = [] +richTokenStyle _ = [] tokenStyle :: TokenType -> [StyleClass] tokenStyle TkIdentifier = ["hs-identifier"] @@ -69,11 +69,19 @@ tokenStyle TkUnknown = [] multiclass :: [StyleClass] -> HtmlAttr multiclass = Html.theclass . intercalate " " +externalAnchor :: TokenDetails -> Html -> Html +externalAnchor (TokenDetails RtkDecl name) content = + Html.anchor content ! [ Html.name $ externalAnchorIdent name ] +externalAnchor _ content = content + internalAnchor :: TokenDetails -> Html -> Html internalAnchor (TokenDetails RtkBind name) content = Html.anchor content ! [ Html.name $ internalAnchorIdent name ] internalAnchor _ content = content +externalAnchorIdent :: GHC.Name -> String +externalAnchorIdent = GHC.occNameString . GHC.nameOccName + internalAnchorIdent :: GHC.Name -> String internalAnchorIdent = ("local-" ++) . show . GHC.getKey . GHC.nameUnique @@ -91,4 +99,4 @@ externalHyperlink name content = Html.anchor content ! [ Html.href $ maybe "" id mmod ++ "#" ++ ident ] where mmod = GHC.moduleNameString . GHC.moduleName <$> GHC.nameModule_maybe name - ident = GHC.occNameString . GHC.nameOccName $ name + ident = externalAnchorIdent name From git at git.haskell.org Wed Jul 8 08:40:38 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:40:38 +0000 (UTC) Subject: [commit: haddock] master: Make hyperlinker generate anchors for record field declarations. (46b1520) Message-ID: <20150708084038.156A13A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/46b1520fcc8ef56825bd42ecf1c1fa8ec899ee58 >--------------------------------------------------------------- commit 46b1520fcc8ef56825bd42ecf1c1fa8ec899ee58 Author: ?ukasz Hanuszczak Date: Mon Jun 29 17:33:59 2015 +0200 Make hyperlinker generate anchors for record field declarations. >--------------------------------------------------------------- 46b1520fcc8ef56825bd42ecf1c1fa8ec899ee58 haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs index c32bb72..5efcd2e 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs @@ -112,17 +112,19 @@ decls (group, _, _, _) = concatMap ($ group) ] where typ (GHC.L _ t) = case t of - GHC.DataDecl (GHC.L sspan name) _ defn _ -> - [(sspan, RtkDecl name)] ++ concatMap con (GHC.dd_cons defn) - _ -> - let (GHC.L sspan name) = GHC.tcdLName t - in pure (sspan, RtkDecl name) + GHC.DataDecl name _ defn _ -> + [decl name] ++ concatMap con (GHC.dd_cons defn) + _ -> pure . decl $ GHC.tcdLName t fun term = case cast term of (Just (GHC.FunBind (GHC.L sspan name) _ _ _ _ _ :: GHC.HsBind GHC.Name)) | GHC.isExternalName name -> pure (sspan, RtkDecl name) _ -> empty - con (GHC.L _ t) = flip map (GHC.con_names t) $ - \(GHC.L sspan name) -> (sspan, RtkDecl name) + con (GHC.L _ t) = + map decl (GHC.con_names t) ++ everything (<|>) fld t + fld term = case cast term of + Just field -> map decl $ GHC.cd_fld_names field + Nothing -> empty + decl (GHC.L sspan name) = (sspan, RtkDecl name) -- | Obtain details map for import declarations. -- From git at git.haskell.org Wed Jul 8 08:40:40 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:40:40 +0000 (UTC) Subject: [commit: haddock] master: Create hyperlinker module and plug it into the Haddock pipeline. (62d44cd) Message-ID: <20150708084040.291213A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/62d44cd1d37d83fa93d169c2e5b5b758fcc231d6 >--------------------------------------------------------------- commit 62d44cd1d37d83fa93d169c2e5b5b758fcc231d6 Author: ?ukasz Hanuszczak Date: Mon Jun 22 16:09:54 2015 +0200 Create hyperlinker module and plug it into the Haddock pipeline. >--------------------------------------------------------------- 62d44cd1d37d83fa93d169c2e5b5b758fcc231d6 haddock-api/haddock-api.cabal | 1 + haddock-api/src/Haddock.hs | 4 ++++ haddock-api/src/Haddock/Backends/Hyperlinker.hs | 25 +++++++++++++++++++++++++ haddock.cabal | 1 + 4 files changed, 31 insertions(+) diff --git a/haddock-api/haddock-api.cabal b/haddock-api/haddock-api.cabal index 109e5f9..6ffde97 100644 --- a/haddock-api/haddock-api.cabal +++ b/haddock-api/haddock-api.cabal @@ -82,6 +82,7 @@ library Haddock.Backends.LaTeX Haddock.Backends.HaddockDB Haddock.Backends.Hoogle + Haddock.Backends.Hyperlinker Haddock.ModuleTree Haddock.Types Haddock.Doc diff --git a/haddock-api/src/Haddock.hs b/haddock-api/src/Haddock.hs index 3e58aba..e45456a 100644 --- a/haddock-api/src/Haddock.hs +++ b/haddock-api/src/Haddock.hs @@ -30,6 +30,7 @@ import Haddock.Backends.Xhtml import Haddock.Backends.Xhtml.Themes (getThemes) import Haddock.Backends.LaTeX import Haddock.Backends.Hoogle +import Haddock.Backends.Hyperlinker import Haddock.Interface import Haddock.Parser import Haddock.Types @@ -308,6 +309,9 @@ render dflags flags qual ifaces installedIfaces srcMap = do ppLaTeX title pkgStr visibleIfaces odir (fmap _doc prologue) opt_latex_style libDir + when (Flag_HyperlinkedSource `elem` flags) $ do + ppHyperlinkedSource odir libDir Nothing visibleIfaces + -- | From GHC 7.10, this function has a potential to crash with a -- nasty message such as @expectJust getPackageDetails@ because -- package name and versions can no longer reliably be extracted in diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker.hs b/haddock-api/src/Haddock/Backends/Hyperlinker.hs new file mode 100644 index 0000000..8861947 --- /dev/null +++ b/haddock-api/src/Haddock/Backends/Hyperlinker.hs @@ -0,0 +1,25 @@ +module Haddock.Backends.Hyperlinker (ppHyperlinkedSource) where + +import Haddock.Types +import Haddock.Backends.Hyperlinker.Renderer + +import GHC +import Text.XHtml hiding (()) +import System.Directory +import System.FilePath + +ppHyperlinkedSource :: FilePath -> FilePath -> Maybe FilePath -> [Interface] + -> IO () +ppHyperlinkedSource outdir libdir mstyle ifaces = do + createDirectoryIfMissing True (outdir "src") + mapM_ (ppHyperlinkedModuleSource outdir mstyle) ifaces + +ppHyperlinkedModuleSource :: FilePath -> Maybe FilePath -> Interface -> IO () +ppHyperlinkedModuleSource outdir mstyle iface = case ifaceTokenizedSrc iface of + Just tokens -> writeFile path $ showHtml . render mstyle $ tokens + Nothing -> return () + where + path = outdir "src" moduleSourceFile (ifaceMod iface) + +moduleSourceFile :: Module -> FilePath +moduleSourceFile = (++ ".html") . moduleNameString . moduleName diff --git a/haddock.cabal b/haddock.cabal index ed570f5..0aebefd 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -101,6 +101,7 @@ executable haddock Haddock.Backends.LaTeX Haddock.Backends.HaddockDB Haddock.Backends.Hoogle + Haddock.Backends.Hyperlinker Haddock.ModuleTree Haddock.Types Haddock.Doc From git at git.haskell.org Wed Jul 8 08:40:42 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:40:42 +0000 (UTC) Subject: [commit: haddock] master: Add command line option for generating hyperlinked source. (ce4b560) Message-ID: <20150708084042.340493A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/ce4b5607f84506e5aafd1994e02300c2e3ee475d >--------------------------------------------------------------- commit ce4b5607f84506e5aafd1994e02300c2e3ee475d Author: ?ukasz Hanuszczak Date: Mon Jun 22 12:27:55 2015 +0200 Add command line option for generating hyperlinked source. >--------------------------------------------------------------- ce4b5607f84506e5aafd1994e02300c2e3ee475d haddock-api/src/Haddock/Options.hs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/haddock-api/src/Haddock/Options.hs b/haddock-api/src/Haddock/Options.hs index e847333..c9d5688 100644 --- a/haddock-api/src/Haddock/Options.hs +++ b/haddock-api/src/Haddock/Options.hs @@ -66,6 +66,7 @@ data Flag | Flag_WikiEntityURL String | Flag_LaTeX | Flag_LaTeXStyle String + | Flag_HyperlinkedSource | Flag_Help | Flag_Verbosity String | Flag_Version @@ -116,6 +117,8 @@ options backwardsCompat = Option ['U'] ["use-unicode"] (NoArg Flag_UseUnicode) "use Unicode in HTML output", Option [] ["hoogle"] (NoArg Flag_Hoogle) "output for Hoogle; you may want --package-name and --package-version too", + Option [] ["hyperlinked-source"] (NoArg Flag_HyperlinkedSource) + "generate highlighted and hyperlinked source code (for use with --html)", Option [] ["source-base"] (ReqArg Flag_SourceBaseURL "URL") "URL for a source code link on the contents\nand index pages", Option ['s'] (if backwardsCompat then ["source", "source-module"] else ["source-module"]) From git at git.haskell.org Wed Jul 8 08:40:44 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:40:44 +0000 (UTC) Subject: [commit: haddock] master: Fix bug with improper newline handling. (a7888ae) Message-ID: <20150708084044.3EA553A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/a7888aefa4011d919b887ff31fcf8651af5632be >--------------------------------------------------------------- commit a7888aefa4011d919b887ff31fcf8651af5632be Author: ?ukasz Hanuszczak Date: Thu Jun 18 00:25:56 2015 +0200 Fix bug with improper newline handling. >--------------------------------------------------------------- a7888aefa4011d919b887ff31fcf8651af5632be haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs index 3ecfc7e..bfee4a7 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs @@ -59,7 +59,7 @@ spanToNewline [] = ([], []) spanToNewline ('\\':'\n':str) = let (str', rest) = spanToNewline str in ('\\':'\n':str', rest) -spanToNewline ('\n':str) = ("\n", str) +spanToNewline str@('\n':_) = ("", str) spanToNewline (c:str) = let (str', rest) = spanToNewline str in (c:str', rest) From git at git.haskell.org Wed Jul 8 08:40:46 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:40:46 +0000 (UTC) Subject: [commit: haddock] master: Rewrite source generation to fixed links and directory structure. (ab07020) Message-ID: <20150708084046.511183A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/ab070206d67748232995a262b533957a5a7b9315 >--------------------------------------------------------------- commit ab070206d67748232995a262b533957a5a7b9315 Author: ?ukasz Hanuszczak Date: Sat Jun 27 18:03:56 2015 +0200 Rewrite source generation to fixed links and directory structure. >--------------------------------------------------------------- ab070206d67748232995a262b533957a5a7b9315 haddock-api/src/Haddock.hs | 11 +++-- haddock-api/src/Haddock/Backends/Hyperlinker.hs | 29 +++++------- .../src/Haddock/Backends/Hyperlinker/Renderer.hs | 52 +++++++++------------- .../src/Haddock/Backends/Hyperlinker/Utils.hs | 48 +++++++++++++++----- haddock-api/src/Haddock/Backends/Xhtml/Utils.hs | 14 +++--- haddock-api/src/Haddock/Utils.hs | 8 ---- 6 files changed, 85 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 ab070206d67748232995a262b533957a5a7b9315 From git at git.haskell.org Wed Jul 8 08:40:48 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:40:48 +0000 (UTC) Subject: [commit: haddock] master: Fix issues with escaped newlines in comments. (45cc27f) Message-ID: <20150708084048.57E853A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/45cc27fe79492a7b921574796a7ea8fdac4c5af2 >--------------------------------------------------------------- commit 45cc27fe79492a7b921574796a7ea8fdac4c5af2 Author: ?ukasz Hanuszczak Date: Thu Jun 18 14:29:59 2015 +0200 Fix issues with escaped newlines in comments. >--------------------------------------------------------------- 45cc27fe79492a7b921574796a7ea8fdac4c5af2 haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs index bfee4a7..fa5a58b 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs @@ -82,14 +82,11 @@ tag :: [String] -> [(Span, String)] tag = reverse . snd . foldl aux (Position 1 1, []) where - aux (pos, cs) c = - let pos' = move pos c - in (pos', ((Span pos pos', c):cs)) - move pos str@(c:_) - | isSpace c = foldl move' pos str - move pos str = pos { posCol = posCol pos + length str } - move' pos '\n' = pos { posRow = posRow pos + 1, posCol = 1 } - move' pos _ = pos { posCol = posCol pos + 1 } + aux (pos, cs) str = + let pos' = foldl move pos str + in (pos', (Span pos pos', str):cs) + move pos '\n' = pos { posRow = posRow pos + 1, posCol = 1 } + move pos _ = pos { posCol = posCol pos + 1 } tokenize :: [(Span, String)] -> [Token] tokenize = From git at git.haskell.org Wed Jul 8 08:40:50 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:40:50 +0000 (UTC) Subject: [commit: haddock] master: Implement hyperlinking of imported module names. (a85224a) Message-ID: <20150708084050.629393A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/a85224a68b51b70035446ad8e5565d571c4a10d4 >--------------------------------------------------------------- commit a85224a68b51b70035446ad8e5565d571c4a10d4 Author: ?ukasz Hanuszczak Date: Wed Jun 17 22:22:49 2015 +0200 Implement hyperlinking of imported module names. >--------------------------------------------------------------- a85224a68b51b70035446ad8e5565d571c4a10d4 .../src/Haddock/Backends/Hyperlinker/Ast.hs | 19 +++++++++------ .../src/Haddock/Backends/Hyperlinker/Renderer.hs | 28 +++++++++++++--------- 2 files changed, 29 insertions(+), 18 deletions(-) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs index 3c07ff3..1038995 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs @@ -24,12 +24,14 @@ data TokenDetails | RtkType GHC.Name | RtkBind GHC.Name | RtkDecl GHC.Name + | RtkModule GHC.ModuleName -rtkName :: TokenDetails -> GHC.Name -rtkName (RtkVar name) = name -rtkName (RtkType name) = name -rtkName (RtkBind name) = name -rtkName (RtkDecl name) = name +rtkName :: TokenDetails -> Either GHC.Name GHC.ModuleName +rtkName (RtkVar name) = Left name +rtkName (RtkType name) = Left name +rtkName (RtkBind name) = Left name +rtkName (RtkDecl name) = Left name +rtkName (RtkModule name) = Right name enrich :: GHC.RenamedSource -> [Token] -> [RichToken] enrich src = @@ -109,8 +111,8 @@ decls (group, _, _, _) = concatMap ($ group) _ -> empty imports :: GHC.RenamedSource -> DetailsMap -imports = - everything (<|>) ie +imports src@(_, imps, _, _) = + everything (<|>) ie src ++ map (imp . GHC.unLoc) imps where ie term = case cast term of (Just (GHC.IEVar v)) -> pure $ var v @@ -120,6 +122,9 @@ imports = _ -> empty typ (GHC.L sspan name) = (sspan, RtkType name) var (GHC.L sspan name) = (sspan, RtkVar name) + imp idecl = + let (GHC.L sspan name) = GHC.ideclName idecl + in (sspan, RtkModule name) matches :: Span -> GHC.SrcSpan -> Bool matches tspan (GHC.RealSrcSpan aspan) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs index e08d897..7052475 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs @@ -8,6 +8,7 @@ import qualified Name as GHC import qualified Unique as GHC import Data.List +import Data.Maybe import Data.Monoid import Text.XHtml (Html, HtmlAttr, (!)) @@ -86,20 +87,25 @@ internalAnchorIdent :: GHC.Name -> String internalAnchorIdent = ("local-" ++) . show . GHC.getKey . GHC.nameUnique hyperlink :: TokenDetails -> Html -> Html -hyperlink details = - if GHC.isInternalName $ name - then internalHyperlink name - else externalHyperlink name - where - name = rtkName details +hyperlink details = case rtkName details of + Left name -> + if GHC.isInternalName name + then internalHyperlink name + else externalHyperlink mname (Just name) + where + mname = GHC.moduleName <$> GHC.nameModule_maybe name + Right name -> externalHyperlink (Just name) Nothing internalHyperlink :: GHC.Name -> Html -> Html internalHyperlink name content = Html.anchor content ! [ Html.href $ "#" ++ internalAnchorIdent name ] -externalHyperlink :: GHC.Name -> Html -> Html -externalHyperlink name content = - Html.anchor content ! [ Html.href $ maybe "" id mmod ++ ".html#" ++ ident ] +externalHyperlink :: Maybe GHC.ModuleName -> Maybe GHC.Name -> Html -> Html +externalHyperlink mmname miname content = + Html.anchor content ! [ Html.href $ path ++ anchor ] where - mmod = GHC.moduleNameString . GHC.moduleName <$> GHC.nameModule_maybe name - ident = externalAnchorIdent name + path = fromMaybe "" $ modulePath <$> mmname + anchor = fromMaybe "" $ ("#" ++) . externalAnchorIdent <$> miname + +modulePath :: GHC.ModuleName -> String +modulePath name = GHC.moduleNameString name ++ ".html" From git at git.haskell.org Wed Jul 8 08:40:54 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:40:54 +0000 (UTC) Subject: [commit: haddock] master: Disable generating hyperlinks for module references. (98cb99c) Message-ID: <20150708084054.77E0B3A301@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/98cb99c2398a2e2b4467da0a1755d24422384f14 >--------------------------------------------------------------- commit 98cb99c2398a2e2b4467da0a1755d24422384f14 Author: ?ukasz Hanuszczak Date: Sun Jun 28 21:33:03 2015 +0200 Disable generating hyperlinks for module references. >--------------------------------------------------------------- 98cb99c2398a2e2b4467da0a1755d24422384f14 haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs index b05a5b8..89d9b60 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs @@ -123,6 +123,13 @@ externalNameHyperlink pkg srcs name content mdl = GHC.nameModule name namePkg = GHC.modulePackageKey mdl +-- TODO: Implement module hyperlinks. +-- +-- Unfortunately, 'ModuleName' is not enough to provide viable cross-package +-- hyperlink. And the problem is that GHC AST does not have other information +-- on imported modules, so for the time being, we do not provide such reference +-- either. externalModHyperlink :: GHC.ModuleName -> Html -> Html -externalModHyperlink mdl content = - Html.anchor content ! [ Html.href $ hypSrcModuleUrl' mdl ] +externalModHyperlink _ content = + content + --Html.anchor content ! [ Html.href $ hypSrcModuleUrl' mdl ] From git at git.haskell.org Wed Jul 8 08:40:56 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:40:56 +0000 (UTC) Subject: [commit: haddock] master: Add some documentation for AST module of source hyperlinker. (937a601) Message-ID: <20150708084056.8315B3A301@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/937a6011d253a77cda98ec112a839cd08ac7e7ca >--------------------------------------------------------------- commit 937a6011d253a77cda98ec112a839cd08ac7e7ca Author: ?ukasz Hanuszczak Date: Mon Jun 22 00:20:44 2015 +0200 Add some documentation for AST module of source hyperlinker. >--------------------------------------------------------------- 937a6011d253a77cda98ec112a839cd08ac7e7ca .../src/Haddock/Backends/Hyperlinker/Ast.hs | 56 ++++++++++++++++++---- 1 file changed, 46 insertions(+), 10 deletions(-) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs index 1038995..275f10e 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs @@ -33,6 +33,7 @@ rtkName (RtkBind name) = Left name rtkName (RtkDecl name) = Left name rtkName (RtkModule name) = Right name +-- | Add more detailed information to token stream using GHC API. enrich :: GHC.RenamedSource -> [Token] -> [RichToken] enrich src = map $ \token -> RichToken @@ -48,23 +49,24 @@ enrich src = , imports ] +-- | A map containing association between source locations and "details" of +-- this location. +-- +-- For the time being, it is just a list of pairs. However, looking up things +-- in such structure has linear complexity. We cannot use any hashmap-like +-- stuff because source locations are not ordered. In the future, this should +-- be replaced with interval tree data structure. type DetailsMap = [(GHC.SrcSpan, TokenDetails)] +lookupBySpan :: Span -> DetailsMap -> Maybe TokenDetails +lookupBySpan tspan = listToMaybe . map snd . filter (matches tspan . fst) + enrichToken :: Token -> DetailsMap -> Maybe TokenDetails enrichToken (Token typ _ spn) dm | typ `elem` [TkIdentifier, TkOperator] = lookupBySpan spn dm enrichToken _ _ = Nothing -lookupBySpan :: Span -> DetailsMap -> Maybe TokenDetails -lookupBySpan tspan = listToMaybe . map snd . filter (matches tspan . fst) - -everything :: (r -> r -> r) -> (forall a. Data a => a -> r) - -> (forall a. Data a => a -> r) -everything k f x = foldl k (f x) (gmapQ (everything k f) x) - -combine :: Alternative f => (forall a. Data a => a -> f r) -> (forall a. Data a => a -> f r) -> (forall a. Data a => a -> f r) -combine f g x = f x <|> g x - +-- | Obtain details map for variables ("normally" used identifiers). variables :: GHC.RenamedSource -> DetailsMap variables = everything (<|>) var @@ -74,6 +76,7 @@ variables = pure (sspan, RtkVar name) _ -> empty +-- | Obtain details map for types. types :: GHC.RenamedSource -> DetailsMap types = everything (<|>) ty @@ -83,6 +86,11 @@ types = pure (sspan, RtkType name) _ -> empty +-- | Obtain details map for identifier bindings. +-- +-- That includes both identifiers bound by pattern matching or declared using +-- ordinary assignment (in top-level declarations, let-expressions and where +-- clauses). binds :: GHC.RenamedSource -> DetailsMap binds = everything (<|>) (fun `combine` pat) @@ -96,6 +104,7 @@ binds = pure (sspan, RtkBind name) _ -> empty +-- | Obtain details map for top-level declarations. decls :: GHC.RenamedSource -> DetailsMap decls (group, _, _, _) = concatMap ($ group) [ map typ . concat . map GHC.group_tyclds . GHC.hs_tyclds @@ -110,6 +119,10 @@ decls (group, _, _, _) = concatMap ($ group) | GHC.isExternalName name -> pure (sspan, RtkDecl name) _ -> empty +-- | Obtain details map for import declarations. +-- +-- This map also includes type and variable details for items in export and +-- import lists. imports :: GHC.RenamedSource -> DetailsMap imports src@(_, imps, _, _) = everything (<|>) ie src ++ map (imp . GHC.unLoc) imps @@ -126,6 +139,15 @@ imports src@(_, imps, _, _) = let (GHC.L sspan name) = GHC.ideclName idecl in (sspan, RtkModule name) +-- | Check whether token stream span matches GHC source span. +-- +-- Currently, it is implemented as checking whether "our" span is contained +-- in GHC span. The reason for that is because GHC span are generally wider +-- and may spread across couple tokens. For example, @(>>=)@ consists of three +-- tokens: @(@, @>>=@, @)@, but GHC source span associated with @>>=@ variable +-- contains @(@ and @)@. Similarly, qualified identifiers like @Foo.Bar.quux@ +-- are tokenized as @Foo@, @.@, @Bar@, @.@, @quux@ but GHC source span +-- associated with @quux@ contains all five elements. matches :: Span -> GHC.SrcSpan -> Bool matches tspan (GHC.RealSrcSpan aspan) | saspan <= stspan && etspan <= easpan = True @@ -135,3 +157,17 @@ matches tspan (GHC.RealSrcSpan aspan) saspan = (GHC.srcSpanStartLine aspan, GHC.srcSpanStartCol aspan) easpan = (GHC.srcSpanEndLine aspan, GHC.srcSpanEndCol aspan) matches _ _ = False + +-- | Perform a query on each level of a tree. +-- +-- This is stolen directly from SYB package and copied here to not introduce +-- additional dependencies. +everything :: (r -> r -> r) -> (forall a. Data a => a -> r) + -> (forall a. Data a => a -> r) +everything k f x = foldl k (f x) (gmapQ (everything k f) x) + +-- | Combine two queries into one using alternative combinator. +combine :: Alternative f => (forall a. Data a => a -> f r) + -> (forall a. Data a => a -> f r) + -> (forall a. Data a => a -> f r) +combine f g x = f x <|> g x From git at git.haskell.org Wed Jul 8 08:40:52 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:40:52 +0000 (UTC) Subject: [commit: haddock] master: Add basic support for cross-package hyperlink generation. (a6eb5a1) Message-ID: <20150708084052.6E5703A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/a6eb5a19b13bc4dfa79d0e55e5992dfa403aa3c3 >--------------------------------------------------------------- commit a6eb5a19b13bc4dfa79d0e55e5992dfa403aa3c3 Author: ?ukasz Hanuszczak Date: Sun Jun 28 21:00:55 2015 +0200 Add basic support for cross-package hyperlink generation. >--------------------------------------------------------------- a6eb5a19b13bc4dfa79d0e55e5992dfa403aa3c3 haddock-api/src/Haddock.hs | 2 +- haddock-api/src/Haddock/Backends/Hyperlinker.hs | 25 ++++++------- .../src/Haddock/Backends/Hyperlinker/Renderer.hs | 42 +++++++++++++--------- 3 files changed, 40 insertions(+), 29 deletions(-) diff --git a/haddock-api/src/Haddock.hs b/haddock-api/src/Haddock.hs index d596c07..caaa1ee 100644 --- a/haddock-api/src/Haddock.hs +++ b/haddock-api/src/Haddock.hs @@ -321,7 +321,7 @@ render dflags flags qual ifaces installedIfaces srcMap = do libDir when (Flag_HyperlinkedSource `elem` flags) $ do - ppHyperlinkedSource odir libDir opt_source_css visibleIfaces + ppHyperlinkedSource odir libDir opt_source_css pkgKey srcMap visibleIfaces -- | From GHC 7.10, this function has a potential to crash with a -- nasty message such as @expectJust getPackageDetails@ because diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker.hs b/haddock-api/src/Haddock/Backends/Hyperlinker.hs index f197eaa..f2caa2c 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker.hs @@ -8,33 +8,34 @@ import Haddock.Backends.Hyperlinker.Renderer import Haddock.Backends.Hyperlinker.Utils import Text.XHtml hiding (()) +import GHC import Data.Maybe import System.Directory import System.FilePath -ppHyperlinkedSource :: FilePath -> FilePath - -> Maybe FilePath - -> [Interface] +ppHyperlinkedSource :: FilePath -> FilePath -> Maybe FilePath + -> PackageKey -> SrcMap -> [Interface] -> IO () -ppHyperlinkedSource outdir libdir mstyle ifaces = do +ppHyperlinkedSource outdir libdir mstyle pkg srcs ifaces = do createDirectoryIfMissing True srcdir let cssFile = fromMaybe (defaultCssFile libdir) mstyle copyFile cssFile $ srcdir srcCssFile copyFile (libdir "html" highlightScript) $ srcdir highlightScript - mapM_ (ppHyperlinkedModuleSource srcdir) ifaces + mapM_ (ppHyperlinkedModuleSource srcdir pkg srcs) ifaces where srcdir = outdir hypSrcDir -ppHyperlinkedModuleSource :: FilePath -> Interface -> IO () -ppHyperlinkedModuleSource srcdir iface = case ifaceTokenizedSrc iface of - Just tokens -> - writeFile path $ showHtml . render mCssFile mJsFile $ tokens - Nothing -> return () +ppHyperlinkedModuleSource :: FilePath + -> PackageKey -> SrcMap -> Interface + -> IO () +ppHyperlinkedModuleSource srcdir pkg srcs iface = + case ifaceTokenizedSrc iface of + Just tokens -> writeFile path . showHtml . render' $ tokens + Nothing -> return () where - mCssFile = Just $ srcCssFile - mJsFile = Just $ highlightScript + render' = render (Just srcCssFile) (Just highlightScript) pkg srcs path = srcdir hypSrcModuleFile (ifaceMod iface) srcCssFile :: FilePath diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs index d8ea5ec..b05a5b8 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs @@ -1,5 +1,6 @@ module Haddock.Backends.Hyperlinker.Renderer (render) where +import Haddock.Types import Haddock.Backends.Hyperlinker.Parser import Haddock.Backends.Hyperlinker.Ast import Haddock.Backends.Hyperlinker.Utils @@ -8,20 +9,25 @@ import qualified GHC import qualified Name as GHC import qualified Unique as GHC +import System.FilePath.Posix (()) + import Data.List import Data.Maybe import Data.Monoid +import qualified Data.Map as Map import Text.XHtml (Html, HtmlAttr, (!)) import qualified Text.XHtml as Html type StyleClass = String -render :: Maybe FilePath -> Maybe FilePath -> [RichToken] -> Html -render mcss mjs tokens = header mcss mjs <> body tokens +render :: Maybe FilePath -> Maybe FilePath + -> GHC.PackageKey -> SrcMap -> [RichToken] + -> Html +render mcss mjs pkg srcs tokens = header mcss mjs <> body pkg srcs tokens -body :: [RichToken] -> Html -body = Html.body . Html.pre . mconcat . map richToken +body :: GHC.PackageKey -> SrcMap -> [RichToken] -> Html +body pkg srcs = Html.body . Html.pre . mconcat . map (richToken pkg srcs) header :: Maybe FilePath -> Maybe FilePath -> Html header mcss mjs @@ -41,13 +47,13 @@ header mcss mjs = , Html.src scriptFile ] -richToken :: RichToken -> Html -richToken (RichToken tok Nothing) = +richToken :: GHC.PackageKey -> SrcMap -> RichToken -> Html +richToken _ _ (RichToken tok Nothing) = tokenSpan tok ! attrs where attrs = [ multiclass . tokenStyle . tkType $ tok ] -richToken (RichToken tok (Just det)) = - externalAnchor det . internalAnchor det . hyperlink det $ content +richToken pkg srcs (RichToken tok (Just det)) = + externalAnchor det . internalAnchor det . hyperlink pkg srcs det $ content where content = tokenSpan tok ! [ multiclass style] style = (tokenStyle . tkType) tok ++ richTokenStyle det @@ -94,25 +100,29 @@ externalAnchorIdent = hypSrcNameUrl internalAnchorIdent :: GHC.Name -> String internalAnchorIdent = ("local-" ++) . show . GHC.getKey . GHC.nameUnique -hyperlink :: TokenDetails -> Html -> Html -hyperlink details = case rtkName details of +hyperlink :: GHC.PackageKey -> SrcMap -> TokenDetails -> Html -> Html +hyperlink pkg srcs details = case rtkName details of Left name -> if GHC.isInternalName name then internalHyperlink name - else externalNameHyperlink name + else externalNameHyperlink pkg srcs name Right name -> externalModHyperlink name internalHyperlink :: GHC.Name -> Html -> Html internalHyperlink name content = Html.anchor content ! [ Html.href $ "#" ++ internalAnchorIdent name ] -externalNameHyperlink :: GHC.Name -> Html -> Html -externalNameHyperlink name content = - Html.anchor content ! [ Html.href href ] +externalNameHyperlink :: GHC.PackageKey -> SrcMap -> GHC.Name -> Html -> Html +externalNameHyperlink pkg srcs name content + | namePkg == pkg = Html.anchor content ! + [ Html.href $ hypSrcModuleNameUrl mdl name ] + | Just path <- Map.lookup namePkg srcs = Html.anchor content ! + [ Html.href $ path hypSrcModuleNameUrl mdl name ] + | otherwise = content where - href = hypSrcModuleNameUrl (GHC.nameModule name) name + mdl = GHC.nameModule name + namePkg = GHC.modulePackageKey mdl externalModHyperlink :: GHC.ModuleName -> Html -> Html externalModHyperlink mdl content = Html.anchor content ! [ Html.href $ hypSrcModuleUrl' mdl ] - From git at git.haskell.org Wed Jul 8 08:40:58 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:40:58 +0000 (UTC) Subject: [commit: haddock] master: Add support for providing custom CSS files for hyperlinked source. (6f16398) Message-ID: <20150708084058.955E23A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/6f16398a26a12d58b3ba7f1924e2b6b00e68f5f7 >--------------------------------------------------------------- commit 6f16398a26a12d58b3ba7f1924e2b6b00e68f5f7 Author: ?ukasz Hanuszczak Date: Mon Jun 22 17:20:37 2015 +0200 Add support for providing custom CSS files for hyperlinked source. >--------------------------------------------------------------- 6f16398a26a12d58b3ba7f1924e2b6b00e68f5f7 haddock-api/haddock-api.cabal | 1 + haddock-api/resources/html/solarized.css | 55 +++++++++++++++++++++++++ haddock-api/src/Haddock.hs | 3 +- haddock-api/src/Haddock/Backends/Hyperlinker.hs | 26 +++++++++--- haddock-api/src/Haddock/Options.hs | 6 +++ 5 files changed, 84 insertions(+), 7 deletions(-) diff --git a/haddock-api/haddock-api.cabal b/haddock-api/haddock-api.cabal index 6ffde97..1465699 100644 --- a/haddock-api/haddock-api.cabal +++ b/haddock-api/haddock-api.cabal @@ -18,6 +18,7 @@ stability: experimental data-dir: resources data-files: + html/solarized.css html/frames.html html/haddock-util.js html/Classic.theme/haskell_icon.gif diff --git a/haddock-api/resources/html/solarized.css b/haddock-api/resources/html/solarized.css new file mode 100644 index 0000000..e4bff38 --- /dev/null +++ b/haddock-api/resources/html/solarized.css @@ -0,0 +1,55 @@ +body { + background-color: #fdf6e3; +} + +.hs-identifier { + color: #073642; +} + +.hs-identifier.hs-var { +} + +.hs-identifier.hs-type { + color: #5f5faf; +} + +.hs-keyword { + color: #af005f; +} + +.hs-string, .hs-char { + color: #cb4b16; +} + +.hs-number { + color: #268bd2; +} + +.hs-operator { + color: #d33682; +} + +.hs-glyph, .hs-special { + color: #dc322f; +} + +.hs-comment { + color: #8a8a8a; +} + +.hs-pragma { + color: #2aa198; +} + +.hs-cpp { + color: #859900; +} + +a:link, a:visited { + text-decoration: none; + border-bottom: 1px solid #eee8d5; +} + +a:hover { + background-color: #eee8d5; +} diff --git a/haddock-api/src/Haddock.hs b/haddock-api/src/Haddock.hs index e45456a..698122e 100644 --- a/haddock-api/src/Haddock.hs +++ b/haddock-api/src/Haddock.hs @@ -244,6 +244,7 @@ render dflags flags qual ifaces installedIfaces srcMap = do opt_index_url = optIndexUrl flags odir = outputDir flags opt_latex_style = optLaTeXStyle flags + opt_source_css = optSourceCssFile flags visibleIfaces = [ i | i <- ifaces, OptHide `notElem` ifaceOptions i ] @@ -310,7 +311,7 @@ render dflags flags qual ifaces installedIfaces srcMap = do libDir when (Flag_HyperlinkedSource `elem` flags) $ do - ppHyperlinkedSource odir libDir Nothing visibleIfaces + ppHyperlinkedSource odir libDir opt_source_css visibleIfaces -- | From GHC 7.10, this function has a potential to crash with a -- nasty message such as @expectJust getPackageDetails@ because diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker.hs b/haddock-api/src/Haddock/Backends/Hyperlinker.hs index 8861947..66392a6 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker.hs @@ -5,21 +5,35 @@ import Haddock.Backends.Hyperlinker.Renderer import GHC import Text.XHtml hiding (()) + +import Data.Maybe import System.Directory import System.FilePath ppHyperlinkedSource :: FilePath -> FilePath -> Maybe FilePath -> [Interface] -> IO () ppHyperlinkedSource outdir libdir mstyle ifaces = do - createDirectoryIfMissing True (outdir "src") - mapM_ (ppHyperlinkedModuleSource outdir mstyle) ifaces + createDirectoryIfMissing True $ srcPath outdir + let cssFile = fromMaybe (defaultCssFile libdir) mstyle + copyFile cssFile $ srcPath outdir srcCssFile + mapM_ (ppHyperlinkedModuleSource outdir) ifaces -ppHyperlinkedModuleSource :: FilePath -> Maybe FilePath -> Interface -> IO () -ppHyperlinkedModuleSource outdir mstyle iface = case ifaceTokenizedSrc iface of - Just tokens -> writeFile path $ showHtml . render mstyle $ tokens +ppHyperlinkedModuleSource :: FilePath -> Interface -> IO () +ppHyperlinkedModuleSource outdir iface = case ifaceTokenizedSrc iface of + Just tokens -> writeFile path $ showHtml . render mSrcCssFile $ tokens Nothing -> return () where - path = outdir "src" moduleSourceFile (ifaceMod iface) + mSrcCssFile = Just $ srcCssFile + path = srcPath outdir moduleSourceFile (ifaceMod iface) moduleSourceFile :: Module -> FilePath moduleSourceFile = (++ ".html") . moduleNameString . moduleName + +srcPath :: FilePath -> FilePath +srcPath outdir = outdir "src" + +srcCssFile :: FilePath +srcCssFile = "style.css" + +defaultCssFile :: FilePath -> FilePath +defaultCssFile libdir = libdir "html" "solarized.css" diff --git a/haddock-api/src/Haddock/Options.hs b/haddock-api/src/Haddock/Options.hs index c9d5688..f84989e 100644 --- a/haddock-api/src/Haddock/Options.hs +++ b/haddock-api/src/Haddock/Options.hs @@ -21,6 +21,7 @@ module Haddock.Options ( optContentsUrl, optIndexUrl, optCssFile, + optSourceCssFile, sourceUrls, wikiUrls, optDumpInterfaceFile, @@ -67,6 +68,7 @@ data Flag | Flag_LaTeX | Flag_LaTeXStyle String | Flag_HyperlinkedSource + | Flag_SourceCss String | Flag_Help | Flag_Verbosity String | Flag_Version @@ -119,6 +121,8 @@ options backwardsCompat = "output for Hoogle; you may want --package-name and --package-version too", Option [] ["hyperlinked-source"] (NoArg Flag_HyperlinkedSource) "generate highlighted and hyperlinked source code (for use with --html)", + Option [] ["source-css"] (ReqArg Flag_SourceCss "FILE") + "use custom CSS file instead of default one in hyperlinked source", Option [] ["source-base"] (ReqArg Flag_SourceBaseURL "URL") "URL for a source code link on the contents\nand index pages", Option ['s'] (if backwardsCompat then ["source", "source-module"] else ["source-module"]) @@ -242,6 +246,8 @@ optIndexUrl flags = optLast [ url | Flag_UseIndex url <- flags ] optCssFile :: [Flag] -> Maybe FilePath optCssFile flags = optLast [ str | Flag_CSS str <- flags ] +optSourceCssFile :: [Flag] -> Maybe FilePath +optSourceCssFile flags = optLast [ str | Flag_SourceCss str <- flags ] sourceUrls :: [Flag] -> (Maybe String, Maybe String, Maybe String, Maybe String) sourceUrls flags = From git at git.haskell.org Wed Jul 8 08:41:00 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:41:00 +0000 (UTC) Subject: [commit: haddock] master: Add support for top-level function declaration anchors. (c678689) Message-ID: <20150708084100.A2A7E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/c6786894f71809ecfa377a44beab0771a3bc7985 >--------------------------------------------------------------- commit c6786894f71809ecfa377a44beab0771a3bc7985 Author: ?ukasz Hanuszczak Date: Fri Jun 12 01:36:49 2015 +0200 Add support for top-level function declaration anchors. >--------------------------------------------------------------- c6786894f71809ecfa377a44beab0771a3bc7985 haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs index 39bbacf..cb9508e 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs @@ -40,9 +40,9 @@ enrich src = detailsMap = concatMap ($ src) [ variables , types + , decls , binds , imports - , decls ] type DetailsMap = [(GHC.SrcSpan, TokenDetails)] @@ -96,11 +96,16 @@ binds = decls :: GHC.RenamedSource -> DetailsMap decls (group, _, _, _) = concatMap ($ group) [ map typ . concat . map GHC.group_tyclds . GHC.hs_tyclds + , everything (<|>) fun ] where typ (GHC.L _ t) = let (GHC.L sspan name) = GHC.tcdLName t in (sspan, TokenDetails RtkDecl name) + fun term = case cast term of + (Just (GHC.FunBind (GHC.L sspan name) _ _ _ _ _ :: GHC.HsBind GHC.Name)) + | GHC.isExternalName name -> pure (sspan, TokenDetails RtkDecl name) + _ -> empty imports :: GHC.RenamedSource -> DetailsMap imports = From git at git.haskell.org Wed Jul 8 08:41:02 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:41:02 +0000 (UTC) Subject: [commit: haddock] master: Make Haddock generate source for all interfaces (also hidden ones). (4a6b6c1) Message-ID: <20150708084102.B3EA83A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/4a6b6c18dbb6542b64f13e4f51cc0447df15a175 >--------------------------------------------------------------- commit 4a6b6c18dbb6542b64f13e4f51cc0447df15a175 Author: ?ukasz Hanuszczak Date: Sun Jun 28 21:45:29 2015 +0200 Make Haddock generate source for all interfaces (also hidden ones). >--------------------------------------------------------------- 4a6b6c18dbb6542b64f13e4f51cc0447df15a175 haddock-api/src/Haddock.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haddock-api/src/Haddock.hs b/haddock-api/src/Haddock.hs index caaa1ee..c76966f 100644 --- a/haddock-api/src/Haddock.hs +++ b/haddock-api/src/Haddock.hs @@ -321,7 +321,7 @@ render dflags flags qual ifaces installedIfaces srcMap = do libDir when (Flag_HyperlinkedSource `elem` flags) $ do - ppHyperlinkedSource odir libDir opt_source_css pkgKey srcMap visibleIfaces + ppHyperlinkedSource odir libDir opt_source_css pkgKey srcMap ifaces -- | From GHC 7.10, this function has a potential to crash with a -- nasty message such as @expectJust getPackageDetails@ because From git at git.haskell.org Wed Jul 8 08:41:04 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:41:04 +0000 (UTC) Subject: [commit: haddock] master: Prevent source parser from throwing exception when lexing fails. (311b3cc) Message-ID: <20150708084104.C02393A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/311b3cc529097ef83a8212439dafcabb86534c62 >--------------------------------------------------------------- commit 311b3cc529097ef83a8212439dafcabb86534c62 Author: ?ukasz Hanuszczak Date: Sun Jun 28 22:28:00 2015 +0200 Prevent source parser from throwing exception when lexing fails. >--------------------------------------------------------------- 311b3cc529097ef83a8212439dafcabb86534c62 haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs index 6e195db..bab5ba0 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs @@ -63,7 +63,9 @@ chunk str@(c:_) chunk str | "--" `isPrefixOf` str = chunk' $ spanToNewline str | "{-" `isPrefixOf` str = chunk' $ chunkComment 0 str - | otherwise = chunk' $ head $ lex str + | otherwise = case lex str of + (tok:_) -> chunk' tok + [] -> [str] where chunk' (c, rest) = c:(chunk rest) From git at git.haskell.org Wed Jul 8 08:41:06 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:41:06 +0000 (UTC) Subject: [commit: haddock] master: Make source hyperlinker generate output in apropriate directory. (affd889) Message-ID: <20150708084106.CDDC03A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/affd889d1b192d2cb9787c92202317b9e9401922 >--------------------------------------------------------------- commit affd889d1b192d2cb9787c92202317b9e9401922 Author: ?ukasz Hanuszczak Date: Fri Jun 26 21:13:12 2015 +0200 Make source hyperlinker generate output in apropriate directory. >--------------------------------------------------------------- affd889d1b192d2cb9787c92202317b9e9401922 haddock-api/src/Haddock.hs | 10 ++++-- haddock-api/src/Haddock/Backends/Hyperlinker.hs | 41 +++++++++++++++---------- haddock-api/src/Haddock/Utils.hs | 5 +++ 3 files changed, 38 insertions(+), 18 deletions(-) diff --git a/haddock-api/src/Haddock.hs b/haddock-api/src/Haddock.hs index 698122e..01e4cd4 100644 --- a/haddock-api/src/Haddock.hs +++ b/haddock-api/src/Haddock.hs @@ -258,10 +258,16 @@ render dflags flags qual ifaces installedIfaces srcMap = do pkgNameVer = modulePackageInfo dflags flags pkgMod (srcBase, srcModule, srcEntity, srcLEntity) = sourceUrls flags + + srcModule' + | isJust srcModule = srcModule + | Flag_HyperlinkedSource `elem` flags = Just defaultModuleSourceUrl + | otherwise = Nothing + srcMap' = maybe srcMap (\path -> Map.insert pkgKey path srcMap) srcEntity -- TODO: Get these from the interface files as with srcMap srcLMap' = maybe Map.empty (\path -> Map.singleton pkgKey path) srcLEntity - sourceUrls' = (srcBase, srcModule, srcMap', srcLMap') + sourceUrls' = (srcBase, srcModule', srcMap', srcLMap') libDir <- getHaddockLibDir flags prologue <- getPrologue dflags flags @@ -311,7 +317,7 @@ render dflags flags qual ifaces installedIfaces srcMap = do libDir when (Flag_HyperlinkedSource `elem` flags) $ do - ppHyperlinkedSource odir libDir opt_source_css visibleIfaces + ppHyperlinkedSource odir libDir opt_source_css sourceUrls' visibleIfaces -- | From GHC 7.10, this function has a potential to crash with a -- nasty message such as @expectJust getPackageDetails@ because diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker.hs b/haddock-api/src/Haddock/Backends/Hyperlinker.hs index 9337307..2ed4dbd 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker.hs @@ -1,45 +1,54 @@ module Haddock.Backends.Hyperlinker (ppHyperlinkedSource) where import Haddock.Types +import Haddock.Utils +import Haddock.Backends.Xhtml.Types +import Haddock.Backends.Xhtml.Utils import Haddock.Backends.Hyperlinker.Renderer -import GHC import Text.XHtml hiding (()) import Data.Maybe import System.Directory import System.FilePath -ppHyperlinkedSource :: FilePath -> FilePath -> Maybe FilePath -> [Interface] +ppHyperlinkedSource :: FilePath -> FilePath + -> Maybe FilePath + -> SourceURLs + -> [Interface] -> IO () -ppHyperlinkedSource outdir libdir mstyle ifaces = do - createDirectoryIfMissing True $ srcPath outdir +ppHyperlinkedSource outdir libdir mstyle urls ifaces = do + createDirectoryIfMissing True srcdir let cssFile = fromMaybe (defaultCssFile libdir) mstyle - copyFile cssFile $ srcPath outdir srcCssFile + copyFile cssFile $ srcdir srcCssFile copyFile (libdir "html" highlightScript) $ - srcPath outdir highlightScript - mapM_ (ppHyperlinkedModuleSource outdir) ifaces + srcdir highlightScript + mapM_ (ppHyperlinkedModuleSource outdir urls) ifaces + where + srcdir = srcPath outdir urls -ppHyperlinkedModuleSource :: FilePath -> Interface -> IO () -ppHyperlinkedModuleSource outdir iface = case ifaceTokenizedSrc iface of +ppHyperlinkedModuleSource :: FilePath -> SourceURLs -> Interface -> IO () +ppHyperlinkedModuleSource outdir urls iface = case ifaceTokenizedSrc iface of Just tokens -> writeFile path $ showHtml . render mCssFile mJsFile $ tokens Nothing -> return () where mCssFile = Just $ srcCssFile mJsFile = Just $ highlightScript - path = srcPath outdir moduleSourceFile (ifaceMod iface) - -moduleSourceFile :: Module -> FilePath -moduleSourceFile = (++ ".html") . moduleNameString . moduleName + srcFile = spliceURL Nothing (Just $ ifaceMod iface) Nothing Nothing $ + srcModUrl urls + path = outdir srcFile -srcPath :: FilePath -> FilePath -srcPath outdir = outdir "src" +srcPath :: FilePath -> SourceURLs -> FilePath +srcPath outdir urls = outdir takeDirectory (srcModUrl urls) srcCssFile :: FilePath -srcCssFile = "style.css" +srcCssFile = "srcstyle.css" highlightScript :: FilePath highlightScript = "highlight.js" defaultCssFile :: FilePath -> FilePath defaultCssFile libdir = libdir "html" "solarized.css" + +srcModUrl :: SourceURLs -> String +srcModUrl (_, mModSrcUrl, _, _) = fromMaybe defaultModuleSourceUrl mModSrcUrl diff --git a/haddock-api/src/Haddock/Utils.hs b/haddock-api/src/Haddock/Utils.hs index 4fed3a1..78c78ac 100644 --- a/haddock-api/src/Haddock/Utils.hs +++ b/haddock-api/src/Haddock/Utils.hs @@ -29,6 +29,7 @@ module Haddock.Utils ( moduleNameUrl, moduleNameUrl', moduleUrl, nameAnchorId, makeAnchorId, + defaultModuleSourceUrl, -- * Miscellaneous utilities getProgramName, bye, die, dieMsg, noDieMsg, mapSnd, mapMaybeM, escapeStr, @@ -277,6 +278,10 @@ makeAnchorId (f:r) = escape isAlpha f ++ concatMap (escape isLegal) r -- NB: '-' is legal in IDs, but we use it as the escape char +defaultModuleSourceUrl :: String +defaultModuleSourceUrl = "src/%{MODULE}.html" + + ------------------------------------------------------------------------------- -- * Files we need to copy from our $libdir ------------------------------------------------------------------------------- From git at git.haskell.org Wed Jul 8 08:41:08 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:41:08 +0000 (UTC) Subject: [commit: haddock] master: Add some documentation for parser module of source hyperlinker. (416c384) Message-ID: <20150708084108.DAD853A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/416c384a981593005c9c6bf87ac27b7c2f9b8695 >--------------------------------------------------------------- commit 416c384a981593005c9c6bf87ac27b7c2f9b8695 Author: ?ukasz Hanuszczak Date: Sun Jun 21 23:48:03 2015 +0200 Add some documentation for parser module of source hyperlinker. >--------------------------------------------------------------- 416c384a981593005c9c6bf87ac27b7c2f9b8695 .../src/Haddock/Backends/Hyperlinker/Parser.hs | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs index 7f40816..6e195db 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs @@ -40,9 +40,20 @@ data TokenType | TkUnknown deriving (Eq) +-- | Turn source code string into a stream of more descriptive tokens. +-- +-- Result should retain original file layout (including comments, whitespace, +-- etc.), i.e. the following "law" should hold: +-- +-- @concat . map 'tkValue' . 'parse' = id@ parse :: String -> [Token] parse = tokenize . tag . chunk +-- | Split raw source string to more meaningful chunks. +-- +-- This is the initial stage of tokenization process. Each chunk is either +-- a comment (including comment delimiters), a whitespace string, preprocessor +-- macro (and all its content until the end of a line) or valid Haskell lexeme. chunk :: String -> [String] chunk [] = [] chunk str@(c:_) @@ -56,6 +67,11 @@ chunk str where chunk' (c, rest) = c:(chunk rest) +-- | Split input to "first line" string and the rest of it. +-- +-- Ideally, this should be done simply with @'break' (== '\n')@. However, +-- Haskell also allows line-unbreaking (or whatever it is called) so things +-- are not as simple and this function deals with that. spanToNewline :: String -> (String, String) spanToNewline [] = ([], []) spanToNewline ('\\':'\n':str) = @@ -66,6 +82,16 @@ spanToNewline (c:str) = let (str', rest) = spanToNewline str in (c:str', rest) +-- | Split input to whitespace string, (optional) preprocessor directive and +-- the rest of it. +-- +-- Again, using something like @'span' 'isSpace'@ would be nice to chunk input +-- to whitespace. The problem is with /#/ symbol - if it is placed at the very +-- beginning of a line, it should be recognized as preprocessor macro. In any +-- other case, it is ordinary Haskell symbol and can be used to declare +-- operators. Hence, while dealing with whitespace we also check whether there +-- happens to be /#/ symbol just after a newline character - if that is the +-- case, we begin treating the whole line as preprocessor macro. spanSpaceOrCpp :: String -> (String, Maybe String, String) spanSpaceOrCpp ('\n':'#':str) = let (str', rest) = spanToNewline str @@ -76,6 +102,10 @@ spanSpaceOrCpp (c:str') in (c:space, mcpp, rest) spanSpaceOrCpp str = ("", Nothing, str) +-- | Split input to comment content (including delimiters) and the rest. +-- +-- Again, some more logic than simple 'span' is required because of Haskell +-- comment nesting policy. chunkComment :: Int -> String -> (String, String) chunkComment _ [] = ("", "") chunkComment depth ('{':'-':str) = @@ -90,6 +120,7 @@ chunkComment depth (e:str) = let (c, rest) = chunkComment depth str in (e:c, rest) +-- | Assign source location for each chunk in given stream. tag :: [String] -> [(Span, String)] tag = reverse . snd . foldl aux (Position 1 1, []) @@ -100,6 +131,7 @@ tag = move pos '\n' = pos { posRow = posRow pos + 1, posCol = 1 } move pos _ = pos { posCol = posCol pos + 1 } +-- | Turn unrecognised chunk stream to more descriptive token stream. tokenize :: [(Span, String)] -> [Token] tokenize = map aux @@ -110,6 +142,13 @@ tokenize = , tkSpan = sp } +-- | Classify given string as appropriate Haskell token. +-- +-- This method is based on Haskell 98 Report lexical structure description: +-- https://www.haskell.org/onlinereport/lexemes.html +-- +-- However, this is probably far from being perfect and most probably does not +-- handle correctly all corner cases. classify :: String -> TokenType classify str | "--" `isPrefixOf` str = TkComment From git at git.haskell.org Wed Jul 8 08:41:10 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:41:10 +0000 (UTC) Subject: [commit: haddock] master: Make external hyperlinks point to locations specified by source URLs. (d58bcf2) Message-ID: <20150708084110.E86543A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/d58bcf24dfa4333e7893935eb86c036be28125b1 >--------------------------------------------------------------- commit d58bcf24dfa4333e7893935eb86c036be28125b1 Author: ?ukasz Hanuszczak Date: Fri Jun 26 22:41:07 2015 +0200 Make external hyperlinks point to locations specified by source URLs. >--------------------------------------------------------------- d58bcf24dfa4333e7893935eb86c036be28125b1 haddock-api/src/Haddock.hs | 7 ++- haddock-api/src/Haddock/Backends/Hyperlinker.hs | 8 ++-- .../src/Haddock/Backends/Hyperlinker/Renderer.hs | 52 +++++++++++++--------- haddock-api/src/Haddock/Utils.hs | 5 ++- 4 files changed, 44 insertions(+), 28 deletions(-) diff --git a/haddock-api/src/Haddock.hs b/haddock-api/src/Haddock.hs index 01e4cd4..3105edf 100644 --- a/haddock-api/src/Haddock.hs +++ b/haddock-api/src/Haddock.hs @@ -264,7 +264,12 @@ render dflags flags qual ifaces installedIfaces srcMap = do | Flag_HyperlinkedSource `elem` flags = Just defaultModuleSourceUrl | otherwise = Nothing - srcMap' = maybe srcMap (\path -> Map.insert pkgKey path srcMap) srcEntity + srcMap' + | Just srcNameUrl <- srcEntity = Map.insert pkgKey srcNameUrl srcMap + | Flag_HyperlinkedSource `elem` flags = + Map.insert pkgKey defaultNameSourceUrl srcMap + | otherwise = srcMap + -- TODO: Get these from the interface files as with srcMap srcLMap' = maybe Map.empty (\path -> Map.singleton pkgKey path) srcLEntity sourceUrls' = (srcBase, srcModule', srcMap', srcLMap') diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker.hs b/haddock-api/src/Haddock/Backends/Hyperlinker.hs index 2ed4dbd..6c66e0c 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker.hs @@ -1,10 +1,10 @@ module Haddock.Backends.Hyperlinker (ppHyperlinkedSource) where import Haddock.Types -import Haddock.Utils import Haddock.Backends.Xhtml.Types import Haddock.Backends.Xhtml.Utils import Haddock.Backends.Hyperlinker.Renderer +import Haddock.Backends.Hyperlinker.Utils import Text.XHtml hiding (()) @@ -29,7 +29,8 @@ ppHyperlinkedSource outdir libdir mstyle urls ifaces = do ppHyperlinkedModuleSource :: FilePath -> SourceURLs -> Interface -> IO () ppHyperlinkedModuleSource outdir urls iface = case ifaceTokenizedSrc iface of - Just tokens -> writeFile path $ showHtml . render mCssFile mJsFile $ tokens + Just tokens -> + writeFile path $ showHtml . render mCssFile mJsFile urls $ tokens Nothing -> return () where mCssFile = Just $ srcCssFile @@ -49,6 +50,3 @@ highlightScript = "highlight.js" defaultCssFile :: FilePath -> FilePath defaultCssFile libdir = libdir "html" "solarized.css" - -srcModUrl :: SourceURLs -> String -srcModUrl (_, mModSrcUrl, _, _) = fromMaybe defaultModuleSourceUrl mModSrcUrl diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs index 6d6d201..2df6293 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs @@ -2,12 +2,16 @@ module Haddock.Backends.Hyperlinker.Renderer (render) where import Haddock.Backends.Hyperlinker.Parser import Haddock.Backends.Hyperlinker.Ast +import Haddock.Backends.Hyperlinker.Utils +import Haddock.Backends.Xhtml.Types +import Haddock.Backends.Xhtml.Utils import qualified GHC import qualified Name as GHC import qualified Unique as GHC import Data.List +import qualified Data.Map as Map import Data.Maybe import Data.Monoid @@ -16,11 +20,11 @@ import qualified Text.XHtml as Html type StyleClass = String -render :: Maybe FilePath -> Maybe FilePath -> [RichToken] -> Html -render mcss mjs tokens = header mcss mjs <> body tokens +render :: Maybe FilePath -> Maybe FilePath -> SourceURLs -> [RichToken] -> Html +render mcss mjs urls tokens = header mcss mjs <> body urls tokens -body :: [RichToken] -> Html -body = Html.body . Html.pre . mconcat . map richToken +body :: SourceURLs -> [RichToken] -> Html +body urls = Html.body . Html.pre . mconcat . map (richToken urls) header :: Maybe FilePath -> Maybe FilePath -> Html header mcss mjs @@ -40,13 +44,13 @@ header mcss mjs = , Html.src jsFile ] -richToken :: RichToken -> Html -richToken (RichToken tok Nothing) = +richToken :: SourceURLs -> RichToken -> Html +richToken _ (RichToken tok Nothing) = tokenSpan tok ! attrs where attrs = [ multiclass . tokenStyle . tkType $ tok ] -richToken (RichToken tok (Just det)) = - externalAnchor det . internalAnchor det . hyperlink det $ content +richToken urls (RichToken tok (Just det)) = + externalAnchor det . internalAnchor det . hyperlink urls det $ content where content = tokenSpan tok ! [ multiclass style] style = (tokenStyle . tkType) tok ++ richTokenStyle det @@ -93,26 +97,32 @@ externalAnchorIdent = GHC.occNameString . GHC.nameOccName internalAnchorIdent :: GHC.Name -> String internalAnchorIdent = ("local-" ++) . show . GHC.getKey . GHC.nameUnique -hyperlink :: TokenDetails -> Html -> Html -hyperlink details = case rtkName details of +hyperlink :: SourceURLs -> TokenDetails -> Html -> Html +hyperlink urls details = case rtkName details of Left name -> if GHC.isInternalName name then internalHyperlink name - else externalHyperlink mname (Just name) - where - mname = GHC.moduleName <$> GHC.nameModule_maybe name - Right name -> externalHyperlink (Just name) Nothing + else externalNameHyperlink urls name + Right name -> externalModHyperlink name internalHyperlink :: GHC.Name -> Html -> Html internalHyperlink name content = Html.anchor content ! [ Html.href $ "#" ++ internalAnchorIdent name ] -externalHyperlink :: Maybe GHC.ModuleName -> Maybe GHC.Name -> Html -> Html -externalHyperlink mmname miname content = - Html.anchor content ! [ Html.href $ path ++ anchor ] +externalNameHyperlink :: SourceURLs -> GHC.Name -> Html -> Html +externalNameHyperlink urls name = + case Map.lookup key $ srcNameUrlMap urls of + Just url -> externalNameHyperlink' url name + Nothing -> id where - path = fromMaybe "" $ modulePath <$> mmname - anchor = fromMaybe "" $ ("#" ++) . externalAnchorIdent <$> miname + key = GHC.modulePackageKey . GHC.nameModule $ name -modulePath :: GHC.ModuleName -> String -modulePath name = GHC.moduleNameString name ++ ".html" +externalNameHyperlink' :: String -> GHC.Name -> Html -> Html +externalNameHyperlink' url name content = + Html.anchor content ! [ Html.href $ href ] + where + mdl = GHC.nameModule name + href = spliceURL Nothing (Just mdl) (Just name) Nothing url + +externalModHyperlink :: GHC.ModuleName -> Html -> Html +externalModHyperlink _ = id -- TODO diff --git a/haddock-api/src/Haddock/Utils.hs b/haddock-api/src/Haddock/Utils.hs index 78c78ac..047d9fd 100644 --- a/haddock-api/src/Haddock/Utils.hs +++ b/haddock-api/src/Haddock/Utils.hs @@ -29,7 +29,7 @@ module Haddock.Utils ( moduleNameUrl, moduleNameUrl', moduleUrl, nameAnchorId, makeAnchorId, - defaultModuleSourceUrl, + defaultModuleSourceUrl, defaultNameSourceUrl, -- * Miscellaneous utilities getProgramName, bye, die, dieMsg, noDieMsg, mapSnd, mapMaybeM, escapeStr, @@ -281,6 +281,9 @@ makeAnchorId (f:r) = escape isAlpha f ++ concatMap (escape isLegal) r defaultModuleSourceUrl :: String defaultModuleSourceUrl = "src/%{MODULE}.html" +defaultNameSourceUrl :: String +defaultNameSourceUrl = defaultModuleSourceUrl ++ "#%{NAME}" + ------------------------------------------------------------------------------- -- * Files we need to copy from our $libdir From git at git.haskell.org Wed Jul 8 08:41:13 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:41:13 +0000 (UTC) Subject: [commit: haddock] master: Implement source tokenization during interface creation process. (4190a05) Message-ID: <20150708084113.065663A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/4190a05c4abc710d253212017fb4a654ebde1862 >--------------------------------------------------------------- commit 4190a05c4abc710d253212017fb4a654ebde1862 Author: ?ukasz Hanuszczak Date: Mon Jun 22 14:04:41 2015 +0200 Implement source tokenization during interface creation process. >--------------------------------------------------------------- 4190a05c4abc710d253212017fb4a654ebde1862 haddock-api/src/Haddock/Interface/Create.hs | 30 ++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/haddock-api/src/Haddock/Interface/Create.hs b/haddock-api/src/Haddock/Interface/Create.hs index 63d4436..59f7076 100644 --- a/haddock-api/src/Haddock/Interface/Create.hs +++ b/haddock-api/src/Haddock/Interface/Create.hs @@ -21,6 +21,8 @@ import Haddock.GhcUtils import Haddock.Utils import Haddock.Convert import Haddock.Interface.LexParseRn +import Haddock.Backends.Hyperlinker.Ast as Hyperlinker +import Haddock.Backends.Hyperlinker.Parser as Hyperlinker import qualified Data.Map as M import Data.Map (Map) @@ -122,6 +124,8 @@ createInterface tm flags modMap instIfaceMap = do mkAliasMap dflags $ tm_renamed_source tm modWarn = moduleWarning dflags gre warnings + tokenizedSrc <- mkMaybeTokenizedSrc flags tm + return $! Interface { ifaceMod = mdl , ifaceOrigFilename = msHsFilePath ms @@ -145,7 +149,7 @@ createInterface tm flags modMap instIfaceMap = do , ifaceFamInstances = fam_instances , ifaceHaddockCoverage = coverage , ifaceWarningMap = warningMap - , ifaceTokenizedSrc = Nothing + , ifaceTokenizedSrc = tokenizedSrc } mkAliasMap :: DynFlags -> Maybe RenamedSource -> M.Map Module ModuleName @@ -862,6 +866,30 @@ seqList :: [a] -> () seqList [] = () seqList (x : xs) = x `seq` seqList xs +mkMaybeTokenizedSrc :: [Flag] -> TypecheckedModule + -> ErrMsgGhc (Maybe [RichToken]) +mkMaybeTokenizedSrc flags tm + | Flag_HyperlinkedSource `elem` flags = case renamedSource tm of + Just src -> do + tokens <- liftGhcToErrMsgGhc . liftIO $ mkTokenizedSrc summary src + return $ Just tokens + Nothing -> do + liftErrMsg . tell . pure $ concat + [ "Warning: Cannot hyperlink module \"" + , moduleNameString . ms_mod_name $ summary + , "\" because renamed source is not available" + ] + return Nothing + | otherwise = return Nothing + where + summary = pm_mod_summary . tm_parsed_module $ tm + +mkTokenizedSrc :: ModSummary -> RenamedSource -> IO [RichToken] +mkTokenizedSrc ms src = + Hyperlinker.enrich src . Hyperlinker.parse <$> rawSrc + where + rawSrc = readFile $ msHsFilePath ms + -- | Find a stand-alone documentation comment by its name. findNamedDoc :: String -> [HsDecl Name] -> ErrMsgM (Maybe HsDocString) findNamedDoc name = search From git at git.haskell.org Wed Jul 8 08:41:15 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:41:15 +0000 (UTC) Subject: [commit: haddock] master: Add support for fancy highlighting upon hovering over identifier. (a6bd86a) Message-ID: <20150708084115.186153A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/a6bd86a8550d5d7e8bdb12e1d09036b9f88eed73 >--------------------------------------------------------------- commit a6bd86a8550d5d7e8bdb12e1d09036b9f88eed73 Author: ?ukasz Hanuszczak Date: Mon Jun 22 17:41:31 2015 +0200 Add support for fancy highlighting upon hovering over identifier. >--------------------------------------------------------------- a6bd86a8550d5d7e8bdb12e1d09036b9f88eed73 haddock-api/haddock-api.cabal | 1 + haddock-api/resources/html/highlight.js | 46 ++++++++++++++++++++++ haddock-api/src/Haddock/Backends/Hyperlinker.hs | 10 ++++- .../src/Haddock/Backends/Hyperlinker/Renderer.hs | 23 +++++++---- 4 files changed, 70 insertions(+), 10 deletions(-) diff --git a/haddock-api/haddock-api.cabal b/haddock-api/haddock-api.cabal index 1465699..216627c 100644 --- a/haddock-api/haddock-api.cabal +++ b/haddock-api/haddock-api.cabal @@ -21,6 +21,7 @@ data-files: html/solarized.css html/frames.html html/haddock-util.js + html/highlight.js html/Classic.theme/haskell_icon.gif html/Classic.theme/minus.gif html/Classic.theme/plus.gif diff --git a/haddock-api/resources/html/highlight.js b/haddock-api/resources/html/highlight.js new file mode 100644 index 0000000..639cf5d --- /dev/null +++ b/haddock-api/resources/html/highlight.js @@ -0,0 +1,46 @@ + +var styleForRule = function (rule) { + var sheets = document.styleSheets; + for (var s = 0; s < sheets.length; s++) { + var rules = sheets[s].cssRules; + for (var r = 0; r < rules.length; r++) { + if (rules[r].selectorText == rule) { + return rules[r].style; + } + } + } +}; + +var highlight = function () { + var color = styleForRule("a:hover")["background-color"]; + var links = document.getElementsByTagName('a'); + for (var i = 0; i < links.length; i++) { + var that = links[i]; + if (this.href == that.href) { + that.style["background-color"] = color; + } + } +}; + +/* + * I have no idea what is the proper antonym for "highlight" in this + * context. "Diminish"? "Unhighlight"? "Lowlight" sounds ridiculously + * so I like it. + */ +var lowlight = function () { + var links = document.getElementsByTagName('a'); + for (var i = 0; i < links.length; i++) { + var that = links[i]; + if (this.href == that.href) { + that.style["background-color"] = ""; + } + } +}; + +window.onload = function () { + var links = document.getElementsByTagName('a'); + for (var i = 0; i < links.length; i++) { + links[i].onmouseover = highlight; + links[i].onmouseout = lowlight; + } +}; diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker.hs b/haddock-api/src/Haddock/Backends/Hyperlinker.hs index 66392a6..9337307 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker.hs @@ -16,14 +16,17 @@ ppHyperlinkedSource outdir libdir mstyle ifaces = do createDirectoryIfMissing True $ srcPath outdir let cssFile = fromMaybe (defaultCssFile libdir) mstyle copyFile cssFile $ srcPath outdir srcCssFile + copyFile (libdir "html" highlightScript) $ + srcPath outdir highlightScript mapM_ (ppHyperlinkedModuleSource outdir) ifaces ppHyperlinkedModuleSource :: FilePath -> Interface -> IO () ppHyperlinkedModuleSource outdir iface = case ifaceTokenizedSrc iface of - Just tokens -> writeFile path $ showHtml . render mSrcCssFile $ tokens + Just tokens -> writeFile path $ showHtml . render mCssFile mJsFile $ tokens Nothing -> return () where - mSrcCssFile = Just $ srcCssFile + mCssFile = Just $ srcCssFile + mJsFile = Just $ highlightScript path = srcPath outdir moduleSourceFile (ifaceMod iface) moduleSourceFile :: Module -> FilePath @@ -35,5 +38,8 @@ srcPath outdir = outdir "src" srcCssFile :: FilePath srcCssFile = "style.css" +highlightScript :: FilePath +highlightScript = "highlight.js" + defaultCssFile :: FilePath -> FilePath defaultCssFile libdir = libdir "html" "solarized.css" diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs index 7052475..6d6d201 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs @@ -16,21 +16,28 @@ import qualified Text.XHtml as Html type StyleClass = String -render :: Maybe FilePath -> [RichToken] -> Html -render css tokens = header css <> body tokens +render :: Maybe FilePath -> Maybe FilePath -> [RichToken] -> Html +render mcss mjs tokens = header mcss mjs <> body tokens body :: [RichToken] -> Html body = Html.body . Html.pre . mconcat . map richToken -header :: Maybe FilePath -> Html -header Nothing = Html.noHtml -header (Just css) = - Html.header $ Html.thelink Html.noHtml ! attrs +header :: Maybe FilePath -> Maybe FilePath -> Html +header mcss mjs + | isNothing mcss && isNothing mjs = Html.noHtml +header mcss mjs = + Html.header $ css mcss <> js mjs where - attrs = + css Nothing = Html.noHtml + css (Just cssFile) = Html.thelink Html.noHtml ! [ Html.rel "stylesheet" - , Html.href css , Html.thetype "text/css" + , Html.href cssFile + ] + js Nothing = Html.noHtml + js (Just jsFile) = Html.script Html.noHtml ! + [ Html.thetype "text/javascript" + , Html.src jsFile ] richToken :: RichToken -> Html From git at git.haskell.org Wed Jul 8 08:41:17 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:41:17 +0000 (UTC) Subject: [commit: haddock] master: Add support for hyperlinking field names in record patterns. (a1d3cb1) Message-ID: <20150708084117.244223A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/a1d3cb1d86340cd670e50f88e1cb8bf4a4e64f7b >--------------------------------------------------------------- commit a1d3cb1d86340cd670e50f88e1cb8bf4a4e64f7b Author: ?ukasz Hanuszczak Date: Mon Jun 29 23:15:26 2015 +0200 Add support for hyperlinking field names in record patterns. >--------------------------------------------------------------- a1d3cb1d86340cd670e50f88e1cb8bf4a4e64f7b haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs index fd3f2f1..3b0e0f4 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs @@ -102,7 +102,11 @@ binds = pat term = case cast term of (Just (GHC.L sspan (GHC.VarPat name))) -> pure (sspan, RtkBind name) - (Just (GHC.L _ (GHC.ConPatIn (GHC.L sspan name) _))) -> + (Just (GHC.L _ (GHC.ConPatIn (GHC.L sspan name) recs))) -> + [(sspan, RtkVar name)] ++ everything (<|>) rec recs + _ -> empty + rec term = case cast term of + (Just (GHC.HsRecField (GHC.L sspan name) (_ :: GHC.LPat GHC.Name) _)) -> pure (sspan, RtkVar name) _ -> empty From git at git.haskell.org Wed Jul 8 08:41:19 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:41:19 +0000 (UTC) Subject: [commit: haddock] master: Add simple tests for do-notation parsing. (2426a64) Message-ID: <20150708084119.306FB3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/2426a64771339efb4a776799d9bf593d6b8d09a3 >--------------------------------------------------------------- commit 2426a64771339efb4a776799d9bf593d6b8d09a3 Author: ?ukasz Hanuszczak Date: Sun Jun 28 15:54:30 2015 +0200 Add simple tests for do-notation parsing. >--------------------------------------------------------------- 2426a64771339efb4a776799d9bf593d6b8d09a3 .../test/Haddock/Backends/Hyperlinker/ParserSpec.hs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/haddock-api/test/Haddock/Backends/Hyperlinker/ParserSpec.hs b/haddock-api/test/Haddock/Backends/Hyperlinker/ParserSpec.hs index fa880a3..5e69b44 100644 --- a/haddock-api/test/Haddock/Backends/Hyperlinker/ParserSpec.hs +++ b/haddock-api/test/Haddock/Backends/Hyperlinker/ParserSpec.hs @@ -67,6 +67,24 @@ parseSpec = do , TkIdentifier, TkSpace, TkGlyph, TkSpace, TkIdentifier ] + it "should parse do-notation syntax" $ do + "do { foo <- getLine; putStrLn foo }" `shouldParseTo` + [ TkKeyword, TkSpace, TkSpecial, TkSpace + , TkIdentifier, TkSpace, TkGlyph, TkSpace + , TkIdentifier, TkSpecial, TkSpace + , TkIdentifier, TkSpace, TkIdentifier, TkSpace, TkSpecial + ] + + unlines + [ "do" + , " foo <- getLine" + , " putStrLn foo" + ] `shouldParseTo` + [ TkKeyword, TkSpace, TkIdentifier + , TkSpace, TkGlyph, TkSpace, TkIdentifier, TkSpace + , TkIdentifier, TkSpace, TkIdentifier, TkSpace + ] + shouldParseTo :: String -> [TokenType] -> Expectation str `shouldParseTo` tokens = map tkType (parse str) `shouldBe` tokens From git at git.haskell.org Wed Jul 8 08:41:21 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:41:21 +0000 (UTC) Subject: [commit: haddock] master: Add basic tests related to comment parsing. (f3d1f3c) Message-ID: <20150708084121.3E9F23A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/f3d1f3cbd6e99f5d477a78e05c13b65b9e8b3fae >--------------------------------------------------------------- commit f3d1f3cbd6e99f5d477a78e05c13b65b9e8b3fae Author: ?ukasz Hanuszczak Date: Sun Jun 28 00:49:17 2015 +0200 Add basic tests related to comment parsing. >--------------------------------------------------------------- f3d1f3cbd6e99f5d477a78e05c13b65b9e8b3fae .../src/Haddock/Backends/Hyperlinker/Parser.hs | 2 +- .../Haddock/Backends/Hyperlinker/ParserSpec.hs | 37 +++++++++++++++++++++- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs index bab5ba0..019075a 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs @@ -38,7 +38,7 @@ data TokenType | TkCpp | TkPragma | TkUnknown - deriving (Eq) + deriving (Show, Eq) -- | Turn source code string into a stream of more descriptive tokens. -- diff --git a/haddock-api/test/Haddock/Backends/Hyperlinker/ParserSpec.hs b/haddock-api/test/Haddock/Backends/Hyperlinker/ParserSpec.hs index c85fa47..d596422 100644 --- a/haddock-api/test/Haddock/Backends/Hyperlinker/ParserSpec.hs +++ b/haddock-api/test/Haddock/Backends/Hyperlinker/ParserSpec.hs @@ -9,9 +9,44 @@ import Haddock.Backends.Hyperlinker.Parser main :: IO () main = hspec spec + spec :: Spec spec = do describe "parse" parseSpec + parseSpec :: Spec -parseSpec = return () +parseSpec = do + + context "when parsing single-line comments" $ do + + it "should ignore content until the end of line" $ + "-- some very simple comment\nidentifier" + `shouldParseTo` + [TkComment, TkSpace, TkIdentifier] + + it "should allow endline escaping" $ + "-- first line\\\nsecond line\\\nand another one" + `shouldParseTo` + [TkComment] + + context "when parsing multi-line comments" $ do + + it "should support nested comments" $ + "{- comment {- nested -} still comment -} {- next comment -}" + `shouldParseTo` + [TkComment, TkSpace, TkComment] + + it "should distinguish compiler pragma" $ + "{- comment -}{-# LANGUAGE GADTs #-}{- comment -}" + `shouldParseTo` + [TkComment, TkPragma, TkComment] + + it "should recognize preprocessor directives" $ do + "\n#define foo bar" `shouldParseTo` [TkSpace, TkCpp] + "x # y" `shouldParseTo` + [TkIdentifier, TkSpace, TkCpp, TkSpace,TkIdentifier] + + +shouldParseTo :: String -> [TokenType] -> Expectation +str `shouldParseTo` tokens = map tkType (parse str) `shouldBe` tokens From git at git.haskell.org Wed Jul 8 08:41:23 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:41:23 +0000 (UTC) Subject: [commit: haddock] master: Setup HSpec framework for Haddock API package. (d44fc5b) Message-ID: <20150708084123.4F1D03A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/d44fc5b2b40e26e76d2fe7ac0a47bea84154cf67 >--------------------------------------------------------------- commit d44fc5b2b40e26e76d2fe7ac0a47bea84154cf67 Author: ?ukasz Hanuszczak Date: Sun Jun 28 00:00:33 2015 +0200 Setup HSpec framework for Haddock API package. >--------------------------------------------------------------- d44fc5b2b40e26e76d2fe7ac0a47bea84154cf67 haddock-api/haddock-api.cabal | 31 ++++++++++++++++++++++ .../Haddock/Backends/Hyperlinker/ParserSpec.hs | 17 ++++++++++++ {haddock-library => haddock-api}/test/Spec.hs | 0 3 files changed, 48 insertions(+) diff --git a/haddock-api/haddock-api.cabal b/haddock-api/haddock-api.cabal index 23c4497..56889e6 100644 --- a/haddock-api/haddock-api.cabal +++ b/haddock-api/haddock-api.cabal @@ -96,6 +96,37 @@ library Haddock.Convert Paths_haddock_api +test-suite spec + type: exitcode-stdio-1.0 + default-language: Haskell2010 + main-is: Spec.hs + ghc-options: -Wall + + hs-source-dirs: + test + , src + + other-modules: + Haddock.Backends.Hyperlinker.ParserSpec + + build-depends: + base >= 4.3 && < 4.9 + , bytestring + , filepath + , directory + , containers + , deepseq + , array + , xhtml >= 3000.2 && < 3000.3 + , Cabal >= 1.10 + , ghc >= 7.10 && < 7.10.2 + + , ghc-paths + , haddock-library == 1.2.* + + , hspec + , QuickCheck == 2.* + source-repository head type: git location: https://github.com/haskell/haddock.git diff --git a/haddock-api/test/Haddock/Backends/Hyperlinker/ParserSpec.hs b/haddock-api/test/Haddock/Backends/Hyperlinker/ParserSpec.hs new file mode 100644 index 0000000..c85fa47 --- /dev/null +++ b/haddock-api/test/Haddock/Backends/Hyperlinker/ParserSpec.hs @@ -0,0 +1,17 @@ +module Haddock.Backends.Hyperlinker.ParserSpec (main, spec) where + + +import Test.Hspec + +import Haddock.Backends.Hyperlinker.Parser + + +main :: IO () +main = hspec spec + +spec :: Spec +spec = do + describe "parse" parseSpec + +parseSpec :: Spec +parseSpec = return () diff --git a/haddock-library/test/Spec.hs b/haddock-api/test/Spec.hs similarity index 100% copy from haddock-library/test/Spec.hs copy to haddock-api/test/Spec.hs From git at git.haskell.org Wed Jul 8 08:41:25 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:41:25 +0000 (UTC) Subject: [commit: haddock] master: Add support for hyperlinking field names in record expressions. (7d26944) Message-ID: <20150708084125.5A8823A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/7d269444ea9c55a2b364ead45fe06d435fa078b2 >--------------------------------------------------------------- commit 7d269444ea9c55a2b364ead45fe06d435fa078b2 Author: ?ukasz Hanuszczak Date: Mon Jun 29 23:41:10 2015 +0200 Add support for hyperlinking field names in record expressions. >--------------------------------------------------------------- 7d269444ea9c55a2b364ead45fe06d435fa078b2 haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs index 3b0e0f4..c41b5e5 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs @@ -69,11 +69,17 @@ enrichToken _ _ = Nothing -- | Obtain details map for variables ("normally" used identifiers). variables :: GHC.RenamedSource -> DetailsMap variables = - everything (<|>) var + everything (<|>) (var `combine` rec) where var term = case cast term of (Just (GHC.L sspan (GHC.HsVar name))) -> pure (sspan, RtkVar name) + (Just (GHC.L _ (GHC.RecordCon (GHC.L sspan name) _ _))) -> + pure (sspan, RtkVar name) + _ -> empty + rec term = case cast term of + Just (GHC.HsRecField (GHC.L sspan name) (_ :: GHC.LHsExpr GHC.Name) _) -> + pure (sspan, RtkVar name) _ -> empty -- | Obtain details map for types. From git at git.haskell.org Wed Jul 8 08:41:27 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:41:27 +0000 (UTC) Subject: [commit: haddock] master: Add test case for literal syntax highlighting. (9dfb3f8) Message-ID: <20150708084127.6AF963A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/9dfb3f87cf71042eb883e228a8c6c7f25c743118 >--------------------------------------------------------------- commit 9dfb3f87cf71042eb883e228a8c6c7f25c743118 Author: ?ukasz Hanuszczak Date: Tue Jun 30 20:30:37 2015 +0200 Add test case for literal syntax highlighting. >--------------------------------------------------------------- 9dfb3f87cf71042eb883e228a8c6c7f25c743118 hypsrc-test/src/Literals.hs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/hypsrc-test/src/Literals.hs b/hypsrc-test/src/Literals.hs new file mode 100644 index 0000000..997b661 --- /dev/null +++ b/hypsrc-test/src/Literals.hs @@ -0,0 +1,17 @@ +module Literals where + + +str :: String +str = "str literal" + +num :: Num a => a +num = 0 + 1 + 1010011 * 41231 + 12131 + +frac :: Fractional a => a +frac = 42.0000001 + +list :: [[[[a]]]] +list = [[], [[]], [[[]]]] + +pair :: ((), ((), (), ()), ()) +pair = ((), ((), (), ()), ()) From git at git.haskell.org Wed Jul 8 08:41:29 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:41:29 +0000 (UTC) Subject: [commit: haddock] master: Add test case for basic identifier hyperlinking. (3b6cbe3) Message-ID: <20150708084129.7CA143A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/3b6cbe3ac03d03ea9824770a54868e41d8cf13b6 >--------------------------------------------------------------- commit 3b6cbe3ac03d03ea9824770a54868e41d8cf13b6 Author: ?ukasz Hanuszczak Date: Tue Jun 30 19:48:24 2015 +0200 Add test case for basic identifier hyperlinking. >--------------------------------------------------------------- 3b6cbe3ac03d03ea9824770a54868e41d8cf13b6 hypsrc-test/src/Identifiers.hs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/hypsrc-test/src/Identifiers.hs b/hypsrc-test/src/Identifiers.hs new file mode 100644 index 0000000..e2d6223 --- /dev/null +++ b/hypsrc-test/src/Identifiers.hs @@ -0,0 +1,27 @@ +module Identifiers where + + +foo, bar, baz :: Int -> Int -> Int +foo x y = x + x * bar y x * y + y +bar x y = y + x - baz x y - x + y +baz x y = x * y * y * y * x + +quux :: Int -> Int +quux x = foo (bar x x) (bar x x) + +norf :: Int -> Int -> Int -> Int +norf x y z + | x < 0 = quux x + | y < 0 = quux y + | z < 0 = quux z + | otherwise = norf (-x) (-y) (-z) + + +main :: IO () +main = do + putStrLn . show $ foo x y + putStrLn . show $ quux z + where + x = 10 + y = 20 + z = 30 From git at git.haskell.org Wed Jul 8 08:41:31 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:41:31 +0000 (UTC) Subject: [commit: haddock] master: Add very simple QuickCheck properties for source parser spec. (5ddb425) Message-ID: <20150708084131.899263A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/5ddb425bbdc29efdd314ffc18db6c8e6c3609d24 >--------------------------------------------------------------- commit 5ddb425bbdc29efdd314ffc18db6c8e6c3609d24 Author: ?ukasz Hanuszczak Date: Sun Jun 28 23:58:24 2015 +0200 Add very simple QuickCheck properties for source parser spec. >--------------------------------------------------------------- 5ddb425bbdc29efdd314ffc18db6c8e6c3609d24 haddock-api/test/Haddock/Backends/Hyperlinker/ParserSpec.hs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/haddock-api/test/Haddock/Backends/Hyperlinker/ParserSpec.hs b/haddock-api/test/Haddock/Backends/Hyperlinker/ParserSpec.hs index 5e69b44..38cdbc8 100644 --- a/haddock-api/test/Haddock/Backends/Hyperlinker/ParserSpec.hs +++ b/haddock-api/test/Haddock/Backends/Hyperlinker/ParserSpec.hs @@ -2,6 +2,7 @@ module Haddock.Backends.Hyperlinker.ParserSpec (main, spec) where import Test.Hspec +import Test.QuickCheck import Haddock.Backends.Hyperlinker.Parser @@ -18,6 +19,12 @@ spec = do parseSpec :: Spec parseSpec = do + it "is total" $ + property $ \src -> length (parse src) `shouldSatisfy` (>= 0) + + it "retains file layout" $ + property $ \src -> concatMap tkValue (parse src) == src + context "when parsing single-line comments" $ do it "should ignore content until the end of line" $ From git at git.haskell.org Wed Jul 8 08:41:33 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:41:33 +0000 (UTC) Subject: [commit: haddock] master: Add support for hyperlinking constructor names in patters. (d6cfd26) Message-ID: <20150708084133.95C803A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/d6cfd266b30066a5452514b26e50b740104a982b >--------------------------------------------------------------- commit d6cfd266b30066a5452514b26e50b740104a982b Author: ?ukasz Hanuszczak Date: Mon Jun 29 23:00:54 2015 +0200 Add support for hyperlinking constructor names in patters. >--------------------------------------------------------------- d6cfd266b30066a5452514b26e50b740104a982b haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs index 5efcd2e..fd3f2f1 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs @@ -102,6 +102,8 @@ binds = pat term = case cast term of (Just (GHC.L sspan (GHC.VarPat name))) -> pure (sspan, RtkBind name) + (Just (GHC.L _ (GHC.ConPatIn (GHC.L sspan name) _))) -> + pure (sspan, RtkVar name) _ -> empty -- | Obtain details map for top-level declarations. From git at git.haskell.org Wed Jul 8 08:41:35 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:41:35 +0000 (UTC) Subject: [commit: haddock] master: Create simple test runner for hyperlinker tests. (5f13457) Message-ID: <20150708084135.AB8FF3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/5f13457a8e31f424d797f721e93434e09bc9140a >--------------------------------------------------------------- commit 5f13457a8e31f424d797f721e93434e09bc9140a Author: ?ukasz Hanuszczak Date: Tue Jun 30 19:38:21 2015 +0200 Create simple test runner for hyperlinker tests. >--------------------------------------------------------------- 5f13457a8e31f424d797f721e93434e09bc9140a hypsrc-test/run.hs | 119 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) diff --git a/hypsrc-test/run.hs b/hypsrc-test/run.hs new file mode 100755 index 0000000..0b97a07 --- /dev/null +++ b/hypsrc-test/run.hs @@ -0,0 +1,119 @@ +#!/usr/bin/env runhaskell +{-# LANGUAGE CPP #-} + + +import Control.Applicative +import Control.Monad + +import Data.List +import Data.Maybe + +import System.IO +import System.Directory +import System.Environment +import System.Exit +import System.FilePath +import System.Process + +import Distribution.Verbosity +import Distribution.Simple.Utils hiding (die) + + +baseDir, rootDir :: FilePath +baseDir = takeDirectory __FILE__ +rootDir = baseDir ".." + +srcDir, refDir, outDir :: FilePath +srcDir = baseDir "src" +refDir = baseDir "ref" +outDir = baseDir "out" + +haddockPath :: FilePath +haddockPath = rootDir "dist" "build" "haddock" "haddock" + + +main :: IO () +main = do + haddockAvailable <- doesFileExist haddockPath + unless haddockAvailable $ die "Haddock exectuable not available" + + (args, mods) <- partition ("-" `isPrefixOf`) <$> getArgs + let args' = filter (\arg -> not $ arg == "--all" || arg == "-a") args + mods' <- map (srcDir ) <$> if "--all" `elem` args || "-a" `elem` args + then getAllSrcModules + else return mods + + putHaddockVersion + putGhcVersion + + putStrLn "Running tests..." + runHaddock $ + [ "--odir=" ++ outDir + , "--no-warnings" + , "--hyperlinked-source" + ] ++ args' ++ mods' + + forM_ mods' $ check True + + +check :: Bool -> FilePath -> IO () +check strict mdl = do + hasReference <- doesFileExist refFile + if hasReference + then do + out <- readFile outFile + ref <- readFile refFile + if out == ref + then putStrLn $ "Pass: " ++ mdl + else do + putStrLn $ "Fail: " ++ mdl + diff refFile outFile + when strict $ die "Aborting further tests." + else do + putStrLn $ "Pass: " ++ mdl ++ " (no reference file)" + where + refFile = refDir takeBaseName mdl ++ ".html" + outFile = outDir takeBaseName mdl ++ ".html" + + +diff :: FilePath -> FilePath -> IO () +diff fileA fileB = do + colorDiffPath <- findProgramLocation silent "colordiff" + let cmd = fromMaybe "diff" colorDiffPath + + result <- system $ cmd ++ " " ++ fileA ++ " " ++ fileB + unless (result == ExitSuccess) $ die "Failed to run `diff` command." + + +getAllSrcModules :: IO [FilePath] +getAllSrcModules = + filter isValid <$> getDirectoryContents srcDir + where + isValid = (== ".hs") . takeExtension + + +putHaddockVersion :: IO () +putHaddockVersion = do + putStrLn "Haddock version:" + runHaddock ["--version"] + putStrLn "" + + +putGhcVersion :: IO () +putGhcVersion = do + putStrLn "GHC version:" + runHaddock ["--ghc-version"] + putStrLn "" + + +runHaddock :: [String] -> IO () +runHaddock args = do + env <- Just <$> getEnvironment + handle <- runProcess haddockPath args Nothing env Nothing Nothing Nothing + waitForSuccess handle $ "Failed to invoke haddock with " ++ show args + + +waitForSuccess :: ProcessHandle -> String -> IO () +waitForSuccess handle msg = do + result <- waitForProcess handle + unless (result == ExitSuccess) $ die msg From git at git.haskell.org Wed Jul 8 08:41:37 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:41:37 +0000 (UTC) Subject: [commit: haddock] master: Add test case for constructor hyperlinking. (95dfb7a) Message-ID: <20150708084137.BC7413A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/95dfb7ab280d69d2bc2eb7f9ab0c4c3deae53cc2 >--------------------------------------------------------------- commit 95dfb7ab280d69d2bc2eb7f9ab0c4c3deae53cc2 Author: ?ukasz Hanuszczak Date: Tue Jun 30 20:10:08 2015 +0200 Add test case for constructor hyperlinking. >--------------------------------------------------------------- 95dfb7ab280d69d2bc2eb7f9ab0c4c3deae53cc2 hypsrc-test/src/Constructors.hs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/hypsrc-test/src/Constructors.hs b/hypsrc-test/src/Constructors.hs new file mode 100644 index 0000000..c52bdc7 --- /dev/null +++ b/hypsrc-test/src/Constructors.hs @@ -0,0 +1,27 @@ +module Constructors where + + +data Foo + = Bar + | Baz + | Quux Foo Int + +newtype Norf = Norf (Foo, [Foo], Foo) + + +bar, baz, quux :: Foo +bar = Bar +baz = Baz +quux = Quux quux 0 + + +unfoo :: Foo -> Int +unfoo Bar = 0 +unfoo Baz = 0 +unfoo (Quux foo n) = 42 * n + unfoo foo + + +unnorf :: Norf -> [Foo] +unnorf (Norf (Bar, xs, Bar)) = xs +unnorf (Norf (Baz, xs, Baz)) = reverse xs +unnorf _ = undefined From git at git.haskell.org Wed Jul 8 08:41:39 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:41:39 +0000 (UTC) Subject: [commit: haddock] master: Make hyperlinker respect pretty-printer flag and add documentation. (6bebd57) Message-ID: <20150708084139.C928E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/6bebd572bc673d10ed68096f935cdc5a9d1839b5 >--------------------------------------------------------------- commit 6bebd572bc673d10ed68096f935cdc5a9d1839b5 Author: ?ukasz Hanuszczak Date: Tue Jun 30 21:58:08 2015 +0200 Make hyperlinker respect pretty-printer flag and add documentation. >--------------------------------------------------------------- 6bebd572bc673d10ed68096f935cdc5a9d1839b5 haddock-api/src/Haddock.hs | 2 +- haddock-api/src/Haddock/Backends/Hyperlinker.hs | 30 +++++++++++++++++++------ 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/haddock-api/src/Haddock.hs b/haddock-api/src/Haddock.hs index c76966f..02e1953 100644 --- a/haddock-api/src/Haddock.hs +++ b/haddock-api/src/Haddock.hs @@ -321,7 +321,7 @@ render dflags flags qual ifaces installedIfaces srcMap = do libDir when (Flag_HyperlinkedSource `elem` flags) $ do - ppHyperlinkedSource odir libDir opt_source_css pkgKey srcMap ifaces + ppHyperlinkedSource odir libDir opt_source_css pretty pkgKey srcMap ifaces -- | From GHC 7.10, this function has a potential to crash with a -- nasty message such as @expectJust getPackageDetails@ because diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker.hs b/haddock-api/src/Haddock/Backends/Hyperlinker.hs index f2caa2c..1fadef4 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker.hs @@ -14,35 +14,51 @@ import Data.Maybe import System.Directory import System.FilePath -ppHyperlinkedSource :: FilePath -> FilePath -> Maybe FilePath - -> PackageKey -> SrcMap -> [Interface] + +-- | Generate hyperlinked source for given interfaces. +-- +-- Note that list of interfaces should also contain interfaces normally hidden +-- when generating documentation. Otherwise this could lead to dead links in +-- produced source. +ppHyperlinkedSource :: FilePath -- ^ Output directory + -> FilePath -- ^ Resource directory + -> Maybe FilePath -- ^ Custom CSS file path + -> Bool -- ^ Flag indicating whether to pretty-print HTML + -> PackageKey -- ^ Package for which we create source + -> SrcMap -- ^ Paths to external sources + -> [Interface] -- ^ Interfaces for which we create source -> IO () -ppHyperlinkedSource outdir libdir mstyle pkg srcs ifaces = do +ppHyperlinkedSource outdir libdir mstyle pretty pkg srcs ifaces = do createDirectoryIfMissing True srcdir let cssFile = fromMaybe (defaultCssFile libdir) mstyle copyFile cssFile $ srcdir srcCssFile copyFile (libdir "html" highlightScript) $ srcdir highlightScript - mapM_ (ppHyperlinkedModuleSource srcdir pkg srcs) ifaces + mapM_ (ppHyperlinkedModuleSource srcdir pretty pkg srcs) ifaces where srcdir = outdir hypSrcDir -ppHyperlinkedModuleSource :: FilePath +-- | Generate hyperlinked source for particular interface. +ppHyperlinkedModuleSource :: FilePath -> Bool -> PackageKey -> SrcMap -> Interface -> IO () -ppHyperlinkedModuleSource srcdir pkg srcs iface = +ppHyperlinkedModuleSource srcdir pretty pkg srcs iface = case ifaceTokenizedSrc iface of - Just tokens -> writeFile path . showHtml . render' $ tokens + Just tokens -> writeFile path . html . render' $ tokens Nothing -> return () where render' = render (Just srcCssFile) (Just highlightScript) pkg srcs + html = if pretty then renderHtml else showHtml path = srcdir hypSrcModuleFile (ifaceMod iface) +-- | Name of CSS file in output directory. srcCssFile :: FilePath srcCssFile = "style.css" +-- | Name of highlight script in output and resource directory. highlightScript :: FilePath highlightScript = "highlight.js" +-- | Path to default CSS file. defaultCssFile :: FilePath -> FilePath defaultCssFile libdir = libdir "html" "solarized.css" From git at git.haskell.org Wed Jul 8 08:41:41 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:41:41 +0000 (UTC) Subject: [commit: haddock] master: Add test case for record expressions and patterns hyperlinking. (354d329) Message-ID: <20150708084141.D88743A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/354d3296371099bad2729cf7b5445d23a107c6c5 >--------------------------------------------------------------- commit 354d3296371099bad2729cf7b5445d23a107c6c5 Author: ?ukasz Hanuszczak Date: Tue Jun 30 20:18:42 2015 +0200 Add test case for record expressions and patterns hyperlinking. >--------------------------------------------------------------- 354d3296371099bad2729cf7b5445d23a107c6c5 hypsrc-test/src/Records.hs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/hypsrc-test/src/Records.hs b/hypsrc-test/src/Records.hs new file mode 100644 index 0000000..4118e29 --- /dev/null +++ b/hypsrc-test/src/Records.hs @@ -0,0 +1,25 @@ +{-# LANGUAGE NamedFieldPuns #-} + +module Records where + + +data Point = Point + { x :: !Int + , y :: !Int + } + + +point :: Int -> Int -> Point +point x y = Point { x = x, y = y } + + +lengthSqr :: Point -> Int +lengthSqr (Point { x = x, y = y }) = x * x + y * y + +lengthSqr' :: Point -> Int +lengthSqr' (Point { x, y }) = y * y + x * x + + +translateX, translateY :: Point -> Int -> Point +translateX p d = p { x = x p + d } +translateY p d = p { y = y p + d } From git at git.haskell.org Wed Jul 8 08:41:43 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:41:43 +0000 (UTC) Subject: [commit: haddock] master: Add tests related to parsing basic language constructs. (86ccbbf) Message-ID: <20150708084143.E45573A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/86ccbbf208fad2b27d2d76d9a32a80b452274d2e >--------------------------------------------------------------- commit 86ccbbf208fad2b27d2d76d9a32a80b452274d2e Author: ?ukasz Hanuszczak Date: Sun Jun 28 12:41:08 2015 +0200 Add tests related to parsing basic language constructs. >--------------------------------------------------------------- 86ccbbf208fad2b27d2d76d9a32a80b452274d2e .../test/Haddock/Backends/Hyperlinker/ParserSpec.hs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/haddock-api/test/Haddock/Backends/Hyperlinker/ParserSpec.hs b/haddock-api/test/Haddock/Backends/Hyperlinker/ParserSpec.hs index d596422..fa880a3 100644 --- a/haddock-api/test/Haddock/Backends/Hyperlinker/ParserSpec.hs +++ b/haddock-api/test/Haddock/Backends/Hyperlinker/ParserSpec.hs @@ -47,6 +47,26 @@ parseSpec = do "x # y" `shouldParseTo` [TkIdentifier, TkSpace, TkCpp, TkSpace,TkIdentifier] + it "should distinguish basic language constructs" $ do + "(* 2) <$> (\"abc\", foo)" `shouldParseTo` + [ TkSpecial, TkOperator, TkSpace, TkNumber, TkSpecial + , TkSpace, TkOperator, TkSpace + , TkSpecial, TkString, TkSpecial, TkSpace, TkIdentifier, TkSpecial + ] + "let foo' = foo in foo' + foo'" `shouldParseTo` + [ TkKeyword, TkSpace, TkIdentifier + , TkSpace, TkGlyph, TkSpace + , TkIdentifier, TkSpace, TkKeyword, TkSpace + , TkIdentifier, TkSpace, TkOperator, TkSpace, TkIdentifier + ] + "square x = y^2 where y = x" `shouldParseTo` + [ TkIdentifier, TkSpace, TkIdentifier + , TkSpace, TkGlyph, TkSpace + , TkIdentifier, TkOperator, TkNumber + , TkSpace, TkKeyword, TkSpace + , TkIdentifier, TkSpace, TkGlyph, TkSpace, TkIdentifier + ] + shouldParseTo :: String -> [TokenType] -> Expectation str `shouldParseTo` tokens = map tkType (parse str) `shouldBe` tokens From git at git.haskell.org Wed Jul 8 08:41:46 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:41:46 +0000 (UTC) Subject: [commit: haddock] master: Add test case for operator hyperlinking. (15ac1a8) Message-ID: <20150708084146.0163A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/15ac1a816a9875591febcf678bbf914a11e5068f >--------------------------------------------------------------- commit 15ac1a816a9875591febcf678bbf914a11e5068f Author: ?ukasz Hanuszczak Date: Tue Jun 30 20:00:32 2015 +0200 Add test case for operator hyperlinking. >--------------------------------------------------------------- 15ac1a816a9875591febcf678bbf914a11e5068f hypsrc-test/src/Operators.hs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/hypsrc-test/src/Operators.hs b/hypsrc-test/src/Operators.hs new file mode 100644 index 0000000..bc76c2d --- /dev/null +++ b/hypsrc-test/src/Operators.hs @@ -0,0 +1,18 @@ +module Operators where + + +(+++) :: [a] -> [a] -> [a] +a +++ b = a ++ b ++ a + +($$$) :: [a] -> [a] -> [a] +a $$$ b = b +++ a + +(***) :: [a] -> [a] -> [a] +(***) a [] = a +(***) a (_:b) = a +++ (a *** b) + +(*/\*) :: [[a]] -> [a] -> [a] +a */\* b = concatMap (*** b) a + +(**/\**) :: [[a]] -> [[a]] -> [[a]] +a **/\** b = zipWith (*/\*) [a +++ b] (a $$$ b) From git at git.haskell.org Wed Jul 8 08:41:48 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:41:48 +0000 (UTC) Subject: [commit: haddock] master: Unexpose hyperlinker modules in Cabal configuration. (fe22eda) Message-ID: <20150708084148.0F4BF3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/fe22edadb6071e0b8e83c2ddff21d28bbe922a68 >--------------------------------------------------------------- commit fe22edadb6071e0b8e83c2ddff21d28bbe922a68 Author: ?ukasz Hanuszczak Date: Tue Jun 30 22:00:14 2015 +0200 Unexpose hyperlinker modules in Cabal configuration. >--------------------------------------------------------------- fe22edadb6071e0b8e83c2ddff21d28bbe922a68 haddock-api/haddock-api.cabal | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/haddock-api/haddock-api.cabal b/haddock-api/haddock-api.cabal index 7670f88..23c4497 100644 --- a/haddock-api/haddock-api.cabal +++ b/haddock-api/haddock-api.cabal @@ -59,9 +59,6 @@ library exposed-modules: Documentation.Haddock - Haddock.Backends.Hyperlinker.Parser - Haddock.Backends.Hyperlinker.Renderer - Haddock.Backends.Hyperlinker.Ast other-modules: Haddock @@ -85,6 +82,9 @@ library Haddock.Backends.HaddockDB Haddock.Backends.Hoogle Haddock.Backends.Hyperlinker + Haddock.Backends.Hyperlinker.Ast + Haddock.Backends.Hyperlinker.Parser + Haddock.Backends.Hyperlinker.Renderer Haddock.Backends.Hyperlinker.Utils Haddock.ModuleTree Haddock.Types From git at git.haskell.org Wed Jul 8 08:41:50 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:41:50 +0000 (UTC) Subject: [commit: haddock] master: Adapt hyperlinker test runner to have the same interface as HTML one. (beab75b) Message-ID: <20150708084150.1E8683A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/beab75b0d28117c9b1e56d3a88e8aac70d5bd0b9 >--------------------------------------------------------------- commit beab75b0d28117c9b1e56d3a88e8aac70d5bd0b9 Author: ?ukasz Hanuszczak Date: Tue Jun 30 21:23:31 2015 +0200 Adapt hyperlinker test runner to have the same interface as HTML one. >--------------------------------------------------------------- beab75b0d28117c9b1e56d3a88e8aac70d5bd0b9 hypsrc-test/run.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hypsrc-test/run.hs b/hypsrc-test/run.hs index 0b97a07..549f33f 100755 --- a/hypsrc-test/run.hs +++ b/hypsrc-test/run.hs @@ -39,9 +39,9 @@ main = do (args, mods) <- partition ("-" `isPrefixOf`) <$> getArgs let args' = filter (\arg -> not $ arg == "--all" || arg == "-a") args - mods' <- map (srcDir ) <$> if "--all" `elem` args || "-a" `elem` args - then getAllSrcModules - else return mods + mods' <- map (srcDir ) <$> case args of + [] -> getAllSrcModules + _ -> return $ map (++ ".hs") mods putHaddockVersion putGhcVersion From git at git.haskell.org Wed Jul 8 08:41:52 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:41:52 +0000 (UTC) Subject: [commit: haddock] master: Fix hyperlinker test runner file paths and add pretty-printing option. (5da9073) Message-ID: <20150708084152.2D4773A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/5da90733ea03cdb935478e0665b45fe44c116728 >--------------------------------------------------------------- commit 5da90733ea03cdb935478e0665b45fe44c116728 Author: ?ukasz Hanuszczak Date: Tue Jun 30 22:28:12 2015 +0200 Fix hyperlinker test runner file paths and add pretty-printing option. >--------------------------------------------------------------- 5da90733ea03cdb935478e0665b45fe44c116728 hypsrc-test/run.hs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hypsrc-test/run.hs b/hypsrc-test/run.hs index 549f33f..e9a38c0 100755 --- a/hypsrc-test/run.hs +++ b/hypsrc-test/run.hs @@ -23,10 +23,12 @@ baseDir, rootDir :: FilePath baseDir = takeDirectory __FILE__ rootDir = baseDir ".." -srcDir, refDir, outDir :: FilePath +srcDir, refDir, outDir, refDir', outDir' :: FilePath srcDir = baseDir "src" refDir = baseDir "ref" outDir = baseDir "out" +refDir' = refDir "src" +outDir' = outDir "src" haddockPath :: FilePath haddockPath = rootDir "dist" "build" "haddock" "haddock" @@ -51,6 +53,7 @@ main = do [ "--odir=" ++ outDir , "--no-warnings" , "--hyperlinked-source" + , "--pretty-html" ] ++ args' ++ mods' forM_ mods' $ check True @@ -72,8 +75,8 @@ check strict mdl = do else do putStrLn $ "Pass: " ++ mdl ++ " (no reference file)" where - refFile = refDir takeBaseName mdl ++ ".html" - outFile = outDir takeBaseName mdl ++ ".html" + refFile = refDir' takeBaseName mdl ++ ".html" + outFile = outDir' takeBaseName mdl ++ ".html" diff :: FilePath -> FilePath -> IO () From git at git.haskell.org Wed Jul 8 08:41:54 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:41:54 +0000 (UTC) Subject: [commit: haddock] master: Add hyperlinker test runner to .cabal and .gitignore files. (cddb709) Message-ID: <20150708084154.386483A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/cddb70986db0f34427cf74cc93352b1ed10ed56b >--------------------------------------------------------------- commit cddb70986db0f34427cf74cc93352b1ed10ed56b Author: ?ukasz Hanuszczak Date: Tue Jun 30 21:18:46 2015 +0200 Add hyperlinker test runner to .cabal and .gitignore files. >--------------------------------------------------------------- cddb70986db0f34427cf74cc93352b1ed10ed56b .gitignore | 1 + haddock.cabal | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/.gitignore b/.gitignore index f07c758..3c9798c 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ /haddock-api/dist/ /haddock-library/dist/ /html-test/out/ +/hypsrc-test/out/ /latex-test/out/ /doc/haddock diff --git a/haddock.cabal b/haddock.cabal index 0aebefd..01e6a55 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -29,6 +29,8 @@ extra-source-files: haddock-api/src/haddock.sh html-test/src/*.hs html-test/ref/*.html + hypsrc-test/src/*.hs + hypsrc-test/ref/*.html latex-test/src/Simple/*.hs latex-test/ref/Simple/*.tex latex-test/ref/Simple/*.sty @@ -120,6 +122,13 @@ test-suite html-test hs-source-dirs: html-test build-depends: base, directory, process, filepath, Cabal +test-suite hypsrc-test + type: exitcode-stdio-1.0 + default-language: Haskell2010 + main-is: run.hs + hs-source-dirs: hypsrc-test + build-depends: base, directory, process, filepath, Cabal + test-suite latex-test type: exitcode-stdio-1.0 default-language: Haskell2010 From git at git.haskell.org Wed Jul 8 08:41:56 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:41:56 +0000 (UTC) Subject: [commit: haddock] master: Add reference files for hyperlinker test cases. (40d0a05) Message-ID: <20150708084156.558333A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/40d0a050c81ff21949fc7eeede4e0dbb3b1d7c98 >--------------------------------------------------------------- commit 40d0a050c81ff21949fc7eeede4e0dbb3b1d7c98 Author: ?ukasz Hanuszczak Date: Tue Jun 30 22:29:34 2015 +0200 Add reference files for hyperlinker test cases. >--------------------------------------------------------------- 40d0a050c81ff21949fc7eeede4e0dbb3b1d7c98 hypsrc-test/ref/src/Constructors.html | 536 +++++++++++++++++++++++ hypsrc-test/ref/src/Identifiers.html | 800 ++++++++++++++++++++++++++++++++++ hypsrc-test/ref/src/Literals.html | 382 ++++++++++++++++ hypsrc-test/ref/src/Operators.html | 655 ++++++++++++++++++++++++++++ hypsrc-test/ref/src/Records.html | 646 +++++++++++++++++++++++++++ 5 files changed, 3019 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 40d0a050c81ff21949fc7eeede4e0dbb3b1d7c98 From git at git.haskell.org Wed Jul 8 08:41:58 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:41:58 +0000 (UTC) Subject: [commit: haddock] master: Make hyperlinker test runner strip local links from generated source. (395a9c3) Message-ID: <20150708084158.661DC3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/395a9c3941f8b8891cffa5c17e1f6ae414edaa79 >--------------------------------------------------------------- commit 395a9c3941f8b8891cffa5c17e1f6ae414edaa79 Author: ?ukasz Hanuszczak Date: Wed Jul 1 00:47:32 2015 +0200 Make hyperlinker test runner strip local links from generated source. >--------------------------------------------------------------- 395a9c3941f8b8891cffa5c17e1f6ae414edaa79 hypsrc-test/Utils.hs | 26 ++++++++++++++++++++++++++ hypsrc-test/run.hs | 37 +++++++++++++++++++++++++++---------- 2 files changed, 53 insertions(+), 10 deletions(-) diff --git a/hypsrc-test/Utils.hs b/hypsrc-test/Utils.hs new file mode 100644 index 0000000..cf3e94e --- /dev/null +++ b/hypsrc-test/Utils.hs @@ -0,0 +1,26 @@ +module Utils + ( stripLocalAnchors + , stripLocalLinks + , stripLocalReferences + ) where + + +import Data.List + + +replaceBetween :: Eq a => [a] -> a -> [a] -> [a] -> [a] +replaceBetween _ _ _ [] = [] +replaceBetween pref end val html@(x:xs') = case stripPrefix pref html of + Just strip -> pref ++ val ++ (replaceBetween' . dropWhile (/= end)) strip + Nothing -> x:(replaceBetween' xs') + where + replaceBetween' = replaceBetween pref end val + +stripLocalAnchors :: String -> String +stripLocalAnchors = replaceBetween " String +stripLocalLinks = replaceBetween " String +stripLocalReferences = stripLocalLinks . stripLocalAnchors diff --git a/hypsrc-test/run.hs b/hypsrc-test/run.hs index e9a38c0..5b6b654 100755 --- a/hypsrc-test/run.hs +++ b/hypsrc-test/run.hs @@ -18,6 +18,8 @@ import System.Process import Distribution.Verbosity import Distribution.Simple.Utils hiding (die) +import Utils + baseDir, rootDir :: FilePath baseDir = takeDirectory __FILE__ @@ -64,14 +66,9 @@ check strict mdl = do hasReference <- doesFileExist refFile if hasReference then do - out <- readFile outFile ref <- readFile refFile - if out == ref - then putStrLn $ "Pass: " ++ mdl - else do - putStrLn $ "Fail: " ++ mdl - diff refFile outFile - when strict $ die "Aborting further tests." + out <- readFile outFile + compareOutput strict mdl ref out else do putStrLn $ "Pass: " ++ mdl ++ " (no reference file)" where @@ -79,13 +76,33 @@ check strict mdl = do outFile = outDir' takeBaseName mdl ++ ".html" -diff :: FilePath -> FilePath -> IO () -diff fileA fileB = do +compareOutput :: Bool -> FilePath -> String -> String -> IO () +compareOutput strict mdl ref out = do + if ref' == out' + then putStrLn $ "Pass: " ++ mdl + else do + putStrLn $ "Fail: " ++ mdl + diff mdl ref' out' + when strict $ die "Aborting further tests." + where + ref' = stripLocalReferences ref + out' = stripLocalReferences out + + +diff :: FilePath -> String -> String -> IO () +diff mdl ref out = do colorDiffPath <- findProgramLocation silent "colordiff" let cmd = fromMaybe "diff" colorDiffPath - result <- system $ cmd ++ " " ++ fileA ++ " " ++ fileB + writeFile refFile ref + writeFile outFile out + + result <- system $ cmd ++ " " ++ refFile ++ " " ++ outFile unless (result == ExitSuccess) $ die "Failed to run `diff` command." + where + refFile = outDir takeFileName mdl ".ref.nolinks" + outFile = outDir takeFileName mdl ".nolinks" + getAllSrcModules :: IO [FilePath] From git at git.haskell.org Wed Jul 8 08:42:00 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:42:00 +0000 (UTC) Subject: [commit: haddock] master: Create simple script for accepting hyperlinker test case references. (7675698) Message-ID: <20150708084200.7A8443A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/767569881732c59378fb577d1a2b57b51bc454d0 >--------------------------------------------------------------- commit 767569881732c59378fb577d1a2b57b51bc454d0 Author: ?ukasz Hanuszczak Date: Wed Jul 1 01:14:59 2015 +0200 Create simple script for accepting hyperlinker test case references. >--------------------------------------------------------------- 767569881732c59378fb577d1a2b57b51bc454d0 haddock.cabal | 1 + hypsrc-test/Utils.hs | 27 ++++++++++++++++++++++++--- hypsrc-test/accept.hs | 27 +++++++++++++++++++++++++++ hypsrc-test/run.hs | 25 ++++--------------------- 4 files changed, 56 insertions(+), 24 deletions(-) diff --git a/haddock.cabal b/haddock.cabal index 01e6a55..2a1caee 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -128,6 +128,7 @@ test-suite hypsrc-test main-is: run.hs hs-source-dirs: hypsrc-test build-depends: base, directory, process, filepath, Cabal + ghc-options: -Wall -fwarn-tabs test-suite latex-test type: exitcode-stdio-1.0 diff --git a/hypsrc-test/Utils.hs b/hypsrc-test/Utils.hs index cf3e94e..e15fabe 100644 --- a/hypsrc-test/Utils.hs +++ b/hypsrc-test/Utils.hs @@ -1,12 +1,33 @@ +{-# LANGUAGE CPP #-} + + module Utils - ( stripLocalAnchors - , stripLocalLinks - , stripLocalReferences + ( baseDir, rootDir + , srcDir, refDir, outDir, refDir', outDir' + , haddockPath + , stripLocalAnchors, stripLocalLinks, stripLocalReferences ) where import Data.List +import System.FilePath + + +baseDir, rootDir :: FilePath +baseDir = takeDirectory __FILE__ +rootDir = baseDir ".." + +srcDir, refDir, outDir, refDir', outDir' :: FilePath +srcDir = baseDir "src" +refDir = baseDir "ref" +outDir = baseDir "out" +refDir' = refDir "src" +outDir' = outDir "src" + +haddockPath :: FilePath +haddockPath = rootDir "dist" "build" "haddock" "haddock" + replaceBetween :: Eq a => [a] -> a -> [a] -> [a] -> [a] replaceBetween _ _ _ [] = [] diff --git a/hypsrc-test/accept.hs b/hypsrc-test/accept.hs new file mode 100755 index 0000000..4606b2d --- /dev/null +++ b/hypsrc-test/accept.hs @@ -0,0 +1,27 @@ +#!/usr/bin/env runhaskell +{-# LANGUAGE CPP #-} + + +import System.Directory +import System.FilePath +import System.Environment + +import Utils + + +main :: IO () +main = do + args <- getArgs + files <- filter isHtmlFile <$> getDirectoryContents outDir' + let files' = if args == ["--all"] || args == ["-a"] + then files + else filter ((`elem` args) . takeBaseName) files + mapM_ copy files' + where + isHtmlFile = (== ".html") . takeExtension + + +copy :: FilePath -> IO () +copy file = do + content <- stripLocalReferences <$> readFile (outDir' file) + writeFile (refDir' file) content diff --git a/hypsrc-test/run.hs b/hypsrc-test/run.hs index 5b6b654..10b6c25 100755 --- a/hypsrc-test/run.hs +++ b/hypsrc-test/run.hs @@ -2,13 +2,11 @@ {-# LANGUAGE CPP #-} -import Control.Applicative import Control.Monad import Data.List import Data.Maybe -import System.IO import System.Directory import System.Environment import System.Exit @@ -21,21 +19,6 @@ import Distribution.Simple.Utils hiding (die) import Utils -baseDir, rootDir :: FilePath -baseDir = takeDirectory __FILE__ -rootDir = baseDir ".." - -srcDir, refDir, outDir, refDir', outDir' :: FilePath -srcDir = baseDir "src" -refDir = baseDir "ref" -outDir = baseDir "out" -refDir' = refDir "src" -outDir' = outDir "src" - -haddockPath :: FilePath -haddockPath = rootDir "dist" "build" "haddock" "haddock" - - main :: IO () main = do haddockAvailable <- doesFileExist haddockPath @@ -107,9 +90,9 @@ diff mdl ref out = do getAllSrcModules :: IO [FilePath] getAllSrcModules = - filter isValid <$> getDirectoryContents srcDir + filter isHaskellFile <$> getDirectoryContents srcDir where - isValid = (== ".hs") . takeExtension + isHaskellFile = (== ".hs") . takeExtension putHaddockVersion :: IO () @@ -128,8 +111,8 @@ putGhcVersion = do runHaddock :: [String] -> IO () runHaddock args = do - env <- Just <$> getEnvironment - handle <- runProcess haddockPath args Nothing env Nothing Nothing Nothing + menv <- Just <$> getEnvironment + handle <- runProcess haddockPath args Nothing menv Nothing Nothing Nothing waitForSuccess handle $ "Failed to invoke haddock with " ++ show args From git at git.haskell.org Wed Jul 8 08:42:02 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:42:02 +0000 (UTC) Subject: [commit: haddock] master: Re-accept hyperlinker test cases with local references stripped out. (db51ad0) Message-ID: <20150708084202.89EE03A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/db51ad0a5b2b29749f69fd82513adeedc8729735 >--------------------------------------------------------------- commit db51ad0a5b2b29749f69fd82513adeedc8729735 Author: ?ukasz Hanuszczak Date: Wed Jul 1 01:16:41 2015 +0200 Re-accept hyperlinker test cases with local references stripped out. >--------------------------------------------------------------- db51ad0a5b2b29749f69fd82513adeedc8729735 hypsrc-test/ref/src/Constructors.html | 24 +++---- hypsrc-test/ref/src/Identifiers.html | 118 +++++++++++++++++----------------- hypsrc-test/ref/src/Literals.html | 10 +-- hypsrc-test/ref/src/Operators.html | 104 +++++++++++++++--------------- hypsrc-test/ref/src/Records.html | 64 +++++++++--------- 5 files changed, 160 insertions(+), 160 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 db51ad0a5b2b29749f69fd82513adeedc8729735 From git at git.haskell.org Wed Jul 8 08:42:04 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:42:04 +0000 (UTC) Subject: [commit: haddock] master: Fix bug with diffing wrong files in hyperlinker test runner. (a229331) Message-ID: <20150708084204.94E7A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/a229331e45518bc7102acc6b19fc492c85321c4f >--------------------------------------------------------------- commit a229331e45518bc7102acc6b19fc492c85321c4f Author: ?ukasz Hanuszczak Date: Wed Jul 1 01:22:09 2015 +0200 Fix bug with diffing wrong files in hyperlinker test runner. >--------------------------------------------------------------- a229331e45518bc7102acc6b19fc492c85321c4f hypsrc-test/run.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hypsrc-test/run.hs b/hypsrc-test/run.hs index 10b6c25..853c4f0 100755 --- a/hypsrc-test/run.hs +++ b/hypsrc-test/run.hs @@ -83,8 +83,8 @@ diff mdl ref out = do result <- system $ cmd ++ " " ++ refFile ++ " " ++ outFile unless (result == ExitSuccess) $ die "Failed to run `diff` command." where - refFile = outDir takeFileName mdl ".ref.nolinks" - outFile = outDir takeFileName mdl ".nolinks" + refFile = outDir takeBaseName mdl ++ ".ref.nolinks" + outFile = outDir takeBaseName mdl ++ ".nolinks" From git at git.haskell.org Wed Jul 8 08:42:06 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:42:06 +0000 (UTC) Subject: [commit: haddock] master: Remove unused dependencies in Haddock API spec configuration. (4b0b4a8) Message-ID: <20150708084206.A23043A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/4b0b4a834b7eeeb0c688ab8718bc9720c00ee67c >--------------------------------------------------------------- commit 4b0b4a834b7eeeb0c688ab8718bc9720c00ee67c Author: ?ukasz Hanuszczak Date: Wed Jul 1 18:04:46 2015 +0200 Remove unused dependencies in Haddock API spec configuration. >--------------------------------------------------------------- 4b0b4a834b7eeeb0c688ab8718bc9720c00ee67c haddock-api/haddock-api.cabal | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/haddock-api/haddock-api.cabal b/haddock-api/haddock-api.cabal index 56889e6..11567f9 100644 --- a/haddock-api/haddock-api.cabal +++ b/haddock-api/haddock-api.cabal @@ -111,18 +111,7 @@ test-suite spec build-depends: base >= 4.3 && < 4.9 - , bytestring - , filepath - , directory , containers - , deepseq - , array - , xhtml >= 3000.2 && < 3000.3 - , Cabal >= 1.10 - , ghc >= 7.10 && < 7.10.2 - - , ghc-paths - , haddock-library == 1.2.* , hspec , QuickCheck == 2.* From git at git.haskell.org Wed Jul 8 08:42:08 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:42:08 +0000 (UTC) Subject: [commit: haddock] master: Add support for hyperlinking synonyms in patterns. (b91ee2f) Message-ID: <20150708084208.AE4EF3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/b91ee2f4f0869d1c1076813019ce858c53738042 >--------------------------------------------------------------- commit b91ee2f4f0869d1c1076813019ce858c53738042 Author: ?ukasz Hanuszczak Date: Wed Jul 1 18:32:19 2015 +0200 Add support for hyperlinking synonyms in patterns. >--------------------------------------------------------------- b91ee2f4f0869d1c1076813019ce858c53738042 haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs index c41b5e5..8777e26 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs @@ -110,6 +110,8 @@ binds = pure (sspan, RtkBind name) (Just (GHC.L _ (GHC.ConPatIn (GHC.L sspan name) recs))) -> [(sspan, RtkVar name)] ++ everything (<|>) rec recs + (Just (GHC.L _ (GHC.AsPat (GHC.L sspan name) _))) -> + pure (sspan, RtkBind name) _ -> empty rec term = case cast term of (Just (GHC.HsRecField (GHC.L sspan name) (_ :: GHC.LPat GHC.Name) _)) -> From git at git.haskell.org Wed Jul 8 08:42:10 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:42:10 +0000 (UTC) Subject: [commit: haddock] master: Create test case for hyperlinking @-patterns. (dc2eed5) Message-ID: <20150708084210.C1B203A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/dc2eed5daa4d01f97a4686352fd17405f4567169 >--------------------------------------------------------------- commit dc2eed5daa4d01f97a4686352fd17405f4567169 Author: ?ukasz Hanuszczak Date: Wed Jul 1 18:33:44 2015 +0200 Create test case for hyperlinking @-patterns. >--------------------------------------------------------------- dc2eed5daa4d01f97a4686352fd17405f4567169 hypsrc-test/ref/src/Constructors.html | 298 ++++++++++++++++++++++++++++++++++ hypsrc-test/src/Constructors.hs | 8 + 2 files changed, 306 insertions(+) diff --git a/hypsrc-test/ref/src/Constructors.html b/hypsrc-test/ref/src/Constructors.html index 6d6c7c0..96be362 100644 --- a/hypsrc-test/ref/src/Constructors.html +++ b/hypsrc-test/ref/src/Constructors.html @@ -529,6 +529,304 @@ >undefined + + +unnorf' :: Norf -> Int +unnorf' x@(Norf (f1@(Quux _ n), _, f2@(Quux f3 _))) = + x' + n * unfoo f1 + aux f3 + where + aux fx = unfoo f2 * unfoo fx * unfoo f3 + x' = sum . map unfoo . unnorf $ x [Foo] unnorf (Norf (Bar, xs, Bar)) = xs unnorf (Norf (Baz, xs, Baz)) = reverse xs unnorf _ = undefined + + +unnorf' :: Norf -> Int +unnorf' x@(Norf (f1@(Quux _ n), _, f2@(Quux f3 _))) = + x' + n * unfoo f1 + aux f3 + where + aux fx = unfoo f2 * unfoo fx * unfoo f3 + x' = sum . map unfoo . unnorf $ x From git at git.haskell.org Wed Jul 8 08:42:12 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:42:12 +0000 (UTC) Subject: [commit: haddock] master: Add support for hyperlinking universally quantified type variables. (dd781d1) Message-ID: <20150708084212.D053A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/dd781d18eca0d8c28350093d78926d4a9b474827 >--------------------------------------------------------------- commit dd781d18eca0d8c28350093d78926d4a9b474827 Author: ?ukasz Hanuszczak Date: Wed Jul 1 19:06:04 2015 +0200 Add support for hyperlinking universally quantified type variables. >--------------------------------------------------------------- dd781d18eca0d8c28350093d78926d4a9b474827 haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs index 8777e26..79e31db 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs @@ -99,7 +99,7 @@ types = -- clauses). binds :: GHC.RenamedSource -> DetailsMap binds = - everything (<|>) (fun `combine` pat) + everything (<|>) (fun `combine` pat `combine` tvar) where fun term = case cast term of (Just (GHC.FunBind (GHC.L sspan name) _ _ _ _ _ :: GHC.HsBind GHC.Name)) -> @@ -117,6 +117,12 @@ binds = (Just (GHC.HsRecField (GHC.L sspan name) (_ :: GHC.LPat GHC.Name) _)) -> pure (sspan, RtkVar name) _ -> empty + tvar term = case cast term of + (Just (GHC.L sspan (GHC.UserTyVar name))) -> + pure (sspan, RtkBind name) + (Just (GHC.L _ (GHC.KindedTyVar (GHC.L sspan name) _))) -> + pure (sspan, RtkBind name) + _ -> empty -- | Obtain details map for top-level declarations. decls :: GHC.RenamedSource -> DetailsMap From git at git.haskell.org Wed Jul 8 08:42:14 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:42:14 +0000 (UTC) Subject: [commit: haddock] master: Create hyperlinker test case with quantified type variables. (571944f) Message-ID: <20150708084214.E46583A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/571944f4a81feae7e04b05d1549a19e0b677f4eb >--------------------------------------------------------------- commit 571944f4a81feae7e04b05d1549a19e0b677f4eb Author: ?ukasz Hanuszczak Date: Wed Jul 1 19:28:32 2015 +0200 Create hyperlinker test case with quantified type variables. >--------------------------------------------------------------- 571944f4a81feae7e04b05d1549a19e0b677f4eb hypsrc-test/src/Polymorphism.hs | 55 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/hypsrc-test/src/Polymorphism.hs b/hypsrc-test/src/Polymorphism.hs new file mode 100644 index 0000000..2e1a93b --- /dev/null +++ b/hypsrc-test/src/Polymorphism.hs @@ -0,0 +1,55 @@ +{-# LANGUAGE RankNTypes #-} + + +module Polymorphism where + + +foo :: a -> a -> a +foo = undefined + +foo' :: forall a. a -> a -> a +foo' = undefined + +bar :: a -> b -> (a, b) +bar = undefined + +bar' :: forall a b. a -> b -> (a, b) +bar' = undefined + +baz :: a -> (a -> [a -> a] -> b) -> b +baz = undefined + +baz' :: forall a b. a -> (a -> [a -> a] -> b) -> b +baz' = undefined + +quux :: a -> (forall a. a -> a) -> a +quux = undefined + +quux' :: forall a. a -> (forall a. a -> a) -> a +quux' = undefined + + +num :: Num a => a -> a -> a +num = undefined + +num' :: forall a. Num a => a -> a -> a +num' = undefined + +eq :: (Eq a, Eq b) => [a] -> [b] -> (a, b) +eq = undefined + +eq' :: forall a b. (Eq a, Eq b) => [a] -> [b] -> (a, b) +eq' = undefined + +mon :: Monad m => (a -> m a) -> m a +mon = undefined + +mon' :: forall m a. Monad m => (a -> m a) -> m a +mon' = undefined + + +norf :: a -> (forall a. Ord a => a -> a) -> a +norf = undefined + +norf' :: forall a. a -> (forall a. Ord a => a -> a) -> a +norf' = undefined From git at git.haskell.org Wed Jul 8 08:42:16 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:42:16 +0000 (UTC) Subject: [commit: haddock] master: Add scoped type variables test for polymorphism test case. (2b748bb) Message-ID: <20150708084217.006B43A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/2b748bb10a40d3787bea35fc24564edac64b11c9 >--------------------------------------------------------------- commit 2b748bb10a40d3787bea35fc24564edac64b11c9 Author: ?ukasz Hanuszczak Date: Wed Jul 1 19:34:22 2015 +0200 Add scoped type variables test for polymorphism test case. >--------------------------------------------------------------- 2b748bb10a40d3787bea35fc24564edac64b11c9 hypsrc-test/src/Polymorphism.hs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hypsrc-test/src/Polymorphism.hs b/hypsrc-test/src/Polymorphism.hs index 2e1a93b..a74ac49 100644 --- a/hypsrc-test/src/Polymorphism.hs +++ b/hypsrc-test/src/Polymorphism.hs @@ -1,4 +1,5 @@ {-# LANGUAGE RankNTypes #-} +{-# LANGUAGE ScopedTypeVariables #-} module Polymorphism where @@ -53,3 +54,13 @@ norf = undefined norf' :: forall a. a -> (forall a. Ord a => a -> a) -> a norf' = undefined + + +plugh :: forall a. a -> a +plugh x = x :: a + +thud :: forall a b. (a -> b) -> a -> (a, b) +thud f x = + (x :: a, y) :: (a, b) + where + y = (f :: a -> b) x :: b From git at git.haskell.org Wed Jul 8 08:42:19 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:42:19 +0000 (UTC) Subject: [commit: haddock] master: Add record wildcards test for records hyperlinking test case. (d6fcd46) Message-ID: <20150708084219.0C0C33A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/d6fcd4692c1d77003ed83c9faf22a2d922dd761f >--------------------------------------------------------------- commit d6fcd4692c1d77003ed83c9faf22a2d922dd761f Author: ?ukasz Hanuszczak Date: Wed Jul 1 19:56:27 2015 +0200 Add record wildcards test for records hyperlinking test case. >--------------------------------------------------------------- d6fcd4692c1d77003ed83c9faf22a2d922dd761f hypsrc-test/ref/src/Records.html | 241 +++++++++++++++++++++++++++++++++++++++ hypsrc-test/src/Records.hs | 9 ++ 2 files changed, 250 insertions(+) diff --git a/hypsrc-test/ref/src/Records.html b/hypsrc-test/ref/src/Records.html index cdff7eb..0751782 100644 --- a/hypsrc-test/ref/src/Records.html +++ b/hypsrc-test/ref/src/Records.html @@ -11,6 +11,12 @@ >{-# LANGUAGE NamedFieldPuns #-} +{-# LANGUAGE RecordWildCards #-} + } + +translate :: Int -> Int -> Point -> Point +translate x y p = + aux p + where + (dx, dy) = (x, y) + aux Point{..} = p { x = x + dx, y = y + dy } Int -> Point translateX p d = p { x = x p + d } translateY p d = p { y = y p + d } + +translate :: Int -> Int -> Point -> Point +translate x y p = + aux p + where + (dx, dy) = (x, y) + aux Point{..} = p { x = x + dx, y = y + dy } From git at git.haskell.org Wed Jul 8 08:42:21 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:42:21 +0000 (UTC) Subject: [commit: haddock] master: Document some functions in XHTML utlity module. (980664b) Message-ID: <20150708084221.1B5873A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/980664b29a588eef44d8048d4beedce4d2a96b09 >--------------------------------------------------------------- commit 980664b29a588eef44d8048d4beedce4d2a96b09 Author: ?ukasz Hanuszczak Date: Wed Jul 1 21:01:42 2015 +0200 Document some functions in XHTML utlity module. >--------------------------------------------------------------- 980664b29a588eef44d8048d4beedce4d2a96b09 haddock-api/src/Haddock/Backends/Xhtml/Utils.hs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Utils.hs b/haddock-api/src/Haddock/Backends/Xhtml/Utils.hs index 36ecf86..5166549 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml/Utils.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml/Utils.hs @@ -41,11 +41,19 @@ import Module ( Module, ModuleName, moduleName, moduleNameString ) import Name ( getOccString, nameOccName, isValOcc ) +-- | Replace placeholder string elements with provided values. +-- +-- Used to generate URL for customized external paths, usually provided with +-- @--source-module@, @--source-entity@ and related command-line arguments. +-- +-- >>> spliceURL Nothing mmod mname Nothing "output/%{MODULE}.hs#%{NAME}" +-- "output/Foo.hs#foo" spliceURL :: Maybe FilePath -> Maybe Module -> Maybe GHC.Name -> Maybe SrcSpan -> String -> String spliceURL mfile mmod = spliceURL' mfile (moduleName <$> mmod) +-- | Same as 'spliceURL' but takes 'ModuleName' instead of 'Module'. spliceURL' :: Maybe FilePath -> Maybe ModuleName -> Maybe GHC.Name -> Maybe SrcSpan -> String -> String spliceURL' maybe_file maybe_mod maybe_name maybe_loc = run From git at git.haskell.org Wed Jul 8 08:42:23 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:42:23 +0000 (UTC) Subject: [commit: haddock] master: Make hyperlinker render qualified names as one entity. (868248d) Message-ID: <20150708084223.266073A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/868248d5e847e29ffede5b6c7d20f08a3ec7eb47 >--------------------------------------------------------------- commit 868248d5e847e29ffede5b6c7d20f08a3ec7eb47 Author: ?ukasz Hanuszczak Date: Wed Jul 1 22:25:21 2015 +0200 Make hyperlinker render qualified names as one entity. >--------------------------------------------------------------- 868248d5e847e29ffede5b6c7d20f08a3ec7eb47 .../src/Haddock/Backends/Hyperlinker/Ast.hs | 1 + .../src/Haddock/Backends/Hyperlinker/Renderer.hs | 50 +++++++++++++++++++--- 2 files changed, 46 insertions(+), 5 deletions(-) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs index 79e31db..decb120 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs @@ -25,6 +25,7 @@ data TokenDetails | RtkBind GHC.Name | RtkDecl GHC.Name | RtkModule GHC.ModuleName + deriving (Eq) rtkName :: TokenDetails -> Either GHC.Name GHC.ModuleName rtkName (RtkVar name) = Left name diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs index 89d9b60..ddb2e5b 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs @@ -19,15 +19,46 @@ import qualified Data.Map as Map import Text.XHtml (Html, HtmlAttr, (!)) import qualified Text.XHtml as Html + type StyleClass = String + render :: Maybe FilePath -> Maybe FilePath -> GHC.PackageKey -> SrcMap -> [RichToken] -> Html render mcss mjs pkg srcs tokens = header mcss mjs <> body pkg srcs tokens + +data TokenGroup + = GrpNormal Token + | GrpRich TokenDetails [Token] + + +-- | Group consecutive tokens pointing to the same element. +-- +-- We want to render qualified identifiers as one entity. For example, +-- @Bar.Baz.foo@ consists of 5 tokens (@Bar@, @.@, @Baz@, @.@, @foo@) but for +-- better user experience when highlighting and clicking links, these tokens +-- should be regarded as one identifier. Therefore, before rendering we must +-- group consecutive elements pointing to the same 'GHC.Name' (note that even +-- dot token has it if it is part of qualified name). +groupTokens :: [RichToken] -> [TokenGroup] +groupTokens [] = [] +groupTokens ((RichToken tok Nothing):rest) = (GrpNormal tok):(groupTokens rest) +groupTokens ((RichToken tok (Just det)):rest) = + let (grp, rest') = span same rest + in (GrpRich det (tok:(map rtkToken grp))):(groupTokens rest') + where + same (RichToken _ (Just det')) = det == det' + same _ = False + + body :: GHC.PackageKey -> SrcMap -> [RichToken] -> Html -body pkg srcs = Html.body . Html.pre . mconcat . map (richToken pkg srcs) +body pkg srcs tokens = + Html.body . Html.pre $ hypsrc + where + hypsrc = mconcat . map (tokenGroup pkg srcs) . groupTokens $ tokens + header :: Maybe FilePath -> Maybe FilePath -> Html header mcss mjs @@ -47,20 +78,29 @@ header mcss mjs = , Html.src scriptFile ] -richToken :: GHC.PackageKey -> SrcMap -> RichToken -> Html -richToken _ _ (RichToken tok Nothing) = + +tokenGroup :: GHC.PackageKey -> SrcMap -> TokenGroup -> Html +tokenGroup _ _ (GrpNormal tok) = tokenSpan tok ! attrs where attrs = [ multiclass . tokenStyle . tkType $ tok ] -richToken pkg srcs (RichToken tok (Just det)) = +tokenGroup pkg srcs (GrpRich det tokens) = externalAnchor det . internalAnchor det . hyperlink pkg srcs det $ content where - content = tokenSpan tok ! [ multiclass style] + content = mconcat . map (richToken det) $ tokens + + +richToken :: TokenDetails -> Token -> Html +richToken det tok = + tokenSpan tok ! [ multiclass style ] + where style = (tokenStyle . tkType) tok ++ richTokenStyle det + tokenSpan :: Token -> Html tokenSpan = Html.thespan . Html.toHtml . tkValue + richTokenStyle :: TokenDetails -> [StyleClass] richTokenStyle (RtkVar _) = ["hs-var"] richTokenStyle (RtkType _) = ["hs-type"] From git at git.haskell.org Wed Jul 8 08:42:25 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:42:25 +0000 (UTC) Subject: [commit: haddock] master: Add qualified name test for identifiers hyperlinking test case. (8071c27) Message-ID: <20150708084225.306F23A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/8071c27826d60eec1cb20f00f9767c32366defac >--------------------------------------------------------------- commit 8071c27826d60eec1cb20f00f9767c32366defac Author: ?ukasz Hanuszczak Date: Wed Jul 1 22:27:38 2015 +0200 Add qualified name test for identifiers hyperlinking test case. >--------------------------------------------------------------- 8071c27826d60eec1cb20f00f9767c32366defac hypsrc-test/ref/src/Identifiers.html | 45 ++++++++++++++++++++++++++++++++++++ hypsrc-test/src/Identifiers.hs | 1 + 2 files changed, 46 insertions(+) diff --git a/hypsrc-test/ref/src/Identifiers.html b/hypsrc-test/ref/src/Identifiers.html index 4c82ad0..14cfbd8 100644 --- a/hypsrc-test/ref/src/Identifiers.html +++ b/hypsrc-test/ref/src/Identifiers.html @@ -737,6 +737,51 @@ > + putStrLn . show $ Identifiers.norf x y z where Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/0d0550cdcf3fa7ceff88e2572f7ffb341b9f760d >--------------------------------------------------------------- commit 0d0550cdcf3fa7ceff88e2572f7ffb341b9f760d Author: ?ukasz Hanuszczak Date: Thu Jul 2 12:32:59 2015 +0200 Fix crash happening when hyperlinking type family declarations. >--------------------------------------------------------------- 0d0550cdcf3fa7ceff88e2572f7ffb341b9f760d haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs index decb120..c12ac35 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs @@ -135,6 +135,7 @@ decls (group, _, _, _) = concatMap ($ group) typ (GHC.L _ t) = case t of GHC.DataDecl name _ defn _ -> [decl name] ++ concatMap con (GHC.dd_cons defn) + GHC.FamDecl fam -> pure . decl $ GHC.fdLName fam _ -> pure . decl $ GHC.tcdLName t fun term = case cast term of (Just (GHC.FunBind (GHC.L sspan name) _ _ _ _ _ :: GHC.HsBind GHC.Name)) From git at git.haskell.org Wed Jul 8 08:42:29 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:42:29 +0000 (UTC) Subject: [commit: haddock] master: Add support for anchoring data family constructor declarations. (5c01af0) Message-ID: <20150708084229.4B44F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/5c01af0e605c2bd16382cbd0de7102f1fbc2f361 >--------------------------------------------------------------- commit 5c01af0e605c2bd16382cbd0de7102f1fbc2f361 Author: ?ukasz Hanuszczak Date: Thu Jul 2 12:47:03 2015 +0200 Add support for anchoring data family constructor declarations. >--------------------------------------------------------------- 5c01af0e605c2bd16382cbd0de7102f1fbc2f361 haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs index c12ac35..b592326 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs @@ -129,20 +129,21 @@ binds = decls :: GHC.RenamedSource -> DetailsMap decls (group, _, _, _) = concatMap ($ group) [ concat . map typ . concat . map GHC.group_tyclds . GHC.hs_tyclds - , everything (<|>) fun + , everything (<|>) (fun `combine` con) ] where typ (GHC.L _ t) = case t of - GHC.DataDecl name _ defn _ -> - [decl name] ++ concatMap con (GHC.dd_cons defn) + GHC.DataDecl name _ _ _ -> pure . decl $ name GHC.FamDecl fam -> pure . decl $ GHC.fdLName fam _ -> pure . decl $ GHC.tcdLName t fun term = case cast term of (Just (GHC.FunBind (GHC.L sspan name) _ _ _ _ _ :: GHC.HsBind GHC.Name)) | GHC.isExternalName name -> pure (sspan, RtkDecl name) _ -> empty - con (GHC.L _ t) = - map decl (GHC.con_names t) ++ everything (<|>) fld t + con term = case cast term of + (Just cdcl) -> + map decl (GHC.con_names cdcl) ++ everything (<|>) fld cdcl + Nothing -> empty fld term = case cast term of Just field -> map decl $ GHC.cd_fld_names field Nothing -> empty From git at git.haskell.org Wed Jul 8 08:42:31 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:42:31 +0000 (UTC) Subject: [commit: haddock] master: Improve support for hyperlinking type families. (28e93ce) Message-ID: <20150708084231.56DB63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/28e93ceec440d0d1ed053bbf3c20e4bdcd6d5f4e >--------------------------------------------------------------- commit 28e93ceec440d0d1ed053bbf3c20e4bdcd6d5f4e Author: ?ukasz Hanuszczak Date: Thu Jul 2 13:31:05 2015 +0200 Improve support for hyperlinking type families. >--------------------------------------------------------------- 28e93ceec440d0d1ed053bbf3c20e4bdcd6d5f4e haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs | 8 +++++++- haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs index b592326..4b60ca3 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs @@ -129,7 +129,7 @@ binds = decls :: GHC.RenamedSource -> DetailsMap decls (group, _, _, _) = concatMap ($ group) [ concat . map typ . concat . map GHC.group_tyclds . GHC.hs_tyclds - , everything (<|>) (fun `combine` con) + , everything (<|>) (fun `combine` con `combine` ins) ] where typ (GHC.L _ t) = case t of @@ -144,10 +144,16 @@ decls (group, _, _, _) = concatMap ($ group) (Just cdcl) -> map decl (GHC.con_names cdcl) ++ everything (<|>) fld cdcl Nothing -> empty + ins term = case cast term of + (Just (GHC.DataFamInstD inst)) -> pure . tyref $ GHC.dfid_tycon inst + (Just (GHC.TyFamInstD (GHC.TyFamInstDecl (GHC.L _ eqn) _))) -> + pure . tyref $ GHC.tfe_tycon eqn + _ -> empty fld term = case cast term of Just field -> map decl $ GHC.cd_fld_names field Nothing -> empty decl (GHC.L sspan name) = (sspan, RtkDecl name) + tyref (GHC.L sspan name) = (sspan, RtkType name) -- | Obtain details map for import declarations. -- diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs index 019075a..37cc537 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs @@ -197,6 +197,7 @@ keywords = , "type" , "where" , "forall" + , "family" , "mdo" ] From git at git.haskell.org Wed Jul 8 08:42:33 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:42:33 +0000 (UTC) Subject: [commit: haddock] master: Add hyperlinker test case for checking type and type family declarations. (0ea2c4a) Message-ID: <20150708084233.769A43A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/0ea2c4a892346d4fdd38c50cf234dbc5e23ac299 >--------------------------------------------------------------- commit 0ea2c4a892346d4fdd38c50cf234dbc5e23ac299 Author: ?ukasz Hanuszczak Date: Thu Jul 2 13:33:34 2015 +0200 Add hyperlinker test case for checking type and type family declarations. >--------------------------------------------------------------- 0ea2c4a892346d4fdd38c50cf234dbc5e23ac299 .../ref/src/{Constructors.html => Types.html} | 887 ++++++++++++--------- hypsrc-test/src/Types.hs | 42 + 2 files changed, 537 insertions(+), 392 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 0ea2c4a892346d4fdd38c50cf234dbc5e23ac299 From git at git.haskell.org Wed Jul 8 08:42:35 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:42:35 +0000 (UTC) Subject: [commit: haddock] master: Fix issue with operators being recognized as preprocessor directives. (aa6c6de) Message-ID: <20150708084235.827523A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/aa6c6deba47af1c21765ed09dc0317825aa1d78d >--------------------------------------------------------------- commit aa6c6deba47af1c21765ed09dc0317825aa1d78d Author: ?ukasz Hanuszczak Date: Thu Jul 2 13:41:38 2015 +0200 Fix issue with operators being recognized as preprocessor directives. >--------------------------------------------------------------- aa6c6deba47af1c21765ed09dc0317825aa1d78d haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs | 6 +++--- hypsrc-test/src/Operators.hs | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs index 37cc537..d927aa0 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs @@ -156,17 +156,17 @@ classify str | "--" `isPrefixOf` str = TkComment | "{-#" `isPrefixOf` str = TkPragma | "{-" `isPrefixOf` str = TkComment -classify (c:_) +classify str@(c:_) | isSpace c = TkSpace | isDigit c = TkNumber | c `elem` special = TkSpecial + | str `elem` glyphs = TkGlyph + | all (`elem` symbols) str = TkOperator | c == '#' = TkCpp | c == '"' = TkString | c == '\'' = TkChar classify str | str `elem` keywords = TkKeyword - | str `elem` glyphs = TkGlyph - | all (`elem` symbols) str = TkOperator | isIdentifier str = TkIdentifier | otherwise = TkUnknown diff --git a/hypsrc-test/src/Operators.hs b/hypsrc-test/src/Operators.hs index bc76c2d..8e86ab0 100644 --- a/hypsrc-test/src/Operators.hs +++ b/hypsrc-test/src/Operators.hs @@ -16,3 +16,7 @@ a */\* b = concatMap (*** b) a (**/\**) :: [[a]] -> [[a]] -> [[a]] a **/\** b = zipWith (*/\*) [a +++ b] (a $$$ b) + + +(#.#) :: a -> b -> (c -> (a, b)) +a #.# b = const $ (a, b) From git at git.haskell.org Wed Jul 8 08:42:37 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:42:37 +0000 (UTC) Subject: [commit: haddock] master: Fix broken tests for parsing and hyperlinking hash operators. (257e045) Message-ID: <20150708084237.8DD7A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/257e0456854a0835bb9901b6d73c17f6f8d0d841 >--------------------------------------------------------------- commit 257e0456854a0835bb9901b6d73c17f6f8d0d841 Author: ?ukasz Hanuszczak Date: Thu Jul 2 17:18:12 2015 +0200 Fix broken tests for parsing and hyperlinking hash operators. >--------------------------------------------------------------- 257e0456854a0835bb9901b6d73c17f6f8d0d841 .../Haddock/Backends/Hyperlinker/ParserSpec.hs | 2 +- hypsrc-test/ref/src/Operators.html | 122 +++++++++++++++++++++ 2 files changed, 123 insertions(+), 1 deletion(-) diff --git a/haddock-api/test/Haddock/Backends/Hyperlinker/ParserSpec.hs b/haddock-api/test/Haddock/Backends/Hyperlinker/ParserSpec.hs index 38cdbc8..a76bdcd 100644 --- a/haddock-api/test/Haddock/Backends/Hyperlinker/ParserSpec.hs +++ b/haddock-api/test/Haddock/Backends/Hyperlinker/ParserSpec.hs @@ -52,7 +52,7 @@ parseSpec = do it "should recognize preprocessor directives" $ do "\n#define foo bar" `shouldParseTo` [TkSpace, TkCpp] "x # y" `shouldParseTo` - [TkIdentifier, TkSpace, TkCpp, TkSpace,TkIdentifier] + [TkIdentifier, TkSpace, TkOperator, TkSpace,TkIdentifier] it "should distinguish basic language constructs" $ do "(* 2) <$> (\"abc\", foo)" `shouldParseTo` diff --git a/hypsrc-test/ref/src/Operators.html b/hypsrc-test/ref/src/Operators.html index 9ed24ab..beefda5 100644 --- a/hypsrc-test/ref/src/Operators.html +++ b/hypsrc-test/ref/src/Operators.html @@ -648,6 +648,128 @@ >) + + +(#.#) :: a -> b -> (c -> (a, b)) +a #.# b = const $ (a, b) Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/d761512f239b17f8e9824629595d75aa46e55554 >--------------------------------------------------------------- commit d761512f239b17f8e9824629595d75aa46e55554 Author: ?ukasz Hanuszczak Date: Thu Jul 2 18:53:28 2015 +0200 Add support for anchoring signatures in type class declarations. >--------------------------------------------------------------- d761512f239b17f8e9824629595d75aa46e55554 haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs index 4b60ca3..98c9770 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs @@ -1,5 +1,7 @@ {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE RecordWildCards #-} + module Haddock.Backends.Hyperlinker.Ast ( enrich @@ -135,6 +137,7 @@ decls (group, _, _, _) = concatMap ($ group) typ (GHC.L _ t) = case t of GHC.DataDecl name _ _ _ -> pure . decl $ name GHC.FamDecl fam -> pure . decl $ GHC.fdLName fam + GHC.ClassDecl{..} -> [decl tcdLName] ++ concatMap sig tcdSigs _ -> pure . decl $ GHC.tcdLName t fun term = case cast term of (Just (GHC.FunBind (GHC.L sspan name) _ _ _ _ _ :: GHC.HsBind GHC.Name)) @@ -152,6 +155,8 @@ decls (group, _, _, _) = concatMap ($ group) fld term = case cast term of Just field -> map decl $ GHC.cd_fld_names field Nothing -> empty + sig (GHC.L _ (GHC.TypeSig names _ _)) = map decl names + sig _ = [] decl (GHC.L sspan name) = (sspan, RtkDecl name) tyref (GHC.L sspan name) = (sspan, RtkType name) From git at git.haskell.org Wed Jul 8 08:42:41 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:42:41 +0000 (UTC) Subject: [commit: haddock] master: Make hyperlinker generate anchors only to top-level value bindings. (ef3b869) Message-ID: <20150708084241.A72693A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/ef3b8691ea607bd4f67d5dc77bb226cf57ec4c30 >--------------------------------------------------------------- commit ef3b8691ea607bd4f67d5dc77bb226cf57ec4c30 Author: ?ukasz Hanuszczak Date: Thu Jul 2 19:04:47 2015 +0200 Make hyperlinker generate anchors only to top-level value bindings. >--------------------------------------------------------------- ef3b8691ea607bd4f67d5dc77bb226cf57ec4c30 haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs index 98c9770..1e121c2 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs @@ -131,7 +131,8 @@ binds = decls :: GHC.RenamedSource -> DetailsMap decls (group, _, _, _) = concatMap ($ group) [ concat . map typ . concat . map GHC.group_tyclds . GHC.hs_tyclds - , everything (<|>) (fun `combine` con `combine` ins) + , everything (<|>) fun . GHC.hs_valds + , everything (<|>) (con `combine` ins) ] where typ (GHC.L _ t) = case t of From git at git.haskell.org Wed Jul 8 08:42:43 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:42:43 +0000 (UTC) Subject: [commit: haddock] master: Create hyperlinker test case for type classes. (29bb1ce) Message-ID: <20150708084243.C82573A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/29bb1ce86e12b368c4eb91dbf515391a0958b8c3 >--------------------------------------------------------------- commit 29bb1ce86e12b368c4eb91dbf515391a0958b8c3 Author: ?ukasz Hanuszczak Date: Thu Jul 2 19:05:58 2015 +0200 Create hyperlinker test case for type classes. >--------------------------------------------------------------- 29bb1ce86e12b368c4eb91dbf515391a0958b8c3 hypsrc-test/ref/src/{Records.html => Classes.html} | 852 +++++++++++---------- hypsrc-test/src/Classes.hs | 38 + 2 files changed, 486 insertions(+), 404 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 29bb1ce86e12b368c4eb91dbf515391a0958b8c3 From git at git.haskell.org Wed Jul 8 08:42:45 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:42:45 +0000 (UTC) Subject: [commit: haddock] master: Update docs with information about source hyperlinking. (9c156cd) Message-ID: <20150708084245.D478D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/9c156cdcfd7d042ed9cfa242871846291af5cf0a >--------------------------------------------------------------- commit 9c156cdcfd7d042ed9cfa242871846291af5cf0a Author: ?ukasz Hanuszczak Date: Sat Jul 4 16:28:26 2015 +0200 Update docs with information about source hyperlinking. >--------------------------------------------------------------- 9c156cdcfd7d042ed9cfa242871846291af5cf0a doc/haddock.xml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/doc/haddock.xml b/doc/haddock.xml index b528fdb..6c83f61 100644 --- a/doc/haddock.xml +++ b/doc/haddock.xml @@ -530,6 +530,43 @@ $ pdflatex package.tex + + + + + Generate hyperlinked source code (as HTML web page). All + rendered files will be put into + src/ subfolder of output + directory. + Usually, this should be used in combination with + option - generated documentation will then + contain references to appropriate code fragments. Previously, this + behaviour could be achieved by generating sources using external + tool and specifying , + , + and related options. Note that these flags are ignored once + is set. + In order to make cross-package source hyperlinking possible, + appropriate source paths have to be set up when providing + interface files using + option. + + + + + + + + + + Use custom CSS file for sources rendered by the + option. If no custom style + file is provided, Haddock will use default one. + + + + + From git at git.haskell.org Wed Jul 8 08:42:47 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:42:47 +0000 (UTC) Subject: [commit: haddock] master: Update docs on using `--read-interface` option. (820381b) Message-ID: <20150708084247.E050F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/820381b78d1f0f7487e120c22913629863a8d1eb >--------------------------------------------------------------- commit 820381b78d1f0f7487e120c22913629863a8d1eb Author: ?ukasz Hanuszczak Date: Sat Jul 4 16:52:15 2015 +0200 Update docs on using `--read-interface` option. >--------------------------------------------------------------- 820381b78d1f0f7487e120c22913629863a8d1eb doc/haddock.xml | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/doc/haddock.xml b/doc/haddock.xml index 6c83f61..b28006f 100644 --- a/doc/haddock.xml +++ b/doc/haddock.xml @@ -345,11 +345,27 @@ - path,file + file + + + + docpath,file + + + + docpath,srcpath,file + + + + =file - =path,file + =docpath,file + + + + =docpath,srcpath,file Read the interface file in @@ -357,19 +373,25 @@ produced by running Haddock with the option. The interface describes a set of modules whose HTML documentation is - located in path (which may be a - relative pathname). The path is - optional, and defaults to .. + located in docpath (which may be a + relative pathname). The docpath is + optional, and defaults to .. The + srcpath is optional but has no default + value. This option allows Haddock to produce separate sets of documentation with hyperlinks between them. The - path is used to direct hyperlinks + docpath is used to direct hyperlinks to point to the right files; so make sure you don't move the HTML files later or these links will break. Using a - relative path means that a + relative docpath means that a documentation subtree can still be moved around without breaking links. + Similarly to docpath, srcpath is used generate cross-package hyperlinks but + within sources rendered with + option. + Multiple options may be given. From git at git.haskell.org Wed Jul 8 08:42:49 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:42:49 +0000 (UTC) Subject: [commit: haddock] master: Remove potentially dangerous record access in hyperlinker AST module. (a861470) Message-ID: <20150708084249.EABE63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/a86147030e0f8fe33ebd4b358ac04d3beb45c3f8 >--------------------------------------------------------------- commit a86147030e0f8fe33ebd4b358ac04d3beb45c3f8 Author: ?ukasz Hanuszczak Date: Sat Jul 4 17:15:26 2015 +0200 Remove potentially dangerous record access in hyperlinker AST module. >--------------------------------------------------------------- a86147030e0f8fe33ebd4b358ac04d3beb45c3f8 haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs index 1e121c2..9d5c127 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs @@ -137,9 +137,9 @@ decls (group, _, _, _) = concatMap ($ group) where typ (GHC.L _ t) = case t of GHC.DataDecl name _ _ _ -> pure . decl $ name + GHC.SynDecl name _ _ _ -> pure . decl $ name GHC.FamDecl fam -> pure . decl $ GHC.fdLName fam GHC.ClassDecl{..} -> [decl tcdLName] ++ concatMap sig tcdSigs - _ -> pure . decl $ GHC.tcdLName t fun term = case cast term of (Just (GHC.FunBind (GHC.L sspan name) _ _ _ _ _ :: GHC.HsBind GHC.Name)) | GHC.isExternalName name -> pure (sspan, RtkDecl name) From git at git.haskell.org Wed Jul 8 08:42:52 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:42:52 +0000 (UTC) Subject: [commit: haddock] master: Make Haddock generate warnings about potential misuse of hyperlinker. (cab1191) Message-ID: <20150708084252.0235B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/cab1191dfb7738c020a1eef9e9d4efe6c4f27a51 >--------------------------------------------------------------- commit cab1191dfb7738c020a1eef9e9d4efe6c4f27a51 Author: ?ukasz Hanuszczak Date: Sat Jul 4 17:40:10 2015 +0200 Make Haddock generate warnings about potential misuse of hyperlinker. >--------------------------------------------------------------- cab1191dfb7738c020a1eef9e9d4efe6c4f27a51 haddock-api/src/Haddock.hs | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/haddock-api/src/Haddock.hs b/haddock-api/src/Haddock.hs index 02e1953..5a1c6ab 100644 --- a/haddock-api/src/Haddock.hs +++ b/haddock-api/src/Haddock.hs @@ -159,6 +159,7 @@ haddockWithGhc ghc args = handleTopExceptions $ do _ -> return flags unless (Flag_NoWarnings `elem` flags) $ do + hypSrcWarnings flags forM_ (warnings args) $ \warning -> do hPutStrLn stderr warning @@ -491,6 +492,35 @@ shortcutFlags flags = do ++ "Ported to use the GHC API by David Waern 2006-2008\n" +-- | Generate some warnings about potential misuse of @--hyperlinked-source at . +hypSrcWarnings :: [Flag] -> IO () +hypSrcWarnings flags = do + + when (hypSrc && any isSourceUrlFlag flags) $ + hPutStrLn stderr $ concat + [ "Warning: " + , "--source-* options are ignored when " + , "--hyperlinked-source is enabled." + ] + + when (not hypSrc && any isSourceCssFlag flags) $ + hPutStrLn stderr $ concat + [ "Warning: " + , "source CSS file is specified but " + , "--hyperlinked-source is disabled." + ] + + where + hypSrc = Flag_HyperlinkedSource `elem` flags + isSourceUrlFlag (Flag_SourceBaseURL _) = True + isSourceUrlFlag (Flag_SourceModuleURL _) = True + isSourceUrlFlag (Flag_SourceEntityURL _) = True + isSourceUrlFlag (Flag_SourceLEntityURL _) = True + isSourceUrlFlag _ = False + isSourceCssFlag (Flag_SourceCss _) = True + isSourceCssFlag _ = False + + updateHTMLXRefs :: [(DocPaths, InterfaceFile)] -> IO () updateHTMLXRefs packages = do writeIORef html_xrefs_ref (Map.fromList mapping) From git at git.haskell.org Wed Jul 8 08:42:54 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:42:54 +0000 (UTC) Subject: [commit: haddock] master: Fix incorrect specification of source style option in doc file. (861c45b) Message-ID: <20150708084254.0DE3E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/861c45b6c16e76e901553739bdb7d7c7e2f827f0 >--------------------------------------------------------------- commit 861c45b6c16e76e901553739bdb7d7c7e2f827f0 Author: ?ukasz Hanuszczak Date: Sat Jul 4 17:43:22 2015 +0200 Fix incorrect specification of source style option in doc file. >--------------------------------------------------------------- 861c45b6c16e76e901553739bdb7d7c7e2f827f0 doc/haddock.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/haddock.xml b/doc/haddock.xml index b28006f..e284521 100644 --- a/doc/haddock.xml +++ b/doc/haddock.xml @@ -577,8 +577,8 @@ $ pdflatex package.tex - - + + Use custom CSS file for sources rendered by the From git at git.haskell.org Wed Jul 8 08:42:56 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:42:56 +0000 (UTC) Subject: [commit: haddock] master: Refactor source path mapping to use modules as indices. (99980dc) Message-ID: <20150708084256.1D7083A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/99980dcc63d696c7912ff1f0d2faadcce169f184 >--------------------------------------------------------------- commit 99980dcc63d696c7912ff1f0d2faadcce169f184 Author: ?ukasz Hanuszczak Date: Sun Jul 5 17:06:36 2015 +0200 Refactor source path mapping to use modules as indices. >--------------------------------------------------------------- 99980dcc63d696c7912ff1f0d2faadcce169f184 haddock-api/src/Haddock.hs | 27 ++++++++++------ haddock-api/src/Haddock/Backends/Hyperlinker.hs | 15 ++++----- .../src/Haddock/Backends/Hyperlinker/Renderer.hs | 36 ++++++++++------------ haddock-api/src/Haddock/InterfaceFile.hs | 11 ++++--- haddock-api/src/Haddock/Types.hs | 9 +++++- 5 files changed, 55 insertions(+), 43 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 99980dcc63d696c7912ff1f0d2faadcce169f184 From git at git.haskell.org Wed Jul 8 08:42:58 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:42:58 +0000 (UTC) Subject: [commit: haddock] master: Fix bug where not all module interfaces were added to source mapping. (5927bfd) Message-ID: <20150708084258.27F663A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/5927bfd4737532e7f1282672a96c2a2cb83c847f >--------------------------------------------------------------- commit 5927bfd4737532e7f1282672a96c2a2cb83c847f Author: ?ukasz Hanuszczak Date: Sun Jul 5 17:47:34 2015 +0200 Fix bug where not all module interfaces were added to source mapping. >--------------------------------------------------------------- 5927bfd4737532e7f1282672a96c2a2cb83c847f haddock-api/src/Haddock.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/haddock-api/src/Haddock.hs b/haddock-api/src/Haddock.hs index 5c48d28..d4d8e3e 100644 --- a/haddock-api/src/Haddock.hs +++ b/haddock-api/src/Haddock.hs @@ -229,8 +229,10 @@ renderStep dflags flags qual pkgs interfaces = do let ifaceFiles = map snd pkgs installedIfaces = concatMap ifInstalledIfaces ifaceFiles - extSrcMap = Map.fromList - [ (ifModule ifile, path) | ((_, Just path), ifile) <- pkgs ] + extSrcMap = Map.fromList $ do + ((_, Just path), ifile) <- pkgs + iface <- ifInstalledIfaces ifile + return (instMod iface, path) render dflags flags qual interfaces installedIfaces extSrcMap From git at git.haskell.org Wed Jul 8 08:43:00 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:43:00 +0000 (UTC) Subject: [commit: haddock] master: Extract main hyperlinker types to separate module. (fcaa46b) Message-ID: <20150708084300.3DFCE3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/fcaa46b054fc3b5a5535a748d3c3283629e3eadf >--------------------------------------------------------------- commit fcaa46b054fc3b5a5535a748d3c3283629e3eadf Author: ?ukasz Hanuszczak Date: Mon Jul 6 16:39:57 2015 +0200 Extract main hyperlinker types to separate module. >--------------------------------------------------------------- fcaa46b054fc3b5a5535a748d3c3283629e3eadf haddock-api/haddock-api.cabal | 1 + haddock-api/src/Haddock/Backends/Hyperlinker.hs | 1 + .../src/Haddock/Backends/Hyperlinker/Ast.hs | 27 ++-------- .../src/Haddock/Backends/Hyperlinker/Parser.hs | 40 ++------------- .../src/Haddock/Backends/Hyperlinker/Renderer.hs | 4 +- .../src/Haddock/Backends/Hyperlinker/Types.hs | 59 ++++++++++++++++++++++ .../src/Haddock/Backends/Hyperlinker/Utils.hs | 1 + haddock-api/src/Haddock/Interface/Create.hs | 1 + haddock-api/src/Haddock/Types.hs | 3 +- haddock.cabal | 5 ++ 10 files changed, 79 insertions(+), 63 deletions(-) diff --git a/haddock-api/haddock-api.cabal b/haddock-api/haddock-api.cabal index 11567f9..3838c3d 100644 --- a/haddock-api/haddock-api.cabal +++ b/haddock-api/haddock-api.cabal @@ -85,6 +85,7 @@ library Haddock.Backends.Hyperlinker.Ast Haddock.Backends.Hyperlinker.Parser Haddock.Backends.Hyperlinker.Renderer + Haddock.Backends.Hyperlinker.Types Haddock.Backends.Hyperlinker.Utils Haddock.ModuleTree Haddock.Types diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker.hs b/haddock-api/src/Haddock/Backends/Hyperlinker.hs index f007f97..4b58190 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker.hs @@ -3,6 +3,7 @@ module Haddock.Backends.Hyperlinker , module Haddock.Backends.Hyperlinker.Utils ) where + import Haddock.Types import Haddock.Backends.Hyperlinker.Renderer import Haddock.Backends.Hyperlinker.Utils diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs index 9d5c127..28fdc3f 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs @@ -3,12 +3,10 @@ {-# LANGUAGE RecordWildCards #-} -module Haddock.Backends.Hyperlinker.Ast - ( enrich - , RichToken(..), TokenDetails(..), rtkName - ) where +module Haddock.Backends.Hyperlinker.Ast (enrich) where -import Haddock.Backends.Hyperlinker.Parser + +import Haddock.Backends.Hyperlinker.Types import qualified GHC @@ -16,25 +14,6 @@ import Control.Applicative import Data.Data import Data.Maybe -data RichToken = RichToken - { rtkToken :: Token - , rtkDetails :: Maybe TokenDetails - } - -data TokenDetails - = RtkVar GHC.Name - | RtkType GHC.Name - | RtkBind GHC.Name - | RtkDecl GHC.Name - | RtkModule GHC.ModuleName - deriving (Eq) - -rtkName :: TokenDetails -> Either GHC.Name GHC.ModuleName -rtkName (RtkVar name) = Left name -rtkName (RtkType name) = Left name -rtkName (RtkBind name) = Left name -rtkName (RtkDecl name) = Left name -rtkName (RtkModule name) = Right name -- | Add more detailed information to token stream using GHC API. enrich :: GHC.RenamedSource -> [Token] -> [RichToken] diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs index d927aa0..e206413 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs @@ -1,44 +1,12 @@ -module Haddock.Backends.Hyperlinker.Parser - ( parse - , Token(..), TokenType(..) - , Position(..), Span(..) - ) where +module Haddock.Backends.Hyperlinker.Parser (parse) where + import Data.Char import Data.List import Data.Maybe -data Token = Token - { tkType :: TokenType - , tkValue :: String - , tkSpan :: Span - } - -data Position = Position - { posRow :: !Int - , posCol :: !Int - } - -data Span = Span - { spStart :: Position - , spEnd :: Position - } - -data TokenType - = TkIdentifier - | TkKeyword - | TkString - | TkChar - | TkNumber - | TkOperator - | TkGlyph - | TkSpecial - | TkSpace - | TkComment - | TkCpp - | TkPragma - | TkUnknown - deriving (Show, Eq) +import Haddock.Backends.Hyperlinker.Types + -- | Turn source code string into a stream of more descriptive tokens. -- diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs index a4d7bc2..add1465 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs @@ -1,8 +1,8 @@ module Haddock.Backends.Hyperlinker.Renderer (render) where + import Haddock.Types -import Haddock.Backends.Hyperlinker.Parser -import Haddock.Backends.Hyperlinker.Ast +import Haddock.Backends.Hyperlinker.Types import Haddock.Backends.Hyperlinker.Utils import qualified GHC diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Types.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Types.hs new file mode 100644 index 0000000..19cc528 --- /dev/null +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Types.hs @@ -0,0 +1,59 @@ +module Haddock.Backends.Hyperlinker.Types where + + +import qualified GHC + + +data Token = Token + { tkType :: TokenType + , tkValue :: String + , tkSpan :: Span + } + +data Position = Position + { posRow :: !Int + , posCol :: !Int + } + +data Span = Span + { spStart :: Position + , spEnd :: Position + } + +data TokenType + = TkIdentifier + | TkKeyword + | TkString + | TkChar + | TkNumber + | TkOperator + | TkGlyph + | TkSpecial + | TkSpace + | TkComment + | TkCpp + | TkPragma + | TkUnknown + deriving (Show, Eq) + + +data RichToken = RichToken + { rtkToken :: Token + , rtkDetails :: Maybe TokenDetails + } + +data TokenDetails + = RtkVar GHC.Name + | RtkType GHC.Name + | RtkBind GHC.Name + | RtkDecl GHC.Name + | RtkModule GHC.ModuleName + deriving (Eq) + + +rtkName :: TokenDetails -> Either GHC.Name GHC.ModuleName +rtkName (RtkVar name) = Left name +rtkName (RtkType name) = Left name +rtkName (RtkBind name) = Left name +rtkName (RtkDecl name) = Left name +rtkName (RtkModule name) = Right name diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Utils.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Utils.hs index 9ba8446..db2bfc7 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Utils.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Utils.hs @@ -4,6 +4,7 @@ module Haddock.Backends.Hyperlinker.Utils , hypSrcModuleUrlFormat, hypSrcModuleNameUrlFormat, ) where + import Haddock.Backends.Xhtml.Utils import GHC diff --git a/haddock-api/src/Haddock/Interface/Create.hs b/haddock-api/src/Haddock/Interface/Create.hs index 59f7076..0599151 100644 --- a/haddock-api/src/Haddock/Interface/Create.hs +++ b/haddock-api/src/Haddock/Interface/Create.hs @@ -21,6 +21,7 @@ import Haddock.GhcUtils import Haddock.Utils import Haddock.Convert import Haddock.Interface.LexParseRn +import Haddock.Backends.Hyperlinker.Types import Haddock.Backends.Hyperlinker.Ast as Hyperlinker import Haddock.Backends.Hyperlinker.Parser as Hyperlinker diff --git a/haddock-api/src/Haddock/Types.hs b/haddock-api/src/Haddock/Types.hs index da4b3ee..90dbb4d 100644 --- a/haddock-api/src/Haddock/Types.hs +++ b/haddock-api/src/Haddock/Types.hs @@ -35,7 +35,8 @@ import DynFlags (ExtensionFlag, Language) import OccName import Outputable import Control.Monad (ap) -import Haddock.Backends.Hyperlinker.Ast + +import Haddock.Backends.Hyperlinker.Types ----------------------------------------------------------------------------- -- * Convenient synonyms diff --git a/haddock.cabal b/haddock.cabal index 2a1caee..8fa9f33 100644 --- a/haddock.cabal +++ b/haddock.cabal @@ -104,6 +104,11 @@ executable haddock Haddock.Backends.HaddockDB Haddock.Backends.Hoogle Haddock.Backends.Hyperlinker + Haddock.Backends.Hyperlinker.Ast + Haddock.Backends.Hyperlinker.Parser + Haddock.Backends.Hyperlinker.Renderer + Haddock.Backends.Hyperlinker.Types + Haddock.Backends.Hyperlinker.Utils Haddock.ModuleTree Haddock.Types Haddock.Doc From git at git.haskell.org Wed Jul 8 08:43:02 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:43:02 +0000 (UTC) Subject: [commit: haddock] master: Move source paths types to hyperlinker types module. (1325460) Message-ID: <20150708084302.4A55E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/13254609062a16e010d1c5a24e571dfe98ab6f69 >--------------------------------------------------------------- commit 13254609062a16e010d1c5a24e571dfe98ab6f69 Author: ?ukasz Hanuszczak Date: Mon Jul 6 16:52:13 2015 +0200 Move source paths types to hyperlinker types module. >--------------------------------------------------------------- 13254609062a16e010d1c5a24e571dfe98ab6f69 haddock-api/src/Haddock/Backends/Hyperlinker.hs | 2 ++ haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs | 1 - haddock-api/src/Haddock/Backends/Hyperlinker/Types.hs | 13 +++++++++++++ haddock-api/src/Haddock/Types.hs | 9 --------- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker.hs b/haddock-api/src/Haddock/Backends/Hyperlinker.hs index 4b58190..248a8a5 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker.hs @@ -1,11 +1,13 @@ module Haddock.Backends.Hyperlinker ( ppHyperlinkedSource + , module Haddock.Backends.Hyperlinker.Types , module Haddock.Backends.Hyperlinker.Utils ) where import Haddock.Types import Haddock.Backends.Hyperlinker.Renderer +import Haddock.Backends.Hyperlinker.Types import Haddock.Backends.Hyperlinker.Utils import Text.XHtml hiding (()) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs index add1465..1065897 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs @@ -1,7 +1,6 @@ module Haddock.Backends.Hyperlinker.Renderer (render) where -import Haddock.Types import Haddock.Backends.Hyperlinker.Types import Haddock.Backends.Hyperlinker.Utils diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Types.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Types.hs index 19cc528..ecb51a0 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Types.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Types.hs @@ -3,6 +3,8 @@ module Haddock.Backends.Hyperlinker.Types where import qualified GHC +import Data.Map (Map) + data Token = Token { tkType :: TokenType @@ -57,3 +59,14 @@ rtkName (RtkType name) = Left name rtkName (RtkBind name) = Left name rtkName (RtkDecl name) = Left name rtkName (RtkModule name) = Right name + + +-- | Path for making cross-package hyperlinks in generated sources. +-- +-- Used in 'SrcMap' to determine whether module originates in current package +-- or in an external package. +data SrcPath + = SrcExternal FilePath + | SrcLocal + +type SrcMap = Map GHC.Module SrcPath diff --git a/haddock-api/src/Haddock/Types.hs b/haddock-api/src/Haddock/Types.hs index 90dbb4d..6dd6450 100644 --- a/haddock-api/src/Haddock/Types.hs +++ b/haddock-api/src/Haddock/Types.hs @@ -51,7 +51,6 @@ type SubMap = Map Name [Name] type DeclMap = Map Name [LHsDecl Name] type InstMap = Map SrcSpan Name type FixMap = Map Name Fixity -type SrcMap = Map Module SrcPath type DocPaths = (FilePath, Maybe FilePath) -- paths to HTML and sources @@ -272,14 +271,6 @@ unrenameDocForDecl (doc, fnArgsDoc) = -- | Type of environment used to cross-reference identifiers in the syntax. type LinkEnv = Map Name Module --- | Path for making cross-package hyperlinks in generated sources. --- --- Used in 'SrcMap' to determine whether module originates in current package --- or in an external package. -data SrcPath - = SrcExternal FilePath - | SrcLocal - -- | Extends 'Name' with cross-reference information. data DocName = Documented Name Module From git at git.haskell.org Wed Jul 8 08:43:04 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:43:04 +0000 (UTC) Subject: [commit: haddock] master: Add support for hyperlinking modules in import lists. (bbd036a) Message-ID: <20150708084304.56FFF3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/bbd036ad309c95ce70affa5aa0a77a61aa5569c8 >--------------------------------------------------------------- commit bbd036ad309c95ce70affa5aa0a77a61aa5569c8 Author: ?ukasz Hanuszczak Date: Mon Jul 6 17:06:19 2015 +0200 Add support for hyperlinking modules in import lists. >--------------------------------------------------------------- bbd036ad309c95ce70affa5aa0a77a61aa5569c8 haddock-api/src/Haddock.hs | 2 +- .../src/Haddock/Backends/Hyperlinker/Renderer.hs | 21 +++++++++------------ .../src/Haddock/Backends/Hyperlinker/Types.hs | 10 +++++++--- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/haddock-api/src/Haddock.hs b/haddock-api/src/Haddock.hs index d4d8e3e..350a73e 100644 --- a/haddock-api/src/Haddock.hs +++ b/haddock-api/src/Haddock.hs @@ -268,7 +268,7 @@ render dflags flags qual ifaces installedIfaces extSrcMap = do | Flag_HyperlinkedSource `elem` flags = Just hypSrcModuleUrlFormat | otherwise = srcModule - srcMap = Map.union + srcMap = mkSrcMap $ Map.union (Map.map SrcExternal extSrcMap) (Map.fromList [ (ifaceMod iface, SrcLocal) | iface <- ifaces ]) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs index 1065897..5037421 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Renderer.hs @@ -144,14 +144,14 @@ hyperlink srcs details = case rtkName details of if GHC.isInternalName name then internalHyperlink name else externalNameHyperlink srcs name - Right name -> externalModHyperlink name + Right name -> externalModHyperlink srcs name internalHyperlink :: GHC.Name -> Html -> Html internalHyperlink name content = Html.anchor content ! [ Html.href $ "#" ++ internalAnchorIdent name ] externalNameHyperlink :: SrcMap -> GHC.Name -> Html -> Html -externalNameHyperlink srcs name content = case Map.lookup mdl srcs of +externalNameHyperlink (srcs, _) name content = case Map.lookup mdl srcs of Just SrcLocal -> Html.anchor content ! [ Html.href $ hypSrcModuleNameUrl mdl name ] Just (SrcExternal path) -> Html.anchor content ! @@ -160,13 +160,10 @@ externalNameHyperlink srcs name content = case Map.lookup mdl srcs of where mdl = GHC.nameModule name --- TODO: Implement module hyperlinks. --- --- Unfortunately, 'ModuleName' is not enough to provide viable cross-package --- hyperlink. And the problem is that GHC AST does not have other information --- on imported modules, so for the time being, we do not provide such reference --- either. -externalModHyperlink :: GHC.ModuleName -> Html -> Html -externalModHyperlink _ content = - content - --Html.anchor content ! [ Html.href $ hypSrcModuleUrl' mdl ] +externalModHyperlink :: SrcMap -> GHC.ModuleName -> Html -> Html +externalModHyperlink (_, srcs) name content = case Map.lookup name srcs of + Just SrcLocal -> Html.anchor content ! + [ Html.href $ hypSrcModuleUrl' name ] + Just (SrcExternal path) -> Html.anchor content ! + [ Html.href $ path hypSrcModuleUrl' name ] + Nothing -> content diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Types.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Types.hs index ecb51a0..c3954dc 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Types.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Types.hs @@ -4,6 +4,7 @@ module Haddock.Backends.Hyperlinker.Types where import qualified GHC import Data.Map (Map) +import qualified Data.Map as Map data Token = Token @@ -66,7 +67,10 @@ rtkName (RtkModule name) = Right name -- Used in 'SrcMap' to determine whether module originates in current package -- or in an external package. data SrcPath - = SrcExternal FilePath - | SrcLocal + = SrcExternal FilePath + | SrcLocal -type SrcMap = Map GHC.Module SrcPath +type SrcMap = (Map GHC.Module SrcPath, Map GHC.ModuleName SrcPath) + +mkSrcMap :: Map GHC.Module SrcPath -> SrcMap +mkSrcMap srcs = (srcs, Map.mapKeys GHC.moduleName srcs) From git at git.haskell.org Wed Jul 8 08:43:06 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:43:06 +0000 (UTC) Subject: [commit: haddock] master: Add short documentation for hyperlinker source map type. (b6e9968) Message-ID: <20150708084306.639FB3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/b6e9968643bc0ab6c61289ecee7205e4d7bc421a >--------------------------------------------------------------- commit b6e9968643bc0ab6c61289ecee7205e4d7bc421a Author: ?ukasz Hanuszczak Date: Mon Jul 6 17:26:49 2015 +0200 Add short documentation for hyperlinker source map type. >--------------------------------------------------------------- b6e9968643bc0ab6c61289ecee7205e4d7bc421a haddock-api/src/Haddock/Backends/Hyperlinker/Types.hs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Types.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Types.hs index c3954dc..5f4dbc8 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Types.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Types.hs @@ -70,6 +70,15 @@ data SrcPath = SrcExternal FilePath | SrcLocal +-- | Mapping from modules to cross-package source paths. +-- +-- This mapping is actually a pair of maps instead of just one map. The reason +-- for this is because when hyperlinking modules in import lists we have no +-- 'GHC.Module' available. On the other hand, we can't just use map with +-- 'GHC.ModuleName' as indices because certain modules may have common name +-- but originate in different packages. Hence, we use both /rich/ and /poor/ +-- versions, where the /poor/ is just projection of /rich/ one cached in pair +-- for better performance. type SrcMap = (Map GHC.Module SrcPath, Map GHC.ModuleName SrcPath) mkSrcMap :: Map GHC.Module SrcPath -> SrcMap From git at git.haskell.org Wed Jul 8 08:43:08 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:43:08 +0000 (UTC) Subject: [commit: haddock] master: Fix bug with module name being hyperlinked to `Prelude`. (0e1cad7) Message-ID: <20150708084308.6FC9D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/0e1cad7c38ed1a771794d9332233f784a52d2c1a >--------------------------------------------------------------- commit 0e1cad7c38ed1a771794d9332233f784a52d2c1a Author: ?ukasz Hanuszczak Date: Mon Jul 6 18:07:20 2015 +0200 Fix bug with module name being hyperlinked to `Prelude`. >--------------------------------------------------------------- 0e1cad7c38ed1a771794d9332233f784a52d2c1a haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs | 7 ++++--- haddock-api/test/Haddock/Backends/Hyperlinker/ParserSpec.hs | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs index 28fdc3f..71b7366 100644 --- a/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs +++ b/haddock-api/src/Haddock/Backends/Hyperlinker/Ast.hs @@ -146,7 +146,7 @@ decls (group, _, _, _) = concatMap ($ group) -- import lists. imports :: GHC.RenamedSource -> DetailsMap imports src@(_, imps, _, _) = - everything (<|>) ie src ++ map (imp . GHC.unLoc) imps + everything (<|>) ie src ++ mapMaybe (imp . GHC.unLoc) imps where ie term = case cast term of (Just (GHC.IEVar v)) -> pure $ var v @@ -156,9 +156,10 @@ imports src@(_, imps, _, _) = _ -> empty typ (GHC.L sspan name) = (sspan, RtkType name) var (GHC.L sspan name) = (sspan, RtkVar name) - imp idecl = + imp idecl | not . GHC.ideclImplicit $ idecl = let (GHC.L sspan name) = GHC.ideclName idecl - in (sspan, RtkModule name) + in Just (sspan, RtkModule name) + imp _ = Nothing -- | Check whether token stream span matches GHC source span. -- diff --git a/haddock-api/test/Haddock/Backends/Hyperlinker/ParserSpec.hs b/haddock-api/test/Haddock/Backends/Hyperlinker/ParserSpec.hs index a76bdcd..8cd2690 100644 --- a/haddock-api/test/Haddock/Backends/Hyperlinker/ParserSpec.hs +++ b/haddock-api/test/Haddock/Backends/Hyperlinker/ParserSpec.hs @@ -5,6 +5,7 @@ import Test.Hspec import Test.QuickCheck import Haddock.Backends.Hyperlinker.Parser +import Haddock.Backends.Hyperlinker.Types main :: IO () From git at git.haskell.org Wed Jul 8 08:43:10 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:43:10 +0000 (UTC) Subject: [commit: haddock] master: Fix problem with spec build in Haddock API configuration. (d76c57b) Message-ID: <20150708084310.7C4583A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/d76c57b3bfade1916b83c11bdb81601990138dff >--------------------------------------------------------------- commit d76c57b3bfade1916b83c11bdb81601990138dff Author: ?ukasz Hanuszczak Date: Mon Jul 6 18:23:47 2015 +0200 Fix problem with spec build in Haddock API configuration. >--------------------------------------------------------------- d76c57b3bfade1916b83c11bdb81601990138dff haddock-api/haddock-api.cabal | 1 + 1 file changed, 1 insertion(+) diff --git a/haddock-api/haddock-api.cabal b/haddock-api/haddock-api.cabal index 3838c3d..439c058 100644 --- a/haddock-api/haddock-api.cabal +++ b/haddock-api/haddock-api.cabal @@ -113,6 +113,7 @@ test-suite spec build-depends: base >= 4.3 && < 4.9 , containers + , ghc >= 7.10 && < 7.10.2 , hspec , QuickCheck == 2.* From git at git.haskell.org Wed Jul 8 08:43:12 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:43:12 +0000 (UTC) Subject: [commit: haddock] adamse-D1033: StrictData: print correct strictness marks (53c47c6) Message-ID: <20150708084312.899CB3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : adamse-D1033 Link : http://git.haskell.org/haddock.git/commitdiff/53c47c6fc6cdaa5084b36ea6ba8320a460fa7106 >--------------------------------------------------------------- commit 53c47c6fc6cdaa5084b36ea6ba8320a460fa7106 Author: Adam Sandberg Eriksson Date: Fri Jul 3 15:57:06 2015 +0200 StrictData: print correct strictness marks >--------------------------------------------------------------- 53c47c6fc6cdaa5084b36ea6ba8320a460fa7106 haddock-api/src/Haddock/Backends/LaTeX.hs | 7 +++++-- haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | 8 +++++--- haddock-api/src/Haddock/Convert.hs | 8 ++++---- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/haddock-api/src/Haddock/Backends/LaTeX.hs b/haddock-api/src/Haddock/Backends/LaTeX.hs index e1090a0..86a6909 100644 --- a/haddock-api/src/Haddock/Backends/LaTeX.hs +++ b/haddock-api/src/Haddock/Backends/LaTeX.hs @@ -823,8 +823,11 @@ pp_hs_context cxt unicode = parenList (map (ppType unicode) cxt) ppBang :: HsBang -> LaTeX -ppBang HsNoBang = empty -ppBang _ = char '!' -- Unpacked args is an implementation detail, +ppBang HsStrict = char '!' +ppBang (HsUnpack {}) = char '!' +ppBang (HsSrcBang _ _ (Just True)) = char '!' +ppBang (HsSrcBang _ _ (Just False)) = char '~' +ppBang _ = empty tupleParens :: HsTupleSort -> [LaTeX] -> LaTeX diff --git a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs index c0be973..2da4cc1 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs @@ -769,9 +769,11 @@ ppDataHeader _ _ _ _ = error "ppDataHeader: illegal argument" ppBang :: HsBang -> Html -ppBang HsNoBang = noHtml -ppBang _ = toHtml "!" -- Unpacked args is an implementation detail, - -- so we just show the strictness annotation +ppBang HsStrict = toHtml "!" +ppBang (HsUnpack {}) = toHtml "!" +ppBang (HsSrcBang _ _ (Just True)) = toHtml "!" +ppBang (HsSrcBang _ _ (Just False)) = toHtml "~" +ppBang _ = noHtml tupleParens :: HsTupleSort -> [Html] -> Html diff --git a/haddock-api/src/Haddock/Convert.hs b/haddock-api/src/Haddock/Convert.hs index d841aec..c11ca54 100644 --- a/haddock-api/src/Haddock/Convert.hs +++ b/haddock-api/src/Haddock/Convert.hs @@ -269,13 +269,13 @@ synifyDataCon use_gadt_syntax dc = linear_tys = zipWith (\ty bang -> let tySyn = synifyType WithinType ty src_bang = case bang of - HsUnpack {} -> HsSrcBang Nothing (Just True) True - HsStrict -> HsSrcBang Nothing (Just False) True + HsUnpack {} -> HsSrcBang Nothing (Just True) (Just True) + HsStrict -> HsSrcBang Nothing (Just False) (Just True) + HsLazy -> HsSrcBang Nothing Nothing Nothing _ -> bang in case src_bang of - HsNoBang -> tySyn + (HsSrcBang _ Nothing Nothing) -> tySyn _ -> noLoc $ HsBangTy bang tySyn - -- HsNoBang never appears, it's implied instead. ) arg_tys (dataConSrcBangs dc) field_tys = zipWith (\field synTy -> noLoc $ ConDeclField From git at git.haskell.org Wed Jul 8 08:43:14 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:43:14 +0000 (UTC) Subject: [commit: haddock] master: Update changelog (ad3b36b) Message-ID: <20150708084314.965293A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/ad3b36b11ae2be54a1be4279cec659f09c5d00bf >--------------------------------------------------------------- commit ad3b36b11ae2be54a1be4279cec659f09c5d00bf Author: Mateusz Kowalczyk Date: Tue Jul 7 23:58:28 2015 +0100 Update changelog >--------------------------------------------------------------- ad3b36b11ae2be54a1be4279cec659f09c5d00bf CHANGES | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES b/CHANGES index cb17fde..ff49b6f 100644 --- a/CHANGES +++ b/CHANGES @@ -21,6 +21,8 @@ Changes in version 2.16.1 * Fix alignment of Source link for instances in Firefox (#384) + * Generate hyperlinked source ourselves (#410, part of GSOC 2015) + Changes in version 2.16.0 * Experimental collapsible header support (#335) From git at git.haskell.org Wed Jul 8 08:43:16 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:43:16 +0000 (UTC) Subject: [commit: haddock] master: Relax upper bound on GHC a bit (d5298da) Message-ID: <20150708084316.A23253A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/d5298da5a2198280347bed9207143e79f44e86ec >--------------------------------------------------------------- commit d5298da5a2198280347bed9207143e79f44e86ec Author: Mateusz Kowalczyk Date: Tue Jul 7 23:58:33 2015 +0100 Relax upper bound on GHC a bit >--------------------------------------------------------------- d5298da5a2198280347bed9207143e79f44e86ec haddock-api/haddock-api.cabal | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/haddock-api/haddock-api.cabal b/haddock-api/haddock-api.cabal index 439c058..1e0b1ea 100644 --- a/haddock-api/haddock-api.cabal +++ b/haddock-api/haddock-api.cabal @@ -47,7 +47,7 @@ library , array , xhtml >= 3000.2 && < 3000.3 , Cabal >= 1.10 - , ghc >= 7.10 && < 7.10.2 + , ghc >= 7.10 && < 7.12 , ghc-paths , haddock-library == 1.2.* @@ -113,8 +113,7 @@ test-suite spec build-depends: base >= 4.3 && < 4.9 , containers - , ghc >= 7.10 && < 7.10.2 - + , ghc >= 7.10 && < 7.12 , hspec , QuickCheck == 2.* From git at git.haskell.org Wed Jul 8 08:43:18 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:43:18 +0000 (UTC) Subject: [commit: haddock] master: Delete trailing whitespace (06e6751) Message-ID: <20150708084318.B4DB53A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/06e675167cc217d5346d706e0d52af0726710e3d >--------------------------------------------------------------- commit 06e675167cc217d5346d706e0d52af0726710e3d Author: Mateusz Kowalczyk Date: Tue Jul 7 23:58:52 2015 +0100 Delete trailing whitespace >--------------------------------------------------------------- 06e675167cc217d5346d706e0d52af0726710e3d haddock-api/resources/html/frames.html | 0 haddock-api/resources/html/haddock-util.js | 0 haddock-api/src/Haddock/Backends/HaddockDB.hs | 0 haddock-api/src/Haddock/Backends/Xhtml/Utils.hs | 0 haddock-api/src/Haddock/Version.hs | 0 haddock-library/LICENSE | 0 html-test/README.markdown | 0 html-test/ref/frames.html | 0 html-test/ref/haddock-util.js | 0 html-test/src/Bugs.hs | 0 hypsrc-test/ref/src/Classes.html | 0 hypsrc-test/src/Classes.hs | 0 12 files changed, 0 insertions(+), 0 deletions(-) From git at git.haskell.org Wed Jul 8 08:43:21 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 08:43:21 +0000 (UTC) Subject: [commit: haddock] wip/pattern-synonyms's head updated: Update Haddock to new pattern synonym type signature syntax (edd2a3b) Message-ID: <20150708084321.87C013A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock Branch 'wip/pattern-synonyms' now includes: 030c726 Adapt to small change in Pretty's exports 39649d7 Some code simplification by using traverse a2f3551 Fix warnings in test helper c1228df Add ByteString version of Attoparsec bb6cef2 One pass parser and tests. 64eb7db Rename Haddock.ParseSpec to Haddock.ParserSpec 27876dc Don't append newline to parseString input 2448bd7 Fix totality, unicode, examples, paragraph parsing d08865e Update acceptance tests ef9aa98 Support for bold. b11f371 Allow for headings inside function documentation. f1f94f2 Per-module extension flags and language listing. 2aec8fd Bump interface version a03c935 Allow for nesting of paragraphs under lists. deb106d Allow escaping in URLs and pictures. 15e1d57 Update documentation. 2e3f0b8 Update maintainer 764a6b8 Fixes #271 7c90581 Support for -XPatternSynonyms 96838d2 Update CPP check for __GLASGOW_HASKELL__ cf73b00 <+>: Don't insert a space when concatenating empty nodes 7d2106e Fix @ code blocks 18e9417 Update tests 039b234 Handle infix vs prefix names correctly everywhere, by explicitly specifying the context 880b91e Correct whitespace in ?hidden? test for <+> change 1e21c67 Document module header. 01de3a3 Insert a space between module link and description 860d650 Ensure a space between type signature and ?Source? e0718f2 Add support for type/data families bc5756d Improve display of poly-kinded type operators 7e53f62 Add test case for PatternSynonyms d86f688 Get rid of re-implementation of sortBy 50d1d18 Only warn about missing docs when docs are missing 6b35adf Add test case for inter-module type/data family instances 91e2c21 Use a bespoke data type to indicate fixity fc7fd18 Strip a single leading space from bird tracks (#201) dfc006a Turn a source code comment into specs 49b2a05 Update test case for lifted GADT type rendering 1944b94 Don't shadow ?strip?. 14531f7 Make ImplicitParams render correctly (#260) 64850ca Lower precedence of equality constraints 6ca2767 Add RankNTypes test case to ImplicitParams.hs 1bf6869 Fix rendering of Contents when links are present daa0ae5 Fix wording in the docs e5bd27b Change rendering of duplicate record field docs 17970e6 Render fixity information 843c42c Reorder topDeclElem to move the source/wiki links to the top 9aa5a2a Use optLast instead of listToMaybe for sourceUrls/wikiUrls 003f117 Differentiate between TH splices (line-links) and regular names 68a7893 Group similar fixities together c40ee25 Update changelog 28e685d Include fixity information in the Interface file 3f6c34a Update changelog 72f655f Update appearance of fixity annotations b8efaf4 Filter family instances of hidden types b999504 Add documentation for --source-entity-line 5f02bd6 Revert "Reorder topDeclElem to move the source/wiki links to the top" dd05c5c Bump version to 2.15.0 8f71c6f Fix up some whitespace 3606ad5 Hide RHS of TFs with non-exported right hand sides 64175d6 Add UnicodeSyntax alternatives for * and -> eaf0a0b Display minimal complete definitions for type classes 4ebde6b Strip links from recently added html tests 385db9a Update changelog 5bcc099 Always read in prologue files as UTF8 (#286). f5532d2 Style only 76bafc9 Add Fuuzetsu maintainers field in cabal file 48f4567 Hide minimal definition for only-method classes 82ab2c0 Fix issue #281 77af42d Please cabal sdist 725faca Drop needless --split-objs which slows us down. f3c7cd3 Fix a few typos bd134c7 Print kind signatures on GADTs 8c64228 Add default for new PlatformConstraints field d6cf6f9 Drop leading whitespace in @-style blocks. a6e36fc Crash when exporting record selectors of data family instances 2eafeb0 Make CHANGES consistent with what's now in 2.14.2 c2a1f75 Actually bundle extra spec tests in sdist 5210342 Update test cases for GHC bug #8945, Haddock #188 4d361e8 Enforce strict GHC version in cabal file b1420ef Initialise some new PlatformConstants fields b4210d4 We don't actually want unicode here af3b144 Parse identifiers with ^ and ? in them. 1a4b54c Ignore version string during HTML tests. 8222e68 Update CHANGES to follow 2.14.3 ac60bd1 remove Origin flag from LHsBindsLR 08aa509 Replace local `die` by new `System.Exit.die` dba02d6 Disambiguate ?die? in test runners. 7ac2d0f Prepare modules for parser split. cc269e6 Move parser + parser tests out to own package. 70ce2cb Move out Show and Eq instances to Types e8756e5 Remove no longer necessary parser error handling. a19af87 Please the GHC build-system. 6bdd39c Update issue tracker URL 4b1f57e Update issue tracker URL for haddock-library 57aa591 Accomodate change in PatSyn representation e110e6e Revert "Accomodate change in PatSyn representation" c4f6201 Revert "Revert "Accomodate change in PatSyn representation"" 61f151a Clear up highlighting of identifiers with ?'?s. 276f201 Follow change in patSynSig 18a5d55 Slightly update the readme. fc16033 Update cabal files b973784 Compatibility with older versions of base and bytestring 7d4e156 Enable travis-ci for haddock-library 05db136 haddock-library: Do not depend on haddock-library in test suite ab33b48 haddock-library: Use -Wall for specs fcad1df Use Travis with multiple GHC versions 89448ef Comment improvements + few words in cabal file 1bbda54 Use doctest to check examples in documentation 8857e50 Remove doctest dependency ca2099a Travis tweaks dd3fee8 Don't actually forget to install specified GHC. e3f52bf Removed reliance on LambdaCase (which breaks build with ghc 7.4). f656de2 Fixed haddock warnings. 5412c26 Update Travis, bump version 5260671 Fix anchors. Closes #308. 64aee65 Drop DocParagraph from front of headers f5be842 Don't mangle append order for nested lists. 1a3f8f7 Bump haddock-library to 1.1.0 for release 8d20ca8 Propagate overloading-mode for instance declarations in haddock (#9242) cb96b4f Adapt to new definition of HsDecls.TyFamEqn 8ac42d3 Track GHC PackageId to PackageKey renaming. b99b57c Track changes for module reexports. d6aec63 Catch mid-line URLs. Fixes #314. d59fec2 Track type signature change of lookupModuleInAllPackages 97b5fa2 If GhcProfiled, also build Haddock profiled. d9b224f Ignore TAGS files. d8f1c1c Update to attoparsec-0.12.1.1 f32ad30 Fix forgotten src b2a807d Changes due to ghc api changes in package representation eee52f6 Import Data.Word w/o import-list aacaa91 Follow changes to TypeAnnot in GHC HEAD 0cc5bc8 Fix import of 'empty' due to AMP. c3a7d47 Bump `base` constraint for AMP 4023817 Followup changes to addition of -fwarn-context-quantification (GHC Trac #4426) ee47a1a Properly render package ID (not package key) in index, fixes #329. 3f57c24 Disambiguate string-literals db14fd8 Revert "Followup changes to addition of -fwarn-context-quantification" 12dc730 Revert "Revert "Followup changes to addition of -fwarn-context-quantification"" a65d213 Revert "Fix import of 'empty' due to AMP." 2f639ff Fix use-after-close lazy IO bug c72175b Add an .arcconfig file. c3f27a9 Add .arclint file. 3fb325a Experimental support for collapsable headers 3937a98 Collapse user-defined section by default (re #335) 5a79e5b reflect ForeignType constructore removal 199936a Remove overlapping pattern match 9cdf19b Make compatible with `deepseq-1.4.0.0` edd2a3b Update Haddock to new pattern synonym type signature syntax From git at git.haskell.org Wed Jul 8 13:35:18 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 13:35:18 +0000 (UTC) Subject: [commit: ghc] wip/impredicativity: Refactoring from Simon and Dimitrios (26d6a3b) Message-ID: <20150708133518.0FC843A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/impredicativity Link : http://ghc.haskell.org/trac/ghc/changeset/26d6a3bcb63fb0b34aeae860b5cae38c42fae7af/ghc >--------------------------------------------------------------- commit 26d6a3bcb63fb0b34aeae860b5cae38c42fae7af Author: Simon Peyton Jones Date: Wed Jul 8 14:34:37 2015 +0100 Refactoring from Simon and Dimitrios >--------------------------------------------------------------- 26d6a3bcb63fb0b34aeae860b5cae38c42fae7af compiler/deSugar/DsBinds.hs | 9 +- compiler/typecheck/TcEvidence.hs | 63 +++++---- compiler/typecheck/TcExpr.hs | 272 +++++++++++++++++++-------------------- compiler/typecheck/TcHsSyn.hs | 9 +- compiler/typecheck/TcRnTypes.hs | 10 +- compiler/typecheck/TcSMonad.hs | 2 +- 6 files changed, 190 insertions(+), 175 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 26d6a3bcb63fb0b34aeae860b5cae38c42fae7af From git at git.haskell.org Wed Jul 8 13:35:26 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 13:35:26 +0000 (UTC) Subject: [commit: ghc] master: Unbreak Windows build: delete unusud throwIOIO (3d5f8e7) Message-ID: <20150708133526.DCA933A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/3d5f8e7493c40da855518f7b602760ed6fc0c234/ghc >--------------------------------------------------------------- commit 3d5f8e7493c40da855518f7b602760ed6fc0c234 Author: Thomas Miedema Date: Wed Jul 8 15:30:30 2015 +0200 Unbreak Windows build: delete unusud throwIOIO Should have been part of 9aa0e4b23d074af44363236fb0f120f07c6e0067. >--------------------------------------------------------------- 3d5f8e7493c40da855518f7b602760ed6fc0c234 utils/ghc-pkg/Main.hs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/utils/ghc-pkg/Main.hs b/utils/ghc-pkg/Main.hs index 6133017..1d80e97 100644 --- a/utils/ghc-pkg/Main.hs +++ b/utils/ghc-pkg/Main.hs @@ -1977,11 +1977,6 @@ installSignalHandlers = do return () #endif -#if mingw32_HOST_OS || mingw32_TARGET_OS -throwIOIO :: Exception.IOException -> IO a -throwIOIO = Exception.throwIO -#endif - catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a catchIO = Exception.catch From git at git.haskell.org Wed Jul 8 14:34:50 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 14:34:50 +0000 (UTC) Subject: [commit: ghc] master: Delete duplicate "Note [Unpack equality predicates]" (6f9efcb) Message-ID: <20150708143450.B0F863A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/6f9efcbda25dec53364bc315fca79a7065f7de50/ghc >--------------------------------------------------------------- commit 6f9efcbda25dec53364bc315fca79a7065f7de50 Author: Thomas Miedema Date: Wed Jul 8 16:31:02 2015 +0200 Delete duplicate "Note [Unpack equality predicates]" The other one is MkId.hs. >--------------------------------------------------------------- 6f9efcbda25dec53364bc315fca79a7065f7de50 compiler/basicTypes/DataCon.hs | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/compiler/basicTypes/DataCon.hs b/compiler/basicTypes/DataCon.hs index 79c1472..5a72458 100644 --- a/compiler/basicTypes/DataCon.hs +++ b/compiler/basicTypes/DataCon.hs @@ -698,17 +698,6 @@ mkDataCon name declared_infix eqSpecPreds :: [(TyVar,Type)] -> ThetaType eqSpecPreds spec = [ mkEqPred (mkTyVarTy tv) ty | (tv,ty) <- spec ] -{- -Note [Unpack equality predicates] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -If we have a GADT with a contructor C :: (a~[b]) => b -> T a -we definitely want that equality predicate *unboxed* so that it -takes no space at all. This is easily done: just give it -an UNPACK pragma. The rest of the unpack/repack code does the -heavy lifting. This one line makes every GADT take a word less -space for each equality predicate, so it's pretty important! --} - -- | The 'Name' of the 'DataCon', giving it a unique, rooted identification dataConName :: DataCon -> Name dataConName = dcName From git at git.haskell.org Wed Jul 8 16:41:51 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 16:41:51 +0000 (UTC) Subject: [commit: ghc] branch 'wip/T10527-2' created Message-ID: <20150708164151.D8D383A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/T10527-2 Referencing: 9e4908b64648416b9ffb95eca88db7c2a596fe46 From git at git.haskell.org Wed Jul 8 16:41:54 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 16:41:54 +0000 (UTC) Subject: [commit: ghc] wip/T10527-2: Add an ambient Id substitution to Subst (9e4908b) Message-ID: <20150708164154.B25383A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T10527-2 Link : http://ghc.haskell.org/trac/ghc/changeset/9e4908b64648416b9ffb95eca88db7c2a596fe46/ghc >--------------------------------------------------------------- commit 9e4908b64648416b9ffb95eca88db7c2a596fe46 Author: Simon Peyton Jones Date: Wed Jul 8 17:39:21 2015 +0100 Add an ambient Id substitution to Subst After a struggle, I fixed Trac #5113 (again) on the 7.10 branch, by adding an ambient substitution to Subst; see CoreSubst, esp Note [IdSubstEnv]. This allowed me to do the impedence-matching in SimplEnv.substExpr efficiently (fixing #10370) as well correctly (fixing the latest problem with #5113). This cost me more time than I like to say. Sigh. >--------------------------------------------------------------- 9e4908b64648416b9ffb95eca88db7c2a596fe46 compiler/coreSyn/CoreSubst.hs | 137 +++++++++++++++++++++++++++++++++-------- compiler/simplCore/SimplEnv.hs | 117 ++++++++++++----------------------- compiler/simplCore/Simplify.hs | 2 +- compiler/specialise/Rules.hs | 8 +-- 4 files changed, 155 insertions(+), 109 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 9e4908b64648416b9ffb95eca88db7c2a596fe46 From git at git.haskell.org Wed Jul 8 22:42:43 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 22:42:43 +0000 (UTC) Subject: [commit: ghc] master: Broaden Outputable instance for Termination (f3bfa3b) Message-ID: <20150708224243.18F6D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/f3bfa3bf31442d57190e1961b5fe9e0b4b457a1c/ghc >--------------------------------------------------------------- commit f3bfa3bf31442d57190e1961b5fe9e0b4b457a1c Author: Simon Peyton Jones Date: Thu Jul 2 22:56:14 2015 +0100 Broaden Outputable instance for Termination >--------------------------------------------------------------- f3bfa3bf31442d57190e1961b5fe9e0b4b457a1c compiler/basicTypes/Demand.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/basicTypes/Demand.hs b/compiler/basicTypes/Demand.hs index 5ffcb3d..b942f4e 100644 --- a/compiler/basicTypes/Demand.hs +++ b/compiler/basicTypes/Demand.hs @@ -839,7 +839,7 @@ bothDmdResult r _ = r -- defaultDmd (r1 `bothDmdResult` r2) = defaultDmd r1 `bothDmd` defaultDmd r2 -- (See Note [Default demand on free variables] for why) -instance Outputable DmdResult where +instance Outputable r => Outputable (Termination r) where ppr Diverges = char 'b' ppr (Dunno c) = ppr c From git at git.haskell.org Wed Jul 8 22:42:45 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 22:42:45 +0000 (UTC) Subject: [commit: ghc] master: Comments only (85b14a7) Message-ID: <20150708224245.EEBA13A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/85b14a777917edd2d6b7d4b3584496cab28bada6/ghc >--------------------------------------------------------------- commit 85b14a777917edd2d6b7d4b3584496cab28bada6 Author: Simon Peyton Jones Date: Wed Jul 8 23:19:42 2015 +0100 Comments only >--------------------------------------------------------------- 85b14a777917edd2d6b7d4b3584496cab28bada6 compiler/codeGen/StgCmmClosure.hs | 58 +++++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 26 deletions(-) diff --git a/compiler/codeGen/StgCmmClosure.hs b/compiler/codeGen/StgCmmClosure.hs index f8741b7..30671ca 100644 --- a/compiler/codeGen/StgCmmClosure.hs +++ b/compiler/codeGen/StgCmmClosure.hs @@ -749,17 +749,12 @@ mkClosureInfo dflags is_static id lf_info tot_wds ptr_wds val_descr -- need. We have a patch for this from Andy Cheadle, but not -- incorporated yet. --SDM [6/2004] -- --- -- Previously, eager blackholing was enabled when ticky-ticky -- was on. But it didn't work, and it wasn't strictly necessary -- to bring back minimal ticky-ticky, so now EAGER_BLACKHOLING -- is unconditionally disabled. -- krc 1/2007 -- --- -- Static closures are never themselves black-holed. --- --- We also never black-hole non-updatable thunks. --- See Note [Black-holing non-updatable thunks] blackHoleOnEntry :: ClosureInfo -> Bool blackHoleOnEntry cl_info @@ -768,28 +763,39 @@ blackHoleOnEntry cl_info | otherwise = case closureLFInfo cl_info of - LFReEntrant _ _ _ _ -> False - LFLetNoEscape -> False - LFThunk _ _no_fvs updatable _ _ -> updatable - _other -> panic "blackHoleOnEntry" -- Should never happen - -{- -Note [Black-holing non-updatable thunks] -========================================= - -We cannot black-hole non-updatable thunks otherwise we run into issues like -Trac #10414. A single-entry (non-updatable) thunk can actually be entered more -than once in a parallel program, if work is duplicated by two threads both -entering the same updatable thunk before the other has blackholed it. So, we -must not eagerly blackhole non-updatable thunks, or the second thread to enter -one will become blocked indefinitely. (They are not blackholed by lazy -blackholing either, since they have no associated update frame.) - -For instance, let's consider the following value (in pseudo-Core, example due to -Reid Barton), - + LFReEntrant _ _ _ _ -> False + LFLetNoEscape -> False + LFThunk _ _no_fvs upd _ _ -> upd -- See Note [Black-holing non-updatable thunks] + _other -> panic "blackHoleOnEntry" + +{- Note [Black-holing non-updatable thunks] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +We must not black-hole non-updatable (single-entry) thunks otherwise +we run into issues like Trac #10414. Specifically: + + * There is no reason to black-hole a non-updatable thunk: it should + not be competed for by multiple threads + + * It could, conceivably, cause a space leak if we don't black-hole + it, if there was a live but never-followed pointer pointing to it. + Let's hope that doesn't happen. + + * It is dangerous to black-hole a non-updatable thunk because + - is not updated (of course) + - hence, if it is black-holed and another thread tries to evalute + it, that thread will block forever + This actually happened in Trac #10414. So we do not black-hole + non-updatable thunks. + + * How could two threads evaluate the same non-updatable (single-entry) + thunk? See Reid Barton's example below. + + * Only eager blackholing could possibly black-hole a non-updatable + thunk, because lazy black-holing only affects thunks with an + update frame on the stack. + +Here is and example due to Reid Barton (Trac #10414): x = \u [] concat [[1], []] - with the following definitions, concat x = case x of From git at git.haskell.org Wed Jul 8 22:42:49 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 8 Jul 2015 22:42:49 +0000 (UTC) Subject: [commit: ghc] master: Fix Trac #10618 (out of scope operator) (4f9d600) Message-ID: <20150708224249.76CDB3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/4f9d6008c04b71fc9449b3dc10861f757539ed0f/ghc >--------------------------------------------------------------- commit 4f9d6008c04b71fc9449b3dc10861f757539ed0f Author: Simon Peyton Jones Date: Wed Jul 8 23:42:28 2015 +0100 Fix Trac #10618 (out of scope operator) Out of scope variables now generate HsUnboundVar, and the fixity re-jigging wasn't taking this into account. >--------------------------------------------------------------- 4f9d6008c04b71fc9449b3dc10861f757539ed0f compiler/rename/RnTypes.hs | 7 +++++-- testsuite/tests/rename/should_fail/T10618.hs | 3 +++ testsuite/tests/rename/should_fail/T10618.stderr | 6 ++++++ testsuite/tests/rename/should_fail/all.T | 1 + 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/compiler/rename/RnTypes.hs b/compiler/rename/RnTypes.hs index 705ca55..ac2982b 100644 --- a/compiler/rename/RnTypes.hs +++ b/compiler/rename/RnTypes.hs @@ -829,8 +829,11 @@ mkOpAppRn e1 op fix e2 -- Default case, no rearrangment ---------------------------- get_op :: LHsExpr Name -> Name -get_op (L _ (HsVar n)) = n -get_op other = pprPanic "get_op" (ppr other) +-- An unbound name could be either HsVar or HsUnboundVra +-- See RnExpr.rnUnboundVar +get_op (L _ (HsVar n)) = n +get_op (L _ (HsUnboundVar occ)) = mkUnboundName (mkRdrUnqual occ) +get_op other = pprPanic "get_op" (ppr other) -- Parser left-associates everything, but -- derived instances may have correctly-associated things to diff --git a/testsuite/tests/rename/should_fail/T10618.hs b/testsuite/tests/rename/should_fail/T10618.hs new file mode 100644 index 0000000..28b665f --- /dev/null +++ b/testsuite/tests/rename/should_fail/T10618.hs @@ -0,0 +1,3 @@ +module T10618 where + +foo = Just $ Nothing <> Nothing diff --git a/testsuite/tests/rename/should_fail/T10618.stderr b/testsuite/tests/rename/should_fail/T10618.stderr new file mode 100644 index 0000000..01e1948 --- /dev/null +++ b/testsuite/tests/rename/should_fail/T10618.stderr @@ -0,0 +1,6 @@ + +T10618.hs:3:22: error: + Variable not in scope: (<>) :: Maybe (Maybe a0) -> Maybe a1 -> t + Perhaps you meant one of these: + ?<$>? (imported from Prelude), ?*>? (imported from Prelude), + ?<$? (imported from Prelude) diff --git a/testsuite/tests/rename/should_fail/all.T b/testsuite/tests/rename/should_fail/all.T index 0df9868..bfd81c5 100644 --- a/testsuite/tests/rename/should_fail/all.T +++ b/testsuite/tests/rename/should_fail/all.T @@ -133,3 +133,4 @@ test('T9032', normal, run_command, ['$MAKE -s --no-print-directory T9032']) +test('T10618', normal, compile_fail, ['']) From git at git.haskell.org Thu Jul 9 00:07:31 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 9 Jul 2015 00:07:31 +0000 (UTC) Subject: [commit: ghc] master: Bitmap: Fix thunk explosion (b29633f) Message-ID: <20150709000731.6C2143A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/b29633f5cf310824f3e34716e9261162ced779d3/ghc >--------------------------------------------------------------- commit b29633f5cf310824f3e34716e9261162ced779d3 Author: Ben Gamari Date: Thu Jul 9 02:08:01 2015 +0200 Bitmap: Fix thunk explosion Previously we would build up another `map (-N)` thunk for every word in the bitmap. Now we strictly accumulate the position and carry out a single ``map (`subtract` accum)``. `Bitmap.intsToBitmap` showed up in the profile while compiling a testcase of #7450 (namely a program containing a record type with large number of fields which derived `Read`). The culprit was `CmmBuildInfoTables.procpointSRT.bitmap`. On the testcase (with 4096 fields), the profile previously looked like, ``` total time = 307.94 secs (307943 ticks @ 1000 us, 1 processor) total alloc = 336,797,868,056 bytes (excludes profiling overheads) COST CENTRE MODULE %time %alloc lintAnnots CoreLint 17.2 25.8 procpointSRT.bitmap CmmBuildInfoTables 11.3 25.2 FloatOutwards SimplCore 7.5 1.6 flatten.lookup CmmBuildInfoTables 4.0 3.9 ... ``` After this fix it looks like, ``` total time = 256.88 secs (256876 ticks @ 1000 us, 1 processor) total alloc = 255,033,667,448 bytes (excludes profiling overheads) COST CENTRE MODULE %time %alloc lintAnnots CoreLint 20.3 34.1 FloatOutwards SimplCore 9.1 2.1 flatten.lookup CmmBuildInfoTables 4.8 5.2 pprNativeCode AsmCodeGen 3.7 4.3 simplLetUnfolding Simplify 3.6 2.2 StgCmm HscMain 3.6 2.1 ``` Signed-off-by: Ben Gamari Test Plan: Validate Reviewers: austin, simonpj Reviewed By: simonpj Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1041 GHC Trac Issues: #7450 >--------------------------------------------------------------- b29633f5cf310824f3e34716e9261162ced779d3 compiler/cmm/Bitmap.hs | 84 ++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 64 insertions(+), 20 deletions(-) diff --git a/compiler/cmm/Bitmap.hs b/compiler/cmm/Bitmap.hs index e7aa072..22ec6ee 100644 --- a/compiler/cmm/Bitmap.hs +++ b/compiler/cmm/Bitmap.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE CPP #-} +{-# LANGUAGE CPP, BangPatterns #-} -- -- (c) The University of Glasgow 2003-2006 @@ -45,31 +45,75 @@ chunkToBitmap dflags chunk = -- eg. @[0,1,3], size 4 ==> 0xb at . -- -- The list of @Int at s /must/ be already sorted. -intsToBitmap :: DynFlags -> Int -> [Int] -> Bitmap -intsToBitmap dflags size slots{- must be sorted -} - | size <= 0 = [] - | otherwise = - (foldr (.|.) (toStgWord dflags 0) (map (toStgWord dflags 1 `shiftL`) these)) : - intsToBitmap dflags (size - wORD_SIZE_IN_BITS dflags) - (map (\x -> x - wORD_SIZE_IN_BITS dflags) rest) - where (these,rest) = span (< wORD_SIZE_IN_BITS dflags) slots +intsToBitmap :: DynFlags + -> Int -- ^ size in bits + -> [Int] -- ^ sorted indices of ones + -> Bitmap +intsToBitmap dflags size = go 0 + where + word_sz = wORD_SIZE_IN_BITS dflags + oneAt :: Int -> StgWord + oneAt i = toStgWord dflags 1 `shiftL` i + + -- It is important that we maintain strictness here. + -- See Note [Strictness when building Bitmaps]. + go :: Int -> [Int] -> Bitmap + go !pos slots + | size <= pos = [] + | otherwise = + (foldr (.|.) (toStgWord dflags 0) (map (\i->oneAt (i - pos)) these)) : + go (pos + word_sz) rest + where + (these,rest) = span (< (pos + word_sz)) slots -- | Make a bitmap where the slots specified are the /zeros/ in the bitmap. -- eg. @[0,1,3], size 4 ==> 0x4@ (we leave any bits outside the size as zero, -- just to make the bitmap easier to read). -- -- The list of @Int at s /must/ be already sorted and duplicate-free. -intsToReverseBitmap :: DynFlags -> Int -> [Int] -> Bitmap -intsToReverseBitmap dflags size slots{- must be sorted -} - | size <= 0 = [] - | otherwise = - (foldr xor (toStgWord dflags init) (map (toStgWord dflags 1 `shiftL`) these)) : - intsToReverseBitmap dflags (size - wORD_SIZE_IN_BITS dflags) - (map (\x -> x - wORD_SIZE_IN_BITS dflags) rest) - where (these,rest) = span (< wORD_SIZE_IN_BITS dflags) slots - init - | size >= wORD_SIZE_IN_BITS dflags = -1 - | otherwise = (1 `shiftL` size) - 1 +intsToReverseBitmap :: DynFlags + -> Int -- ^ size in bits + -> [Int] -- ^ sorted indices of zeros free of duplicates + -> Bitmap +intsToReverseBitmap dflags size = go 0 + where + word_sz = wORD_SIZE_IN_BITS dflags + oneAt :: Int -> StgWord + oneAt i = toStgWord dflags 1 `shiftL` i + + -- It is important that we maintain strictness here. + -- See Note [Strictness when building Bitmaps]. + go :: Int -> [Int] -> Bitmap + go !pos slots + | size <= pos = [] + | otherwise = + (foldr xor (toStgWord dflags init) (map (\i->oneAt (i - pos)) these)) : + go (pos + word_sz) rest + where + (these,rest) = span (< (pos + word_sz)) slots + remain = size - pos + init + | remain >= word_sz = -1 + | otherwise = (1 `shiftL` remain) - 1 + +{- + +Note [Strictness when building Bitmaps] +======================================== + +One of the places where @Bitmap@ is used is in in building Static Reference +Tables (SRTs) (in @CmmBuildInfoTables.procpointSRT@). In #7450 it was noticed +that some test cases (particularly those whose C-- have large numbers of CAFs) +produced large quantities of allocations from this function. + +The source traced back to 'intsToBitmap', which was lazily subtracting the word +size from the elements of the tail of the @slots@ list and recursively invoking +itself with the result. This resulted in large numbers of subtraction thunks +being built up. Here we take care to avoid passing new thunks to the recursive +call. Instead we pass the unmodified tail along with an explicit position +accumulator, which get subtracted in the fold when we compute the Word. + +-} {- | Magic number, must agree with @BITMAP_BITS_SHIFT@ in InfoTables.h. From git at git.haskell.org Thu Jul 9 08:31:48 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 9 Jul 2015 08:31:48 +0000 (UTC) Subject: [commit: ghc] wip/impredicativity: Keep working on RULES simplification (e37d47b) Message-ID: <20150709083148.B863B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/impredicativity Link : http://ghc.haskell.org/trac/ghc/changeset/e37d47b5a52c47d3efcdff7f11910fc7763e3b1b/ghc >--------------------------------------------------------------- commit e37d47b5a52c47d3efcdff7f11910fc7763e3b1b Author: Alejandro Serrano Date: Wed Jul 8 15:46:22 2015 +0200 Keep working on RULES simplification >--------------------------------------------------------------- e37d47b5a52c47d3efcdff7f11910fc7763e3b1b compiler/coreSyn/CoreSubst.hs | 26 +++++++++++++++++--------- compiler/coreSyn/PprCore.hs | 3 +++ compiler/deSugar/DsBinds.hs | 21 +++++++++++---------- compiler/specialise/Rules.hs | 6 +++--- compiler/typecheck/TcRules.hs | 12 +++++++++--- 5 files changed, 43 insertions(+), 25 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 e37d47b5a52c47d3efcdff7f11910fc7763e3b1b From git at git.haskell.org Thu Jul 9 08:31:51 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 9 Jul 2015 08:31:51 +0000 (UTC) Subject: [commit: ghc] wip/impredicativity: Merge remote-tracking branch 'origin/wip/impredicativity' into wip/impredicativity (a56a5ba) Message-ID: <20150709083151.A18723A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/impredicativity Link : http://ghc.haskell.org/trac/ghc/changeset/a56a5ba91858bc4491deb058f2ecdefe89749106/ghc >--------------------------------------------------------------- commit a56a5ba91858bc4491deb058f2ecdefe89749106 Merge: e37d47b 26d6a3b Author: Alejandro Serrano Date: Thu Jul 9 10:32:11 2015 +0200 Merge remote-tracking branch 'origin/wip/impredicativity' into wip/impredicativity Conflicts: compiler/deSugar/DsBinds.hs >--------------------------------------------------------------- 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 a56a5ba91858bc4491deb058f2ecdefe89749106 From git at git.haskell.org Thu Jul 9 08:48:53 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 9 Jul 2015 08:48:53 +0000 (UTC) Subject: [commit: ghc] wip/impredicativity: Remove isInstantiationFn from IdInfo (d99b170) Message-ID: <20150709084853.36BDB3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/impredicativity Link : http://ghc.haskell.org/trac/ghc/changeset/d99b1705a17169255d9997eb9f4deccb65aa017f/ghc >--------------------------------------------------------------- commit d99b1705a17169255d9997eb9f4deccb65aa017f Author: Alejandro Serrano Date: Thu Jul 9 10:49:33 2015 +0200 Remove isInstantiationFn from IdInfo >--------------------------------------------------------------- d99b1705a17169255d9997eb9f4deccb65aa017f compiler/basicTypes/Id.hs | 13 ++----------- compiler/basicTypes/IdInfo.hs | 13 +++---------- compiler/coreSyn/CoreSubst.hs | 26 +++++++++++--------------- compiler/coreSyn/PprCore.hs | 3 --- compiler/deSugar/DsBinds.hs | 7 ++----- compiler/specialise/Rules.hs | 6 +++--- 6 files changed, 21 insertions(+), 47 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 d99b1705a17169255d9997eb9f4deccb65aa017f From git at git.haskell.org Thu Jul 9 11:46:38 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 9 Jul 2015 11:46:38 +0000 (UTC) Subject: [commit: ghc] master: Document RULES and class methods (889824d) Message-ID: <20150709114638.8A1FC3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/889824dd5ea37adc0fbfe851f724ca9331278664/ghc >--------------------------------------------------------------- commit 889824dd5ea37adc0fbfe851f724ca9331278664 Author: Simon Peyton Jones Date: Thu Jul 9 12:46:58 2015 +0100 Document RULES and class methods Relates to Trac #10595 >--------------------------------------------------------------- 889824dd5ea37adc0fbfe851f724ca9331278664 docs/users_guide/glasgow_exts.xml | 55 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/docs/users_guide/glasgow_exts.xml b/docs/users_guide/glasgow_exts.xml index 6d69c75..1e926a3 100644 --- a/docs/users_guide/glasgow_exts.xml +++ b/docs/users_guide/glasgow_exts.xml @@ -12084,6 +12084,61 @@ not going to be inlined before the rule has a chance to fire. +a +How rules interact with class methods + + +Giving a RULE for a class method is a bad idea: + +class C a where + op :: a -> a -> a + +instance C Bool where + op x y = ...rhs for op at Bool... + +{-# RULES "f" op True y = False #-} + +In this +example, op is not an ordinary top-level function; +it is a class method. GHC rapidly rewrites any occurrences of +op-used-at-type-Bool +to a specialised function, say opBool, where + +opBool :: Bool -> Bool -> Bool +opBool x y = ..rhs for op at Bool... + +So the RULE never has a chance to fire, for just the same reasons as in . + + +The solution is to define the instance-specific function yourself, with a pragma to prevent +it being inlined too early, and give a RULE for it: + +instance C Bool where + op x y = opBool + +opBool :: Bool -> Bool -> Bool +{-# NOINLINE [1] opBool #-} +opBool x y = ..rhs for op at Bool... + +{-# RULES "f" opBool True y = False #-} + +If you want a RULE that truly applies to the overloaded class method, the only way to +do it is like this: + +class C a where + op_c :: a -> a -> a + +op :: C a => a -> a -> a +{-# NOINLINE [1] op #-} +op = op_c + +{-# RULES "reassociate" op (op x y) z = op x (op y z) #-} + +Now the inlining of op is delayed until the rule has a chance to fire. +The down-side is that instance declarations must define op_c, but +all other uses should go via op. + + List fusion From git at git.haskell.org Thu Jul 9 12:03:22 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 9 Jul 2015 12:03:22 +0000 (UTC) Subject: [commit: ghc] master: White space only (c58dc1a) Message-ID: <20150709120322.889613A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/c58dc1a149128dcc923b6cd2b20b0139e765c50d/ghc >--------------------------------------------------------------- commit c58dc1a149128dcc923b6cd2b20b0139e765c50d Author: Simon Peyton Jones Date: Thu Jul 9 13:00:59 2015 +0100 White space only >--------------------------------------------------------------- c58dc1a149128dcc923b6cd2b20b0139e765c50d 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 ac36908..de49c91 100644 --- a/compiler/typecheck/TcBinds.hs +++ b/compiler/typecheck/TcBinds.hs @@ -690,7 +690,7 @@ mkInferredPolyId poly_name qtvs theta mono_ty ; my_theta <- pickQuantifiablePreds my_tvs2 theta - ; let my_tvs = filter (`elemVarSet` my_tvs2) qtvs -- Maintain original order + ; let my_tvs = filter (`elemVarSet` my_tvs2) qtvs -- Maintain original order inferred_poly_ty = mkSigmaTy my_tvs my_theta norm_mono_ty ; addErrCtxtM (mk_bind_msg True False poly_name inferred_poly_ty) $ From git at git.haskell.org Thu Jul 9 12:03:25 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 9 Jul 2015 12:03:25 +0000 (UTC) Subject: [commit: ghc] master: Infer types with flexible contexts (b5aabfb) Message-ID: <20150709120325.6FAC53A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/b5aabfbdb96ba8abf2748d089f40c267c2131215/ghc >--------------------------------------------------------------- commit b5aabfbdb96ba8abf2748d089f40c267c2131215 Author: Simon Peyton Jones Date: Thu Jul 9 13:03:34 2015 +0100 Infer types with flexible contexts Responding to Trac #10608 and Trac #10351, I've reverted to making type inference infer structured constraint like f :: C [t] => t -> t even if -XFlexibleContexts is not set. That elicits an error message suggesting the flag. The result is more helpful than the error message you get otherwise. >--------------------------------------------------------------- b5aabfbdb96ba8abf2748d089f40c267c2131215 compiler/typecheck/TcSimplify.hs | 7 ++++--- testsuite/tests/typecheck/should_fail/T10351.stderr | 9 +++++---- testsuite/tests/typecheck/should_fail/T6022.stderr | 10 +++++----- testsuite/tests/typecheck/should_fail/T8883.stderr | 16 +++++++--------- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/compiler/typecheck/TcSimplify.hs b/compiler/typecheck/TcSimplify.hs index f4ff467..4129adc 100644 --- a/compiler/typecheck/TcSimplify.hs +++ b/compiler/typecheck/TcSimplify.hs @@ -17,8 +17,7 @@ module TcSimplify( import Bag import Class ( classKey ) import Class ( Class ) -import DynFlags ( ExtensionFlag( Opt_AllowAmbiguousTypes - , Opt_FlexibleContexts ) +import DynFlags ( ExtensionFlag( Opt_AllowAmbiguousTypes ) , DynFlags( solverIterations ) ) import Inst import Id ( idType ) @@ -603,7 +602,9 @@ pickQuantifiablePreds :: TyVarSet -- Quantifying over these -- This function decides whether a particular constraint shoudl be -- quantified over, given the type variables that are being quantified pickQuantifiablePreds qtvs theta - = do { flex_ctxt <- xoptM Opt_FlexibleContexts + = do { let flex_ctxt = True -- Quantify over non-tyvar constraints, even without + -- -XFlexibleContexts: see Trac #10608, #10351 + -- flex_ctxt <- xoptM Opt_FlexibleContexts ; return (filter (pick_me flex_ctxt) theta) } where pick_me flex_ctxt pred diff --git a/testsuite/tests/typecheck/should_fail/T10351.stderr b/testsuite/tests/typecheck/should_fail/T10351.stderr index 178005a..58c28e4 100644 --- a/testsuite/tests/typecheck/should_fail/T10351.stderr +++ b/testsuite/tests/typecheck/should_fail/T10351.stderr @@ -1,5 +1,6 @@ -T10351.hs:6:7: error: - No instance for (C [t]) arising from a use of ?op? - In the expression: op [x] - In an equation for ?f?: f x = op [x] +T10351.hs:6:1: error: + Non type-variable argument in the constraint: C [t] + (Use FlexibleContexts to permit this) + When checking that ?f? has the inferred type + f :: forall t. C [t] => t -> () diff --git a/testsuite/tests/typecheck/should_fail/T6022.stderr b/testsuite/tests/typecheck/should_fail/T6022.stderr index a85c628..a3cd78e 100644 --- a/testsuite/tests/typecheck/should_fail/T6022.stderr +++ b/testsuite/tests/typecheck/should_fail/T6022.stderr @@ -1,6 +1,6 @@ -T6022.hs:3:9: error: - No instance for (Eq ([a] -> a)) arising from a use of ?==? - (maybe you haven't applied a function to enough arguments?) - In the expression: x == head - In an equation for ?f?: f x = x == head +T6022.hs:3:1: error: + Non type-variable argument in the constraint: Eq ([a] -> a) + (Use FlexibleContexts to permit this) + When checking that ?f? has the inferred type + f :: forall a. Eq ([a] -> a) => ([a] -> a) -> Bool diff --git a/testsuite/tests/typecheck/should_fail/T8883.stderr b/testsuite/tests/typecheck/should_fail/T8883.stderr index dc4bdfc..3f0a430 100644 --- a/testsuite/tests/typecheck/should_fail/T8883.stderr +++ b/testsuite/tests/typecheck/should_fail/T8883.stderr @@ -1,10 +1,8 @@ -T8883.hs:20:14: error: - Could not deduce (Functor (PF a)) arising from a use of ?fmap? - from the context: Regular a - bound by the inferred type of - fold :: Regular a => (PF a b -> b) -> a -> b - at T8883.hs:20:1-33 - In the first argument of ?(.)?, namely ?fmap (fold f)? - In the second argument of ?(.)?, namely ?fmap (fold f) . from? - In the expression: f . fmap (fold f) . from +T8883.hs:20:1: error: + Non type-variable argument in the constraint: Functor (PF a) + (Use FlexibleContexts to permit this) + When checking that ?fold? has the inferred type + fold :: forall b a. + (Functor (PF a), Regular a) => + (PF a b -> b) -> a -> b From git at git.haskell.org Thu Jul 9 12:09:57 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 9 Jul 2015 12:09:57 +0000 (UTC) Subject: [commit: ghc] master: users_guide: Fix errant "a" in RULES/class methods docs (7dcf86f) Message-ID: <20150709120957.017663A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/7dcf86f54901f38317546cdcad16f28947443999/ghc >--------------------------------------------------------------- commit 7dcf86f54901f38317546cdcad16f28947443999 Author: Ben Gamari Date: Thu Jul 9 14:08:20 2015 +0200 users_guide: Fix errant "a" in RULES/class methods docs >--------------------------------------------------------------- 7dcf86f54901f38317546cdcad16f28947443999 docs/users_guide/glasgow_exts.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/users_guide/glasgow_exts.xml b/docs/users_guide/glasgow_exts.xml index 1e926a3..51448d5 100644 --- a/docs/users_guide/glasgow_exts.xml +++ b/docs/users_guide/glasgow_exts.xml @@ -12084,7 +12084,7 @@ not going to be inlined before the rule has a chance to fire. -a + How rules interact with class methods From git at git.haskell.org Thu Jul 9 12:32:26 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 9 Jul 2015 12:32:26 +0000 (UTC) Subject: [commit: ghc] master: Add testcase for #10602 (a6359f2) Message-ID: <20150709123226.247D23A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a6359f2629024d67fc82a7d41c67d5d89d2d3a3d/ghc >--------------------------------------------------------------- commit a6359f2629024d67fc82a7d41c67d5d89d2d3a3d Author: Ben Gamari Date: Thu Jul 9 05:12:05 2015 -0400 Add testcase for #10602 >--------------------------------------------------------------- a6359f2629024d67fc82a7d41c67d5d89d2d3a3d testsuite/tests/simplCore/should_compile/T10602.hs | 34 ++++++++++++++++++++++ testsuite/tests/simplCore/should_compile/all.T | 1 + 2 files changed, 35 insertions(+) diff --git a/testsuite/tests/simplCore/should_compile/T10602.hs b/testsuite/tests/simplCore/should_compile/T10602.hs new file mode 100644 index 0000000..fc2523d --- /dev/null +++ b/testsuite/tests/simplCore/should_compile/T10602.hs @@ -0,0 +1,34 @@ +import Control.Monad +import Data.Binary +import Data.List + +newtype A a = A [a] + +instance Binary a => Binary (A a) where + put (A xs) = case splitAt 254 xs of + (_, []) -> mapM_ put xs + (a, b) -> put (A b) + + get = do xs <- replicateM 254 get + A ys <- get + return $ A $ xs ++ ys + +main :: IO () +main = undefined + +{- +This intermittently failed with although I was never able to reliably reproduce, + +$ ./inplace/bin/ghc-stage2 -O2 Test.hs -fforce-recomp +[1 of 1] Compiling Main ( Test.hs, Test.o ) +ghc-stage2: panic! (the 'impossible' happened) + (GHC version 7.10.1.20150708 for x86_64-unknown-linux): + Template variable unbound in rewrite rule + sg_s5zh + [sc_s5zf, sc_s5zg, sg_s5zh, sg_s5zi] + [sc_s5zf, sc_s5zg, sg_s5zh, sg_s5zi] + [: @ a_a3fv sc_s5zf sc_s5zg] + [: @ a_a3fv sc_s5zb sc_s5zc] + +Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug +-} diff --git a/testsuite/tests/simplCore/should_compile/all.T b/testsuite/tests/simplCore/should_compile/all.T index f7ff85b..1ee56ec 100644 --- a/testsuite/tests/simplCore/should_compile/all.T +++ b/testsuite/tests/simplCore/should_compile/all.T @@ -212,3 +212,4 @@ test('T9565', only_ways(['optasm']), compile, ['']) test('T5821', only_ways(['optasm']), compile, ['']) test('T10176', only_ways(['optasm']), compile, ['']) test('T10180', only_ways(['optasm']), compile, ['']) +test('T10602', only_ways(['optasm']), compile, ['-O2']) From git at git.haskell.org Thu Jul 9 12:57:14 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 9 Jul 2015 12:57:14 +0000 (UTC) Subject: [commit: ghc] wip/gadtpm: Small opt in record-pattern translation (eae2173) Message-ID: <20150709125714.C9A383A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/gadtpm Link : http://ghc.haskell.org/trac/ghc/changeset/eae2173306a3a5a0461b6b99ad491aa1dc821042/ghc >--------------------------------------------------------------- commit eae2173306a3a5a0461b6b99ad491aa1dc821042 Author: George Karachalias Date: Thu Jul 9 13:13:18 2015 +0200 Small opt in record-pattern translation >--------------------------------------------------------------- eae2173306a3a5a0461b6b99ad491aa1dc821042 compiler/deSugar/Check.hs | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/compiler/deSugar/Check.hs b/compiler/deSugar/Check.hs index ec08a2a..10de020 100644 --- a/compiler/deSugar/Check.hs +++ b/compiler/deSugar/Check.hs @@ -325,23 +325,18 @@ translateConPatVec _univ_tys _ex_tvs _ (InfixCon p1 p2) = concat <$> translatePa translateConPatVec univ_tys ex_tvs c (RecCon (HsRecFields fs _)) | null fs = mkPmVarsSM arg_tys -- Nothing matched. Make up some fresh variables | null orig_lbls = ASSERT (null matched_lbls) mkPmVarsSM arg_tys -- If it is not a record but uses record syntax it can only be {}. So just like above --- It is an optimisation anyway, we can avoid doing it.. --- | matched_lbls `subsetOf` orig_lbls = do -- Ordered: The easy case (no additional guards) --- arg_pats <- zip orig_lbls <$> mkPmVarsSM arg_tys --- {- WE'VE GOT WORK TO DO -} --- undefined --- subsetOf :: Eq a => [a] -> [a] -> Bool --- subsetOf [] _ = True --- subsetOf (_:_) [] = False --- subsetOf (x:xs) (y:ys) --- | x == y = subsetOf xs ys --- | otherwise = subsetOf (x:xs) ys + -- It is an optimisation anyway, we can avoid doing it.. + | matched_lbls `subsetOf` orig_lbls = ASSERT (length orig_lbls == length arg_tys) -- Ordered: The easy case (no additional guards) + let translateOne (lbl, ty) = case lookup lbl matched_pats of + Just p -> translatePat p + Nothing -> mkPmVarsSM [ty] + in concatMapM translateOne (zip orig_lbls arg_tys) | otherwise = do -- Not Ordered: We match against all patterns and add (strict) guards to match in the right order arg_var_pats <- mkPmVarsSM arg_tys -- the normal variable patterns -- no forcing yet translated_pats <- forM matched_pats $ \(x,pat) -> do pvec <- translatePat pat - return (idName x, pvec) + return (x, pvec) let zipped = zip orig_lbls [ x | VarAbs x <- arg_var_pats ] -- [(Name, Id)] guards = map (\(name,pvec) -> case lookup name zipped of @@ -354,8 +349,15 @@ translateConPatVec univ_tys ex_tvs c (RecCon (HsRecFields fs _)) -- Some label information orig_lbls = dataConFieldLabels c - matched_lbls = [idName id | L _ (HsRecField (L _ id) _ _) <- fs] - matched_pats = [(id,pat) | L _ (HsRecField (L _ id) (L _ pat) _) <- fs] + matched_lbls = [ idName id | L _ (HsRecField (L _ id) _ _) <- fs] + matched_pats = [(idName id,pat) | L _ (HsRecField (L _ id) (L _ pat) _) <- fs] + + subsetOf :: Eq a => [a] -> [a] -> Bool + subsetOf [] _ = True + subsetOf (_:_) [] = False + subsetOf (x:xs) (y:ys) + | x == y = subsetOf xs ys + | otherwise = subsetOf (x:xs) ys translateMatch :: LMatch Id (LHsExpr Id) -> UniqSM (PatVec,[PatVec]) translateMatch (L _ (Match lpats _ grhss)) = do From git at git.haskell.org Thu Jul 9 13:21:33 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 9 Jul 2015 13:21:33 +0000 (UTC) Subject: [commit: ghc] wip/impredicativity: Get back special cases for SectionL and SectionR in TcExpr (7d9b1fd) Message-ID: <20150709132133.146683A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/impredicativity Link : http://ghc.haskell.org/trac/ghc/changeset/7d9b1fda7724c61a5b389244bb57896171f36573/ghc >--------------------------------------------------------------- commit 7d9b1fda7724c61a5b389244bb57896171f36573 Author: Alejandro Serrano Date: Thu Jul 9 15:22:17 2015 +0200 Get back special cases for SectionL and SectionR in TcExpr >--------------------------------------------------------------- 7d9b1fda7724c61a5b389244bb57896171f36573 compiler/hsSyn/HsUtils.hs | 2 +- compiler/typecheck/TcExpr.hs | 28 ++++++++++++++++++---------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/compiler/hsSyn/HsUtils.hs b/compiler/hsSyn/HsUtils.hs index fd3d5ef..486c35a 100644 --- a/compiler/hsSyn/HsUtils.hs +++ b/compiler/hsSyn/HsUtils.hs @@ -23,7 +23,7 @@ module HsUtils( mkSimpleMatch, unguardedGRHSs, unguardedRHS, mkMatchGroup, mkMatchGroupName, mkMatch, mkHsLam, mkHsIf, mkHsWrap, mkLHsWrap, mkHsWrapCo, mkHsWrapCoR, mkLHsWrapCo, - coToHsWrapper, mkHsDictLet, mkHsLams, + coToHsWrapper, coToHsWrapperR, mkHsDictLet, mkHsLams, mkHsOpApp, mkHsDo, mkHsComp, mkHsWrapPat, mkHsWrapPatCo, mkLHsPar, mkHsCmdCast, diff --git a/compiler/typecheck/TcExpr.hs b/compiler/typecheck/TcExpr.hs index 4737bfa..5ddfed9 100644 --- a/compiler/typecheck/TcExpr.hs +++ b/compiler/typecheck/TcExpr.hs @@ -286,23 +286,31 @@ tcExpr app@(OpApp _ _ _ _) res_ty = tcApp app res_ty (mkLHsWrapCo co_a arg2') } -} +tcExpr (SectionL arg1 op) res_ty + = do { dflags <- getDynFlags -- Note [Left sections] + ; let n_reqd_args | xopt Opt_PostfixOperators dflags = 1 + | otherwise = 2 + ; (co_fun, args_tys@(arg1_ty : _), rest_ty) <- + matchExpectedFunTys (mk_app_msg op) n_reqd_args res_ty + ; let op_ty = mkFunTys args_tys rest_ty + -- typecheck op and arg1 + ; op' <- tcPolyMonoExprNC op op_ty + ; arg1' <- tcArg op' (arg1, arg1_ty, 1) + ; return $ SectionL arg1' (mkLHsWrapCo co_fun op') } + -- Right sections, equivalent to \ x -> x `op` expr, or -- \ x -> op x expr - -tcExpr app@(SectionL _ _) res_ty = tcApp app res_ty -tcExpr app@(SectionR _ _) res_ty = tcApp app res_ty -{- +tcExpr (SectionR op arg2) res_ty = do { -- res_ty = arg1_ty -> rest_ty (co_fun, [arg1_ty], rest_ty) <- matchExpectedFunTys (mk_app_msg op) 1 res_ty ; arg2_ty <- newFlexiTyVarTy openTypeKind -- op_ty = arg1_ty -> arg2_ty -> rest_ty - ; let op_ty = mkFunTys [arg1_ty,arg2_ty] rest_ty + ; let op_ty = mkFunTys [arg1_ty, arg2_ty] rest_ty -- typecheck op and arg2 - ; op' <- tcCheckFun op op_ty - ; arg2' <- tcArg op (arg2, arg2_ty, 2) + ; op' <- tcPolyMonoExprNC op op_ty + ; arg2' <- tcArg op' (arg2, arg2_ty, 2) ; return $ SectionR (mkLHsWrapCo co_fun op') arg2' } --} tcExpr (ExplicitTuple tup_args boxity) res_ty | all tupArgPresent tup_args @@ -1010,7 +1018,7 @@ tc_app fun_expr args fun_ty res_ty args1 -- Arguments (coToHsWrapper co_res) } } } -- Coercion to expected result type -mk_app_msg :: LHsExpr TcId -> SDoc +mk_app_msg :: Outputable a => a -> SDoc mk_app_msg fun = sep [ ptext (sLit "The function") <+> quotes (ppr fun) , ptext (sLit "is applied to")] @@ -1286,7 +1294,7 @@ tcTagToEnum loc fun_name arg res_ty ; arg' <- tcPolyMonoExpr arg intPrimTy ; let fun' = L loc (HsWrap (WpTyApp rep_ty) (HsVar fun)) rep_ty = mkTyConApp rep_tc rep_args - wrapper = coToHsWrapper (mkTcSymCo $ TcCoercion coi) + wrapper = coToHsWrapperR (mkTcSymCo $ TcCoercion coi) ; return (TcAppResult fun' [arg'] wrapper) } -- coi is a Representational coercion From git at git.haskell.org Thu Jul 9 18:04:33 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 9 Jul 2015 18:04:33 +0000 (UTC) Subject: [commit: ghc] master: Make mkQualPackage more robust when package key is bad. (6f1c076) Message-ID: <20150709180433.2B7EF3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/6f1c0766943cdb9a567c0e2b9d41c5e73c2ff5bc/ghc >--------------------------------------------------------------- commit 6f1c0766943cdb9a567c0e2b9d41c5e73c2ff5bc Author: Edward Z. Yang Date: Thu Jul 9 10:21:51 2015 -0700 Make mkQualPackage more robust when package key is bad. Signed-off-by: Edward Z. Yang Test Plan: validate Reviewers: bgamari, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1060 GHC Trac Issues: #10624 >--------------------------------------------------------------- 6f1c0766943cdb9a567c0e2b9d41c5e73c2ff5bc compiler/main/HscTypes.hs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/compiler/main/HscTypes.hs b/compiler/main/HscTypes.hs index c2a5153..b7707f8 100644 --- a/compiler/main/HscTypes.hs +++ b/compiler/main/HscTypes.hs @@ -1620,15 +1620,14 @@ mkQualPackage dflags pkg_key -- Skip the lookup if it's main, since it won't be in the package -- database! = False - | searchPackageId dflags pkgid `lengthIs` 1 + | Just pkgid <- mb_pkgid + , searchPackageId dflags pkgid `lengthIs` 1 -- this says: we are given a package pkg-0.1 at MMM, are there only one -- exposed packages whose package ID is pkg-0.1? = False | otherwise = True - where pkg = fromMaybe (pprPanic "qual_pkg" (ftext (packageKeyFS pkg_key))) - (lookupPackage dflags pkg_key) - pkgid = sourcePackageId pkg + where mb_pkgid = fmap sourcePackageId (lookupPackage dflags pkg_key) -- | A function which only qualifies package names if necessary; but -- qualifies all other identifiers. From git at git.haskell.org Fri Jul 10 06:34:26 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 10 Jul 2015 06:34:26 +0000 (UTC) Subject: [commit: ghc] wip/impredicativity: Add documentation for impredicativity design (4add25f) Message-ID: <20150710063426.C17DB3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/impredicativity Link : http://ghc.haskell.org/trac/ghc/changeset/4add25f488504443a45584cc0bd7f9081cb56870/ghc >--------------------------------------------------------------- commit 4add25f488504443a45584cc0bd7f9081cb56870 Author: Alejandro Serrano Date: Fri Jul 10 08:35:08 2015 +0200 Add documentation for impredicativity design >--------------------------------------------------------------- 4add25f488504443a45584cc0bd7f9081cb56870 docs/types/impredicativity.ltx | 525 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 525 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 4add25f488504443a45584cc0bd7f9081cb56870 From git at git.haskell.org Fri Jul 10 08:38:22 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 10 Jul 2015 08:38:22 +0000 (UTC) Subject: [commit: ghc] wip/impredicativity: Rename InstanceOf to (<=) and implement it as a newtype (541d037) Message-ID: <20150710083822.22FD63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/impredicativity Link : http://ghc.haskell.org/trac/ghc/changeset/541d037cdd842cf9c50bafeece239862120f07ab/ghc >--------------------------------------------------------------- commit 541d037cdd842cf9c50bafeece239862120f07ab Author: Alejandro Serrano Date: Fri Jul 10 10:36:11 2015 +0200 Rename InstanceOf to (<=) and implement it as a newtype - For that, we need to include its name and definition in ghc-prim, PrelName and TysWiredIn. - Change the desugaring in DsBinds to generate the corresponding casts from and to (<=) and (->). >--------------------------------------------------------------- 541d037cdd842cf9c50bafeece239862120f07ab compiler/deSugar/DsBinds.hs | 61 ++++++++++++++++++++++------------------- compiler/prelude/PrelNames.hs | 4 +++ compiler/prelude/TysWiredIn.hs | 23 ++++++++++++---- compiler/typecheck/TcHsSyn.hs | 14 ++-------- libraries/ghc-prim/GHC/Types.hs | 2 +- 5 files changed, 58 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 541d037cdd842cf9c50bafeece239862120f07ab From git at git.haskell.org Fri Jul 10 09:37:18 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 10 Jul 2015 09:37:18 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: driver: pass '-fPIC' option to all CC invocations (0e7e611) Message-ID: <20150710093718.3E6C53A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/0e7e611470a7c70ef5a3c84be01eeac8fddadf94/ghc >--------------------------------------------------------------- commit 0e7e611470a7c70ef5a3c84be01eeac8fddadf94 Author: Sergei Trofimovich Date: Wed Jun 24 22:10:47 2015 +0100 driver: pass '-fPIC' option to all CC invocations Reported by mitchty: When porting ghc to alpine linux (rumors say they build all binaries as Position Independent Executables to leverage global ASLR) linker issued obscure errors: Tiny example: $ echo 'main = print "hello"' > a.hs $ ghc -fforce-recomp a.hs -fPIC -dynamic -optl-pie -o a ld: /tmp/ghc2142_0/ghc2142_5.o: relocation R_X86_64_32 against `ZCMain_main_closure' can not be used when making a shared object; recompile with -fPIC /tmp/ghc2142_0/ghc2142_5.o: error adding symbols: Bad value collect2: error: ld returned 1 exit status There is two entry points in CC driver: 'runPhase' (CC) and 'mkExtraObj' 'mkExtraObj' does not handle most of 'runPhase's complexity. Ideally it should. This patch only adds -fPIC propagation to 'mkExtraObj'. Please merge to stable branch. Signed-off-by: Sergei Trofimovich >--------------------------------------------------------------- 0e7e611470a7c70ef5a3c84be01eeac8fddadf94 compiler/main/DriverPipeline.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs index 6d597f9..623f356 100644 --- a/compiler/main/DriverPipeline.hs +++ b/compiler/main/DriverPipeline.hs @@ -1623,12 +1623,14 @@ mkExtraObj dflags extn xs oFile <- newTempName dflags "o" writeFile cFile xs let rtsDetails = getPackageDetails dflags rtsPackageKey + pic_c_flags = picCCOpts dflags SysTools.runCc dflags ([Option "-c", FileOption "" cFile, Option "-o", FileOption "" oFile] - ++ map (FileOption "-I") (includeDirs rtsDetails)) + ++ map (FileOption "-I") (includeDirs rtsDetails) + ++ map Option pic_c_flags) return oFile -- When linking a binary, we need to create a C main() function that From git at git.haskell.org Fri Jul 10 09:37:21 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 10 Jul 2015 09:37:21 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Testsuite: mark T4945 as expect_broken (#4945) (7fa3b23) Message-ID: <20150710093721.0FE2E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/7fa3b23cc9b631d36f02fdb884be722fbb36d15a/ghc >--------------------------------------------------------------- commit 7fa3b23cc9b631d36f02fdb884be722fbb36d15a Author: Thomas Miedema Date: Thu Jun 11 17:25:47 2015 +0200 Testsuite: mark T4945 as expect_broken (#4945) In commit 7d519dabd2006c9742e82fce02df55704da15482, the file T4945.stdout was added to the repository, to make T4945 pass validatation presumably. When that test produces output however, there is a bug somewhere, and we shouldn't hide it. There is a comment in the Makefile which says: "When SpecConstr works there are no STUArrays at all" So here we remove T4945.stdout again, mark T4945 as expect_broken, and reopen the ticket. Differential Revision: https://phabricator.haskell.org/D976 Conflicts: testsuite/tests/simplCore/should_compile/T4945.stdout testsuite/tests/simplCore/should_compile/all.T >--------------------------------------------------------------- 7fa3b23cc9b631d36f02fdb884be722fbb36d15a testsuite/tests/simplCore/should_compile/T4945.stdout | 7 ------- testsuite/tests/simplCore/should_compile/all.T | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/testsuite/tests/simplCore/should_compile/T4945.stdout b/testsuite/tests/simplCore/should_compile/T4945.stdout deleted file mode 100644 index 2467d21..0000000 --- a/testsuite/tests/simplCore/should_compile/T4945.stdout +++ /dev/null @@ -1,7 +0,0 @@ - -> STUArray RealWorld Int Int - (ipv3 [OS=OneShot] :: STUArray RealWorld Int Int) -> - case ipv3 of _ [Occ=Dead] { STUArray ds5 ds6 dt ds7 -> - (Data.Array.Base.STUArray - (Data.Array.Base.STUArray - (Data.Array.Base.STUArray - (Data.Array.Base.STUArray diff --git a/testsuite/tests/simplCore/should_compile/all.T b/testsuite/tests/simplCore/should_compile/all.T index 32aa8ea..30c63cf 100644 --- a/testsuite/tests/simplCore/should_compile/all.T +++ b/testsuite/tests/simplCore/should_compile/all.T @@ -108,7 +108,7 @@ test('T4918', ['$MAKE -s --no-print-directory T4918']) test('T4945', - when(compiler_lt('ghc', '7.1'), expect_fail), + normal, run_command, ['$MAKE -s --no-print-directory T4945']) From git at git.haskell.org Fri Jul 10 09:37:23 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 10 Jul 2015 09:37:23 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Add an ambient Id substitution to Subst (1171d42) Message-ID: <20150710093723.DA18D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/1171d420715eb7fbe8ac35d82e5dbc1476149c3c/ghc >--------------------------------------------------------------- commit 1171d420715eb7fbe8ac35d82e5dbc1476149c3c Author: Simon Peyton Jones Date: Wed Jul 8 17:39:21 2015 +0100 Add an ambient Id substitution to Subst After a struggle, I fixed Trac #5113 (again) on the 7.10 branch, by adding an ambient substitution to Subst; see CoreSubst, esp Note [IdSubstEnv]. This allowed me to do the impedence-matching in SimplEnv.substExpr efficiently (fixing #10370) as well correctly (fixing the latest problem with #5113). This cost me more time than I like to say. Sigh. >--------------------------------------------------------------- 1171d420715eb7fbe8ac35d82e5dbc1476149c3c compiler/coreSyn/CoreSubst.hs | 137 +++++++++++++++++++++++++++++++++-------- compiler/simplCore/SimplEnv.hs | 118 ++++++++++++----------------------- compiler/simplCore/Simplify.hs | 2 +- compiler/specialise/Rules.hs | 8 +-- 4 files changed, 156 insertions(+), 109 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 1171d420715eb7fbe8ac35d82e5dbc1476149c3c From git at git.haskell.org Fri Jul 10 09:37:27 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 10 Jul 2015 09:37:27 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Add testcase for #10602 (9938a40) Message-ID: <20150710093727.20B343A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/9938a40ef9af63bf176caf2d48cb679e82370577/ghc >--------------------------------------------------------------- commit 9938a40ef9af63bf176caf2d48cb679e82370577 Author: Ben Gamari Date: Thu Jul 9 05:12:05 2015 -0400 Add testcase for #10602 >--------------------------------------------------------------- 9938a40ef9af63bf176caf2d48cb679e82370577 testsuite/tests/simplCore/should_compile/T10602.hs | 34 ++++++++++++++++++++++ testsuite/tests/simplCore/should_compile/all.T | 1 + 2 files changed, 35 insertions(+) diff --git a/testsuite/tests/simplCore/should_compile/T10602.hs b/testsuite/tests/simplCore/should_compile/T10602.hs new file mode 100644 index 0000000..fc2523d --- /dev/null +++ b/testsuite/tests/simplCore/should_compile/T10602.hs @@ -0,0 +1,34 @@ +import Control.Monad +import Data.Binary +import Data.List + +newtype A a = A [a] + +instance Binary a => Binary (A a) where + put (A xs) = case splitAt 254 xs of + (_, []) -> mapM_ put xs + (a, b) -> put (A b) + + get = do xs <- replicateM 254 get + A ys <- get + return $ A $ xs ++ ys + +main :: IO () +main = undefined + +{- +This intermittently failed with although I was never able to reliably reproduce, + +$ ./inplace/bin/ghc-stage2 -O2 Test.hs -fforce-recomp +[1 of 1] Compiling Main ( Test.hs, Test.o ) +ghc-stage2: panic! (the 'impossible' happened) + (GHC version 7.10.1.20150708 for x86_64-unknown-linux): + Template variable unbound in rewrite rule + sg_s5zh + [sc_s5zf, sc_s5zg, sg_s5zh, sg_s5zi] + [sc_s5zf, sc_s5zg, sg_s5zh, sg_s5zi] + [: @ a_a3fv sc_s5zf sc_s5zg] + [: @ a_a3fv sc_s5zb sc_s5zc] + +Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug +-} diff --git a/testsuite/tests/simplCore/should_compile/all.T b/testsuite/tests/simplCore/should_compile/all.T index 30c63cf..84e9c6d 100644 --- a/testsuite/tests/simplCore/should_compile/all.T +++ b/testsuite/tests/simplCore/should_compile/all.T @@ -210,3 +210,4 @@ test('T9400', only_ways(['optasm']), compile, ['-O0 -ddump-simpl -dsuppress-uniq test('T9583', only_ways(['optasm']), compile, ['']) test('T9565', only_ways(['optasm']), compile, ['']) test('T10176', only_ways(['optasm']), compile, ['']) +test('T10602', only_ways(['optasm']), compile, ['-O2']) From git at git.haskell.org Fri Jul 10 09:37:29 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 10 Jul 2015 09:37:29 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Recenter performance numbers (73105e2) Message-ID: <20150710093729.EF3243A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/73105e2f5a0b39f2f2bbc95c1548358675aa9a45/ghc >--------------------------------------------------------------- commit 73105e2f5a0b39f2f2bbc95c1548358675aa9a45 Author: Ben Gamari Date: Thu Jul 9 04:40:49 2015 -0400 Recenter performance numbers These are fairly small changes. I'm just going to recenter these and then focus on identifying the reason for the drift on master >--------------------------------------------------------------- 73105e2f5a0b39f2f2bbc95c1548358675aa9a45 testsuite/tests/perf/compiler/all.T | 3 ++- testsuite/tests/perf/should_run/all.T | 10 ++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/testsuite/tests/perf/compiler/all.T b/testsuite/tests/perf/compiler/all.T index bd7e5d1..22253a7 100644 --- a/testsuite/tests/perf/compiler/all.T +++ b/testsuite/tests/perf/compiler/all.T @@ -607,10 +607,11 @@ test('T9872d', test('T9961', [ only_ways(['normal']), compiler_stats_num_field('bytes allocated', - [(wordsize(64), 663978160, 5), + [(wordsize(64), 617926624, 5), # 2015-01-12 807117816 Initally created # 2015-spring 772510192 Got better # 2015-05-22 663978160 Fix for #10370 improves it more + # 2015-07-09 617926624 Fix for #10527 improves it even more (wordsize(32), 375647160, 5) ]), ], diff --git a/testsuite/tests/perf/should_run/all.T b/testsuite/tests/perf/should_run/all.T index 3731218..af6d51d 100644 --- a/testsuite/tests/perf/should_run/all.T +++ b/testsuite/tests/perf/should_run/all.T @@ -16,10 +16,11 @@ test('T3586', test('T4830', [stats_num_field('bytes allocated', - [(wordsize(64), 98248, 1), + [(wordsize(64), 98784, 1), # 127000 (amd64/Linux) # 2013-02-07: 99264 (amd64/Linux) # 2014-01-13: 98248 (amd64/Linux) due to #8647 + # 2015-07-09: 98784 (amd64/Linux) (wordsize(32), 70646, 3)]), # 2013-02-10: 69744 (x86/Windows) # 2013-02-10: 71548 (x86/OSX) @@ -276,12 +277,13 @@ test('T7507', omit_ways(['ghci']), compile_and_run, ['-O']) test('T7436', [stats_num_field('max_bytes_used', - [(wordsize(64), 60360, 1), + [(wordsize(64), 60296, 1), # 127000 (amd64/Linux) # 2013-02-07: 60360 (amd64/Linux) + # 2015-07-09: 60296 (amd64/Linux) (wordsize(32), 58434, 1)]), - # 2013-02-10: 58032 (x86/Windows) - # 2013-02-10: 58836 (x86/OSX) + # 2013-02-10: 58032 (x86/Windows) + # 2013-02-10: 58836 (x86/OSX) only_ways(['normal']) ], compile_and_run, From git at git.haskell.org Fri Jul 10 09:37:32 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 10 Jul 2015 09:37:32 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Fix self-contained handling of ASCII encoding (677552f) Message-ID: <20150710093732.A79313A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/677552f21690761b89255d05e42976679be4d374/ghc >--------------------------------------------------------------- commit 677552f21690761b89255d05e42976679be4d374 Author: Ben Gamari Date: Thu Jul 9 08:07:54 2015 -0400 Fix self-contained handling of ASCII encoding D898 was primarily intended to fix hangs in the event that iconv was unavailable (namely #10298 and #7695). In addition to this fix, it also introduced self-contained handling of ANSI terminals to allow compiled executables to run in minimal environments lacking iconv. However, the behavior that the patch introduced is highly suspicious. Specifically, it gives the user a UTF-8 encoding even if they requested ASCII. This has the potential to break quite a lot of code. At very least it breaks GHC's Unicode terminal detection logic, which attempts to catch an invalid character when encoding a pair of smart-quotes. Of course, this exception will never be thrown if a UTF-8 encoder is used. Here we use the `char8` encoding to handle requests for ASCII encodings. Fixes #10623. >--------------------------------------------------------------- 677552f21690761b89255d05e42976679be4d374 libraries/base/GHC/IO/Encoding.hs | 35 +++++++++++++++++++++++---------- libraries/base/GHC/IO/Encoding/Iconv.hs | 2 ++ libraries/base/GHC/TopHandler.hs | 6 +++++- testsuite/tests/driver/Makefile | 2 +- 4 files changed, 33 insertions(+), 12 deletions(-) diff --git a/libraries/base/GHC/IO/Encoding.hs b/libraries/base/GHC/IO/Encoding.hs index 014b61b..108b0fc 100644 --- a/libraries/base/GHC/IO/Encoding.hs +++ b/libraries/base/GHC/IO/Encoding.hs @@ -30,6 +30,7 @@ module GHC.IO.Encoding ( ) where import GHC.Base +import GHC.Foreign (charIsRepresentable) import GHC.IO.Exception import GHC.IO.Buffer import GHC.IO.Encoding.Failure @@ -235,14 +236,9 @@ mkTextEncoding e = case mb_coding_failure_mode of _ -> Nothing mkTextEncoding' :: CodingFailureMode -> String -> IO TextEncoding -mkTextEncoding' cfm enc - -- First, specifically match on ASCII encodings directly using - -- several possible aliases (specified by RFC 1345 & co), which - -- allows us to handle ASCII conversions without iconv at all (see - -- trac #10298). - | any (== enc) ansiEncNames = return (UTF8.mkUTF8 cfm) - -- Otherwise, handle other encoding needs via iconv. - | otherwise = case [toUpper c | c <- enc, c /= '-'] of +mkTextEncoding' cfm enc = + case [toUpper c | c <- enc, c /= '-'] of + -- UTF-8 and friends we can handle ourselves "UTF8" -> return $ UTF8.mkUTF8 cfm "UTF16" -> return $ UTF16.mkUTF16 cfm "UTF16LE" -> return $ UTF16.mkUTF16le cfm @@ -254,13 +250,32 @@ mkTextEncoding' cfm enc 'C':'P':n | [(cp,"")] <- reads n -> return $ CodePage.mkCodePageEncoding cfm cp _ -> unknownEncodingErr (enc ++ codingFailureModeSuffix cfm) #else - _ -> Iconv.mkIconvEncoding cfm enc -#endif + -- Otherwise, handle other encoding needs via iconv. + + -- Unfortunately there is no good way to determine whether iconv is actually + -- functional without telling it to do something. + _ -> do res <- Iconv.mkIconvEncoding cfm enc + good <- charIsRepresentable res 'a' + let isAscii = any (== enc) ansiEncNames + case good of + True -> return res + -- At this point we know that we can't count on iconv to work + -- (see, for instance, Trac #10298). However, we still want to do + -- what can to work with what we have. For instance, ASCII is + -- easy. We match on ASCII encodings directly using several + -- possible aliases (specified by RFC 1345 & Co) and for this use + -- the 'char8' encodeing + False + | isAscii -> return char8 + | otherwise -> + unknownEncodingErr (enc ++ codingFailureModeSuffix cfm) where ansiEncNames = -- ASCII aliases [ "ANSI_X3.4-1968", "iso-ir-6", "ANSI_X3.4-1986", "ISO_646.irv:1991" , "US-ASCII", "us", "IBM367", "cp367", "csASCII", "ASCII", "ISO646-US" ] +#endif + latin1_encode :: CharBuffer -> Buffer Word8 -> IO (CharBuffer, Buffer Word8) latin1_encode input output = fmap (\(_why,input',output') -> (input',output')) $ Latin1.latin1_encode input output -- unchecked, used for char8 diff --git a/libraries/base/GHC/IO/Encoding/Iconv.hs b/libraries/base/GHC/IO/Encoding/Iconv.hs index 89ca71e..f64d245 100644 --- a/libraries/base/GHC/IO/Encoding/Iconv.hs +++ b/libraries/base/GHC/IO/Encoding/Iconv.hs @@ -99,6 +99,8 @@ char_shift | charSize == 2 = 1 iconvEncoding :: String -> IO TextEncoding iconvEncoding = mkIconvEncoding ErrorOnCodingFailure +-- | Construct an iconv-based 'TextEncoding' for the given character set and +-- 'CodingFailureMode'. mkIconvEncoding :: CodingFailureMode -> String -> IO TextEncoding mkIconvEncoding cfm charset = do return (TextEncoding { diff --git a/libraries/base/GHC/TopHandler.hs b/libraries/base/GHC/TopHandler.hs index e725196..d901069 100644 --- a/libraries/base/GHC/TopHandler.hs +++ b/libraries/base/GHC/TopHandler.hs @@ -176,7 +176,11 @@ disasterHandler exit _ = withCAString "%s" $ \fmt -> withCAString msgStr $ \msg -> errorBelch fmt msg >> exit 1 - where msgStr = "encountered an exception while trying to report an exception" + where + msgStr = + "encountered an exception while trying to report an exception." ++ + "One possible reason for this is that we failed while trying to " ++ + "encode an error message. Check that your locale configured properly." {- Note [Disaster with iconv] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/testsuite/tests/driver/Makefile b/testsuite/tests/driver/Makefile index 4418ba4..e12f3a5 100644 --- a/testsuite/tests/driver/Makefile +++ b/testsuite/tests/driver/Makefile @@ -551,7 +551,7 @@ T7563: -"$(TEST_HC)" $(TEST_HC_OPTS_NO_RECOMP) -C T7563.hs # Below we set LC_ALL=C to request standard ASCII output in the resulting error -# messagse. Unfortunately, Mac OS X still uses a Unicode encoding even with +# messages. Unfortunately, Mac OS X still uses a Unicode encoding even with # LC_ALL=C, so we expect these tests to fail there. .PHONY: T6037 From git at git.haskell.org Fri Jul 10 09:37:35 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 10 Jul 2015 09:37:35 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Make mkQualPackage more robust when package key is bad. (c808656) Message-ID: <20150710093735.67F863A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/c808656bc4c5c37057088b8ac45b40749ce98e0b/ghc >--------------------------------------------------------------- commit c808656bc4c5c37057088b8ac45b40749ce98e0b Author: Edward Z. Yang Date: Thu Jul 9 10:21:51 2015 -0700 Make mkQualPackage more robust when package key is bad. Signed-off-by: Edward Z. Yang Test Plan: validate Reviewers: bgamari, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1060 GHC Trac Issues: #10624 >--------------------------------------------------------------- c808656bc4c5c37057088b8ac45b40749ce98e0b compiler/main/HscTypes.hs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/compiler/main/HscTypes.hs b/compiler/main/HscTypes.hs index 02592a3..dfc394d 100644 --- a/compiler/main/HscTypes.hs +++ b/compiler/main/HscTypes.hs @@ -1588,15 +1588,14 @@ mkQualPackage dflags pkg_key -- Skip the lookup if it's main, since it won't be in the package -- database! = False - | searchPackageId dflags pkgid `lengthIs` 1 + | Just pkgid <- mb_pkgid + , searchPackageId dflags pkgid `lengthIs` 1 -- this says: we are given a package pkg-0.1 at MMM, are there only one -- exposed packages whose package ID is pkg-0.1? = False | otherwise = True - where pkg = fromMaybe (pprPanic "qual_pkg" (ftext (packageKeyFS pkg_key))) - (lookupPackage dflags pkg_key) - pkgid = sourcePackageId pkg + where mb_pkgid = fmap sourcePackageId (lookupPackage dflags pkg_key) -- | A function which only qualifies package names if necessary; but -- qualifies all other identifiers. From git at git.haskell.org Fri Jul 10 09:37:38 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 10 Jul 2015 09:37:38 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Parenthesization wibble in T10279. (51de934) Message-ID: <20150710093738.2D7143A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/51de9342b915688f1222760c74b9a63e44c533d3/ghc >--------------------------------------------------------------- commit 51de9342b915688f1222760c74b9a63e44c533d3 Author: Ben Gamari Date: Fri Jul 10 03:45:48 2015 -0400 Parenthesization wibble in T10279. See Trac #10624. >--------------------------------------------------------------- 51de9342b915688f1222760c74b9a63e44c533d3 testsuite/tests/th/T10279.stderr | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/testsuite/tests/th/T10279.stderr b/testsuite/tests/th/T10279.stderr index 9c72bf9..071ee45 100644 --- a/testsuite/tests/th/T10279.stderr +++ b/testsuite/tests/th/T10279.stderr @@ -1,8 +1,8 @@ -T10279.hs:10:10: +T10279.hs:10:8: Failed to load interface for ?A? no package key matching ?rts-1.0? was found (This package key looks like the source package ID; the real package key is ?rts?) - In the expression: (rts-1.0:A.Foo) - In an equation for ?blah?: blah = (rts-1.0:A.Foo) + In the expression: rts-1.0:A.Foo + In an equation for ?blah?: blah = rts-1.0:A.Foo From git at git.haskell.org Fri Jul 10 09:37:40 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 10 Jul 2015 09:37:40 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Don't repeat package key with -dppr-debug when package info is missing. (4869272) Message-ID: <20150710093740.EB4713A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/4869272036841043e5fef350007b6a943e8c4690/ghc >--------------------------------------------------------------- commit 4869272036841043e5fef350007b6a943e8c4690 Author: Edward Z. Yang Date: Tue Apr 7 09:08:54 2015 -0500 Don't repeat package key with -dppr-debug when package info is missing. Signed-off-by: Edward Z. Yang Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D802 >--------------------------------------------------------------- 4869272036841043e5fef350007b6a943e8c4690 compiler/basicTypes/Module.hs | 12 +++++++----- compiler/main/Packages.hs | 8 +++----- compiler/main/Packages.hs-boot | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/compiler/basicTypes/Module.hs b/compiler/basicTypes/Module.hs index ac5efd4..85e852f 100644 --- a/compiler/basicTypes/Module.hs +++ b/compiler/basicTypes/Module.hs @@ -326,11 +326,13 @@ stablePackageKeyCmp p1 p2 = packageKeyFS p1 `compare` packageKeyFS p2 instance Outputable PackageKey where ppr pk = getPprStyle $ \sty -> sdocWithDynFlags $ \dflags -> - text (packageKeyPackageIdString dflags pk) - -- Don't bother qualifying if it's wired in! - <> (if qualPackage sty pk && not (pk `elem` wiredInPackageKeys) - then char '@' <> ftext (packageKeyFS pk) - else empty) + case packageKeyPackageIdString dflags pk of + Nothing -> ftext (packageKeyFS pk) + Just pkg -> text pkg + -- Don't bother qualifying if it's wired in! + <> (if qualPackage sty pk && not (pk `elem` wiredInPackageKeys) + then char '@' <> ftext (packageKeyFS pk) + else empty) instance Binary PackageKey where put_ bh pid = put_ bh (packageKeyFS pid) diff --git a/compiler/main/Packages.hs b/compiler/main/Packages.hs index 28f2f2d..aa97280 100644 --- a/compiler/main/Packages.hs +++ b/compiler/main/Packages.hs @@ -1325,12 +1325,10 @@ missingDependencyMsg (Just parent) -- ----------------------------------------------------------------------------- -packageKeyPackageIdString :: DynFlags -> PackageKey -> String +packageKeyPackageIdString :: DynFlags -> PackageKey -> Maybe String packageKeyPackageIdString dflags pkg_key - | pkg_key == mainPackageKey = "main" - | otherwise = maybe "(unknown)" - sourcePackageIdString - (lookupPackage dflags pkg_key) + | pkg_key == mainPackageKey = Just "main" + | otherwise = fmap sourcePackageIdString (lookupPackage dflags pkg_key) -- | Will the 'Name' come from a dynamically linked library? isDllName :: DynFlags -> PackageKey -> Module -> Name -> Bool diff --git a/compiler/main/Packages.hs-boot b/compiler/main/Packages.hs-boot index 2f898f1..f2343b6 100644 --- a/compiler/main/Packages.hs-boot +++ b/compiler/main/Packages.hs-boot @@ -3,4 +3,4 @@ module Packages where import {-# SOURCE #-} Module (PackageKey) import {-# SOURCE #-} DynFlags (DynFlags) data PackageState -packageKeyPackageIdString :: DynFlags -> PackageKey -> String +packageKeyPackageIdString :: DynFlags -> PackageKey -> Maybe String From git at git.haskell.org Fri Jul 10 09:37:43 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 10 Jul 2015 09:37:43 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Fix T2507 expected output (4fd6221) Message-ID: <20150710093743.B87D43A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/4fd62218b0c2191ab3c65c54ec8201c8ebd78605/ghc >--------------------------------------------------------------- commit 4fd62218b0c2191ab3c65c54ec8201c8ebd78605 Author: Ben Gamari Date: Thu Jul 9 09:39:30 2015 -0400 Fix T2507 expected output This seems to have been changed in 07282c7222d718e6d3df8d8f843d95d534dd7062 to include Unicode quotes despite the fact that we explicitly set LC_ALL=C in the Makefile to request standard ASCII output. >--------------------------------------------------------------- 4fd62218b0c2191ab3c65c54ec8201c8ebd78605 testsuite/tests/driver/Makefile | 4 ++++ testsuite/tests/driver/T2507.stderr | 4 ++-- testsuite/tests/driver/all.T | 8 +++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/testsuite/tests/driver/Makefile b/testsuite/tests/driver/Makefile index 4670958..4418ba4 100644 --- a/testsuite/tests/driver/Makefile +++ b/testsuite/tests/driver/Makefile @@ -550,6 +550,10 @@ T7130: T7563: -"$(TEST_HC)" $(TEST_HC_OPTS_NO_RECOMP) -C T7563.hs +# Below we set LC_ALL=C to request standard ASCII output in the resulting error +# messagse. Unfortunately, Mac OS X still uses a Unicode encoding even with +# LC_ALL=C, so we expect these tests to fail there. + .PHONY: T6037 T6037: -LC_ALL=C "$(TEST_HC)" $(TEST_HC_OPTS_NO_RECOMP) -c T6037.hs diff --git a/testsuite/tests/driver/T2507.stderr b/testsuite/tests/driver/T2507.stderr index e4365a3..925a870 100644 --- a/testsuite/tests/driver/T2507.stderr +++ b/testsuite/tests/driver/T2507.stderr @@ -1,5 +1,5 @@ T2507.hs:5:7: - Couldn't match expected type ?Int? with actual type ?()? + Couldn't match expected type `Int' with actual type `()' In the expression: () - In an equation for ?foo?: foo = () + In an equation for `foo': foo = () diff --git a/testsuite/tests/driver/all.T b/testsuite/tests/driver/all.T index f236f6b..a260a17 100644 --- a/testsuite/tests/driver/all.T +++ b/testsuite/tests/driver/all.T @@ -384,8 +384,14 @@ test('T7060', test('T7130', normal, compile_fail, ['-fflul-laziness']) test('T7563', when(unregisterised(), skip), run_command, ['$MAKE -s --no-print-directory T7563']) -test('T6037', expect_broken(6037), run_command, + +test('T6037', + # The testsuite doesn't know how to set a non-Unicode locale on Windows or Mac OS X + [when(opsys('mingw32'), expect_fail), when(opsys('darwin'), expect_fail), + expect_broken(6037)], + run_command, ['$MAKE -s --no-print-directory T6037']) + test('T2507', # The testsuite doesn't know how to set a non-Unicode locale on Windows or Mac OS X [when(opsys('mingw32'), expect_fail), when(opsys('darwin'), expect_fail)], From git at git.haskell.org Fri Jul 10 11:53:33 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 10 Jul 2015 11:53:33 +0000 (UTC) Subject: [commit: ghc] master: Comments only (0a3c43f) Message-ID: <20150710115333.6923E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/0a3c43fe8852a1f7fc5fcd104b56457811fa3912/ghc >--------------------------------------------------------------- commit 0a3c43fe8852a1f7fc5fcd104b56457811fa3912 Author: Simon Peyton Jones Date: Fri Jul 10 12:52:50 2015 +0100 Comments only >--------------------------------------------------------------- 0a3c43fe8852a1f7fc5fcd104b56457811fa3912 compiler/simplCore/Simplify.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/simplCore/Simplify.hs b/compiler/simplCore/Simplify.hs index c6f115a..bd17361 100644 --- a/compiler/simplCore/Simplify.hs +++ b/compiler/simplCore/Simplify.hs @@ -2797,6 +2797,8 @@ Other choices: When x is inlined into its full context, we find that it was a bad idea to have pushed the outer case inside the (...) case. +There is a cost to not doing case-of-case; see Trac #10626. + Note [Single-alternative-unlifted] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Here's another single-alternative where we really want to do case-of-case: From git at git.haskell.org Fri Jul 10 11:53:36 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 10 Jul 2015 11:53:36 +0000 (UTC) Subject: [commit: ghc] master: Better type wildcard errors (9e86bf1) Message-ID: <20150710115336.32E213A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/9e86bf1b346934e04ccc17ec50ea7e7d906f25e2/ghc >--------------------------------------------------------------- commit 9e86bf1b346934e04ccc17ec50ea7e7d906f25e2 Author: Simon Peyton Jones Date: Fri Jul 10 12:53:53 2015 +0100 Better type wildcard errors Adopts sugggestion in Trac #10224, comment:3 >--------------------------------------------------------------- 9e86bf1b346934e04ccc17ec50ea7e7d906f25e2 compiler/typecheck/TcErrors.hs | 44 ++++++++++++---------- .../partial-sigs/should_compile/T10403.stderr | 4 +- .../partial-sigs/should_compile/T10438.stderr | 2 +- .../WarningWildcardInstantiations.stderr | 10 ++--- .../InstantiatedNamedWildcardsInConstraints.stderr | 2 +- .../should_fail/NamedWildcardsEnabled.stderr | 4 +- .../PartialTypeSignaturesDisabled.stderr | 4 +- .../partial-sigs/should_fail/TidyClash.stderr | 4 +- .../partial-sigs/should_fail/Trac10045.stderr | 2 +- .../should_fail/WildcardInstantiations.stderr | 10 ++--- .../WildcardsInPatternAndExprSig.stderr | 10 ++--- .../tests/typecheck/should_compile/T10072.stderr | 2 +- 12 files changed, 51 insertions(+), 47 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 9e86bf1b346934e04ccc17ec50ea7e7d906f25e2 From git at git.haskell.org Fri Jul 10 13:27:50 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 10 Jul 2015 13:27:50 +0000 (UTC) Subject: [commit: ghc] wip/impredicativity: Rename and give right kind to (<~) (52b6048) Message-ID: <20150710132750.48D873A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/impredicativity Link : http://ghc.haskell.org/trac/ghc/changeset/52b6048ec7b88baa5e86389d54cf1cfb65947d2a/ghc >--------------------------------------------------------------- commit 52b6048ec7b88baa5e86389d54cf1cfb65947d2a Author: Alejandro Serrano Date: Fri Jul 10 15:26:30 2015 +0200 Rename and give right kind to (<~) - Since (<=) is already taken in base, the name of the "instance of" constraint has been changed to (<~). It tries to be like "less than or equal" where equality is ~. - The previous definition of (<=) had kind * -> * -> Constraint. This disallows having constraints like Int# <~ Int#, which are generated when working with unboxed types. Now, the constraint takes arguments of kind OpenKind. >--------------------------------------------------------------- 52b6048ec7b88baa5e86389d54cf1cfb65947d2a compiler/coreSyn/CoreSubst.hs | 15 ++++++--------- compiler/prelude/TysWiredIn.hs | 22 ++++++++++++---------- libraries/ghc-prim/GHC/Types.hs | 6 +++--- 3 files changed, 21 insertions(+), 22 deletions(-) diff --git a/compiler/coreSyn/CoreSubst.hs b/compiler/coreSyn/CoreSubst.hs index 89e293a..46975bb 100644 --- a/compiler/coreSyn/CoreSubst.hs +++ b/compiler/coreSyn/CoreSubst.hs @@ -57,7 +57,7 @@ import Coercion hiding ( substTy, substCo, extendTvSubst, substTyVarBndr, substC import TyCon ( tyConArity ) import DataCon import PrelNames ( eqBoxDataConKey, coercibleDataConKey, unpackCStringIdKey - , unpackCStringUtf8IdKey ) + , unpackCStringUtf8IdKey, instanceOfTyConKey ) import OptCoercion ( optCoercion ) import PprCore ( pprCoreBindings, pprRules ) import Module ( Module ) @@ -959,14 +959,6 @@ simple_app subst (Var v) as , isAlwaysActive (idInlineActivation v) -- See Note [Unfold compulsory unfoldings in LHSs] = simple_app subst (unfoldingTemplate (idUnfolding v)) as - -- Instantiation functions are always inlined - {- - | lookupIdIsInstantiationFn subst v, isLocalId v, c:cs <- as - = case lookupIdSubst (text "simpleOptExpr") subst v of - Lam b e -> simple_app (extendIdSubst subst b c) e cs - Var v' | v == v' -> foldl App (simple_opt_expr subst e) as - e' -> simple_app subst e' as - -} simple_app subst (Tick t e) as -- Okay to do "(Tick t e) x ==> Tick t (e x)"? | t `tickishScopesLike` SoftScope @@ -1031,6 +1023,11 @@ maybe_substitute subst b r , not (isUnLiftedType (idType b)) || exprOkForSpeculation r = Just (extendIdSubst subst b r) + | isId b + , Just (tc, _) <- splitTyConApp_maybe (idType b) + , tc `hasKey` instanceOfTyConKey + = Just (extendIdSubst subst b r) -- Aggresively inline (<=) coercions + | otherwise = Nothing where diff --git a/compiler/prelude/TysWiredIn.hs b/compiler/prelude/TysWiredIn.hs index d5b0b78..8d538ef 100644 --- a/compiler/prelude/TysWiredIn.hs +++ b/compiler/prelude/TysWiredIn.hs @@ -188,7 +188,7 @@ coercibleDataConName = mkWiredInDataConName UserSyntax gHC_TYPES (fsLit "MkCoerc -- See Note [Kind-changing of (~). Coercible and InstanceOf] instanceOfTyConName, instanceOfDataConName, instanceOfAxiomName :: Name -instanceOfTyConName = mkWiredInTyConName UserSyntax gHC_TYPES (fsLit "<=") instanceOfTyConKey instanceOfTyCon +instanceOfTyConName = mkWiredInTyConName UserSyntax gHC_TYPES (fsLit "<~") instanceOfTyConKey instanceOfTyCon instanceOfDataConName = mkWiredInDataConName UserSyntax gHC_TYPES (fsLit "InstOf") instanceOfDataConKey instanceOfDataCon instanceOfAxiomName = mkWiredInName gHC_TYPES (mkDataOccFS (fsLit "InstOfArrow")) instanceOfAxiomKey (ACoAxiom (toBranchedAxiom instanceOfNewtypeAxiom)) UserSyntax @@ -597,15 +597,17 @@ coercibleClass = mkClass (tyConTyVars coercibleTyCon) [] [] [] [] [] (mkAnd []) instanceOfTyCon :: TyCon instanceOfTyCon = mkAlgTyCon instanceOfTyConName - (mkArrowKinds [liftedTypeKind, liftedTypeKind] constraintKind) - [alphaTyVar, betaTyVar] + (mkArrowKinds [openTypeKind, openTypeKind] constraintKind) + [openAlphaTyVar, openBetaTyVar] [Nominal, Nominal] Nothing [] -- No stupid theta (NewTyCon { data_con = instanceOfDataCon - , nt_rhs = FunTy (mkTyVarTy alphaTyVar) (mkTyVarTy betaTyVar) - , nt_etad_rhs = ( [alphaTyVar, betaTyVar] - , FunTy (mkTyVarTy alphaTyVar) (mkTyVarTy betaTyVar) ) + , nt_rhs = FunTy (mkTyVarTy openAlphaTyVar) + (mkTyVarTy openBetaTyVar) + , nt_etad_rhs = ( [openAlphaTyVar, betaTyVar] + , FunTy (mkTyVarTy openAlphaTyVar) + (mkTyVarTy openBetaTyVar) ) , nt_co = instanceOfNewtypeAxiom }) NoParentTyCon NonRecursive @@ -614,14 +616,14 @@ instanceOfTyCon = mkAlgTyCon instanceOfTyConName instanceOfDataCon :: DataCon instanceOfDataCon = pcDataCon instanceOfDataConName - [alphaTyVar, betaTyVar] - [FunTy (mkTyVarTy alphaTyVar) (mkTyVarTy betaTyVar)] + [openAlphaTyVar, openBetaTyVar] + [FunTy (mkTyVarTy openAlphaTyVar) (mkTyVarTy openBetaTyVar)] instanceOfTyCon instanceOfNewtypeAxiom :: CoAxiom Unbranched instanceOfNewtypeAxiom = mkNewTypeCo instanceOfAxiomName - instanceOfTyCon [alphaTyVar, betaTyVar] [Nominal, Nominal] - (FunTy (mkTyVarTy alphaTyVar) (mkTyVarTy betaTyVar)) + instanceOfTyCon [openAlphaTyVar, openBetaTyVar] [Nominal, Nominal] + (FunTy (mkTyVarTy openAlphaTyVar) (mkTyVarTy openBetaTyVar)) charTy :: Type charTy = mkTyConTy charTyCon diff --git a/libraries/ghc-prim/GHC/Types.hs b/libraries/ghc-prim/GHC/Types.hs index 3a9ffaf..f796ebf 100644 --- a/libraries/ghc-prim/GHC/Types.hs +++ b/libraries/ghc-prim/GHC/Types.hs @@ -1,5 +1,5 @@ {-# LANGUAGE MagicHash, NoImplicitPrelude, TypeFamilies, UnboxedTuples, - MultiParamTypeClasses, RoleAnnotations #-} + MultiParamTypeClasses, RoleAnnotations, TypeOperators #-} ----------------------------------------------------------------------------- -- | -- Module : GHC.Types @@ -24,7 +24,7 @@ module GHC.Types ( SPEC(..), Nat, Symbol, Coercible, - InstanceOf + type (<~) ) where import GHC.Prim @@ -177,7 +177,7 @@ data Coercible a b = MkCoercible ((~#) a b) -- Also see Note [Kind-changing of (~) and Coercible] -- | A constraint inhabited only if type `a` is an instance of type `b`. -newtype (<=) b a = InstOf (b -> a) +newtype (<~) b a = InstOf (b -> a) -- | Alias for 'tagToEnum#'. Returns True if its parameter is 1# and False -- if it is 0#. From git at git.haskell.org Fri Jul 10 14:24:48 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 10 Jul 2015 14:24:48 +0000 (UTC) Subject: [commit: ghc] wip/impredicativity: Fix flavoring of variables when checking RULES (579e9f2) Message-ID: <20150710142448.314193A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/impredicativity Link : http://ghc.haskell.org/trac/ghc/changeset/579e9f27b3eb474565dc19003651f588231e51eb/ghc >--------------------------------------------------------------- commit 579e9f27b3eb474565dc19003651f588231e51eb Author: Alejandro Serrano Date: Fri Jul 10 16:25:35 2015 +0200 Fix flavoring of variables when checking RULES >--------------------------------------------------------------- 579e9f27b3eb474565dc19003651f588231e51eb compiler/typecheck/TcRules.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/compiler/typecheck/TcRules.hs b/compiler/typecheck/TcRules.hs index 680b5c1..2217cee 100644 --- a/compiler/typecheck/TcRules.hs +++ b/compiler/typecheck/TcRules.hs @@ -69,7 +69,7 @@ tcRule (HsRule name act hs_bndrs lhs fv_lhs rhs fv_rhs) -- the RULE. c.f. Trac #10072 ; let (id_bndrs, tv_bndrs) = partition isId vars - id_bndrs' = [(id_bndr, TcIdUnrestricted) | id_bndr <- id_bndrs] + id_bndrs' = [(id_bndr, choose_tc_id_flavor id_bndr) | id_bndr <- id_bndrs] ; (lhs', lhs_wanted, rhs', rhs_wanted, rule_ty) <- tcExtendTyVarEnv tv_bndrs $ tcExtendIdEnv id_bndrs' $ @@ -143,6 +143,11 @@ tcRule (HsRule name act hs_bndrs lhs fv_lhs rhs fv_rhs) (mkHsDictLet (TcEvBinds lhs_binds_var) lhs') fv_lhs (mkHsDictLet (TcEvBinds rhs_binds_var) rhs') fv_rhs) } +choose_tc_id_flavor :: Id -> TcIdFlavor +choose_tc_id_flavor v + | Just _ <- tcGetTyVar_maybe (idType v) = TcIdMonomorphic + | otherwise = TcIdUnrestricted + tcRuleBndrs :: [LRuleBndr Name] -> TcM [Var] tcRuleBndrs [] = return [] From git at git.haskell.org Fri Jul 10 15:04:41 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 10 Jul 2015 15:04:41 +0000 (UTC) Subject: [commit: ghc] master: Update .mailmap [skip ci] (888026d) Message-ID: <20150710150441.2B8A63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/888026dba01279dd6de5216856c81432836abaf1/ghc >--------------------------------------------------------------- commit 888026dba01279dd6de5216856c81432836abaf1 Author: Thomas Miedema Date: Fri Jul 10 17:05:08 2015 +0200 Update .mailmap [skip ci] >--------------------------------------------------------------- 888026dba01279dd6de5216856c81432836abaf1 .mailmap | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.mailmap b/.mailmap index ec555d5..fca1f62 100644 --- a/.mailmap +++ b/.mailmap @@ -162,6 +162,7 @@ Marc Weber marco-oweber at gmx.de Marcin 'Qrczak' Kowalczyk qrczak Marco T?lio Gontijo e Silva Marco T?lio Gontijo e Silva +Markus Gro?er Marios Titas Matt Chapman matthewc Matthias Kilian kili at outback.escape.de @@ -231,6 +232,7 @@ Sven Panne panne Sven Panne sven.panne at aedion.de S?bastien Carlier sebc Thorkil Naur naur at post11.tele.dk +Tibor Erdesz Tim Chevalier Tim Chevalier Tim Chevalier krc # Ticket #670. From git at git.haskell.org Fri Jul 10 15:30:38 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 10 Jul 2015 15:30:38 +0000 (UTC) Subject: [commit: ghc] master: Improve error message for fundeps (2d06a9f) Message-ID: <20150710153038.C58873A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/2d06a9f19d5b3ab8c3ff0b24f508c15bedae99d2/ghc >--------------------------------------------------------------- commit 2d06a9f19d5b3ab8c3ff0b24f508c15bedae99d2 Author: Simon Peyton Jones Date: Fri Jul 10 16:24:46 2015 +0100 Improve error message for fundeps Improve error message fundeps, especially when PolyKinds means that the un-determined variables are (invisible) kind variables. See Trac #10570. >--------------------------------------------------------------- 2d06a9f19d5b3ab8c3ff0b24f508c15bedae99d2 compiler/typecheck/FunDeps.hs | 21 ++++++++++++++------- testsuite/tests/polykinds/T10570.hs | 11 +++++++++++ testsuite/tests/polykinds/T10570.stderr | 9 +++++++++ testsuite/tests/polykinds/T9106.stderr | 3 ++- testsuite/tests/polykinds/all.T | 1 + testsuite/tests/typecheck/should_fail/T2247.stderr | 3 ++- .../tests/typecheck/should_fail/tcfail170.stderr | 3 ++- 7 files changed, 41 insertions(+), 10 deletions(-) diff --git a/compiler/typecheck/FunDeps.hs b/compiler/typecheck/FunDeps.hs index 3b44caa..9d4ef1c 100644 --- a/compiler/typecheck/FunDeps.hs +++ b/compiler/typecheck/FunDeps.hs @@ -377,19 +377,22 @@ checkInstCoverage be_liberal clas theta inst_taus where (tyvars, fds) = classTvsFds clas fundep_ok fd - | if be_liberal then liberal_ok else conservative_ok - = IsValid - | otherwise - = NotValid msg + | isEmptyVarSet undetermined_tvs = IsValid + | otherwise = NotValid msg where (ls,rs) = instFD fd tyvars inst_taus ls_tvs = tyVarsOfTypes ls rs_tvs = tyVarsOfTypes rs - conservative_ok = rs_tvs `subVarSet` closeOverKinds ls_tvs - liberal_ok = rs_tvs `subVarSet` oclose theta (closeOverKinds ls_tvs) + undetermined_tvs | be_liberal = liberal_undet_tvs + | otherwise = conserv_undet_tvs + + liberal_undet_tvs = rs_tvs `minusVarSet`oclose theta (closeOverKinds ls_tvs) + conserv_undet_tvs = rs_tvs `minusVarSet` closeOverKinds ls_tvs -- closeOverKinds: see Note [Closing over kinds in coverage] + undet_list = varSetElemsKvsFirst undetermined_tvs + msg = vcat [ -- text "ls_tvs" <+> ppr ls_tvs -- , text "closed ls_tvs" <+> ppr (closeOverKinds ls_tvs) -- , text "theta" <+> ppr theta @@ -408,7 +411,11 @@ checkInstCoverage be_liberal clas theta inst_taus else ptext (sLit "do not jointly")) <+> ptext (sLit "determine rhs type")<>plural rs <+> pprQuotedList rs ] - , ppWhen (not be_liberal && liberal_ok) $ + , ptext (sLit "Un-determined variable") <> plural undet_list <> colon + <+> pprWithCommas ppr undet_list + , ppWhen (all isKindVar undet_list) $ + ptext (sLit "(Use -fprint-explicit-kinds to see the kind variables in the types)") + , ppWhen (not be_liberal && isEmptyVarSet liberal_undet_tvs) $ ptext (sLit "Using UndecidableInstances might help") ] {- Note [Closing over kinds in coverage] diff --git a/testsuite/tests/polykinds/T10570.hs b/testsuite/tests/polykinds/T10570.hs new file mode 100644 index 0000000..259a32b --- /dev/null +++ b/testsuite/tests/polykinds/T10570.hs @@ -0,0 +1,11 @@ +{-# LANGUAGE FunctionalDependencies, PolyKinds, FlexibleInstances #-} + +module T10570 where + +import Data.Proxy + +class ConsByIdx2 x a m cls | x -> m where + consByIdx2 :: x -> a -> m cls + +instance ConsByIdx2 Int a Proxy cls where + consByIdx2 _ _ = Proxy diff --git a/testsuite/tests/polykinds/T10570.stderr b/testsuite/tests/polykinds/T10570.stderr new file mode 100644 index 0000000..f40ed10 --- /dev/null +++ b/testsuite/tests/polykinds/T10570.stderr @@ -0,0 +1,9 @@ + +T10570.hs:10:10: error: + Illegal instance declaration for ?ConsByIdx2 Int a Proxy cls? + The coverage condition fails in class ?ConsByIdx2? + for functional dependency: ?x -> m? + Reason: lhs type ?Int? does not determine rhs type ?Proxy? + Un-determined variable: k + (Use -fprint-explicit-kinds to see the kind variables in the types) + In the instance declaration for ?ConsByIdx2 Int a Proxy cls? diff --git a/testsuite/tests/polykinds/T9106.stderr b/testsuite/tests/polykinds/T9106.stderr index 0b239f2..bbb3633 100644 --- a/testsuite/tests/polykinds/T9106.stderr +++ b/testsuite/tests/polykinds/T9106.stderr @@ -1,8 +1,9 @@ -T9106.hs:13:10: +T9106.hs:13:10: error: Illegal instance declaration for ?FunctorN n f a (f fa)? The liberal coverage condition fails in class ?FunctorN? for functional dependency: ?n f a -> fa? Reason: lhs types ?n?, ?f?, ?a? do not jointly determine rhs type ?f fa? + Un-determined variable: fa In the instance declaration for ?FunctorN n f a (f fa)? diff --git a/testsuite/tests/polykinds/all.T b/testsuite/tests/polykinds/all.T index 95f0d83..8a8f8b5 100644 --- a/testsuite/tests/polykinds/all.T +++ b/testsuite/tests/polykinds/all.T @@ -118,3 +118,4 @@ test('T10041', normal, compile, ['']) test('T10451', normal, compile_fail, ['']) test('T10516', normal, compile_fail, ['']) test('T10503', normal, compile_fail, ['']) +test('T10570', normal, compile_fail, ['']) diff --git a/testsuite/tests/typecheck/should_fail/T2247.stderr b/testsuite/tests/typecheck/should_fail/T2247.stderr index edf4246..54a6c2a 100644 --- a/testsuite/tests/typecheck/should_fail/T2247.stderr +++ b/testsuite/tests/typecheck/should_fail/T2247.stderr @@ -1,7 +1,8 @@ -T2247.hs:6:10: +T2247.hs:6:10: error: Illegal instance declaration for ?FD a b? The liberal coverage condition fails in class ?FD? for functional dependency: ?a -> b? Reason: lhs type ?a? does not determine rhs type ?b? + Un-determined variable: b In the instance declaration for ?FD a b? diff --git a/testsuite/tests/typecheck/should_fail/tcfail170.stderr b/testsuite/tests/typecheck/should_fail/tcfail170.stderr index bb952ba..77e2ca3 100644 --- a/testsuite/tests/typecheck/should_fail/tcfail170.stderr +++ b/testsuite/tests/typecheck/should_fail/tcfail170.stderr @@ -1,7 +1,8 @@ -tcfail170.hs:7:10: +tcfail170.hs:7:10: error: Illegal instance declaration for ?C [p] [q]? The coverage condition fails in class ?C? for functional dependency: ?a -> b? Reason: lhs type ?[p]? does not determine rhs type ?[q]? + Un-determined variable: q In the instance declaration for ?C [p] [q]? From git at git.haskell.org Fri Jul 10 17:42:13 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 10 Jul 2015 17:42:13 +0000 (UTC) Subject: [commit: ghc] master: Delete the WayPar way (9b1ebba) Message-ID: <20150710174213.313ED3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/9b1ebba2af060fef90dcd722313d3f8041ec5a97/ghc >--------------------------------------------------------------- commit 9b1ebba2af060fef90dcd722313d3f8041ec5a97 Author: Thomas Miedema Date: Wed Jul 8 21:09:33 2015 +0200 Delete the WayPar way Also remove 't' and 's' from ALL_WAYS; they don't exist. Differential Revision: https://phabricator.haskell.org/D1055 >--------------------------------------------------------------- 9b1ebba2af060fef90dcd722313d3f8041ec5a97 compiler/codeGen/StgCmmClosure.hs | 7 --- compiler/main/DriverPipeline.hs | 97 +-------------------------------- compiler/main/DynFlags.hs | 14 ----- libraries/base/Data/IORef.hs | 9 +-- libraries/base/System/Mem/StableName.hs | 18 ------ libraries/base/tests/Memo1.lhs | 6 -- libraries/base/tests/Memo2.lhs | 6 -- mk/ways.mk | 6 +- rts/Schedule.c | 27 +-------- rts/Sparks.c | 2 +- 10 files changed, 6 insertions(+), 186 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 9b1ebba2af060fef90dcd722313d3f8041ec5a97 From git at git.haskell.org Fri Jul 10 17:54:59 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 10 Jul 2015 17:54:59 +0000 (UTC) Subject: [commit: ghc] master: Fix self-contained handling of ASCII encoding (d69dfba) Message-ID: <20150710175459.2501B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d69dfba4e27c4ec33459906fd87c9a56a371f510/ghc >--------------------------------------------------------------- commit d69dfba4e27c4ec33459906fd87c9a56a371f510 Author: Ben Gamari Date: Fri Jul 10 19:49:29 2015 +0200 Fix self-contained handling of ASCII encoding D898 was primarily intended to fix hangs in the event that iconv was unavailable (namely #10298 and #7695). In addition to this fix, it also introduced self-contained handling of ANSI terminals to allow compiled executables to run in minimal environments lacking iconv. However, the behavior that the patch introduced is highly suspicious. Specifically, it gives the user a UTF-8 encoding even if they requested ASCII. This has the potential to break quite a lot of code. At very least it breaks GHC's Unicode terminal detection logic, which attempts to catch an invalid character when encoding a pair of smart-quotes. Of course, this exception will never be thrown if a UTF-8 encoder is used. Here we use the `char8` encoding to handle requests for ASCII encodings in the event that we find iconv to be non-functional. Fixes #10623. Test Plan: Validate with T8959a Reviewers: rwbarton, hvr, austin, hsyl20 Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1059 GHC Trac Issues: #10623 >--------------------------------------------------------------- d69dfba4e27c4ec33459906fd87c9a56a371f510 libraries/base/GHC/IO/Encoding.hs | 33 +++++++++++++++++++++++---------- libraries/base/GHC/IO/Encoding/Iconv.hs | 27 ++++++++++++++++++++------- libraries/base/GHC/TopHandler.hs | 7 ++++++- testsuite/tests/driver/Makefile | 4 ++++ testsuite/tests/driver/T2507.stderr | 4 ++-- testsuite/tests/driver/T8959a.stderr | 4 ++-- 6 files changed, 57 insertions(+), 22 deletions(-) diff --git a/libraries/base/GHC/IO/Encoding.hs b/libraries/base/GHC/IO/Encoding.hs index 014b61b..76c7f55 100644 --- a/libraries/base/GHC/IO/Encoding.hs +++ b/libraries/base/GHC/IO/Encoding.hs @@ -235,14 +235,9 @@ mkTextEncoding e = case mb_coding_failure_mode of _ -> Nothing mkTextEncoding' :: CodingFailureMode -> String -> IO TextEncoding -mkTextEncoding' cfm enc - -- First, specifically match on ASCII encodings directly using - -- several possible aliases (specified by RFC 1345 & co), which - -- allows us to handle ASCII conversions without iconv at all (see - -- trac #10298). - | any (== enc) ansiEncNames = return (UTF8.mkUTF8 cfm) - -- Otherwise, handle other encoding needs via iconv. - | otherwise = case [toUpper c | c <- enc, c /= '-'] of +mkTextEncoding' cfm enc = + case [toUpper c | c <- enc, c /= '-'] of + -- UTF-8 and friends we can handle ourselves "UTF8" -> return $ UTF8.mkUTF8 cfm "UTF16" -> return $ UTF16.mkUTF16 cfm "UTF16LE" -> return $ UTF16.mkUTF16le cfm @@ -254,13 +249,31 @@ mkTextEncoding' cfm enc 'C':'P':n | [(cp,"")] <- reads n -> return $ CodePage.mkCodePageEncoding cfm cp _ -> unknownEncodingErr (enc ++ codingFailureModeSuffix cfm) #else - _ -> Iconv.mkIconvEncoding cfm enc -#endif + -- Otherwise, handle other encoding needs via iconv. + + -- Unfortunately there is no good way to determine whether iconv is actually + -- functional without telling it to do something. + _ -> do res <- Iconv.mkIconvEncoding cfm enc + let isAscii = any (== enc) ansiEncNames + case res of + Just e -> return e + -- At this point we know that we can't count on iconv to work + -- (see, for instance, Trac #10298). However, we still want to do + -- what we can to work with what we have. For instance, ASCII is + -- easy. We match on ASCII encodings directly using several + -- possible aliases (specified by RFC 1345 & Co) and for this use + -- the 'char8' encoding + Nothing + | isAscii -> return char8 + | otherwise -> + unknownEncodingErr (enc ++ codingFailureModeSuffix cfm) where ansiEncNames = -- ASCII aliases [ "ANSI_X3.4-1968", "iso-ir-6", "ANSI_X3.4-1986", "ISO_646.irv:1991" , "US-ASCII", "us", "IBM367", "cp367", "csASCII", "ASCII", "ISO646-US" ] +#endif + latin1_encode :: CharBuffer -> Buffer Word8 -> IO (CharBuffer, Buffer Word8) latin1_encode input output = fmap (\(_why,input',output') -> (input',output')) $ Latin1.latin1_encode input output -- unchecked, used for char8 diff --git a/libraries/base/GHC/IO/Encoding/Iconv.hs b/libraries/base/GHC/IO/Encoding/Iconv.hs index 89ca71e..061bd60 100644 --- a/libraries/base/GHC/IO/Encoding/Iconv.hs +++ b/libraries/base/GHC/IO/Encoding/Iconv.hs @@ -34,9 +34,10 @@ import GHC.Base () -- For build ordering #else import Foreign -import Foreign.C +import Foreign.C hiding (charIsRepresentable) import Data.Maybe import GHC.Base +import GHC.Foreign (charIsRepresentable) import GHC.IO.Buffer import GHC.IO.Encoding.Failure import GHC.IO.Encoding.Types @@ -96,15 +97,27 @@ char_shift :: Int char_shift | charSize == 2 = 1 | otherwise = 2 -iconvEncoding :: String -> IO TextEncoding +iconvEncoding :: String -> IO (Maybe TextEncoding) iconvEncoding = mkIconvEncoding ErrorOnCodingFailure -mkIconvEncoding :: CodingFailureMode -> String -> IO TextEncoding +-- | Construct an iconv-based 'TextEncoding' for the given character set and +-- 'CodingFailureMode'. +-- +-- As iconv is missing in some minimal environments (e.g. #10298), this +-- checks to ensure that iconv is working properly before returning the +-- encoding, returning 'Nothing' if not. +mkIconvEncoding :: CodingFailureMode -> String -> IO (Maybe TextEncoding) mkIconvEncoding cfm charset = do - return (TextEncoding { - textEncodingName = charset, - mkTextDecoder = newIConv raw_charset (haskellChar ++ suffix) (recoverDecode cfm) iconvDecode, - mkTextEncoder = newIConv haskellChar charset (recoverEncode cfm) iconvEncode}) + let enc = TextEncoding { + textEncodingName = charset, + mkTextDecoder = newIConv raw_charset (haskellChar ++ suffix) + (recoverDecode cfm) iconvDecode, + mkTextEncoder = newIConv haskellChar charset + (recoverEncode cfm) iconvEncode} + good <- charIsRepresentable enc 'a' + return $ if good + then Just enc + else Nothing where -- An annoying feature of GNU iconv is that the //PREFIXES only take -- effect when they appear on the tocode parameter to iconv_open: diff --git a/libraries/base/GHC/TopHandler.hs b/libraries/base/GHC/TopHandler.hs index e725196..05c905f 100644 --- a/libraries/base/GHC/TopHandler.hs +++ b/libraries/base/GHC/TopHandler.hs @@ -176,7 +176,12 @@ disasterHandler exit _ = withCAString "%s" $ \fmt -> withCAString msgStr $ \msg -> errorBelch fmt msg >> exit 1 - where msgStr = "encountered an exception while trying to report an exception" + where + msgStr = + "encountered an exception while trying to report an exception." ++ + "One possible reason for this is that we failed while trying to " ++ + "encode an error message. Check that your locale is configured " ++ + "properly." {- Note [Disaster with iconv] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/testsuite/tests/driver/Makefile b/testsuite/tests/driver/Makefile index d5ce683..dc1238c 100644 --- a/testsuite/tests/driver/Makefile +++ b/testsuite/tests/driver/Makefile @@ -550,6 +550,10 @@ T7130: T7563: -"$(TEST_HC)" $(TEST_HC_OPTS_NO_RECOMP) -C T7563.hs +# Below we set LC_ALL=C to request standard ASCII output in the resulting error +# messages. Unfortunately, Mac OS X still uses a Unicode encoding even with +# LC_ALL=C, so we expect these tests to fail there. + .PHONY: T6037 T6037: -LC_ALL=C "$(TEST_HC)" $(TEST_HC_OPTS_NO_RECOMP) -c T6037.hs diff --git a/testsuite/tests/driver/T2507.stderr b/testsuite/tests/driver/T2507.stderr index eb0878f..1a6e6f3 100644 --- a/testsuite/tests/driver/T2507.stderr +++ b/testsuite/tests/driver/T2507.stderr @@ -1,5 +1,5 @@ T2507.hs:5:7: error: - Couldn't match expected type ?Int? with actual type ?()? + Couldn't match expected type `Int' with actual type `()' In the expression: () - In an equation for ?foo?: foo = () + In an equation for `foo': foo = () diff --git a/testsuite/tests/driver/T8959a.stderr b/testsuite/tests/driver/T8959a.stderr index defb34b..476b9ee 100644 --- a/testsuite/tests/driver/T8959a.stderr +++ b/testsuite/tests/driver/T8959a.stderr @@ -1,5 +1,5 @@ T8959a.hs:5:7: error: - Couldn't match expected type ?Int -> Int? with actual type ?()? + Couldn't match expected type `Int -> Int' with actual type `()' In the expression: () - In an equation for ?foo?: foo = () + In an equation for `foo': foo = () From git at git.haskell.org Sat Jul 11 11:08:13 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 11 Jul 2015 11:08:13 +0000 (UTC) Subject: [commit: ghc] master: T1969: Update max_bytes_used (ee28a79) Message-ID: <20150711110813.5F1F73A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/ee28a794020ce9afbeea952bb1aee070e210eedf/ghc >--------------------------------------------------------------- commit ee28a794020ce9afbeea952bb1aee070e210eedf Author: Ben Gamari Date: Sat Jul 11 12:27:20 2015 +0200 T1969: Update max_bytes_used b5e1944e2b069a7df3444e57bae0b4ee15bde73c started using a single GC generation yet didn't update this. >--------------------------------------------------------------- ee28a794020ce9afbeea952bb1aee070e210eedf testsuite/tests/perf/compiler/all.T | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/testsuite/tests/perf/compiler/all.T b/testsuite/tests/perf/compiler/all.T index 03133f2..b30288c 100644 --- a/testsuite/tests/perf/compiler/all.T +++ b/testsuite/tests/perf/compiler/all.T @@ -59,7 +59,7 @@ test('T1969', # 2009-12-31 6149572 (x86/Linux) # 2014-01-22 6429864 (x86/Linux) # 2014-06-29 5949188 (x86/Linux) - (wordsize(64), 10000000, 15)]), + (wordsize(64), 11000000, 15)]), # 2014-09-10 10463640, 10 # post-AMP-update (somewhat stabelish) # looks like the peak is around ~10M, but we're # unlikely to GC exactly on the peak. @@ -68,6 +68,7 @@ test('T1969', # See Note [residency] to get an accurate view. # 2014-09-14 9684256, 10 # try to lower it a bit more to match Phab's CI # 2014-11-03 10584344, # ghcspeed reports higher numbers consistently + # 2015-07-11 11670120 (amd64/Linux) compiler_stats_num_field('bytes allocated', [(platform('i386-unknown-mingw32'), 301784492, 5), # 215582916 (x86/Windows) From git at git.haskell.org Sat Jul 11 11:08:16 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 11 Jul 2015 11:08:16 +0000 (UTC) Subject: [commit: ghc] master: T876 (32-bit): Update bytes allocated (a846088) Message-ID: <20150711110816.263B63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a846088cbfee1c357f0d5a1b92a4dba11607f83f/ghc >--------------------------------------------------------------- commit a846088cbfee1c357f0d5a1b92a4dba11607f83f Author: Ben Gamari Date: Sat Jul 11 12:42:14 2015 +0200 T876 (32-bit): Update bytes allocated This seems to have improved by a bit >--------------------------------------------------------------- a846088cbfee1c357f0d5a1b92a4dba11607f83f testsuite/tests/perf/should_run/all.T | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/testsuite/tests/perf/should_run/all.T b/testsuite/tests/perf/should_run/all.T index 2fc7a5c..0fa09f4 100644 --- a/testsuite/tests/perf/should_run/all.T +++ b/testsuite/tests/perf/should_run/all.T @@ -83,11 +83,12 @@ test('T876', # 2013-02-14: 1263712 (x86_64/Linux) # 2014-02-10: 63216 (x86_64/Linux), call arity analysis - (wordsize(32), 56796, 5) ]), + (wordsize(32), 53156, 5) ]), # some date: 663712 (Windows, 64-bit machine) # 2014-04-04: 56820 (Windows, 64-bit machine) # 2014-06-29: 53024 (x86_64/Linux) # 2014-12-01: 56796 (Windows) + # 2015-07-11: 53156 (x86_64/Linux) only_ways(['normal']), extra_run_opts('10000') From git at git.haskell.org Sat Jul 11 11:08:18 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 11 Jul 2015 11:08:18 +0000 (UTC) Subject: [commit: ghc] master: perf/compiler: Switch to -G1 and update performance metrics (de6597e) Message-ID: <20150711110818.E90F63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/de6597ede33e22b6cf6222a8f9244456d1d5a473/ghc >--------------------------------------------------------------- commit de6597ede33e22b6cf6222a8f9244456d1d5a473 Author: Ben Gamari Date: Sat Jul 11 10:53:40 2015 +0000 perf/compiler: Switch to -G1 and update performance metrics >--------------------------------------------------------------- de6597ede33e22b6cf6222a8f9244456d1d5a473 testsuite/tests/perf/compiler/all.T | 42 ++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/testsuite/tests/perf/compiler/all.T b/testsuite/tests/perf/compiler/all.T index b30288c..477bc4e 100644 --- a/testsuite/tests/perf/compiler/all.T +++ b/testsuite/tests/perf/compiler/all.T @@ -29,13 +29,14 @@ setTestOpts(no_lint) test('T1969', [compiler_stats_num_field('peak_megabytes_allocated', # Note [residency] - [(wordsize(32), 17, 15), + [(wordsize(32), 21, 15), # 2010-05-17 14 (x86/Windows) # 15 (x86/OS X) # 19 (x86/OS X) # 2013-02-10 13 (x86/Windows) # 2013-02-10 14 (x86/OSX) # 2013-11-13 17 (x86/Windows, 64bit machine) + # 2015-07-11 21 (x86/Linux, 64bit machine) use +RTS -G1 (wordsize(64), 41, 20)]), # 28 (amd64/Linux) # 34 (amd64/Linux) @@ -54,11 +55,12 @@ test('T1969', # 2013-02-10 5030080 (x86/Windows) # 2013-11-13 7295012 (x86/Windows, 64bit machine) # 2014-04-24 5719436 (x86/Windows, 64bit machine) - (wordsize(32), 5949188, 1), + (wordsize(32), 6241108, 1), # 6707308 (x86/OS X) # 2009-12-31 6149572 (x86/Linux) # 2014-01-22 6429864 (x86/Linux) # 2014-06-29 5949188 (x86/Linux) + # 2015-07-11 6241108 (x86/Linux, 64bit machine) use +RTS -G1 (wordsize(64), 11000000, 15)]), # 2014-09-10 10463640, 10 # post-AMP-update (somewhat stabelish) # looks like the peak is around ~10M, but we're @@ -76,13 +78,14 @@ test('T1969', # 2013-02-10 310633884 (x86/Windows) # 2013-11-13 317975916 (x86/Windows, 64bit machine) # 2014-04-04 301784492 (x86/Windows, 64bit machine) - (wordsize(32), 303300692, 1), + (wordsize(32), 288699104, 1), # 221667908 (x86/OS X) # 274932264 (x86/Linux) # 2012-10-08 303930948 (x86/Linux, new codegen) # 2013-02-10 322937684 (x86/OSX) # 2014-01-22 316103268 (x86/Linux) # 2014-06-29 303300692 (x86/Linux) + # 2015-07-11 288699104 (x86/Linux, 64-bit machine) use +RTS -G1 (wordsize(64), 581460896, 5)]), # 17/11/2009 434845560 (amd64/Linux) # 08/12/2009 459776680 (amd64/Linux) @@ -109,8 +112,7 @@ test('T1969', # that will catch a regression in -dcore-lint performance. # Use `+RTS -G1` for more stable residency measurements. Note [residency]. - # Only 64-bit as we don't have a good 32-bit test environment at the moment - when(wordsize(64), extra_hc_opts('+RTS -G1 -RTS')) + extra_hc_opts('+RTS -G1 -RTS') ], compile, ['']) @@ -130,7 +132,7 @@ else: test('T3294', [ compiler_stats_num_field('max_bytes_used', # Note [residency] - [(wordsize(32), 26525384, 15), + [(wordsize(32), 43196344, 15), # 17725476 (x86/OS X) # 14593500 (Windows) # 2013-02-10 20651576 (x86/Windows) @@ -138,6 +140,7 @@ test('T3294', # 2013-11-13 24009436 (x86/Windows, 64bit machine) # 2014-04-24 19882188 (x86/Windows, 64bit machine) # 2014-12-22 26525384 (x86/Windows) Increase due to silent superclasses? + # 2015-07-11 43196344 (x86/Linux, 64-bit machine) use +RTS -G1 (wordsize(64), 45000000, 20)]), # prev: 25753192 (amd64/Linux) @@ -176,8 +179,7 @@ test('T3294', conf_3294, # Use `+RTS -G1` for more stable residency measurements. Note [residency]. - # Only 64-bit as we don't have a good 32-bit test environment at the moment - when(wordsize(64), extra_hc_opts('+RTS -G1 -RTS')) + extra_hc_opts('+RTS -G1 -RTS') ], compile, ['']) @@ -248,19 +250,19 @@ test('T4801', extra_hc_opts('-static'), # Use `+RTS -G1` for more stable residency measurements. Note [residency]. - # Only 64-bit as we don't have a good 32-bit test environment at the moment - when(wordsize(64), extra_hc_opts('+RTS -G1 -RTS')) + extra_hc_opts('+RTS -G1 -RTS') ], compile, ['']) test('T3064', [compiler_stats_num_field('peak_megabytes_allocated',# Note [residency] - [(wordsize(32), 16, 20), + [(wordsize(32), 28, 20), # expected value: 14 (x86/Linux 28-06-2012): # 2013-11-13: 18 (x86/Windows, 64bit machine) # 2014-01-22: 23 (x86/Linux) # 2014-12-22: 23 (x86/Linux) death to silent superclasses + # 2015-07-11 28 (x86/Linux, 64-bit machine) use +RTS -G1 (wordsize(64), 54, 20)]), # (amd64/Linux): 18 # (amd64/Linux) 2012-02-07: 26 @@ -331,8 +333,7 @@ test('T3064', only_ways(['normal']), # Use `+RTS -G1` for more stable residency measurements. Note [residency]. - # Only 64-bit as we don't have a good 32-bit test environment at the moment - when(wordsize(64), extra_hc_opts('+RTS -G1 -RTS')) + extra_hc_opts('+RTS -G1 -RTS') ], compile, ['']) @@ -344,12 +345,13 @@ test('T4007', test('T5030', [compiler_stats_num_field('bytes allocated', - [(wordsize(32), 227205560, 10), + [(wordsize(32), 201882912, 10), # previous: 196457520 # 2012-10-08: 259547660 (x86/Linux, new codegen) # 2013-11-21: 198573456 (x86 Windows, 64 bit machine) # 2014-12-10: 227205560 constraint solver got worse again; more aggressive solving # of family-applications leads to less sharing, I think + # 2015-07-11: 201882912 reason unknown (wordsize(64), 403932600, 10)]), # Previously 530000000 (+/- 10%) @@ -585,7 +587,8 @@ test('T9675', # 2014-10-13 18582472 different machines giving different results.. # 2014-10-13 22220552 use the mean # 2015-06-21 28056344 switch to `+RTS -G1`, tighten bound to 15% - (wordsize(32), 11220552, 15) + (wordsize(32), 15341228, 15) + # 2015-07-11 15341228 (x86/Linux, 64-bit machine) use +RTS -G1 ]), compiler_stats_num_field('peak_megabytes_allocated', # Note [residency] [(wordsize(64), 105, 15), @@ -595,17 +598,18 @@ test('T9675', # 2014-10-13 53 use the mean # 2015-06-15 44 reduced for some reason # 2015-06-21 105 switch to `+RTS -G1` - (wordsize(32), 25, 15) + (wordsize(32), 56, 15) + # 2015-07-11 56 (x86/Linux, 64-bit machine) use +RTS -G1 ]), compiler_stats_num_field('bytes allocated', [(wordsize(64), 544489040, 10) # 2014-10-13 544489040 - ,(wordsize(32), 250000000, 10) + ,(wordsize(32), 279480696, 10) + # 2015-07-11 279480696 (x86/Linux, 64-bit machine) use +RTS -G1 ]), # Use `+RTS -G1` for more stable residency measurements. Note [residency]. - # Only 64-bit as we don't have a good 32-bit test environment at the moment - when(wordsize(64), extra_hc_opts('+RTS -G1 -RTS')) + extra_hc_opts('+RTS -G1 -RTS') ], compile, ['']) From git at git.haskell.org Sat Jul 11 11:08:21 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 11 Jul 2015 11:08:21 +0000 (UTC) Subject: [commit: ghc] master: T9872d: Update 32-bit allocations (b935497) Message-ID: <20150711110821.BD4E23A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/b935497756cb76964184ce5135a501116cde2c4c/ghc >--------------------------------------------------------------- commit b935497756cb76964184ce5135a501116cde2c4c Author: Ben Gamari Date: Sat Jul 11 13:07:34 2015 +0200 T9872d: Update 32-bit allocations >--------------------------------------------------------------- b935497756cb76964184ce5135a501116cde2c4c testsuite/tests/perf/compiler/all.T | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/testsuite/tests/perf/compiler/all.T b/testsuite/tests/perf/compiler/all.T index 477bc4e..4cb811d 100644 --- a/testsuite/tests/perf/compiler/all.T +++ b/testsuite/tests/perf/compiler/all.T @@ -659,7 +659,9 @@ test('T9872d', # 2014-12-18 739189056 Reduce type families even more eagerly # 2015-01-07 687562440 TrieMap leaf compression # 2015-03-17 726679784 tweak to solver; probably flattens more - (wordsize(32), 328810212, 5) + (wordsize(32), 350369584, 5) + # some date 328810212 + # 2015-07-11 350369584 ]), ], compile, From git at git.haskell.org Mon Jul 13 09:38:21 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 13 Jul 2015 09:38:21 +0000 (UTC) Subject: [commit: ghc] master: Do not optimise RULE lhs in substRule (d073c77) Message-ID: <20150713093821.1584C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d073c770209d3e7208059b3be8187a47c9181a3e/ghc >--------------------------------------------------------------- commit d073c770209d3e7208059b3be8187a47c9181a3e Author: Simon Peyton Jones Date: Mon Jul 13 10:29:18 2015 +0100 Do not optimise RULE lhs in substRule This was causing Trac #10627. See Note [Substitute lazily] in CoreSubst. The bug was introduced by commit 30c17e7096919c55218083c8fcb98e6287552058 Author: simonpj at microsoft.com Date: Thu Nov 25 17:23:56 2010 +0000 Substitution should just substitute, not optimise The fix is not to optimise the RHS as well as not-optimising the LHS! The simplifier does the right thing in Simplify.simplRule >--------------------------------------------------------------- d073c770209d3e7208059b3be8187a47c9181a3e compiler/coreSyn/CoreSubst.hs | 31 ++++++++++++++++------ testsuite/tests/simplCore/should_compile/T10627.hs | 17 ++++++++++++ testsuite/tests/simplCore/should_compile/all.T | 1 + 3 files changed, 41 insertions(+), 8 deletions(-) diff --git a/compiler/coreSyn/CoreSubst.hs b/compiler/coreSyn/CoreSubst.hs index a3665ed..4764b4d 100644 --- a/compiler/coreSyn/CoreSubst.hs +++ b/compiler/coreSyn/CoreSubst.hs @@ -695,15 +695,16 @@ substRule _ _ rule@(BuiltinRule {}) = rule substRule subst subst_ru_fn rule@(Rule { ru_bndrs = bndrs, ru_args = args , ru_fn = fn_name, ru_rhs = rhs , ru_local = is_local }) - = rule { ru_bndrs = bndrs', - ru_fn = if is_local + = rule { ru_bndrs = bndrs' + , ru_fn = if is_local then subst_ru_fn fn_name - else fn_name, - ru_args = map (substExpr (text "subst-rule" <+> ppr fn_name) subst') args, - ru_rhs = simpleOptExprWith subst' rhs } - -- Do simple optimisation on RHS, in case substitution lets - -- you improve it. The real simplifier never gets to look at it. + else fn_name + , ru_args = map (substExpr doc subst') args + , ru_rhs = substExpr (text "foo") subst' rhs } + -- Do NOT optimise the RHS (previously we did simplOptExpr here) + -- See Note [Substitute lazily] where + doc = ptext (sLit "subst-rule") <+> ppr fn_name (subst', bndrs') = substBndrs subst bndrs ------------------ @@ -733,8 +734,22 @@ substTickish subst (Breakpoint n ids) = Breakpoint n (map do_one ids) where do_one = getIdFromTrivialExpr . lookupIdSubst (text "subst_tickish") subst substTickish _subst other = other -{- Note [substTickish] +{- Note [Substitute lazily] +~~~~~~~~~~~~~~~~~~~~~~~~~~~ +The functions that substitute over IdInfo must be pretty lazy, becuause +they are knot-tied by substRecBndrs. +One case in point was Trac #10627 in which a rule for a function 'f' +referred to 'f' (at a differnet type) on the RHS. But instead of just +substituting in the rhs of the rule, we were calling simpleOptExpr, which +looked at the idInfo for 'f'; result <>. + +In any case we don't need to optimise the RHS of rules, or unfoldings, +because the simplifier will do that. + + +Note [substTickish] +~~~~~~~~~~~~~~~~~~~~~~ A Breakpoint contains a list of Ids. What happens if we ever want to substitute an expression for one of these Ids? diff --git a/testsuite/tests/simplCore/should_compile/T10627.hs b/testsuite/tests/simplCore/should_compile/T10627.hs new file mode 100644 index 0000000..6b4d73a --- /dev/null +++ b/testsuite/tests/simplCore/should_compile/T10627.hs @@ -0,0 +1,17 @@ +-- Made GHC 6.10.2 go into a loop in substRecBndrs +{-# OPTIONS_GHC -w #-} + +module T10627 where + +import Data.Word + +class C a where + splitFraction :: a -> (b,a) + +roundSimple :: (C a) => a -> b +roundSimple x = error "rik" + +{-# RULES + "rs" roundSimple = (fromIntegral :: Int -> Word) . roundSimple; + #-} + diff --git a/testsuite/tests/simplCore/should_compile/all.T b/testsuite/tests/simplCore/should_compile/all.T index 1ee56ec..ec2a18a 100644 --- a/testsuite/tests/simplCore/should_compile/all.T +++ b/testsuite/tests/simplCore/should_compile/all.T @@ -213,3 +213,4 @@ test('T5821', only_ways(['optasm']), compile, ['']) test('T10176', only_ways(['optasm']), compile, ['']) test('T10180', only_ways(['optasm']), compile, ['']) test('T10602', only_ways(['optasm']), compile, ['-O2']) +test('T10627', only_ways(['optasm']), compile, ['']) From git at git.haskell.org Mon Jul 13 10:22:24 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 13 Jul 2015 10:22:24 +0000 (UTC) Subject: [commit: ghc] master: Add Linting for Rules (e922847) Message-ID: <20150713102224.057CA3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e922847ec3729096f69d6551a5fdf0074870517a/ghc >--------------------------------------------------------------- commit e922847ec3729096f69d6551a5fdf0074870517a Author: Simon Peyton Jones Date: Mon Jul 13 10:40:44 2015 +0100 Add Linting for Rules >--------------------------------------------------------------- e922847ec3729096f69d6551a5fdf0074870517a compiler/coreSyn/CoreLint.hs | 64 +++++++++++++++++++++++++++++++++----------- 1 file changed, 48 insertions(+), 16 deletions(-) diff --git a/compiler/coreSyn/CoreLint.hs b/compiler/coreSyn/CoreLint.hs index f681ea5..dad3b6d 100644 --- a/compiler/coreSyn/CoreLint.hs +++ b/compiler/coreSyn/CoreLint.hs @@ -447,7 +447,7 @@ lintSingleBinding top_lvl_flag rec_flag (binder,rhs) -- Check the rhs do { ty <- lintCoreExpr rhs ; lintBinder binder -- Check match to RHS type - ; binder_ty <- applySubstTy binder_ty + ; binder_ty <- applySubstTy (idType binder) ; checkTys binder_ty ty (mkRhsMsg binder (ptext (sLit "RHS")) ty) -- Check the let/app invariant @@ -469,9 +469,6 @@ lintSingleBinding top_lvl_flag rec_flag (binder,rhs) ; checkL (not (isExternalName (Var.varName binder)) || isTopLevel top_lvl_flag) (mkNonTopExternalNameMsg binder) - -- Check whether binder's specialisations contain any out-of-scope variables - ; mapM_ (checkBndrIdInScope binder) bndr_vars - ; flags <- getLintFlags ; when (lf_check_inline_loop_breakers flags && isStrongLoopBreaker (idOccInfo binder) @@ -507,14 +504,12 @@ lintSingleBinding top_lvl_flag rec_flag (binder,rhs) ppr binder) _ -> return () + ; mapM_ (lintCoreRule binder_ty) (idCoreRules binder) ; lintIdUnfolding binder binder_ty (idUnfolding binder) } -- We should check the unfolding, if any, but this is tricky because -- the unfolding is a SimplifiableCoreExpr. Give up for now. where - binder_ty = idType binder - bndr_vars = varSetElems (idFreeVars binder) - -- If you edit this function, you may need to update the GHC formalism -- See Note [GHC Formalism] lintBinder var | isId var = lintIdBndr var $ \_ -> (return ()) @@ -526,7 +521,8 @@ lintIdUnfolding bndr bndr_ty (CoreUnfolding { uf_tmpl = rhs, uf_src = src }) = do { ty <- lintCoreExpr rhs ; checkTys bndr_ty ty (mkRhsMsg bndr (ptext (sLit "unfolding")) ty) } lintIdUnfolding _ _ _ - = return () -- We could check more + = return () -- Do not Lint unstable unfoldings, becuase that leads + -- to exponential behaviour; c.f. CoreFVs.idUnfoldingVars {- Note [Checking for INLINE loop breakers] @@ -690,7 +686,7 @@ lintCoreExpr e@(Case scrut var alt_ty alts) = -- This case can't happen; linting types in expressions gets routed through -- lintCoreArgs lintCoreExpr (Type ty) - = pprPanic "lintCoreExpr" (ppr ty) + = failWithL (ptext (sLit "Type found as expression") <+> ppr ty) lintCoreExpr (Coercion co) = do { (_kind, ty1, ty2, role) <- lintInCo co @@ -1115,6 +1111,49 @@ lint_app doc kfn kas go_app _ _ = failWithL fail_msg +{- ********************************************************************* +* * + Linting rules +* * +********************************************************************* -} + +lintCoreRule :: OutType -> CoreRule -> LintM () +lintCoreRule _ (BuiltinRule {}) + = return () -- Don't bother + +lintCoreRule fun_ty (Rule { ru_name = name, ru_bndrs = bndrs + , ru_args = args, ru_rhs = rhs }) + = lintBinders bndrs $ \ _ -> + do { lhs_ty <- foldM lintCoreArg fun_ty args + ; rhs_ty <- lintCoreExpr rhs + ; checkTys lhs_ty rhs_ty $ + (rule_doc <+> vcat [ ptext (sLit "lhs type:") <+> ppr lhs_ty + , ptext (sLit "rhs type:") <+> ppr rhs_ty ]) + ; let bad_bndrs = filterOut (`elemVarSet` exprsFreeVars args) bndrs + ; checkL (null bad_bndrs) + (rule_doc <+> ptext (sLit "unbound") <+> ppr bad_bndrs) + -- See Note [Linting rules] + } + where + rule_doc = ptext (sLit "Rule") <+> doubleQuotes (ftext name) <> colon + +{- Note [Linting rules] +~~~~~~~~~~~~~~~~~~~~~~~ +It's very bad if simplifying a rule means that one of the template +variables (ru_bndrs) becomes not-mentioned in the template argumments +(ru_args). How can that happen? Well, in Trac #10602, SpecConstr +stupidly constructed a rule like + + forall x,c1,c2. + f (x |> c1 |> c2) = .... + +But simplExpr collapses those coercions into one. (Indeed in +#10602, it collapsed to the identity and was removed altogether.) + +We don't have a great story for what to do here, but at least +this check will nail it. +-} + {- ************************************************************************ * * @@ -1572,13 +1611,6 @@ lookupIdInScope id oneTupleDataConId :: Id -- Should not happen oneTupleDataConId = dataConWorkId (tupleDataCon Boxed 1) -checkBndrIdInScope :: Var -> Var -> LintM () -checkBndrIdInScope binder id - = checkInScope msg id - where - msg = ptext (sLit "is out of scope inside info for") <+> - ppr binder - checkTyCoVarInScope :: Var -> LintM () checkTyCoVarInScope v = checkInScope (ptext (sLit "is out of scope")) v From git at git.haskell.org Mon Jul 13 11:57:01 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 13 Jul 2015 11:57:01 +0000 (UTC) Subject: [commit: ghc] wip/impredicativity: Add instantiation to type family checking (7f96d98) Message-ID: <20150713115701.6F4AD3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/impredicativity Link : http://ghc.haskell.org/trac/ghc/changeset/7f96d98c7fb0abdd8e0cc91ce0dbfeca1bfab891/ghc >--------------------------------------------------------------- commit 7f96d98c7fb0abdd8e0cc91ce0dbfeca1bfab891 Author: Alejandro Serrano Date: Mon Jul 13 13:57:47 2015 +0200 Add instantiation to type family checking >--------------------------------------------------------------- 7f96d98c7fb0abdd8e0cc91ce0dbfeca1bfab891 compiler/typecheck/TcFlatten.hs | 6 +-- compiler/typecheck/TcInteract.hs | 95 +++++++++++++++++++++------------------- compiler/typecheck/TcSMonad.hs | 14 +++--- 3 files changed, 62 insertions(+), 53 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 7f96d98c7fb0abdd8e0cc91ce0dbfeca1bfab891 From git at git.haskell.org Mon Jul 13 12:01:01 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 13 Jul 2015 12:01:01 +0000 (UTC) Subject: [commit: ghc] master: Make sure rule LHSs are simplified (7da7b0e) Message-ID: <20150713120101.F21A83A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/7da7b0e48598af7df25e1129772b42cb31649c74/ghc >--------------------------------------------------------------- commit 7da7b0e48598af7df25e1129772b42cb31649c74 Author: Simon Peyton Jones Date: Mon Jul 13 12:58:34 2015 +0100 Make sure rule LHSs are simplified SpecConstr was generating a rule LHS with nested casts, which the simplifier then optimised away. Result: unbound template variables. Easily fixed. See Note [SpecConstr call patterns] >--------------------------------------------------------------- 7da7b0e48598af7df25e1129772b42cb31649c74 compiler/specialise/SpecConstr.hs | 25 ++++++++++-- testsuite/tests/simplCore/should_compile/T10602.hs | 46 +++++++++------------- .../tests/simplCore/should_compile/T10602b.hs | 20 ++++++++++ testsuite/tests/simplCore/should_compile/all.T | 2 +- 4 files changed, 61 insertions(+), 32 deletions(-) diff --git a/compiler/specialise/SpecConstr.hs b/compiler/specialise/SpecConstr.hs index a8c6f06..d7172a9 100644 --- a/compiler/specialise/SpecConstr.hs +++ b/compiler/specialise/SpecConstr.hs @@ -1178,7 +1178,9 @@ scExpr' _ e@(Lit {}) = return (nullUsage, e) scExpr' env (Tick t e) = do (usg, e') <- scExpr env e return (usg, Tick t e') scExpr' env (Cast e co) = do (usg, e') <- scExpr env e - return (usg, Cast e' (scSubstCo env co)) + return (usg, mkCast e' (scSubstCo env co)) + -- Important to use mkCast here + -- See Note [SpecConstr call patterns] scExpr' env e@(App _ _) = scApp env (collectArgs e) scExpr' env (Lam b e) = do let (env', b') = extendBndr env b (usg, e') <- scExpr env' e @@ -1764,9 +1766,27 @@ BUT phantom type synonyms can mess this reasoning up, eg x::T b with type T b = Int So we apply expandTypeSynonyms to the bound Ids. See Trac # 5458. Yuk. + +Note [SpecConstr call patterns] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +A "call patterns" that we collect is going to become the LHS of a RULE. +It's important that it doesn't have + e |> Refl +or + e |> g1 |> g2 +because both of these will be optimised by Simplify.simplRule. In the +former case such optimisation benign, because the rule will match more +terms; but in the latter we may lose a binding of 'g1' or 'g2', and +end up with a rule LHS that doesn't bind the template variables (Trac +#10602). + +The simplifier eliminates such things, but SpecConstr itself constructs +new terms by substituting. So the 'mkCast' in the Cast case of scExpr +is very important! -} type CallPat = ([Var], [CoreExpr]) -- Quantified variables and arguments + -- See Note [SpecConstr call patterns] callsToPats :: ScEnv -> [OneSpec] -> [ArgOcc] -> [Call] -> UniqSM (Bool, [CallPat]) -- Result has no duplicate patterns, @@ -1886,9 +1906,6 @@ argToPat env in_scope val_env (Case scrut _ _ [(_, _, rhs)]) arg_occ -} argToPat env in_scope val_env (Cast arg co) arg_occ - | isReflCo co -- Substitution in the SpecConstr itself - -- can lead to identity coercions - = argToPat env in_scope val_env arg arg_occ | not (ignoreType env ty2) = do { (interesting, arg') <- argToPat env in_scope val_env arg arg_occ ; if not interesting then diff --git a/testsuite/tests/simplCore/should_compile/T10602.hs b/testsuite/tests/simplCore/should_compile/T10602.hs index fc2523d..c29d743 100644 --- a/testsuite/tests/simplCore/should_compile/T10602.hs +++ b/testsuite/tests/simplCore/should_compile/T10602.hs @@ -1,34 +1,26 @@ -import Control.Monad -import Data.Binary -import Data.List +{-# OPTIONS_GHC -O2 #-} +{-# OPTIONS_GHC -fno-warn-missing-methods #-} +{-# LANGUAGE NoImplicitPrelude #-} +-- {-# OPTIONS_GHC -fno-spec-constr #-} -- Makes the problem go away. +-- {-# OPTIONS_GHC -fspec-constr-count=1 #-} -- Makes the problem go away. -newtype A a = A [a] +module T10602 where -instance Binary a => Binary (A a) where - put (A xs) = case splitAt 254 xs of - (_, []) -> mapM_ put xs - (a, b) -> put (A b) +-- Copy-pasting T10602b.hs into the current module makes the problem go away. +import T10602b - get = do xs <- replicateM 254 get - A ys <- get - return $ A $ xs ++ ys +data PairS a = PairS a a -main :: IO () -main = undefined +-- Removing the '~' makes the problem go away. +(PairS _ _) >> ~(PairS b g) = PairS b g -{- -This intermittently failed with although I was never able to reliably reproduce, +class Binary t where + put :: t -> PairS () -$ ./inplace/bin/ghc-stage2 -O2 Test.hs -fforce-recomp -[1 of 1] Compiling Main ( Test.hs, Test.o ) -ghc-stage2: panic! (the 'impossible' happened) - (GHC version 7.10.1.20150708 for x86_64-unknown-linux): - Template variable unbound in rewrite rule - sg_s5zh - [sc_s5zf, sc_s5zg, sg_s5zh, sg_s5zi] - [sc_s5zf, sc_s5zg, sg_s5zh, sg_s5zi] - [: @ a_a3fv sc_s5zf sc_s5zg] - [: @ a_a3fv sc_s5zb sc_s5zc] +-- Not using a newtype makes the problem go away. +newtype A a = A [a] -Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug --} +instance Binary a => Binary (A a) where + put (A xs) = case splitAt 254 xs of + (_, []) -> foldr (>>) (PairS () ()) (map put xs) + (_, b) -> put (A b) diff --git a/testsuite/tests/simplCore/should_compile/T10602b.hs b/testsuite/tests/simplCore/should_compile/T10602b.hs new file mode 100644 index 0000000..f90ad0a --- /dev/null +++ b/testsuite/tests/simplCore/should_compile/T10602b.hs @@ -0,0 +1,20 @@ +{-# OPTIONS_GHC -O2 #-} +{-# LANGUAGE NoImplicitPrelude #-} +module T10602b (splitAt, map, foldr) where + +import GHC.Classes +import GHC.Types +import GHC.Num +import GHC.Base + +splitAt :: Int -> [a] -> ([a],[a]) +splitAt n ls + | n <= 0 = ([], ls) + | otherwise = splitAt' n ls + where + splitAt' :: Int -> [a] -> ([a], [a]) + splitAt' _ [] = ([], []) + splitAt' 1 (x:xs) = ([x], xs) + splitAt' m (x:xs) = (x:xs', xs'') + where + (xs', xs'') = splitAt' (m - 1) xs diff --git a/testsuite/tests/simplCore/should_compile/all.T b/testsuite/tests/simplCore/should_compile/all.T index ec2a18a..e08eb84 100644 --- a/testsuite/tests/simplCore/should_compile/all.T +++ b/testsuite/tests/simplCore/should_compile/all.T @@ -212,5 +212,5 @@ test('T9565', only_ways(['optasm']), compile, ['']) test('T5821', only_ways(['optasm']), compile, ['']) test('T10176', only_ways(['optasm']), compile, ['']) test('T10180', only_ways(['optasm']), compile, ['']) -test('T10602', only_ways(['optasm']), compile, ['-O2']) +test('T10602', only_ways(['optasm']), multimod_compile, ['T10602','-v0']) test('T10627', only_ways(['optasm']), compile, ['']) From git at git.haskell.org Mon Jul 13 12:21:20 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 13 Jul 2015 12:21:20 +0000 (UTC) Subject: [commit: ghc] master: Reformat a leading # in a comment (875723b) Message-ID: <20150713122120.5DC713A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/875723b336ef3f79a6196a509c65c3d3b7034fa6/ghc >--------------------------------------------------------------- commit 875723b336ef3f79a6196a509c65c3d3b7034fa6 Author: Simon Peyton Jones Date: Mon Jul 13 13:08:44 2015 +0100 Reformat a leading # in a comment The leading hash in a comment confused CPP, though it worked fine on my machine. Apologies. >--------------------------------------------------------------- 875723b336ef3f79a6196a509c65c3d3b7034fa6 compiler/coreSyn/CoreLint.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/coreSyn/CoreLint.hs b/compiler/coreSyn/CoreLint.hs index dad3b6d..41b6a94 100644 --- a/compiler/coreSyn/CoreLint.hs +++ b/compiler/coreSyn/CoreLint.hs @@ -1148,7 +1148,7 @@ stupidly constructed a rule like f (x |> c1 |> c2) = .... But simplExpr collapses those coercions into one. (Indeed in -#10602, it collapsed to the identity and was removed altogether.) +Trac #10602, it collapsed to the identity and was removed altogether.) We don't have a great story for what to do here, but at least this check will nail it. From git at git.haskell.org Mon Jul 13 12:21:23 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 13 Jul 2015 12:21:23 +0000 (UTC) Subject: [commit: ghc] master: Test Trac #10463 (d7335f7) Message-ID: <20150713122123.E1F9E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d7335f74744a78bb468326b13fdd8b0c471eb71f/ghc >--------------------------------------------------------------- commit d7335f74744a78bb468326b13fdd8b0c471eb71f Author: Simon Peyton Jones Date: Mon Jul 13 13:20:56 2015 +0100 Test Trac #10463 was fixed along with Trac #10224 >--------------------------------------------------------------- d7335f74744a78bb468326b13fdd8b0c471eb71f testsuite/tests/partial-sigs/should_compile/T10463.hs | 5 +++++ testsuite/tests/partial-sigs/should_compile/T10463.stderr | 8 ++++++++ testsuite/tests/partial-sigs/should_compile/all.T | 1 + 3 files changed, 14 insertions(+) diff --git a/testsuite/tests/partial-sigs/should_compile/T10463.hs b/testsuite/tests/partial-sigs/should_compile/T10463.hs new file mode 100644 index 0000000..7279ecd --- /dev/null +++ b/testsuite/tests/partial-sigs/should_compile/T10463.hs @@ -0,0 +1,5 @@ +{-# LANGUAGE ScopedTypeVariables, PartialTypeSignatures #-} + +module T10463 where + +f (x :: _) = x ++ "" diff --git a/testsuite/tests/partial-sigs/should_compile/T10463.stderr b/testsuite/tests/partial-sigs/should_compile/T10463.stderr new file mode 100644 index 0000000..01fc4b3 --- /dev/null +++ b/testsuite/tests/partial-sigs/should_compile/T10463.stderr @@ -0,0 +1,8 @@ + +T10463.hs:5:9: warning: + Found type wildcard ?_? standing for ?[Char]? + Relevant bindings include + f :: [Char] -> [Char] (bound at T10463.hs:5:1) + In a pattern type signature: _ + In the pattern: x :: _ + In an equation for ?f?: f (x :: _) = x ++ "" diff --git a/testsuite/tests/partial-sigs/should_compile/all.T b/testsuite/tests/partial-sigs/should_compile/all.T index e649472..c86e14e 100644 --- a/testsuite/tests/partial-sigs/should_compile/all.T +++ b/testsuite/tests/partial-sigs/should_compile/all.T @@ -49,3 +49,4 @@ test('WarningWildcardInstantiations', normal, compile, ['-ddump-types']) test('T10403', normal, compile, ['']) test('T10438', normal, compile, ['']) test('T10519', normal, compile, ['']) +test('T10463', normal, compile, ['']) From git at git.haskell.org Mon Jul 13 12:28:13 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 13 Jul 2015 12:28:13 +0000 (UTC) Subject: [commit: ghc] master: Test Trac #10634 (02a6b29) Message-ID: <20150713122813.E6B873A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/02a6b29cc85b2820016fb66ae426dee7ecd36895/ghc >--------------------------------------------------------------- commit 02a6b29cc85b2820016fb66ae426dee7ecd36895 Author: Simon Peyton Jones Date: Mon Jul 13 13:28:27 2015 +0100 Test Trac #10634 >--------------------------------------------------------------- 02a6b29cc85b2820016fb66ae426dee7ecd36895 .../tests/indexed-types/should_compile/T10634.hs | 23 ++++++++++++++++++++++ testsuite/tests/indexed-types/should_compile/all.T | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/testsuite/tests/indexed-types/should_compile/T10634.hs b/testsuite/tests/indexed-types/should_compile/T10634.hs new file mode 100644 index 0000000..f02cf81 --- /dev/null +++ b/testsuite/tests/indexed-types/should_compile/T10634.hs @@ -0,0 +1,23 @@ +{-# LANGUAGE TypeFamilies #-} +module T10634 where + +import Data.Int (Int8, Int16, Int32) + +type family Up a +type instance Up Int8 = Int16 +type instance Up Int16 = Int32 + +class (Up (Down a) ~ a) => Convert a where + type Down a + down :: a -> Down a + +instance Convert Int16 where + type Down Int16 = Int8 + down = fromIntegral + +instance Convert Int32 where + type Down Int32 = Int16 + down = fromIntegral + +x :: Int8 +x = down 8 diff --git a/testsuite/tests/indexed-types/should_compile/all.T b/testsuite/tests/indexed-types/should_compile/all.T index 67be121..3bc73a3 100644 --- a/testsuite/tests/indexed-types/should_compile/all.T +++ b/testsuite/tests/indexed-types/should_compile/all.T @@ -260,4 +260,4 @@ test('T10139', normal, compile, ['']) test('T10340', normal, compile, ['']) test('T10226', normal, compile, ['']) test('T10507', normal, compile, ['']) - +test('T10634', normal, compile, ['']) From git at git.haskell.org Mon Jul 13 12:30:09 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 13 Jul 2015 12:30:09 +0000 (UTC) Subject: [commit: ghc] master: Another comment with a leading # (sigh) (946c8b1) Message-ID: <20150713123009.C93DA3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/946c8b10f0a9f085800e922c89e3b0b40e3be9b4/ghc >--------------------------------------------------------------- commit 946c8b10f0a9f085800e922c89e3b0b40e3be9b4 Author: Simon Peyton Jones Date: Mon Jul 13 13:30:47 2015 +0100 Another comment with a leading # (sigh) >--------------------------------------------------------------- 946c8b10f0a9f085800e922c89e3b0b40e3be9b4 compiler/specialise/SpecConstr.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/specialise/SpecConstr.hs b/compiler/specialise/SpecConstr.hs index d7172a9..5435920 100644 --- a/compiler/specialise/SpecConstr.hs +++ b/compiler/specialise/SpecConstr.hs @@ -1777,8 +1777,8 @@ or because both of these will be optimised by Simplify.simplRule. In the former case such optimisation benign, because the rule will match more terms; but in the latter we may lose a binding of 'g1' or 'g2', and -end up with a rule LHS that doesn't bind the template variables (Trac -#10602). +end up with a rule LHS that doesn't bind the template variables +(Trac #10602). The simplifier eliminates such things, but SpecConstr itself constructs new terms by substituting. So the 'mkCast' in the Cast case of scExpr From git at git.haskell.org Mon Jul 13 19:09:00 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 13 Jul 2015 19:09:00 +0000 (UTC) Subject: [commit: ghc] master: Build system: comments only [skip ci] (2e52057) Message-ID: <20150713190900.A1A3D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/2e52057adaab6d29c55a87fa9e52cdae4b9e3182/ghc >--------------------------------------------------------------- commit 2e52057adaab6d29c55a87fa9e52cdae4b9e3182 Author: Thomas Miedema Date: Thu Jul 9 19:27:17 2015 +0200 Build system: comments only [skip ci] >--------------------------------------------------------------- 2e52057adaab6d29c55a87fa9e52cdae4b9e3182 ghc.mk | 15 +++++++++++++-- rules/build-package-data.mk | 4 ++-- rules/haddock.mk | 2 +- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/ghc.mk b/ghc.mk index 6c1d88d..7e9c2e5 100644 --- a/ghc.mk +++ b/ghc.mk @@ -48,6 +48,8 @@ # o Build utils/ghc-cabal # o Build utils/ghc-pkg # o Build utils/hsc2hs +# o Build utils/genprimopcode +# o Build utils/deriveConstants # * For each package: # o configure, generate package-data.mk and inplace-pkg-config # o register each package into inplace/lib/package.conf @@ -369,7 +371,7 @@ PACKAGES_STAGE1 += $1 endef $(eval $(call foreachLibrary,addLibraryForCleaning)) -else +else # CLEANING # Packages that are built by stage0. These packages are dependencies of # programs such as GHC and ghc-pkg, that we do not assume the stage0 @@ -475,7 +477,7 @@ else INSTALL_PACKAGES := $(SUPERSIZE_INSTALL_PACKAGES) endif -endif +endif # CLEANING # ------------------------------------------- # Dependencies between package-data.mk files @@ -622,6 +624,10 @@ BUILD_DIRS += bindisttest BUILD_DIRS += utils/genapply endif +# When cleaning, don't add any library packages to BUILD_DIRS. We include +# ghc.mk files for all BUILD_DIRS, but they don't exist until after running +# `./boot`. Running `make clean` before anything else, as well as running +# `make maintainer-clean` twice, should work. ifneq "$(CLEANING)" "YES" # These are deliberately in reverse order, so as to ensure that # there is no need to have them in dependency order. That's important @@ -632,6 +638,10 @@ BUILD_DIRS += $(patsubst %, libraries/%, $(PACKAGES_STAGE2)) BUILD_DIRS += $(patsubst %, libraries/%, $(PACKAGES_STAGE1)) BUILD_DIRS += $(patsubst %, libraries/%, $(filter-out $(PACKAGES_STAGE1),$(PACKAGES_STAGE0))) ifeq "$(BUILD_DPH)" "YES" +# Note: `$(eval $(call foreachLibrary,addExtraPackage))` above adds the +# packages listed in `libraries/dph/ghc-packages` (e.g. dph-base) to +# PACKAGES_STAGE2. But not 'libraries/dph' itself (it doesn't have a cabal +# file). Since it does have a ghc.mk file, we add it to BUILD_DIRS here. BUILD_DIRS += $(wildcard libraries/dph) endif endif @@ -1350,6 +1360,7 @@ maintainer-clean : distclean .PHONY: all_libraries .PHONY: bootstrapping-files +# See https://ghc.haskell.org/trac/ghc/wiki/Building/Porting bootstrapping-files: $(includes_H_CONFIG) bootstrapping-files: $(includes_DERIVEDCONSTANTS) bootstrapping-files: $(includes_GHCCONSTANTS) diff --git a/rules/build-package-data.mk b/rules/build-package-data.mk index edf3216..938b6bf 100644 --- a/rules/build-package-data.mk +++ b/rules/build-package-data.mk @@ -139,8 +139,8 @@ ifneq "$$($1_$2_REGISTER_PACKAGE)" "NO" $$(call cmd,$1_$2_GHC_PKG) update --force $$($1_$2_GHC_PKG_OPTS) $1/$2/inplace-pkg-config endif endif -endif -endif +endif # NO_GENERATED_MAKEFILE_RULES +endif # BINDIST PACKAGE_DATA_MKS += $1/$2/package-data.mk diff --git a/rules/haddock.mk b/rules/haddock.mk index 5604a50..988e254 100644 --- a/rules/haddock.mk +++ b/rules/haddock.mk @@ -75,7 +75,7 @@ endif $$($$($1_PACKAGE)-$$($1_$2_VERSION)_HADDOCK_FILE) : $$($1_$2_$$(HADDOCK_WAY)_LIB) endif -endif +endif # $1_$2_DO_HADDOCK $(call profEnd, haddock($1,$2)) endef From git at git.haskell.org Mon Jul 13 19:09:03 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 13 Jul 2015 19:09:03 +0000 (UTC) Subject: [commit: ghc] master: Build system: add `make show!` command (#7810) (ec197d3) Message-ID: <20150713190903.70A743A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/ec197d390e18a6cfaa420009f5c5f143237f5a9f/ghc >--------------------------------------------------------------- commit ec197d390e18a6cfaa420009f5c5f143237f5a9f Author: Thomas Miedema Date: Fri Jul 10 18:38:02 2015 +0200 Build system: add `make show!` command (#7810) A normal `make show` starts a build of the ghc-stage1 compiler, to create package-data.mk files. This version doesn't read those, so it will work right after ./configure. Differential Revision: https://phabricator.haskell.org/D1064 >--------------------------------------------------------------- ec197d390e18a6cfaa420009f5c5f143237f5a9f MAKEHELP.md | 5 +++++ Makefile | 5 +++++ mk/sub-makefile.mk | 4 ++-- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/MAKEHELP.md b/MAKEHELP.md index ff0e434..3b58292 100644 --- a/MAKEHELP.md +++ b/MAKEHELP.md @@ -36,6 +36,11 @@ Common commands: Displays the value of make variable + - `make show! VALUE=` + + Same as `make show`, but works right after ./configure (it skips reading + package-data.mk files). + - make clean - make distclean - make maintainer-clean diff --git a/Makefile b/Makefile index c08ccc5..b1b1742 100644 --- a/Makefile +++ b/Makefile @@ -78,6 +78,7 @@ REALGOALS=$(filter-out \ distclean \ maintainer-clean \ show \ + show! \ echo \ help \ test \ @@ -142,6 +143,10 @@ $(filter clean_%, $(MAKECMDGOALS)) : clean_% : bootstrapping-files show echo: $(MAKE) --no-print-directory -f ghc.mk $@ +.PHONY: show! +show!: + $(MAKE) --no-print-directory -f ghc.mk show NO_INCLUDE_PKGDATA=YES + ifeq "$(darwin_TARGET_OS)" "1" .PHONY: framework-pkg framework-pkg: diff --git a/mk/sub-makefile.mk b/mk/sub-makefile.mk index 12f47f0..73d98c9 100644 --- a/mk/sub-makefile.mk +++ b/mk/sub-makefile.mk @@ -42,7 +42,7 @@ endif .NOTPARALLEL: STD_TARGETS = all clean distclean maintainer_clean install html ps pdf -DIRECTORY_INDEPENDENT_TARGETS = show +DIRECTORY_INDEPENDENT_TARGETS = show show! # The + tells make that we're recursively invoking make, otherwise 'make -j2' # goes wrong. @@ -52,7 +52,7 @@ $(STD_TARGETS): $(DIRECTORY_INDEPENDENT_TARGETS): +$(TOPMAKE) $@ $(EXTRA_MAKE_OPTS) -OTHERTARGETS=$(filter-out fast help show $(STD_TARGETS) $(SPEC_TARGETS),$(MAKECMDGOALS)) +OTHERTARGETS=$(filter-out fast help $(DIRECTORY_INDEPENDENT_TARGETS) $(STD_TARGETS) $(SPEC_TARGETS),$(MAKECMDGOALS)) .PHONY: $(OTHERTARGETS) $(OTHERTARGETS): +$(TOPMAKE) $(dir)/$@ $(EXTRA_MAKE_OPTS) From git at git.haskell.org Tue Jul 14 07:43:00 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 14 Jul 2015 07:43:00 +0000 (UTC) Subject: [commit: ghc] wip/impredicativity: Fix bug in SectionL handling (b55fbe0) Message-ID: <20150714074300.2C0B63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/impredicativity Link : http://ghc.haskell.org/trac/ghc/changeset/b55fbe02a6a887481a8707e86aed3cab92550c3d/ghc >--------------------------------------------------------------- commit b55fbe02a6a887481a8707e86aed3cab92550c3d Author: Alejandro Serrano Date: Tue Jul 14 09:43:49 2015 +0200 Fix bug in SectionL handling >--------------------------------------------------------------- b55fbe02a6a887481a8707e86aed3cab92550c3d compiler/typecheck/TcExpr.hs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/compiler/typecheck/TcExpr.hs b/compiler/typecheck/TcExpr.hs index 5ddfed9..a52a81e 100644 --- a/compiler/typecheck/TcExpr.hs +++ b/compiler/typecheck/TcExpr.hs @@ -288,11 +288,12 @@ tcExpr app@(OpApp _ _ _ _) res_ty = tcApp app res_ty tcExpr (SectionL arg1 op) res_ty = do { dflags <- getDynFlags -- Note [Left sections] - ; let n_reqd_args | xopt Opt_PostfixOperators dflags = 1 - | otherwise = 2 - ; (co_fun, args_tys@(arg1_ty : _), rest_ty) <- + ; let n_reqd_args | xopt Opt_PostfixOperators dflags = 0 + | otherwise = 1 + ; (co_fun, args_tys, rest_ty) <- matchExpectedFunTys (mk_app_msg op) n_reqd_args res_ty - ; let op_ty = mkFunTys args_tys rest_ty + ; arg1_ty <- newFlexiTyVarTy openTypeKind + ; let op_ty = mkFunTys (arg1_ty:args_tys) rest_ty -- typecheck op and arg1 ; op' <- tcPolyMonoExprNC op op_ty ; arg1' <- tcArg op' (arg1, arg1_ty, 1) From git at git.haskell.org Tue Jul 14 07:54:01 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 14 Jul 2015 07:54:01 +0000 (UTC) Subject: [commit: ghc] branch 'wip/travis' created Message-ID: <20150714075402.017CD3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/travis Referencing: 4b94118a077c7b0d7d0894340dca2181a37bd37b From git at git.haskell.org Tue Jul 14 07:54:04 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 14 Jul 2015 07:54:04 +0000 (UTC) Subject: [commit: ghc] wip/travis: traivs: Use the new container based travis setup (4b94118) Message-ID: <20150714075404.E4A793A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/travis Link : http://ghc.haskell.org/trac/ghc/changeset/4b94118a077c7b0d7d0894340dca2181a37bd37b/ghc >--------------------------------------------------------------- commit 4b94118a077c7b0d7d0894340dca2181a37bd37b Author: Joachim Breitner Date: Tue Jul 14 09:54:28 2015 +0200 traivs: Use the new container based travis setup which supposedly has more resources, so maybe this makes travis useful for us again. >--------------------------------------------------------------- 4b94118a077c7b0d7d0894340dca2181a37bd37b .travis.yml | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index a1e22c9..b283937 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,6 @@ +# The following enables container-based travis instances +sudo: false + git: submodules: false @@ -5,14 +8,20 @@ env: - DEBUG_STAGE2=YES - DEBUG_STAGE2=NO +addons: + apt: + sources: + - hvr-ghc + - llvm-toolchain-precise-3.6 + - ubuntu-toolchain-r-test + packages: + - cabal-install-1.18 + - ghc-7.6.3 + - alex-3.1.3 + - happy-1.19.4 + - llvm-3.6 + before_install: - - travis_retry sudo add-apt-repository -y ppa:hvr/ghc - - travis_retry sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test - - travis_retry sudo sh -c "echo 'deb http://llvm.org/apt/precise/ llvm-toolchain-precise-3.6 main' >> /etc/apt/sources.list" - - wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add - - - travis_retry sudo apt-get -q update - - travis_retry sudo apt-get -q install cabal-install-1.18 ghc-7.6.3 alex-3.1.3 happy-1.19.4 - - travis_retry sudo apt-get -q install llvm-3.6 - export PATH=/opt/ghc/7.6.3/bin:/opt/cabal/1.18/bin:/opt/alex/3.1.3/bin:/opt/happy/1.19.4/bin:/usr/lib/llvm-3.6/bin:$PATH # Be explicit about which protocol to use, such that we don't have to repeat the rewrite command for each. @@ -29,10 +38,6 @@ before_install: - git submodule init # Don't be quiet, we want to show these urls. - git submodule --quiet update --recursive # Now we can be quiet again. -install: -# - sudo apt-get update -# - sudo apt-get install haskell-platform autoconf libtool make ncurses-dev g++ dblatex docbook-xsl docbook-utils -# - cabal update script: # do not build docs - echo 'HADDOCK_DOCS = NO' >> mk/validate.mk From git at git.haskell.org Tue Jul 14 08:24:36 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 14 Jul 2015 08:24:36 +0000 (UTC) Subject: [commit: ghc] wip/impredicativity: Added a new rule to canonicalization of InstanceOf (19c685e) Message-ID: <20150714082436.AFB513A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/impredicativity Link : http://ghc.haskell.org/trac/ghc/changeset/19c685ed0292a133426c019f129c80dd37209128/ghc >--------------------------------------------------------------- commit 19c685ed0292a133426c019f129c80dd37209128 Author: Alejandro Serrano Date: Tue Jul 14 10:23:00 2015 +0200 Added a new rule to canonicalization of InstanceOf - When we have (Q => ty1) <~ ty2, where none of the sides has a forall at the from, we can convert it to ty1 ~ ty2 /\ Q1. This is needed, for example, to prove (b ~ b => r) <~ r, that appears in base/Data/Type/Equality.hs. >--------------------------------------------------------------- 19c685ed0292a133426c019f129c80dd37209128 compiler/typecheck/TcCanonical.hs | 88 +++++++++++++++++++++++---------------- docs/types/impredicativity.ltx | 9 ++-- 2 files changed, 56 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 19c685ed0292a133426c019f129c80dd37209128 From git at git.haskell.org Tue Jul 14 08:24:56 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 14 Jul 2015 08:24:56 +0000 (UTC) Subject: [commit: ghc] master: Build system: delete two unused files (f70f1b6) Message-ID: <20150714082456.03FEB3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/f70f1b656b6c3d5eef2f1a545876774047338ad1/ghc >--------------------------------------------------------------- commit f70f1b656b6c3d5eef2f1a545876774047338ad1 Author: Thomas Miedema Date: Mon Jul 13 11:34:17 2015 +0200 Build system: delete two unused files They were introduced in 6ae696a1d1f25bf52923a3dd1c3b4a08e2033bfd. We do cross-compilation differently now. >--------------------------------------------------------------- f70f1b656b6c3d5eef2f1a545876774047338ad1 ghc/ghc-cross.wrapper | 1 - rules/cross-compiling.mk | 24 ------------------------ 2 files changed, 25 deletions(-) diff --git a/ghc/ghc-cross.wrapper b/ghc/ghc-cross.wrapper deleted file mode 100644 index 56564e5..0000000 --- a/ghc/ghc-cross.wrapper +++ /dev/null @@ -1 +0,0 @@ -exec "$executablename" -B"$topdir" ${1+"$@"} -pgma "$pgmgcc" -pgmc "$pgmgcc" -pgml "$pgmgcc" diff --git a/rules/cross-compiling.mk b/rules/cross-compiling.mk deleted file mode 100644 index 520b5c1..0000000 --- a/rules/cross-compiling.mk +++ /dev/null @@ -1,24 +0,0 @@ -# ----------------------------------------------------------------------------- -# -# (c) 2012 The University of Glasgow -# -# This file is part of the GHC build system. -# -# To understand how the build system works and how to modify it, see -# http://ghc.haskell.org/trac/ghc/wiki/Building/Architecture -# http://ghc.haskell.org/trac/ghc/wiki/Building/Modifying -# -# ----------------------------------------------------------------------------- - -define cross-compiling # $1 = then, $2 = else, $3 = then, ... -ifneq "$(TARGETPLATFORM)" "$(HOSTPLATFORM)" -ifneq "$(BUILDPLATFORM)" "$(HOSTPLATFORM)" -$(warning When cross-compiling, the build and host platforms must be equal (--build=$(BUILDPLATFORM) --host=$(HOSTPLATFORM) --target=$(TARGETPLATFORM))) -endif -$1 -$3 -else -$2 -$4 -endif -endef From git at git.haskell.org Tue Jul 14 08:24:58 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 14 Jul 2015 08:24:58 +0000 (UTC) Subject: [commit: ghc] master: Build system: delete REGULAR_INSTALL_DYNLIBS and INSTALL_DYNLIBS (47ebe26) Message-ID: <20150714082458.D268A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/47ebe267e8f78eee68333ba12a83d4fa6d763c3b/ghc >--------------------------------------------------------------- commit 47ebe267e8f78eee68333ba12a83d4fa6d763c3b Author: Thomas Miedema Date: Thu Jul 9 19:21:28 2015 +0200 Build system: delete REGULAR_INSTALL_DYNLIBS and INSTALL_DYNLIBS Ever since we ship xhtml, terminfo and haskeline (#8919), commit 4caadb7cbee5c176abb99df25c4cc1657ae57f40, REGULAR_INSTALL_DYNLIBS is always empty. REGULAR_INSTALL_PACKAGES = PACKAGES_STAGE1 + compiler + PACKAGES_STAGE2 REGULAR_INSTALL_DYNLIBS = PACKAGES_STAGE1 + PACKAGES_STAGE2 - REGULAR_INSTALL_PACKAGES So we can delete it, and all the places where it is used. This simplifies ghc.mk a bit. Differential Revision: https://phabricator.haskell.org/D1062 >--------------------------------------------------------------- 47ebe267e8f78eee68333ba12a83d4fa6d763c3b ghc.mk | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/ghc.mk b/ghc.mk index 7e9c2e5..219cdc7 100644 --- a/ghc.mk +++ b/ghc.mk @@ -430,14 +430,6 @@ REGULAR_INSTALL_PACKAGES += compiler endif REGULAR_INSTALL_PACKAGES += $(addprefix libraries/,$(PACKAGES_STAGE2)) -# If we have built the programs with dynamic libraries, then -# ghc will be dynamically linked against haskeline.so etc, so -# we need the dynamic libraries of everything down to here -REGULAR_INSTALL_DYNLIBS := $(addprefix libraries/,$(PACKAGES_STAGE1)) -REGULAR_INSTALL_DYNLIBS += $(addprefix libraries/,$(PACKAGES_STAGE2)) -REGULAR_INSTALL_DYNLIBS := $(filter-out $(REGULAR_INSTALL_PACKAGES),\ - $(REGULAR_INSTALL_DYNLIBS)) - ifneq "$(CrossCompiling)" "YES" define addExtraPackage ifeq "$2" "-" @@ -467,12 +459,8 @@ SUPERSIZE_INSTALL_PACKAGES += compiler endif SUPERSIZE_INSTALL_PACKAGES += $(addprefix libraries/,$(PACKAGES_STAGE2)) -INSTALL_DYNLIBS := ifeq "$(InstallExtraPackages)" "NO" INSTALL_PACKAGES := $(REGULAR_INSTALL_PACKAGES) -ifeq "$(DYNAMIC_GHC_PROGRAMS)" "YES" -INSTALL_DYNLIBS := $(REGULAR_INSTALL_DYNLIBS) -endif else INSTALL_PACKAGES := $(SUPERSIZE_INSTALL_PACKAGES) endif @@ -917,8 +905,6 @@ install_packages: rts/dist/package.conf.install $(call INSTALL_DIR,"$(INSTALLED_PACKAGE_CONF)") $(call INSTALL_DIR,"$(DESTDIR)$(topdir)/rts") $(call installLibsTo, $(RTS_INSTALL_LIBS), "$(DESTDIR)$(topdir)/rts") - $(foreach p, $(INSTALL_DYNLIBS), \ - $(call installLibsTo, $(wildcard $p/dist-install/build/*.so $p/dist-install/build/*.dll $p/dist-install/build/*.dylib), "$(DESTDIR)$(topdir)/$($p_dist-install_LIB_NAME)")) $(foreach p, $(INSTALL_PACKAGES), \ $(call make-command, \ "$(ghc-cabal_INPLACE)" copy \ From git at git.haskell.org Tue Jul 14 08:25:01 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 14 Jul 2015 08:25:01 +0000 (UTC) Subject: [commit: ghc] master: Build system: do not build stm and parallel by default (392ff06) Message-ID: <20150714082501.BB5683A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/392ff06d4bc47bcd731404a48355d8b165609293/ghc >--------------------------------------------------------------- commit 392ff06d4bc47bcd731404a48355d8b165609293 Author: Thomas Miedema Date: Fri Jul 10 19:15:49 2015 +0200 Build system: do not build stm and parallel by default stm and parallel have an 'extra' tag in the ./packages file, so would get added to PACKAGES_STAGE2 by default, and subsequently build by the stage2 compiler. With this patch, this happens only when you set BUILD_EXTRA_PKGS=YES in build.mk. A normal validate still builds (and tests) the 'extra' packages, but they are skipped for `validate --fast`. Maybe this brings us closer to finishing within the 50 minute Travis limit as well. We can later try to give random, primitive and vector an 'extra' tag as well (now they have a 'dph' tag), but some tests will probably fail at first. Differential Revision: https://phabricator.haskell.org/D1065 >--------------------------------------------------------------- 392ff06d4bc47bcd731404a48355d8b165609293 ghc.mk | 14 ++++++-------- mk/build.mk.sample | 4 ++++ mk/config.mk.in | 2 ++ validate | 5 +++++ 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/ghc.mk b/ghc.mk index 219cdc7..db077bc 100644 --- a/ghc.mk +++ b/ghc.mk @@ -435,16 +435,14 @@ define addExtraPackage ifeq "$2" "-" # Do nothing; this package is already handled above else ifeq "$2" "dph" -## DPH-specific clause -ifeq "$$(GhcProfiled)" "YES" -# Ignore package: The DPH packages need TH, which is incompatible with -# a profiled GHC -else ifneq "$$(BUILD_DPH)" "YES" -# Ignore package: DPH was disabled -else +ifeq "$$(BUILD_DPH) $$(GhcProfiled)" "YES NO" +# The DPH packages need TH, which is incompatible with a profiled GHC. +PACKAGES_STAGE2 += $1 +endif +else ifeq "$2" "extra" +ifeq "$$(BUILD_EXTRA_PKGS)" "YES" PACKAGES_STAGE2 += $1 endif -## end of DPH-specific clause else PACKAGES_STAGE2 += $1 endif diff --git a/mk/build.mk.sample b/mk/build.mk.sample index 3f97702..19a59ae 100644 --- a/mk/build.mk.sample +++ b/mk/build.mk.sample @@ -69,6 +69,10 @@ V = 1 # working on stage 2 and want to freeze stage 1 and the libraries for # a while. +# Build the "extra" packages (see ./packages). This enables more tests. See: +# https://ghc.haskell.org/trac/ghc/wiki/Building/RunningTests/Running#AdditionalPackages +#BUILD_EXTRA_PKGS=YES + # Uncomment the following line to enable building DPH #BUILD_DPH=YES diff --git a/mk/config.mk.in b/mk/config.mk.in index bcdebbf..175aa06 100644 --- a/mk/config.mk.in +++ b/mk/config.mk.in @@ -773,6 +773,8 @@ endif # Build DPH? BUILD_DPH = NO +# Build the "extra" packages (see ./packages)? +BUILD_EXTRA_PKGS = NO ################################################################################ # diff --git a/validate b/validate index fbf3c1b..e72a578 100755 --- a/validate +++ b/validate @@ -171,6 +171,11 @@ echo "ValidateSpeed=$speed" >> mk/are-validating.mk echo "ValidateHpc=$hpc" >> mk/are-validating.mk echo "V=0" >> mk/are-validating.mk # Less gunk +if [ $speed != "FAST" ]; then + # Build the "extra" packages (see ./packages), to enable more tests. + echo "BUILD_EXTRA_PKGS=YES" >> mk/are-validating.mk +fi + if [ $use_dph -eq 1 ]; then echo "BUILD_DPH=YES" >> mk/are-validating.mk else From git at git.haskell.org Tue Jul 14 08:25:04 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 14 Jul 2015 08:25:04 +0000 (UTC) Subject: [commit: ghc] master: Testsuite: delete unused with_namebase (5764ade) Message-ID: <20150714082504.B80B73A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/5764ade40104db4efacf5a5e452335f0aac1be8d/ghc >--------------------------------------------------------------- commit 5764ade40104db4efacf5a5e452335f0aac1be8d Author: Thomas Miedema Date: Mon Jul 13 11:30:37 2015 +0200 Testsuite: delete unused with_namebase It was introduced in 39c6c735c216d259854ee31b15ec87ea653f2b5d (2007). >--------------------------------------------------------------- 5764ade40104db4efacf5a5e452335f0aac1be8d testsuite/driver/testglobals.py | 4 ---- testsuite/driver/testlib.py | 43 +++++------------------------------------ 2 files changed, 5 insertions(+), 42 deletions(-) diff --git a/testsuite/driver/testglobals.py b/testsuite/driver/testglobals.py index 76d26a3..34767f4 100644 --- a/testsuite/driver/testglobals.py +++ b/testsuite/driver/testglobals.py @@ -166,10 +166,6 @@ def getTestRun(): class TestOptions: def __init__(self): - # if not None then we look for namebase.stderr etc rather than - # using the test name - self.with_namebase = None - # skip this test? self.skip = 0 diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py index 0fcb738..cb38949 100644 --- a/testsuite/driver/testlib.py +++ b/testsuite/driver/testlib.py @@ -410,14 +410,6 @@ def tag( t ): # --- -def namebase( nb ): - return lambda opts, nb=nb: _namebase(opts, nb) - -def _namebase( opts, nb ): - opts.with_namebase = nb - -# --- - def high_memory_usage(name, opts): opts.alone = True @@ -1049,12 +1041,7 @@ def do_compile( name, way, should_fail, top_mod, extra_mods, extra_hc_opts, over # of whether we expected the compilation to fail or not (successful # compilations may generate warnings). - if getTestOpts().with_namebase == None: - namebase = name - else: - namebase = getTestOpts().with_namebase - - (platform_specific, expected_stderr_file) = platform_wordsize_qualify(namebase, 'stderr') + (platform_specific, expected_stderr_file) = platform_wordsize_qualify(name, 'stderr') actual_stderr_file = qualify(name, 'comp.stderr') if not compare_outputs(way, 'stderr', @@ -1079,12 +1066,7 @@ def compile_cmp_asm( name, way, extra_hc_opts ): # of whether we expected the compilation to fail or not (successful # compilations may generate warnings). - if getTestOpts().with_namebase == None: - namebase = name - else: - namebase = getTestOpts().with_namebase - - (platform_specific, expected_asm_file) = platform_wordsize_qualify(namebase, 'asm') + (platform_specific, expected_asm_file) = platform_wordsize_qualify(name, 'asm') actual_asm_file = qualify(name, 's') if not compare_outputs(way, 'asm', @@ -1530,13 +1512,8 @@ def get_compiler_flags(override_flags, noforce): return flags def check_stdout_ok(name, way): - if getTestOpts().with_namebase == None: - namebase = name - else: - namebase = getTestOpts().with_namebase - actual_stdout_file = qualify(name, 'run.stdout') - (platform_specific, expected_stdout_file) = platform_wordsize_qualify(namebase, 'stdout') + (platform_specific, expected_stdout_file) = platform_wordsize_qualify(name, 'stdout') def norm(str): if platform_specific: @@ -1558,13 +1535,8 @@ def dump_stdout( name ): print(read_no_crs(qualify(name, 'run.stdout'))) def check_stderr_ok(name, way): - if getTestOpts().with_namebase == None: - namebase = name - else: - namebase = getTestOpts().with_namebase - actual_stderr_file = qualify(name, 'run.stderr') - (platform_specific, expected_stderr_file) = platform_wordsize_qualify(namebase, 'stderr') + (platform_specific, expected_stderr_file) = platform_wordsize_qualify(name, 'stderr') def norm(str): if platform_specific: @@ -1634,13 +1606,8 @@ def check_prof_ok(name, way): print(prof_file + " is empty") return(False) - if getTestOpts().with_namebase == None: - namebase = name - else: - namebase = getTestOpts().with_namebase - (platform_specific, expected_prof_file) = \ - platform_wordsize_qualify(namebase, 'prof.sample') + platform_wordsize_qualify(name, 'prof.sample') # sample prof file is not required if not os.path.exists(expected_prof_file): From git at git.haskell.org Tue Jul 14 08:25:07 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 14 Jul 2015 08:25:07 +0000 (UTC) Subject: [commit: ghc] master: Testsuite: delete remaining only_compiler_types(['ghc']) setups (322ae32) Message-ID: <20150714082507.BCF263A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/322ae32f56e68adea8db3d3d7c078298b335d7da/ghc >--------------------------------------------------------------- commit 322ae32f56e68adea8db3d3d7c078298b335d7da Author: Thomas Miedema Date: Mon Jul 13 12:18:10 2015 +0200 Testsuite: delete remaining only_compiler_types(['ghc']) setups No point in pretending other compilers can use the GHC testsuite. This makes the *.T files a bit shorter. >--------------------------------------------------------------- 322ae32f56e68adea8db3d3d7c078298b335d7da libraries/base/tests/Concurrent/all.T | 2 - libraries/base/tests/IO/all.T | 2 +- testsuite/config/ghc | 1 - testsuite/driver/testglobals.py | 3 - testsuite/driver/testlib.py | 43 ++++-------- testsuite/tests/arrows/should_compile/all.T | 2 - testsuite/tests/arrows/should_fail/all.T | 2 - testsuite/tests/arrows/should_run/all.T | 2 - testsuite/tests/cabal/all.T | 2 - testsuite/tests/cabal/cabal01/all.T | 2 - testsuite/tests/cabal/cabal04/all.T | 2 - testsuite/tests/codeGen/should_compile/all.T | 2 +- testsuite/tests/codeGen/should_run/all.T | 14 ++-- testsuite/tests/concurrent/should_run/all.T | 78 +++++++++------------- testsuite/tests/deSugar/should_compile/all.T | 6 +- testsuite/tests/deriving/should_run/all.T | 2 +- testsuite/tests/driver/T9562/all.T | 2 - testsuite/tests/driver/all.T | 2 - testsuite/tests/driver/dynamicToo/all.T | 1 - .../tests/driver/dynamicToo/dynamicToo001/test.T | 1 - .../tests/driver/dynamicToo/dynamicToo002/test.T | 1 - .../tests/driver/dynamicToo/dynamicToo004/test.T | 3 +- testsuite/tests/ffi/should_fail/all.T | 13 ++-- testsuite/tests/ffi/should_run/all.T | 3 +- testsuite/tests/gadt/all.T | 2 - testsuite/tests/generics/GEq/test.T | 2 - testsuite/tests/generics/GFunctor/test.T | 2 - testsuite/tests/generics/GMap/test.T | 2 - testsuite/tests/generics/GShow/test.T | 2 - testsuite/tests/generics/Uniplate/test.T | 2 - testsuite/tests/generics/all.T | 2 - testsuite/tests/ghci/prog004/prog004.T | 2 - testsuite/tests/hpc/all.T | 4 +- testsuite/tests/indexed-types/should_compile/all.T | 1 - testsuite/tests/indexed-types/should_fail/all.T | 1 - testsuite/tests/indexed-types/should_run/all.T | 1 - testsuite/tests/layout/all.T | 25 +++---- testsuite/tests/mdo/should_compile/all.T | 4 +- testsuite/tests/module/base01/all.T | 2 - testsuite/tests/module/mod175/all.T | 2 - testsuite/tests/numeric/should_run/all.T | 7 +- testsuite/tests/package/all.T | 2 - testsuite/tests/partial-sigs/should_fail/all.T | 2 +- testsuite/tests/polykinds/all.T | 2 - testsuite/tests/primops/should_compile/all.T | 2 +- testsuite/tests/programs/cvh_unboxing/test.T | 2 - .../tests/programs/thurston-modular-arith/test.T | 2 +- testsuite/tests/quasiquotation/T4491/test.T | 1 - testsuite/tests/quasiquotation/all.T | 8 +-- testsuite/tests/quasiquotation/qq001/test.T | 3 +- testsuite/tests/quasiquotation/qq002/test.T | 3 +- testsuite/tests/quasiquotation/qq003/test.T | 3 +- testsuite/tests/quasiquotation/qq004/test.T | 3 +- testsuite/tests/quasiquotation/qq005/test.T | 1 - testsuite/tests/quasiquotation/qq006/test.T | 2 +- testsuite/tests/quasiquotation/qq007/test.T | 2 +- testsuite/tests/quasiquotation/qq008/test.T | 2 +- testsuite/tests/rebindable/all.T | 1 - testsuite/tests/rename/prog005/test.T | 2 +- testsuite/tests/rename/should_compile/T3103/test.T | 3 +- testsuite/tests/rename/should_compile/all.T | 16 ++--- testsuite/tests/simplCore/should_compile/all.T | 2 +- testsuite/tests/th/all.T | 1 - testsuite/tests/typecheck/prog002/test.T | 2 - testsuite/tests/typecheck/should_compile/all.T | 44 ++++++------ testsuite/tests/typecheck/should_fail/all.T | 22 +++--- testsuite/tests/typecheck/should_run/all.T | 42 +++++------- 67 files changed, 154 insertions(+), 275 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 322ae32f56e68adea8db3d3d7c078298b335d7da From git at git.haskell.org Tue Jul 14 08:45:20 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 14 Jul 2015 08:45:20 +0000 (UTC) Subject: [commit: ghc] branch 'wip/travis' deleted Message-ID: <20150714084520.4E3123A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Deleted branch: wip/travis From git at git.haskell.org Tue Jul 14 08:45:23 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 14 Jul 2015 08:45:23 +0000 (UTC) Subject: [commit: ghc] master: traivs: Use the new container based travis setup (783b79b) Message-ID: <20150714084523.2BCD03A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/783b79bfb5e0ca85b446335fe20cb794a1519ed4/ghc >--------------------------------------------------------------- commit 783b79bfb5e0ca85b446335fe20cb794a1519ed4 Author: Joachim Breitner Date: Tue Jul 14 09:54:28 2015 +0200 traivs: Use the new container based travis setup which supposedly has more resources, so maybe this makes travis useful for us again. >--------------------------------------------------------------- 783b79bfb5e0ca85b446335fe20cb794a1519ed4 .travis.yml | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index a1e22c9..b283937 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,6 @@ +# The following enables container-based travis instances +sudo: false + git: submodules: false @@ -5,14 +8,20 @@ env: - DEBUG_STAGE2=YES - DEBUG_STAGE2=NO +addons: + apt: + sources: + - hvr-ghc + - llvm-toolchain-precise-3.6 + - ubuntu-toolchain-r-test + packages: + - cabal-install-1.18 + - ghc-7.6.3 + - alex-3.1.3 + - happy-1.19.4 + - llvm-3.6 + before_install: - - travis_retry sudo add-apt-repository -y ppa:hvr/ghc - - travis_retry sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test - - travis_retry sudo sh -c "echo 'deb http://llvm.org/apt/precise/ llvm-toolchain-precise-3.6 main' >> /etc/apt/sources.list" - - wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add - - - travis_retry sudo apt-get -q update - - travis_retry sudo apt-get -q install cabal-install-1.18 ghc-7.6.3 alex-3.1.3 happy-1.19.4 - - travis_retry sudo apt-get -q install llvm-3.6 - export PATH=/opt/ghc/7.6.3/bin:/opt/cabal/1.18/bin:/opt/alex/3.1.3/bin:/opt/happy/1.19.4/bin:/usr/lib/llvm-3.6/bin:$PATH # Be explicit about which protocol to use, such that we don't have to repeat the rewrite command for each. @@ -29,10 +38,6 @@ before_install: - git submodule init # Don't be quiet, we want to show these urls. - git submodule --quiet update --recursive # Now we can be quiet again. -install: -# - sudo apt-get update -# - sudo apt-get install haskell-platform autoconf libtool make ncurses-dev g++ dblatex docbook-xsl docbook-utils -# - cabal update script: # do not build docs - echo 'HADDOCK_DOCS = NO' >> mk/validate.mk From git at git.haskell.org Tue Jul 14 13:00:26 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 14 Jul 2015 13:00:26 +0000 (UTC) Subject: [commit: ghc] master: Testsuite: delete *.stderr-ghc-7.0 *.stdout-ghc-7.0 (ab5257b) Message-ID: <20150714130026.94FE23A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/ab5257b90b16c6403f73f26fb3381545bb2e75c4/ghc >--------------------------------------------------------------- commit ab5257b90b16c6403f73f26fb3381545bb2e75c4 Author: Thomas Miedema Date: Tue Jul 14 13:57:29 2015 +0200 Testsuite: delete *.stderr-ghc-7.0 *.stdout-ghc-7.0 No point in pretending the testsuite can be run with older versions of GHC. >--------------------------------------------------------------- ab5257b90b16c6403f73f26fb3381545bb2e75c4 testsuite/driver/testlib.py | 7 +- .../tests/arrows/should_fail/T2111.stderr-ghc-7.0 | 10 -- .../ghci.debugger/scripts/break024.stdout-ghc-7.0 | 28 ---- .../tests/ghci/scripts/ghci025.stdout-ghc-7.0 | 111 --------------- .../indexed-types/should_fail/T4174.stderr-ghc-7.0 | 7 - .../mdo/should_fail/mdofail001.stderr-ghc-7.0 | 8 -- .../mdo/should_fail/mdofail002.stderr-ghc-7.0 | 5 - .../mdo/should_fail/mdofail003.stderr-ghc-7.0 | 5 - .../mdo/should_fail/mdofail004.stderr-ghc-7.0 | 7 - .../parser/should_fail/readFail045.stderr-ghc-7.0 | 2 - .../simplCore/should_compile/T3717.stderr-ghc-7.0 | 47 ------- .../simplCore/should_compile/T3772.stdout-ghc-7.0 | 25 ---- .../simplCore/should_compile/T4908.stderr-ghc-7.0 | 77 ----------- .../should_compile/spec-inline.stderr-ghc-7.0 | 154 --------------------- testsuite/tests/th/T2700.stderr-ghc-7.0 | 1 - .../typecheck/should_fail/tcfail016.stderr-ghc-7.0 | 8 -- .../typecheck/should_fail/tcfail186.stderr-ghc-7.0 | 7 - 17 files changed, 3 insertions(+), 506 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 ab5257b90b16c6403f73f26fb3381545bb2e75c4 From git at git.haskell.org Tue Jul 14 13:00:29 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 14 Jul 2015 13:00:29 +0000 (UTC) Subject: [commit: ghc] master: Testsuite: rename *.stderr-ghc to *.stderr (4dc3877) Message-ID: <20150714130029.846053A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/4dc38775687ea70e10cd20bae0eaa522d4f034e7/ghc >--------------------------------------------------------------- commit 4dc38775687ea70e10cd20bae0eaa522d4f034e7 Author: Thomas Miedema Date: Tue Jul 14 13:37:55 2015 +0200 Testsuite: rename *.stderr-ghc to *.stderr And *.stdout-ghc to *.stdout. We only have output files for ghc now. >--------------------------------------------------------------- 4dc38775687ea70e10cd20bae0eaa522d4f034e7 libraries/base/tests/list001.stdout | 8 ++-- libraries/base/tests/list001.stdout-ghc | 54 ---------------------- libraries/base/tests/ratio001.stdout-ghc | 1 - testsuite/driver/testlib.py | 7 ++- .../{ds002.stderr-ghc => ds002.stderr} | 0 .../{ds003.stderr-ghc => ds003.stderr} | 0 .../{ds019.stderr-ghc => ds019.stderr} | 0 .../{ds020.stderr-ghc => ds020.stderr} | 0 .../{ds022.stderr-ghc => ds022.stderr} | 0 .../{ds040.stderr-ghc => ds040.stderr} | 0 .../{ds041.stderr-ghc => ds041.stderr} | 0 .../{ds043.stderr-ghc => ds043.stderr} | 0 .../{ds051.stderr-ghc => ds051.stderr} | 0 .../{ds053.stderr-ghc => ds053.stderr} | 0 .../module/{mod128.stderr-ghc => mod128.stderr} | 0 .../module/{mod14.stderr-ghc => mod14.stderr} | 0 .../tests/module/{mod5.stderr-ghc => mod5.stderr} | 0 .../tests/numeric/should_run/arith001.stdout-ghc | 5 -- .../tests/numeric/should_run/arith002.stdout-ghc | 4 -- .../{read014.stderr-ghc => read014.stderr} | 0 .../{T3262.stderr-ghc => T3262.stderr} | 0 .../{mc10.stderr-ghc => mc10.stderr} | 0 .../{rn037.stderr-ghc => rn037.stderr} | 0 .../{rn039.stderr-ghc => rn039.stderr} | 0 .../{rn040.stderr-ghc => rn040.stderr} | 0 .../{rn041.stderr-ghc => rn041.stderr} | 0 .../{rn046.stderr-ghc => rn046.stderr} | 0 .../{rn047.stderr-ghc => rn047.stderr} | 0 .../{rn055.stderr-ghc => rn055.stderr} | 0 ...prog001.stderr-ghc => typecheck.prog001.stderr} | 0 .../{HasKey.stderr-ghc => HasKey.stderr} | 0 .../{T7903.stderr-ghc => T7903.stderr} | 0 .../{tc078.stderr-ghc => tc078.stderr} | 0 .../{tc115.stderr-ghc => tc115.stderr} | 0 .../{tc116.stderr-ghc => tc116.stderr} | 0 .../{tc125.stderr-ghc => tc125.stderr} | 0 .../{tc126.stderr-ghc => tc126.stderr} | 0 .../{tc161.stderr-ghc => tc161.stderr} | 0 .../tests/typecheck/should_run/tcrun003.stdout-ghc | 1 - 39 files changed, 7 insertions(+), 73 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 4dc38775687ea70e10cd20bae0eaa522d4f034e7 From git at git.haskell.org Tue Jul 14 20:53:05 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 14 Jul 2015 20:53:05 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Use a map when renaming ConDeclFields (4023d61) Message-ID: <20150714205305.422AD3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/4023d61a54a70fefcf305bf531886465938c43b9/ghc >--------------------------------------------------------------- commit 4023d61a54a70fefcf305bf531886465938c43b9 Author: Adam Gundry Date: Thu Jul 9 17:32:46 2015 +0100 Use a map when renaming ConDeclFields >--------------------------------------------------------------- 4023d61a54a70fefcf305bf531886465938c43b9 compiler/rename/RnTypes.hs | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/compiler/rename/RnTypes.hs b/compiler/rename/RnTypes.hs index de234f9..98086ab 100644 --- a/compiler/rename/RnTypes.hs +++ b/compiler/rename/RnTypes.hs @@ -691,19 +691,27 @@ checkValidPartialType doc lty {- ********************************************************* -* * -\subsection{Contexts and predicates} -* * +* * + ConDeclField +* * ********************************************************* + +When renaming a ConDeclField, we have to find the FieldLabel +associated with each field. But we already have all the FieldLabels +available (since they were brought into scope by +RnNames.getLocalNonValBinders), so we just take the list as an +argument, build a map and look them up. -} rnConDeclFields :: [FieldLabel] -> HsDocContext -> [LConDeclField RdrName] -> RnM ([LConDeclField Name], FreeVars) -rnConDeclFields fls doc fields = mapFvRn (rnField fls doc) fields +rnConDeclFields fls doc fields = mapFvRn (rnField fl_env doc) fields + where + fl_env = mkFsEnv [ (flLabel fl, fl) | fl <- fls ] -rnField :: [FieldLabel] -> HsDocContext -> LConDeclField RdrName +rnField :: FastStringEnv FieldLabel -> HsDocContext -> LConDeclField RdrName -> RnM (LConDeclField Name, FreeVars) -rnField fls doc (L l (ConDeclField names ty haddock_doc)) +rnField fl_env doc (L l (ConDeclField names ty haddock_doc)) = do { let new_names = map (fmap lookupField) names ; (new_ty, fvs) <- rnLHsType doc ty ; new_haddock_doc <- rnMbLHsDoc haddock_doc @@ -713,7 +721,16 @@ rnField fls doc (L l (ConDeclField names ty haddock_doc)) lookupField (FieldOcc rdr _) = FieldOcc rdr fl where lbl = occNameFS $ rdrNameOcc rdr - fl = expectJust "rnField" $ find ((== lbl) . flLabel) fls + fl = expectJust "rnField" $ lookupFsEnv fl_env lbl + + +{- +********************************************************* +* * + Contexts +* * +********************************************************* +-} rnContext :: HsDocContext -> LHsContext RdrName -> RnM (LHsContext Name, FreeVars) rnContext doc (L loc cxt) From git at git.haskell.org Tue Jul 14 20:53:09 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 14 Jul 2015 20:53:09 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Do a global lookup when renaming fields in updates (f24192e) Message-ID: <20150714205309.2D2F43A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/f24192e3bcbe3c188e6307125fdc884e45cb50f0/ghc >--------------------------------------------------------------- commit f24192e3bcbe3c188e6307125fdc884e45cb50f0 Author: Adam Gundry Date: Thu Jul 9 18:03:00 2015 +0100 Do a global lookup when renaming fields in updates >--------------------------------------------------------------- f24192e3bcbe3c188e6307125fdc884e45cb50f0 compiler/rename/RnEnv.hs | 2 +- compiler/rename/RnPat.hs | 2 +- testsuite/tests/overloadedrecflds/should_run/all.T | 1 + .../should_run/overloadedrecfldsrun05.hs | 27 ++++++++++++++++++++++ .../should_run/overloadedrecfldsrun05.stdout | 4 ++++ 5 files changed, 34 insertions(+), 2 deletions(-) diff --git a/compiler/rename/RnEnv.hs b/compiler/rename/RnEnv.hs index 952ff01..d203a58 100644 --- a/compiler/rename/RnEnv.hs +++ b/compiler/rename/RnEnv.hs @@ -14,7 +14,7 @@ module RnEnv ( lookupLocalOccThLvl_maybe, lookupTypeOccRn, lookupKindOccRn, lookupGlobalOccRn, lookupGlobalOccRn_maybe, - lookupOccRn_overloaded, + lookupOccRn_overloaded, lookupGlobalOccRn_overloaded, reportUnboundName, unknownNameSuggestions, HsSigCtxt(..), lookupLocalTcNames, lookupSigOccRn, diff --git a/compiler/rename/RnPat.hs b/compiler/rename/RnPat.hs index 21b0943..19fada3 100644 --- a/compiler/rename/RnPat.hs +++ b/compiler/rename/RnPat.hs @@ -675,7 +675,7 @@ rnHsRecUpdFields flds -- Defer renaming of overloaded fields to the typechecker -- See Note [Disambiguating record updates] in TcExpr if overload_ok - then do { mb <- lookupOccRn_overloaded overload_ok lbl + then do { mb <- lookupGlobalOccRn_overloaded overload_ok lbl ; case mb of Nothing -> do { addErr (unknownSubordinateErr doc lbl) ; return (Right []) } diff --git a/testsuite/tests/overloadedrecflds/should_run/all.T b/testsuite/tests/overloadedrecflds/should_run/all.T index a062b1b..012916a 100644 --- a/testsuite/tests/overloadedrecflds/should_run/all.T +++ b/testsuite/tests/overloadedrecflds/should_run/all.T @@ -6,3 +6,4 @@ test('overloadedrecfldsrun02', multimod_compile_and_run, ['overloadedrecfldsrun02', '']) test('overloadedrecfldsrun03', normal, compile_and_run, ['']) test('overloadedrecfldsrun04', normal, compile_and_run, ['']) +test('overloadedrecfldsrun05', normal, compile_and_run, ['']) diff --git a/testsuite/tests/overloadedrecflds/should_run/overloadedrecfldsrun05.hs b/testsuite/tests/overloadedrecflds/should_run/overloadedrecfldsrun05.hs new file mode 100644 index 0000000..0cb9041 --- /dev/null +++ b/testsuite/tests/overloadedrecflds/should_run/overloadedrecfldsrun05.hs @@ -0,0 +1,27 @@ +-- Test that AllowDuplicateRecordFields works with NamedFieldPuns and +-- RecordWildCards + +{-# LANGUAGE AllowDuplicateRecordFields, NamedFieldPuns, RecordWildCards #-} + +data S = MkS { foo :: Int } + deriving Show +data T = MkT { foo :: Int } + deriving Show + +f MkS{foo} = MkT{foo} + +g MkT{..} = MkS{..} + +h e = let foo = 6 in e { foo } :: S + +main = do print a + print b + print c + print d + where + foo = 42 + + a = MkS{foo} + b = f a + c = g b + d = h c diff --git a/testsuite/tests/overloadedrecflds/should_run/overloadedrecfldsrun05.stdout b/testsuite/tests/overloadedrecflds/should_run/overloadedrecfldsrun05.stdout new file mode 100644 index 0000000..d7796b8 --- /dev/null +++ b/testsuite/tests/overloadedrecflds/should_run/overloadedrecfldsrun05.stdout @@ -0,0 +1,4 @@ +MkS {foo = 42} +MkT {foo = 42} +MkS {foo = 42} +MkS {foo = 6} From git at git.haskell.org Tue Jul 14 20:53:12 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 14 Jul 2015 20:53:12 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Return FieldOccs from lookupOccRn_overloaded (c874a85) Message-ID: <20150714205312.1960B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/c874a8519c7ca60fcd6a8e4ed4760212183aa81a/ghc >--------------------------------------------------------------- commit c874a8519c7ca60fcd6a8e4ed4760212183aa81a Author: Adam Gundry Date: Tue Jul 14 09:32:15 2015 +0100 Return FieldOccs from lookupOccRn_overloaded >--------------------------------------------------------------- c874a8519c7ca60fcd6a8e4ed4760212183aa81a compiler/rename/RnEnv.hs | 20 ++++++++++++-------- compiler/rename/RnExpr.hs | 5 ++--- compiler/rename/RnPat.hs | 3 +-- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/compiler/rename/RnEnv.hs b/compiler/rename/RnEnv.hs index d203a58..15a3a0a 100644 --- a/compiler/rename/RnEnv.hs +++ b/compiler/rename/RnEnv.hs @@ -833,10 +833,10 @@ lookupGlobalOccRn_maybe rdr_name -- * Nothing -> name not in scope (no error reported) -- * Just (Left x) -> name uniquely refers to x, -- or there is a name clash (reported) --- * Just (Right xs) -> name refers to one or more (parent, record selector) --- pairs; if overload_ok was False, this list will be +-- * Just (Right xs) -> name refers to one or more record selectors; +-- if overload_ok was False, this list will be -- a singleton. -lookupOccRn_overloaded :: Bool -> RdrName -> RnM (Maybe (Either Name [(Name, Name)])) +lookupOccRn_overloaded :: Bool -> RdrName -> RnM (Maybe (Either Name [FieldOcc Name])) lookupOccRn_overloaded overload_ok rdr_name = do { local_env <- getLocalRdrEnv ; case lookupLocalRdrEnv local_env rdr_name of { @@ -853,7 +853,7 @@ lookupOccRn_overloaded overload_ok rdr_name (n:_) -> return $ Just $ Left n -- Unlikely to be more than one...? [] -> return Nothing } } } } } -lookupGlobalOccRn_overloaded :: Bool -> RdrName -> RnM (Maybe (Either Name [(Name, Name)])) +lookupGlobalOccRn_overloaded :: Bool -> RdrName -> RnM (Maybe (Either Name [FieldOcc Name])) lookupGlobalOccRn_overloaded overload_ok rdr_name | Just n <- isExact_maybe rdr_name -- This happens in derived code = do { n' <- lookupExactOcc n; return (Just (Left n')) } @@ -868,18 +868,22 @@ lookupGlobalOccRn_overloaded overload_ok rdr_name [] -> return Nothing [gre] | isOverloadedRecFldGRE gre -> do { addUsedRdrName True gre rdr_name - ; return (Just (Right [greBits gre])) } + ; return (Just (Right [greToFieldOcc gre])) } | otherwise -> do { addUsedRdrName True gre rdr_name ; return (Just (Left (gre_name gre))) } gres | all isRecFldGRE gres && overload_ok -> do { mapM_ (\ gre -> addUsedRdrName True gre rdr_name) gres - ; return (Just (Right (map greBits gres))) } + ; return (Just (Right (map greToFieldOcc gres))) } gres -> do { addNameClashErrRn rdr_name gres ; return (Just (Left (gre_name (head gres)))) } } where - greBits (GRE{ gre_name = n, gre_par = FldParent { par_is = p }}) = (p, n) - greBits gre = pprPanic "lookupGlobalOccRn_overloaded/greBits" (ppr gre) + greToFieldOcc :: GlobalRdrElt -> FieldOcc Name + greToFieldOcc gre = FieldOcc rdr_name (FieldLabel lbl is_overloaded sel) + where + lbl = occNameFS $ rdrNameOcc rdr_name + is_overloaded = isOverloadedRecFldGRE gre + sel = gre_name gre -------------------------------------------------- diff --git a/compiler/rename/RnExpr.hs b/compiler/rename/RnExpr.hs index f73686e..52947c0 100644 --- a/compiler/rename/RnExpr.hs +++ b/compiler/rename/RnExpr.hs @@ -109,9 +109,8 @@ rnExpr (HsVar v) | otherwise -> finishHsVar name ; - Just (Right ((_, sel_name):ns)) -> ASSERT( null ns ) - -- AMG TODO push up into lookupOccRn_overloaded? False is wrong! - return (HsSingleRecFld (FieldOcc v (FieldLabel (occNameFS $ rdrNameOcc v) False sel_name)), unitFV sel_name) ; + Just (Right (f:fs)) -> ASSERT( null fs ) + return (HsSingleRecFld f, unitFV (flSelector (labelFieldOcc f))) ; Just (Right []) -> error "runExpr/HsVar" } } rnExpr (HsIPVar v) diff --git a/compiler/rename/RnPat.hs b/compiler/rename/RnPat.hs index 19fada3..d10e5a6 100644 --- a/compiler/rename/RnPat.hs +++ b/compiler/rename/RnPat.hs @@ -55,7 +55,6 @@ import NameSet import RdrName import BasicTypes import Util -import Maybes import ListSetOps ( removeDups ) import Outputable import SrcLoc @@ -694,7 +693,7 @@ rnHsRecUpdFields flds ; return (L l (HsRecUpdField { hsRecUpdFieldLbl = L loc lbl , hsRecUpdFieldSel = case sel of Left sel_name -> [sel_name] - Right xs -> map snd xs + Right xs -> map (flSelector . labelFieldOcc) xs , hsRecUpdFieldArg = arg'' , hsRecUpdPun = pun }), fvs') } From git at git.haskell.org Tue Jul 14 20:53:15 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 14 Jul 2015 20:53:15 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Store just selector Name in FieldOcc, not FieldLbl (7b12694) Message-ID: <20150714205315.052BE3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/7b12694f85eeec9594c3d81cfbfe7a6776510428/ghc >--------------------------------------------------------------- commit 7b12694f85eeec9594c3d81cfbfe7a6776510428 Author: Adam Gundry Date: Tue Jul 14 09:36:07 2015 +0100 Store just selector Name in FieldOcc, not FieldLbl >--------------------------------------------------------------- 7b12694f85eeec9594c3d81cfbfe7a6776510428 compiler/deSugar/DsMeta.hs | 8 +++++--- compiler/hsSyn/HsPat.hs | 21 ++++++++------------- compiler/hsSyn/HsTypes.hs | 10 +++++----- compiler/hsSyn/HsUtils.hs | 2 +- compiler/hsSyn/PlaceHolder.hs | 3 +-- compiler/rename/RnEnv.hs | 12 ++---------- compiler/rename/RnExpr.hs | 2 +- compiler/rename/RnPat.hs | 12 ++++++------ compiler/rename/RnTypes.hs | 2 +- compiler/typecheck/TcExpr.hs | 13 ++++++------- compiler/typecheck/TcHsSyn.hs | 2 +- compiler/typecheck/TcPat.hs | 6 +++--- compiler/typecheck/TcTyClsDecls.hs | 2 +- 13 files changed, 41 insertions(+), 54 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 7b12694f85eeec9594c3d81cfbfe7a6776510428 From git at git.haskell.org Tue Jul 14 20:53:17 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 14 Jul 2015 20:53:17 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Make parser report use of .. in record updates (653aee2) Message-ID: <20150714205317.E72BC3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/653aee2163a39ae8db6bc290778defe68a98224d/ghc >--------------------------------------------------------------- commit 653aee2163a39ae8db6bc290778defe68a98224d Author: Adam Gundry Date: Tue Jul 14 20:39:19 2015 +0100 Make parser report use of .. in record updates >--------------------------------------------------------------- 653aee2163a39ae8db6bc290778defe68a98224d compiler/parser/RdrHsSyn.hs | 5 +++-- compiler/rename/RnPat.hs | 14 ++++---------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/compiler/parser/RdrHsSyn.hs b/compiler/parser/RdrHsSyn.hs index be0cf1b..ab3207f 100644 --- a/compiler/parser/RdrHsSyn.hs +++ b/compiler/parser/RdrHsSyn.hs @@ -1179,8 +1179,9 @@ mkRecConstrOrUpdate mkRecConstrOrUpdate (L l (HsVar c)) _ (fs,dd) | isRdrDataCon c = return (RecordCon (L l c) noPostTcExpr (mk_rec_fields fs dd)) -mkRecConstrOrUpdate exp _ (fs,dd) - = return (RecordUpd exp (map (fmap mk_rec_upd_field) fs) [] [] []) +mkRecConstrOrUpdate exp@(L l _) _ (fs,dd) + | dd = parseErrorSDoc l (text "You cannot use `..' in a record update") + | otherwise = return (RecordUpd exp (map (fmap mk_rec_upd_field) fs) [] [] []) mk_rec_fields :: [LHsRecField id arg] -> Bool -> HsRecFields id arg mk_rec_fields fs False = HsRecFields { rec_flds = fs, rec_dotdot = Nothing } diff --git a/compiler/rename/RnPat.hs b/compiler/rename/RnPat.hs index 316bf34..9bd3718 100644 --- a/compiler/rename/RnPat.hs +++ b/compiler/rename/RnPat.hs @@ -566,17 +566,14 @@ rnHsRecFields ctxt mk_arg (HsRecFields { rec_flds = flds, rec_dotdot = dotdot }) , hsRecPun = pun })) } rn_dotdot :: Maybe Int -- See Note [DotDot fields] in HsPat - -> Maybe Name -- The constructor (Nothing for an update - -- or out of scope constructor) + -> Maybe Name -- The constructor (Nothing for an + -- out of scope constructor) -> [LHsRecField Name (Located arg)] -- Explicit fields -> RnM [LHsRecField Name (Located arg)] -- Filled in .. fields rn_dotdot Nothing _mb_con _flds -- No ".." at all = return [] - rn_dotdot (Just {}) Nothing _flds -- ".." on record update - = do { case ctxt of - HsRecFieldUpd -> addErr badDotDotUpd - _ -> return () - ; return [] } + rn_dotdot (Just {}) Nothing _flds -- Constructor out of scope + = return [] rn_dotdot (Just n) (Just con) flds -- ".." on record construction / pat match = ASSERT( n == length flds ) do { loc <- getSrcSpanM -- Rather approximate @@ -723,9 +720,6 @@ badDotDotCon con = vcat [ ptext (sLit "Illegal `..' notation for constructor") <+> quotes (ppr con) , nest 2 (ptext (sLit "The constructor has no labelled fields")) ] -badDotDotUpd :: SDoc -badDotDotUpd = ptext (sLit "You cannot use `..' in a record update") - emptyUpdateErr :: SDoc emptyUpdateErr = ptext (sLit "Empty record update") From git at git.haskell.org Tue Jul 14 20:53:20 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 14 Jul 2015 20:53:20 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Fix unused imports/declarations/constraints and missing deriving Typeable (2936eee) Message-ID: <20150714205320.C86733A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/2936eeeeeeecdac15478aafe45ab2a5a24765a3a/ghc >--------------------------------------------------------------- commit 2936eeeeeeecdac15478aafe45ab2a5a24765a3a Author: Adam Gundry Date: Tue Jul 14 20:40:37 2015 +0100 Fix unused imports/declarations/constraints and missing deriving Typeable >--------------------------------------------------------------- 2936eeeeeeecdac15478aafe45ab2a5a24765a3a compiler/basicTypes/FieldLabel.hs | 2 +- compiler/deSugar/DsExpr.hs | 1 - compiler/deSugar/DsMeta.hs | 1 - compiler/hsSyn/HsExpr.hs | 1 - compiler/hsSyn/HsPat.hs | 4 ++-- compiler/hsSyn/HsTypes.hs | 2 +- compiler/hsSyn/PlaceHolder.hs | 1 - compiler/iface/TcIface.hs | 1 - compiler/rename/RnExpr.hs | 1 - compiler/rename/RnSource.hs | 11 +---------- compiler/rename/RnTypes.hs | 2 +- compiler/typecheck/TcInstDcls.hs | 2 +- 12 files changed, 7 insertions(+), 22 deletions(-) diff --git a/compiler/basicTypes/FieldLabel.hs b/compiler/basicTypes/FieldLabel.hs index 6c4a9cc..4829dd6 100644 --- a/compiler/basicTypes/FieldLabel.hs +++ b/compiler/basicTypes/FieldLabel.hs @@ -100,7 +100,7 @@ data FieldLbl a = FieldLabel { -- in the defining module for this datatype? flSelector :: a -- ^ Record selector function } - deriving (Functor, Foldable, Traversable) + deriving (Functor, Foldable, Traversable, Typeable) deriving instance Data a => Data (FieldLbl a) instance Outputable a => Outputable (FieldLbl a) where diff --git a/compiler/deSugar/DsExpr.hs b/compiler/deSugar/DsExpr.hs index 48e2ff4..fa21130 100644 --- a/compiler/deSugar/DsExpr.hs +++ b/compiler/deSugar/DsExpr.hs @@ -22,7 +22,6 @@ import DsArrows import DsMonad import Name import NameEnv -import RdrName import FamInstEnv( topNormaliseType ) import DsMeta import HsSyn diff --git a/compiler/deSugar/DsMeta.hs b/compiler/deSugar/DsMeta.hs index 68bcd6e..7b22455 100644 --- a/compiler/deSugar/DsMeta.hs +++ b/compiler/deSugar/DsMeta.hs @@ -50,7 +50,6 @@ import CoreUtils import SrcLoc import Unique import BasicTypes -import FieldLabel import Outputable import Bag import DynFlags diff --git a/compiler/hsSyn/HsExpr.hs b/compiler/hsSyn/HsExpr.hs index 12a5b49..432ee9a 100644 --- a/compiler/hsSyn/HsExpr.hs +++ b/compiler/hsSyn/HsExpr.hs @@ -28,7 +28,6 @@ import TcEvidence import CoreSyn import Var import Name -import RdrName import BasicTypes import DataCon import SrcLoc diff --git a/compiler/hsSyn/HsPat.hs b/compiler/hsSyn/HsPat.hs index 7f2c4e8..145bd0e 100644 --- a/compiler/hsSyn/HsPat.hs +++ b/compiler/hsSyn/HsPat.hs @@ -428,7 +428,7 @@ pprConArgs (PrefixCon pats) = sep (map pprParendLPat pats) pprConArgs (InfixCon p1 p2) = sep [pprParendLPat p1, pprParendLPat p2] pprConArgs (RecCon rpats) = ppr rpats -instance (OutputableBndr id, Outputable arg) +instance (Outputable arg) => Outputable (HsRecFields id arg) where ppr (HsRecFields { rec_flds = flds, rec_dotdot = Nothing }) = braces (fsep (punctuate comma (map ppr flds))) @@ -437,7 +437,7 @@ instance (OutputableBndr id, Outputable arg) where dotdot = ptext (sLit "..") <+> ifPprDebug (ppr (drop n flds)) -instance (OutputableBndr id, Outputable arg) +instance (Outputable arg) => Outputable (HsRecField id arg) where ppr (HsRecField { hsRecFieldLbl = f, hsRecFieldArg = arg, hsRecPun = pun }) diff --git a/compiler/hsSyn/HsTypes.hs b/compiler/hsSyn/HsTypes.hs index 1307826..1d90755 100644 --- a/compiler/hsSyn/HsTypes.hs +++ b/compiler/hsSyn/HsTypes.hs @@ -73,7 +73,6 @@ import TysWiredIn import PrelNames( ipClassName ) import HsDoc import BasicTypes -import FieldLabel import SrcLoc import StaticFlags import Outputable @@ -563,6 +562,7 @@ type LFieldOcc name = Located (FieldOcc name) -- both the 'RdrName' the user originally wrote, and after the -- renamer, the selector function. data FieldOcc name = FieldOcc RdrName (PostRn name name) + deriving Typeable deriving instance (DataId name) => Data (FieldOcc name) instance Outputable (FieldOcc name) where diff --git a/compiler/hsSyn/PlaceHolder.hs b/compiler/hsSyn/PlaceHolder.hs index f7da3ef..2f29f54 100644 --- a/compiler/hsSyn/PlaceHolder.hs +++ b/compiler/hsSyn/PlaceHolder.hs @@ -12,7 +12,6 @@ import NameSet import RdrName import Var import Coercion -import FieldLabel import Data.Data hiding ( Fixity ) import BasicTypes (Fixity) diff --git a/compiler/iface/TcIface.hs b/compiler/iface/TcIface.hs index d1b615a..879a035 100644 --- a/compiler/iface/TcIface.hs +++ b/compiler/iface/TcIface.hs @@ -46,7 +46,6 @@ import TyCon import CoAxiom import ConLike import DataCon -import FieldLabel import PrelNames import TysWiredIn import TysPrim ( superKindTyConName ) diff --git a/compiler/rename/RnExpr.hs b/compiler/rename/RnExpr.hs index d39a43f..c14ab00 100644 --- a/compiler/rename/RnExpr.hs +++ b/compiler/rename/RnExpr.hs @@ -30,7 +30,6 @@ import RnPat import DynFlags import BasicTypes ( FixityDirection(..), Fixity(..), minPrecedence ) import PrelNames -import FieldLabel import Name import NameSet diff --git a/compiler/rename/RnSource.hs b/compiler/rename/RnSource.hs index dd36652..aaa4b73 100644 --- a/compiler/rename/RnSource.hs +++ b/compiler/rename/RnSource.hs @@ -25,7 +25,6 @@ import RnHsDoc ( rnHsDoc, rnMbLHsDoc ) import TcAnnotations ( annCtxt ) import TcRnMonad -import IfaceEnv import ForeignCall ( CCallTarget(..) ) import Module import HscTypes ( Warnings(..), plusWarns ) @@ -35,7 +34,6 @@ import Name import NameSet import NameEnv import Avail -import DataCon import Outputable import Bag import BasicTypes ( RuleName ) @@ -46,11 +44,10 @@ import HscTypes ( HscEnv, hsc_dflags ) import ListSetOps ( findDupsEq, removeDups ) import Digraph ( SCC, flattenSCC, stronglyConnCompFromEdgedVertices ) import Util ( mapSnd ) -import State import Control.Monad import Data.List( partition, sortBy ) -import Maybes( orElse, mapMaybe, expectJust ) +import Maybes( orElse, mapMaybe ) #if __GLASGOW_HASKELL__ < 709 import Data.Traversable (traverse) #endif @@ -218,12 +215,6 @@ rnSrcDecls extra_deps group@(HsGroup { hs_valds = val_decls, return (final_tcg_env, rn_group) }}}} --- some utils because we do this a bunch above --- compute and install the new env -inNewEnv :: TcM TcGblEnv -> (TcGblEnv -> TcM a) -> TcM a -inNewEnv env cont = do e <- env - setGblEnv e $ cont e - addTcgDUs :: TcGblEnv -> DefUses -> TcGblEnv -- This function could be defined lower down in the module hierarchy, -- but there doesn't seem anywhere very logical to put it. diff --git a/compiler/rename/RnTypes.hs b/compiler/rename/RnTypes.hs index 6fec5f2..208fbf1 100644 --- a/compiler/rename/RnTypes.hs +++ b/compiler/rename/RnTypes.hs @@ -48,7 +48,7 @@ import BasicTypes ( compareFixity, funTyFixity, negateFixity, import Outputable import FastString import Maybes -import Data.List ( nub, nubBy, find, deleteFirstsBy ) +import Data.List ( nub, nubBy, deleteFirstsBy ) import Control.Monad ( unless, when ) #if __GLASGOW_HASKELL__ < 709 diff --git a/compiler/typecheck/TcInstDcls.hs b/compiler/typecheck/TcInstDcls.hs index 9742e71..2c9a980 100644 --- a/compiler/typecheck/TcInstDcls.hs +++ b/compiler/typecheck/TcInstDcls.hs @@ -61,7 +61,7 @@ import Util import BooleanFormula ( isUnsatisfied, pprBooleanFormulaNice ) import Control.Monad -import Maybes ( isNothing, isJust, whenIsJust, catMaybes, expectJust ) +import Maybes ( isNothing, isJust, whenIsJust, catMaybes ) import Data.List ( mapAccumL, partition ) {- From git at git.haskell.org Tue Jul 14 20:53:23 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 14 Jul 2015 20:53:23 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Use Maybe Name instead of Parent where that's what we mean (ac647b3) Message-ID: <20150714205323.B599A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/ac647b3d530777cd247b4ed5d9c65b200ddf9529/ghc >--------------------------------------------------------------- commit ac647b3d530777cd247b4ed5d9c65b200ddf9529 Author: Adam Gundry Date: Tue Jul 14 21:01:13 2015 +0100 Use Maybe Name instead of Parent where that's what we mean >--------------------------------------------------------------- ac647b3d530777cd247b4ed5d9c65b200ddf9529 compiler/rename/RnEnv.hs | 21 +++++++++------------ compiler/rename/RnPat.hs | 15 ++++++++------- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/compiler/rename/RnEnv.hs b/compiler/rename/RnEnv.hs index 73aa90d..c938d73 100644 --- a/compiler/rename/RnEnv.hs +++ b/compiler/rename/RnEnv.hs @@ -414,7 +414,7 @@ lookupInstDeclBndr cls what rdr -- warnings when a deprecated class -- method is defined. We only warn -- when it's used - (ParentIs cls) doc rdr } + (Just cls) doc rdr } where doc = what <+> ptext (sLit "of class") <+> quotes (ppr cls) @@ -461,8 +461,8 @@ lookupConstructorFields con_name -- unambiguous because there is only one field id 'fld' in scope. -- But currently it's rejected. lookupSubBndrOcc :: Bool - -> Parent -- NoParent => just look it up as usual - -- ParentIs p => use p to disambiguate + -> Maybe Name -- Nothing => just look it up as usual + -- Just p => use parent p to disambiguate -> SDoc -> RdrName -> RnM Name lookupSubBndrOcc warnIfDeprec parent doc rdr_name @@ -496,19 +496,16 @@ lookupSubBndrOcc warnIfDeprec parent doc rdr_name | isQual rdr_name = rdr_name | otherwise = greUsedRdrName gre -lookupSubBndrGREs :: GlobalRdrEnv -> Parent -> RdrName -> [GlobalRdrElt] --- If Parent = NoParent, just do a normal lookup --- If Parent = Parent p then find all GREs that +lookupSubBndrGREs :: GlobalRdrEnv -> Maybe Name -> RdrName -> [GlobalRdrElt] +-- If parent = Nothing, just do a normal lookup +-- If parent = Just p then find all GREs that -- (a) have parent p -- (b) for Unqual, are in scope qualified or unqualified -- for Qual, are in scope with that qualification lookupSubBndrGREs env parent rdr_name = case parent of - NoParent -> pickGREs rdr_name gres - ParentIs p - | isUnqual rdr_name -> filter (parent_is p) gres - | otherwise -> filter (parent_is p) (pickGREs rdr_name gres) - FldParent { par_is = p } + Nothing -> pickGREs rdr_name gres + Just p | isUnqual rdr_name -> filter (parent_is p) gres | otherwise -> filter (parent_is p) (pickGREs rdr_name gres) @@ -1196,7 +1193,7 @@ lookupBindGroupOcc ctxt what rdr_name where lookup_cls_op cls = do { env <- getGlobalRdrEnv - ; let gres = lookupSubBndrGREs env (ParentIs cls) rdr_name + ; let gres = lookupSubBndrGREs env (Just cls) rdr_name ; case gres of [] -> return (Left (unknownSubordinateErr doc rdr_name)) (gre:_) -> return (Right (gre_name gre)) } diff --git a/compiler/rename/RnPat.hs b/compiler/rename/RnPat.hs index 9bd3718..08c836b 100644 --- a/compiler/rename/RnPat.hs +++ b/compiler/rename/RnPat.hs @@ -552,7 +552,8 @@ rnHsRecFields ctxt mk_arg (HsRecFields { rec_flds = flds, rec_dotdot = dotdot }) Nothing -> ptext (sLit "constructor field name") Just con -> ptext (sLit "field of constructor") <+> quotes (ppr con) - rn_fld :: Bool -> Parent -> LHsRecField RdrName (Located arg) -> RnM (LHsRecField Name (Located arg)) + rn_fld :: Bool -> Maybe Name -> LHsRecField RdrName (Located arg) + -> RnM (LHsRecField Name (Located arg)) rn_fld pun_ok parent (L l (HsRecField { hsRecFieldLbl = L loc (FieldOcc lbl _) , hsRecFieldArg = arg , hsRecPun = pun })) @@ -611,7 +612,7 @@ rnHsRecFields ctxt mk_arg (HsRecFields { rec_flds = flds, rec_dotdot = dotdot }) HsRecFieldCon {} -> arg_in_scope lbl _other -> True ] - ; addUsedRdrNames (map (\ (_, _, gre) -> greUsedRdrName gre) dot_dot_gres) -- AMG TODO wrong + ; addUsedRdrNames (map (\ (_, _, gre) -> greUsedRdrName gre) dot_dot_gres) ; return [ L loc (HsRecField { hsRecFieldLbl = L loc (FieldOcc arg_rdr sel) , hsRecFieldArg = L loc (mk_arg arg_rdr) @@ -619,12 +620,12 @@ rnHsRecFields ctxt mk_arg (HsRecFields { rec_flds = flds, rec_dotdot = dotdot }) | (lbl, sel, _) <- dot_dot_gres , let arg_rdr = mkVarUnqual lbl ] } - check_disambiguation :: Bool -> Maybe Name -> RnM Parent - -- When disambiguation is on, + check_disambiguation :: Bool -> Maybe Name -> RnM (Maybe Name) + -- When disambiguation is on, return name of parent tycon. check_disambiguation disambig_ok mb_con | disambig_ok, Just con <- mb_con - = do { env <- getGlobalRdrEnv; return (ParentIs (find_tycon env con)) } - | otherwise = return NoParent + = do { env <- getGlobalRdrEnv; return (Just (find_tycon env con)) } + | otherwise = return Nothing find_tycon :: GlobalRdrEnv -> Name {- DataCon -} -> Name {- TyCon -} -- Return the parent *type constructor* of the data constructor @@ -676,7 +677,7 @@ rnHsRecUpdFields flds Nothing -> do { addErr (unknownSubordinateErr doc lbl) ; return (Right []) } Just r -> return r } - else fmap Left $ lookupSubBndrOcc True NoParent doc lbl + else fmap Left $ lookupSubBndrOcc True Nothing doc lbl ; arg' <- if pun then do { checkErr pun_ok (badPun (L loc lbl)) ; return (L loc (HsVar lbl)) } From git at git.haskell.org Tue Jul 14 20:53:26 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 14 Jul 2015 20:53:26 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Update haddock submodule (af108c6) Message-ID: <20150714205326.86AF23A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/af108c62665e38666fc2a4359ca596cf7e1727a7/ghc >--------------------------------------------------------------- commit af108c62665e38666fc2a4359ca596cf7e1727a7 Author: Adam Gundry Date: Tue Jul 14 21:42:33 2015 +0100 Update haddock submodule >--------------------------------------------------------------- af108c62665e38666fc2a4359ca596cf7e1727a7 utils/haddock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/haddock b/utils/haddock index 637b695..eb0a6a5 160000 --- a/utils/haddock +++ b/utils/haddock @@ -1 +1 @@ -Subproject commit 637b695e6a72083d81748af56c667b8e83d977fd +Subproject commit eb0a6a5e9866db38d811123c9fd55bceaf913b49 From git at git.haskell.org Tue Jul 14 20:53:29 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 14 Jul 2015 20:53:29 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Get rid of OverloadedRecordFields for now; add ADRF to T4437 (5ea8a42) Message-ID: <20150714205329.5D9C13A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/5ea8a4239755076537e381ffa3410c536db37308/ghc >--------------------------------------------------------------- commit 5ea8a4239755076537e381ffa3410c536db37308 Author: Adam Gundry Date: Tue Jul 14 21:48:07 2015 +0100 Get rid of OverloadedRecordFields for now; add ADRF to T4437 >--------------------------------------------------------------- 5ea8a4239755076537e381ffa3410c536db37308 compiler/main/DynFlags.hs | 5 +---- compiler/rename/RnEnv.hs | 2 +- compiler/typecheck/TcRnTypes.hs | 9 ++++----- testsuite/tests/driver/T4437.hs | 2 +- 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 79d81e1..3ce5605 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -640,7 +640,6 @@ data ExtensionFlag | Opt_BinaryLiterals | Opt_NegativeLiterals | Opt_AllowDuplicateRecordFields - | Opt_OverloadedRecordFields | Opt_EmptyCase | Opt_PatternSynonyms | Opt_PartialTypeSignatures @@ -3153,7 +3152,6 @@ xFlags = [ flagSpec' "OverlappingInstances" Opt_OverlappingInstances setOverlappingInsts, flagSpec "OverloadedLists" Opt_OverloadedLists, - flagSpec "OverloadedRecordFields" Opt_OverloadedRecordFields, flagSpec "OverloadedStrings" Opt_OverloadedStrings, flagSpec "PackageImports" Opt_PackageImports, flagSpec "ParallelArrays" Opt_ParallelArrays, @@ -3278,8 +3276,7 @@ impliedXFlags , (Opt_DeriveTraversable, turnOn, Opt_DeriveFunctor) , (Opt_DeriveTraversable, turnOn, Opt_DeriveFoldable) - -- Overloaded record fields require field disambiguation - , (Opt_OverloadedRecordFields, turnOn, Opt_AllowDuplicateRecordFields) + -- Duplicate record fields require field disambiguation , (Opt_AllowDuplicateRecordFields, turnOn, Opt_DisambiguateRecordFields) ] diff --git a/compiler/rename/RnEnv.hs b/compiler/rename/RnEnv.hs index c938d73..c5a071f 100644 --- a/compiler/rename/RnEnv.hs +++ b/compiler/rename/RnEnv.hs @@ -949,7 +949,7 @@ Note [Handling of deprecations] -} addUsedSelector :: Name -> RnM () --- Record usage of record selectors by OverloadedRecordFields +-- Record usage of record selectors by AllowDuplicateRecordFields addUsedSelector n = do { env <- getGblEnv ; updMutVar (tcg_used_selectors env) (\s -> extendNameSet s n) } diff --git a/compiler/typecheck/TcRnTypes.hs b/compiler/typecheck/TcRnTypes.hs index e1d71f6..dc14bf8 100644 --- a/compiler/typecheck/TcRnTypes.hs +++ b/compiler/typecheck/TcRnTypes.hs @@ -581,11 +581,10 @@ We gather three sorts of usage information is unnecessary. This info isn't present in Names. * tcg_used_selectors - Records the Names of record selectors that are used during - typechecking (by the OverloadedRecordFields extension). These - may otherwise be missed from tcg_used_rdrnames as they need - not actually occur in the source text: they might be needed - only to satisfy a Has constraint, for example. + Records the Names of record selectors that are used + by the AllowDuplicateRecordFields extension. These + may otherwise be missed from tcg_used_rdrnames as a + single RdrName might refer to multiple fields. ************************************************************************ diff --git a/testsuite/tests/driver/T4437.hs b/testsuite/tests/driver/T4437.hs index 9ff2d7f..aa1d17f 100644 --- a/testsuite/tests/driver/T4437.hs +++ b/testsuite/tests/driver/T4437.hs @@ -33,7 +33,7 @@ expectedGhcOnlyExtensions :: [String] expectedGhcOnlyExtensions = ["RelaxedLayout", "AlternativeLayoutRule", "AlternativeLayoutRuleTransitional", - "OverloadedRecordFields", + "AllowDuplicateRecordFields", "StaticPointers"] expectedCabalOnlyExtensions :: [String] From git at git.haskell.org Tue Jul 14 20:53:32 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 14 Jul 2015 20:53:32 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Tweak test output for T7145b (e9aab57) Message-ID: <20150714205332.2D2CB3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/e9aab5772724dc3b8aa8c5df179fdd9d61cfabb8/ghc >--------------------------------------------------------------- commit e9aab5772724dc3b8aa8c5df179fdd9d61cfabb8 Author: Adam Gundry Date: Tue Jul 14 21:50:07 2015 +0100 Tweak test output for T7145b >--------------------------------------------------------------- e9aab5772724dc3b8aa8c5df179fdd9d61cfabb8 testsuite/tests/rename/should_compile/T7145b.stderr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/tests/rename/should_compile/T7145b.stderr b/testsuite/tests/rename/should_compile/T7145b.stderr index d5f7c08..ed2333e 100644 --- a/testsuite/tests/rename/should_compile/T7145b.stderr +++ b/testsuite/tests/rename/should_compile/T7145b.stderr @@ -1,2 +1,2 @@ -T7145b.hs:7:1: Warning: Defined but not used: ?T7145b.pure? +T7145b.hs:7:1: Warning: Defined but not used: ?pure? From git at git.haskell.org Wed Jul 15 08:09:20 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 15 Jul 2015 08:09:20 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: parser: Allow Lm (MODIFIER LETTER) category in identifiers (358e0a8) Message-ID: <20150715080920.088E93A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/358e0a8d4cb49baa29cf6b001eaa9d4ac428bb2d/ghc >--------------------------------------------------------------- commit 358e0a8d4cb49baa29cf6b001eaa9d4ac428bb2d Author: Thomas Miedema Date: Fri Jul 3 22:37:18 2015 +0200 parser: Allow Lm (MODIFIER LETTER) category in identifiers Easy fix in the parser to stop regressions, due to Unicode 7.0 changing the classification of some prior code points. Signed-off-by: Austin Seipp Test Plan: `tests/parser/should_compile/T10196.hs` Reviewers: hvr, austin, bgamari Reviewed By: austin, bgamari Subscribers: thomie, bgamari Differential Revision: https://phabricator.haskell.org/D969 GHC Trac Issues: #10196 >--------------------------------------------------------------- 358e0a8d4cb49baa29cf6b001eaa9d4ac428bb2d compiler/basicTypes/Lexeme.hs | 11 ++++++++++- compiler/parser/Lexer.x | 8 ++++++-- compiler/utils/Util.hs | 14 ++++++++++++++ testsuite/tests/parser/should_compile/T10196.hs | 13 +++++++++++++ testsuite/tests/parser/should_compile/all.T | 1 + testsuite/tests/parser/should_fail/T10196Fail1.hs | 4 ++++ testsuite/tests/parser/should_fail/T10196Fail1.stderr | 2 ++ testsuite/tests/parser/should_fail/T10196Fail2.hs | 4 ++++ testsuite/tests/parser/should_fail/T10196Fail2.stderr | 2 ++ testsuite/tests/parser/should_fail/T10196Fail3.hs | 6 ++++++ testsuite/tests/parser/should_fail/T10196Fail3.stderr | 2 ++ testsuite/tests/parser/should_fail/all.T | 3 +++ 12 files changed, 67 insertions(+), 3 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 358e0a8d4cb49baa29cf6b001eaa9d4ac428bb2d From git at git.haskell.org Wed Jul 15 08:09:23 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 15 Jul 2015 08:09:23 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Do not optimise RULE lhs in substRule (3794b59) Message-ID: <20150715080923.971D93A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/3794b597896e1138e23043de5646e60e3d011b27/ghc >--------------------------------------------------------------- commit 3794b597896e1138e23043de5646e60e3d011b27 Author: Simon Peyton Jones Date: Mon Jul 13 10:29:18 2015 +0100 Do not optimise RULE lhs in substRule This was causing Trac #10627. See Note [Substitute lazily] in CoreSubst. The bug was introduced by commit 30c17e7096919c55218083c8fcb98e6287552058 Author: simonpj at microsoft.com Date: Thu Nov 25 17:23:56 2010 +0000 Substitution should just substitute, not optimise The fix is not to optimise the RHS as well as not-optimising the LHS! The simplifier does the right thing in Simplify.simplRule >--------------------------------------------------------------- 3794b597896e1138e23043de5646e60e3d011b27 compiler/coreSyn/CoreSubst.hs | 31 ++++++++++++++++------ testsuite/tests/simplCore/should_compile/T10627.hs | 17 ++++++++++++ testsuite/tests/simplCore/should_compile/all.T | 1 + 3 files changed, 41 insertions(+), 8 deletions(-) diff --git a/compiler/coreSyn/CoreSubst.hs b/compiler/coreSyn/CoreSubst.hs index 26732a2..fa83f41 100644 --- a/compiler/coreSyn/CoreSubst.hs +++ b/compiler/coreSyn/CoreSubst.hs @@ -780,15 +780,16 @@ substRule _ _ rule@(BuiltinRule {}) = rule substRule subst subst_ru_fn rule@(Rule { ru_bndrs = bndrs, ru_args = args , ru_fn = fn_name, ru_rhs = rhs , ru_local = is_local }) - = rule { ru_bndrs = bndrs', - ru_fn = if is_local + = rule { ru_bndrs = bndrs' + , ru_fn = if is_local then subst_ru_fn fn_name - else fn_name, - ru_args = map (substExpr (text "subst-rule" <+> ppr fn_name) subst') args, - ru_rhs = simpleOptExprWith subst' rhs } - -- Do simple optimisation on RHS, in case substitution lets - -- you improve it. The real simplifier never gets to look at it. + else fn_name + , ru_args = map (substExpr doc subst') args + , ru_rhs = substExpr (text "foo") subst' rhs } + -- Do NOT optimise the RHS (previously we did simplOptExpr here) + -- See Note [Substitute lazily] where + doc = ptext (sLit "subst-rule") <+> ppr fn_name (subst', bndrs') = substBndrs subst bndrs ------------------ @@ -818,8 +819,22 @@ substTickish subst (Breakpoint n ids) = Breakpoint n (map do_one ids) where do_one = getIdFromTrivialExpr . lookupIdSubst (text "subst_tickish") subst substTickish _subst other = other -{- Note [substTickish] +{- Note [Substitute lazily] +~~~~~~~~~~~~~~~~~~~~~~~~~~~ +The functions that substitute over IdInfo must be pretty lazy, becuause +they are knot-tied by substRecBndrs. +One case in point was Trac #10627 in which a rule for a function 'f' +referred to 'f' (at a differnet type) on the RHS. But instead of just +substituting in the rhs of the rule, we were calling simpleOptExpr, which +looked at the idInfo for 'f'; result <>. + +In any case we don't need to optimise the RHS of rules, or unfoldings, +because the simplifier will do that. + + +Note [substTickish] +~~~~~~~~~~~~~~~~~~~~~~ A Breakpoint contains a list of Ids. What happens if we ever want to substitute an expression for one of these Ids? diff --git a/testsuite/tests/simplCore/should_compile/T10627.hs b/testsuite/tests/simplCore/should_compile/T10627.hs new file mode 100644 index 0000000..6b4d73a --- /dev/null +++ b/testsuite/tests/simplCore/should_compile/T10627.hs @@ -0,0 +1,17 @@ +-- Made GHC 6.10.2 go into a loop in substRecBndrs +{-# OPTIONS_GHC -w #-} + +module T10627 where + +import Data.Word + +class C a where + splitFraction :: a -> (b,a) + +roundSimple :: (C a) => a -> b +roundSimple x = error "rik" + +{-# RULES + "rs" roundSimple = (fromIntegral :: Int -> Word) . roundSimple; + #-} + diff --git a/testsuite/tests/simplCore/should_compile/all.T b/testsuite/tests/simplCore/should_compile/all.T index 84e9c6d..6a211fb 100644 --- a/testsuite/tests/simplCore/should_compile/all.T +++ b/testsuite/tests/simplCore/should_compile/all.T @@ -211,3 +211,4 @@ test('T9583', only_ways(['optasm']), compile, ['']) test('T9565', only_ways(['optasm']), compile, ['']) test('T10176', only_ways(['optasm']), compile, ['']) test('T10602', only_ways(['optasm']), compile, ['-O2']) +test('T10627', only_ways(['optasm']), compile, ['']) From git at git.haskell.org Wed Jul 15 08:09:26 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 15 Jul 2015 08:09:26 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Make sure rule LHSs are simplified (3cadf44) Message-ID: <20150715080926.E49053A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/3cadf440c490abc1c8d5d45f5d034809c8912815/ghc >--------------------------------------------------------------- commit 3cadf440c490abc1c8d5d45f5d034809c8912815 Author: Simon Peyton Jones Date: Mon Jul 13 12:58:34 2015 +0100 Make sure rule LHSs are simplified SpecConstr was generating a rule LHS with nested casts, which the simplifier then optimised away. Result: unbound template variables. Easily fixed. See Note [SpecConstr call patterns] >--------------------------------------------------------------- 3cadf440c490abc1c8d5d45f5d034809c8912815 compiler/specialise/SpecConstr.hs | 25 ++++++++++-- testsuite/tests/simplCore/should_compile/T10602.hs | 46 +++++++++------------- .../tests/simplCore/should_compile/T10602b.hs | 20 ++++++++++ testsuite/tests/simplCore/should_compile/all.T | 2 +- 4 files changed, 61 insertions(+), 32 deletions(-) diff --git a/compiler/specialise/SpecConstr.hs b/compiler/specialise/SpecConstr.hs index 9b24604..c5d286d 100644 --- a/compiler/specialise/SpecConstr.hs +++ b/compiler/specialise/SpecConstr.hs @@ -1144,7 +1144,9 @@ scExpr' _ e@(Lit {}) = return (nullUsage, e) scExpr' env (Tick t e) = do (usg, e') <- scExpr env e return (usg, Tick t e') scExpr' env (Cast e co) = do (usg, e') <- scExpr env e - return (usg, Cast e' (scSubstCo env co)) + return (usg, mkCast e' (scSubstCo env co)) + -- Important to use mkCast here + -- See Note [SpecConstr call patterns] scExpr' env e@(App _ _) = scApp env (collectArgs e) scExpr' env (Lam b e) = do let (env', b') = extendBndr env b (usg, e') <- scExpr env' e @@ -1727,9 +1729,27 @@ BUT phantom type synonyms can mess this reasoning up, eg x::T b with type T b = Int So we apply expandTypeSynonyms to the bound Ids. See Trac # 5458. Yuk. + +Note [SpecConstr call patterns] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +A "call patterns" that we collect is going to become the LHS of a RULE. +It's important that it doesn't have + e |> Refl +or + e |> g1 |> g2 +because both of these will be optimised by Simplify.simplRule. In the +former case such optimisation benign, because the rule will match more +terms; but in the latter we may lose a binding of 'g1' or 'g2', and +end up with a rule LHS that doesn't bind the template variables (Trac +#10602). + +The simplifier eliminates such things, but SpecConstr itself constructs +new terms by substituting. So the 'mkCast' in the Cast case of scExpr +is very important! -} type CallPat = ([Var], [CoreExpr]) -- Quantified variables and arguments + -- See Note [SpecConstr call patterns] callsToPats :: ScEnv -> [OneSpec] -> [ArgOcc] -> [Call] -> UniqSM (Bool, [CallPat]) -- Result has no duplicate patterns, @@ -1849,9 +1869,6 @@ argToPat env in_scope val_env (Case scrut _ _ [(_, _, rhs)]) arg_occ -} argToPat env in_scope val_env (Cast arg co) arg_occ - | isReflCo co -- Substitution in the SpecConstr itself - -- can lead to identity coercions - = argToPat env in_scope val_env arg arg_occ | not (ignoreType env ty2) = do { (interesting, arg') <- argToPat env in_scope val_env arg arg_occ ; if not interesting then diff --git a/testsuite/tests/simplCore/should_compile/T10602.hs b/testsuite/tests/simplCore/should_compile/T10602.hs index fc2523d..c29d743 100644 --- a/testsuite/tests/simplCore/should_compile/T10602.hs +++ b/testsuite/tests/simplCore/should_compile/T10602.hs @@ -1,34 +1,26 @@ -import Control.Monad -import Data.Binary -import Data.List +{-# OPTIONS_GHC -O2 #-} +{-# OPTIONS_GHC -fno-warn-missing-methods #-} +{-# LANGUAGE NoImplicitPrelude #-} +-- {-# OPTIONS_GHC -fno-spec-constr #-} -- Makes the problem go away. +-- {-# OPTIONS_GHC -fspec-constr-count=1 #-} -- Makes the problem go away. -newtype A a = A [a] +module T10602 where -instance Binary a => Binary (A a) where - put (A xs) = case splitAt 254 xs of - (_, []) -> mapM_ put xs - (a, b) -> put (A b) +-- Copy-pasting T10602b.hs into the current module makes the problem go away. +import T10602b - get = do xs <- replicateM 254 get - A ys <- get - return $ A $ xs ++ ys +data PairS a = PairS a a -main :: IO () -main = undefined +-- Removing the '~' makes the problem go away. +(PairS _ _) >> ~(PairS b g) = PairS b g -{- -This intermittently failed with although I was never able to reliably reproduce, +class Binary t where + put :: t -> PairS () -$ ./inplace/bin/ghc-stage2 -O2 Test.hs -fforce-recomp -[1 of 1] Compiling Main ( Test.hs, Test.o ) -ghc-stage2: panic! (the 'impossible' happened) - (GHC version 7.10.1.20150708 for x86_64-unknown-linux): - Template variable unbound in rewrite rule - sg_s5zh - [sc_s5zf, sc_s5zg, sg_s5zh, sg_s5zi] - [sc_s5zf, sc_s5zg, sg_s5zh, sg_s5zi] - [: @ a_a3fv sc_s5zf sc_s5zg] - [: @ a_a3fv sc_s5zb sc_s5zc] +-- Not using a newtype makes the problem go away. +newtype A a = A [a] -Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug --} +instance Binary a => Binary (A a) where + put (A xs) = case splitAt 254 xs of + (_, []) -> foldr (>>) (PairS () ()) (map put xs) + (_, b) -> put (A b) diff --git a/testsuite/tests/simplCore/should_compile/T10602b.hs b/testsuite/tests/simplCore/should_compile/T10602b.hs new file mode 100644 index 0000000..f90ad0a --- /dev/null +++ b/testsuite/tests/simplCore/should_compile/T10602b.hs @@ -0,0 +1,20 @@ +{-# OPTIONS_GHC -O2 #-} +{-# LANGUAGE NoImplicitPrelude #-} +module T10602b (splitAt, map, foldr) where + +import GHC.Classes +import GHC.Types +import GHC.Num +import GHC.Base + +splitAt :: Int -> [a] -> ([a],[a]) +splitAt n ls + | n <= 0 = ([], ls) + | otherwise = splitAt' n ls + where + splitAt' :: Int -> [a] -> ([a], [a]) + splitAt' _ [] = ([], []) + splitAt' 1 (x:xs) = ([x], xs) + splitAt' m (x:xs) = (x:xs', xs'') + where + (xs', xs'') = splitAt' (m - 1) xs diff --git a/testsuite/tests/simplCore/should_compile/all.T b/testsuite/tests/simplCore/should_compile/all.T index 6a211fb..d2be73e 100644 --- a/testsuite/tests/simplCore/should_compile/all.T +++ b/testsuite/tests/simplCore/should_compile/all.T @@ -210,5 +210,5 @@ test('T9400', only_ways(['optasm']), compile, ['-O0 -ddump-simpl -dsuppress-uniq test('T9583', only_ways(['optasm']), compile, ['']) test('T9565', only_ways(['optasm']), compile, ['']) test('T10176', only_ways(['optasm']), compile, ['']) -test('T10602', only_ways(['optasm']), compile, ['-O2']) +test('T10602', only_ways(['optasm']), multimod_compile, ['T10602','-v0']) test('T10627', only_ways(['optasm']), compile, ['']) From git at git.haskell.org Wed Jul 15 08:10:01 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 15 Jul 2015 08:10:01 +0000 (UTC) Subject: [commit: ghc] wip/impredicativity: Simplify canonicalization rules (5a5bbb8) Message-ID: <20150715081001.52C833A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/impredicativity Link : http://ghc.haskell.org/trac/ghc/changeset/5a5bbb81f6f624f4477b852f7a0921c868160922/ghc >--------------------------------------------------------------- commit 5a5bbb81f6f624f4477b852f7a0921c868160922 Author: Alejandro Serrano Date: Wed Jul 15 10:10:48 2015 +0200 Simplify canonicalization rules >--------------------------------------------------------------- 5a5bbb81f6f624f4477b852f7a0921c868160922 compiler/typecheck/TcCanonical.hs | 55 ++++++++++++--------------------------- docs/types/impredicativity.ltx | 46 ++++++++++++++++++-------------- 2 files changed, 42 insertions(+), 59 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 5a5bbb81f6f624f4477b852f7a0921c868160922 From git at git.haskell.org Wed Jul 15 08:27:10 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 15 Jul 2015 08:27:10 +0000 (UTC) Subject: [commit: ghc] master: Mark test case for #10294 expect_broken on #10301 (4ee658a0) Message-ID: <20150715082710.619AA3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/4ee658a02ccc6d3aa0b6a0a5f2f5934a593f1356/ghc >--------------------------------------------------------------- commit 4ee658a02ccc6d3aa0b6a0a5f2f5934a593f1356 Author: Joachim Breitner Date: Wed Jul 15 10:26:05 2015 +0200 Mark test case for #10294 expect_broken on #10301 as it is broken on Travis, and in #10301 others have reported the same error. >--------------------------------------------------------------- 4ee658a02ccc6d3aa0b6a0a5f2f5934a593f1356 testsuite/tests/plugins/all.T | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/testsuite/tests/plugins/all.T b/testsuite/tests/plugins/all.T index 62e6923..7c52e07 100644 --- a/testsuite/tests/plugins/all.T +++ b/testsuite/tests/plugins/all.T @@ -52,7 +52,8 @@ test('T10420', test('T10294', [pre_cmd('$MAKE -s --no-print-directory -C annotation-plugin package.T10294'), - clean_cmd('$MAKE -s --no-print-directory -C annotation-plugin clean.T10294')], + clean_cmd('$MAKE -s --no-print-directory -C annotation-plugin clean.T10294'), + expect_broken(10301)], run_command, ['$MAKE -s --no-print-directory T10294']) From git at git.haskell.org Wed Jul 15 08:29:10 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 15 Jul 2015 08:29:10 +0000 (UTC) Subject: [commit: ghc] master: Flush stdout in test case for #10596 (0a40278) Message-ID: <20150715082910.6B87B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/0a402785c9c5ab4be9487518790d24af9d211a8b/ghc >--------------------------------------------------------------- commit 0a402785c9c5ab4be9487518790d24af9d211a8b Author: Joachim Breitner Date: Wed Jul 15 10:29:26 2015 +0200 Flush stdout in test case for #10596 which might help, as it has helped with lots of other TH-related test cases in the past. >--------------------------------------------------------------- 0a402785c9c5ab4be9487518790d24af9d211a8b testsuite/tests/th/T10596.hs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/testsuite/tests/th/T10596.hs b/testsuite/tests/th/T10596.hs index c861156..35d59e9 100644 --- a/testsuite/tests/th/T10596.hs +++ b/testsuite/tests/th/T10596.hs @@ -2,10 +2,13 @@ module T10596 where import Language.Haskell.TH import Language.Haskell.TH.Syntax +import System.IO + do putQ (100 :: Int) x <- (getQ :: Q (Maybe Int)) -- It should print "Just 100" runIO $ print x + runIO $ hFlush stdout return [] From git at git.haskell.org Wed Jul 15 08:41:36 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 15 Jul 2015 08:41:36 +0000 (UTC) Subject: [commit: ghc] master: Mark test case for #10294 conditionally expect_broken on #10301 (8e6a503) Message-ID: <20150715084136.423403A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/8e6a50339a4a61d4f2cbec645c78abc85098a294/ghc >--------------------------------------------------------------- commit 8e6a50339a4a61d4f2cbec645c78abc85098a294 Author: Joachim Breitner Date: Wed Jul 15 10:41:03 2015 +0200 Mark test case for #10294 conditionally expect_broken on #10301 the hypothesis is that it only breaks with `DYNAMIC_GHC_PROGRAMS = NO`, so use `unless(have_dynamic(),expect_broken(10301))` to not break the Phabricator build. >--------------------------------------------------------------- 8e6a50339a4a61d4f2cbec645c78abc85098a294 testsuite/tests/plugins/all.T | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/tests/plugins/all.T b/testsuite/tests/plugins/all.T index 7c52e07..473bed3 100644 --- a/testsuite/tests/plugins/all.T +++ b/testsuite/tests/plugins/all.T @@ -53,7 +53,7 @@ test('T10420', test('T10294', [pre_cmd('$MAKE -s --no-print-directory -C annotation-plugin package.T10294'), clean_cmd('$MAKE -s --no-print-directory -C annotation-plugin clean.T10294'), - expect_broken(10301)], + when(have_dynamic(),expect_broken(10301))], run_command, ['$MAKE -s --no-print-directory T10294']) From git at git.haskell.org Wed Jul 15 09:32:11 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 15 Jul 2015 09:32:11 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Do not treat prim and javascript imports as C imports in TH and QQ (98587f0) Message-ID: <20150715093211.635DE3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/98587f0c34b15ed307a9a6f8ebc50fb5339b4042/ghc >--------------------------------------------------------------- commit 98587f0c34b15ed307a9a6f8ebc50fb5339b4042 Author: Ben Gamari Date: Wed Jul 15 10:19:33 2015 +0200 Do not treat prim and javascript imports as C imports in TH and QQ This fixes trac Trac #10638. >--------------------------------------------------------------- 98587f0c34b15ed307a9a6f8ebc50fb5339b4042 compiler/deSugar/DsMeta.hs | 8 +++++--- compiler/hsSyn/Convert.hs | 14 ++++++++++---- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/compiler/deSugar/DsMeta.hs b/compiler/deSugar/DsMeta.hs index 63b6539..6eeba5e 100644 --- a/compiler/deSugar/DsMeta.hs +++ b/compiler/deSugar/DsMeta.hs @@ -491,12 +491,14 @@ repForD (L loc (ForeignImport name typ _ (CImport (L _ cc) (L _ s) mch cis _))) conv_cimportspec (CFunction (StaticTarget fs _ True)) = return (unpackFS fs) conv_cimportspec (CFunction (StaticTarget _ _ False)) = panic "conv_cimportspec: values not supported yet" conv_cimportspec CWrapper = return "wrapper" + -- these calling conventions do not support headers and the static keyword + raw_cconv = cc == PrimCallConv || cc == JavaScriptCallConv static = case cis of - CFunction (StaticTarget _ _ _) -> "static " + CFunction (StaticTarget _ _ _) | not raw_cconv -> "static " _ -> "" chStr = case mch of - Nothing -> "" - Just (Header h) -> unpackFS h ++ " " + Just (Header h) | not raw_cconv -> unpackFS h ++ " " + _ -> "" repForD decl = notHandled "Foreign declaration" (ppr decl) repCCallConv :: CCallConv -> DsM (Core TH.Callconv) diff --git a/compiler/hsSyn/Convert.hs b/compiler/hsSyn/Convert.hs index 03c9bf5..8ffda3a 100644 --- a/compiler/hsSyn/Convert.hs +++ b/compiler/hsSyn/Convert.hs @@ -476,16 +476,22 @@ noExistentials = [] cvtForD :: Foreign -> CvtM (ForeignDecl RdrName) cvtForD (ImportF callconv safety from nm ty) + | callconv == TH.Prim || callconv == TH.JavaScript + = mk_imp (CImport (noLoc (cvt_conv callconv)) (noLoc safety') Nothing + (CFunction (StaticTarget (mkFastString from) Nothing True)) + (noLoc from)) | Just impspec <- parseCImport (noLoc (cvt_conv callconv)) (noLoc safety') (mkFastString (TH.nameBase nm)) from (noLoc from) - = do { nm' <- vNameL nm - ; ty' <- cvtType ty - ; return (ForeignImport nm' ty' noForeignImportCoercionYet impspec) - } + = mk_imp impspec | otherwise = failWith $ text (show from) <+> ptext (sLit "is not a valid ccall impent") where + mk_imp impspec + = do { nm' <- vNameL nm + ; ty' <- cvtType ty + ; return (ForeignImport nm' ty' noForeignImportCoercionYet impspec) + } safety' = case safety of Unsafe -> PlayRisky Safe -> PlaySafe From git at git.haskell.org Wed Jul 15 09:32:14 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 15 Jul 2015 09:32:14 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Make the location in TcLclEnv and CtLoc into a RealSrcSpan (00cd617) Message-ID: <20150715093214.3D5793A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/00cd6173a620ef99739d97ac843258fee8e2dee9/ghc >--------------------------------------------------------------- commit 00cd6173a620ef99739d97ac843258fee8e2dee9 Author: Simon Peyton Jones Date: Tue Jan 6 12:28:37 2015 +0000 Make the location in TcLclEnv and CtLoc into a RealSrcSpan Previously it was a SrcSpan, which can be an UnhelpulSrcSpan, but actually for TcLclEnv and CtLoc we always know it is a real source location, and it's good to make the types reflect that fact. There is a continuing slight awkwardness (not new with this patch) about what "file name" to use for GHCi code. Current we say "" which seems just about OK. >--------------------------------------------------------------- 00cd6173a620ef99739d97ac843258fee8e2dee9 compiler/ghci/RtClosureInspect.hs | 4 +-- compiler/main/HscMain.hs | 9 ++--- compiler/main/HscTypes.hs | 9 +++-- compiler/main/InteractiveEval.hs | 6 ++-- compiler/typecheck/TcErrors.hs | 4 +-- compiler/typecheck/TcRnDriver.hs | 41 ++++++++++++++-------- compiler/typecheck/TcRnMonad.hs | 33 ++++++++++------- compiler/typecheck/TcRnTypes.hs | 8 ++--- .../tests/ghci.debugger/scripts/break019.stderr | 2 +- testsuite/tests/ghci/scripts/T7894.stderr | 2 +- testsuite/tests/ghci/scripts/T9140.stdout | 2 +- testsuite/tests/ghci/scripts/ghci034.stderr | 2 +- 12 files changed, 69 insertions(+), 53 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 00cd6173a620ef99739d97ac843258fee8e2dee9 From git at git.haskell.org Wed Jul 15 09:32:17 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 15 Jul 2015 09:32:17 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Fix T10196 expected output (66428af) Message-ID: <20150715093217.01AF13A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/66428afad27ff901e96e48d554c46c96dde7fc1c/ghc >--------------------------------------------------------------- commit 66428afad27ff901e96e48d554c46c96dde7fc1c Author: Ben Gamari Date: Wed Jul 15 05:30:02 2015 -0400 Fix T10196 expected output >--------------------------------------------------------------- 66428afad27ff901e96e48d554c46c96dde7fc1c testsuite/tests/parser/should_fail/T10196Fail1.stderr | 2 +- testsuite/tests/parser/should_fail/T10196Fail2.stderr | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/testsuite/tests/parser/should_fail/T10196Fail1.stderr b/testsuite/tests/parser/should_fail/T10196Fail1.stderr index 3c4a173..c6154c7 100644 --- a/testsuite/tests/parser/should_fail/T10196Fail1.stderr +++ b/testsuite/tests/parser/should_fail/T10196Fail1.stderr @@ -1,2 +1,2 @@ -T10196Fail1.hs:4:12: error: lexical error at character '\7526' +T10196Fail1.hs:4:12: lexical error at character '\7526' diff --git a/testsuite/tests/parser/should_fail/T10196Fail2.stderr b/testsuite/tests/parser/should_fail/T10196Fail2.stderr index abba8aa..bfbd31e 100644 --- a/testsuite/tests/parser/should_fail/T10196Fail2.stderr +++ b/testsuite/tests/parser/should_fail/T10196Fail2.stderr @@ -1,2 +1,2 @@ -T10196Fail2.hs:4:1: error: lexical error at character '\7526' +T10196Fail2.hs:4:1: lexical error at character '\7526' From git at git.haskell.org Wed Jul 15 09:32:20 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 15 Jul 2015 09:32:20 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Expose source locations via Implicit Parameters of type GHC.Location.Location (e3dc280) Message-ID: <20150715093220.7A12E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/e3dc28046373f3183dda56b096dbebec865e3be7/ghc >--------------------------------------------------------------- commit e3dc28046373f3183dda56b096dbebec865e3be7 Author: Eric Seidel Date: Mon Jan 19 16:08:32 2015 -0600 Expose source locations via Implicit Parameters of type GHC.Location.Location IPs with this type will always be solved for the current source location. If another IP of the same type is in scope, the two locations will be appended, creating a call-stack. The Location type is kept abstract so users cannot create them, but a Location can be turned into a list of SrcLocs, which correspond to individual locations in a program. Each SrcLoc contains a package/module/file name and start/end lines and columns. The only thing missing from the SrcLoc in my opinion is the name of the top-level definition it inhabits. I suspect that would also be useful, but it's not clear to me how to extract the current top-level binder from within the constraint solver. (Surely I'm just missing something here?) I made the (perhaps controversial) decision to have GHC completely ignore the names of Location IPs, meaning that in the following code: bar :: (?myloc :: Location) => String bar = foo foo :: (?loc :: Location) => String foo = show ?loc if I call `bar`, the resulting call-stack will include locations for 1. the use of `?loc` inside `foo`, 2. `foo`s call-site inside `bar`, and 3. `bar`s call-site, wherever that may be. This makes Location IPs very special indeed, and I'm happy to change it if the dissonance is too great. I've also left out any changes to base to make use of Location IPs, since there were some concerns about a snowball effect. I think it would be reasonable to mark this as an experimental feature for now (it is!), and defer using it in base until we have more experience with it. It is, after all, quite easy to define your own version of `error`, `undefined`, etc. that use Location IPs. Test Plan: validate, new test-case is testsuite/tests/typecheck/should_run/IPLocation.hs Reviewers: austin, hvr, simonpj Reviewed By: simonpj Subscribers: simonmar, rodlogic, carter, thomie Differential Revision: https://phabricator.haskell.org/D578 GHC Trac Issues: #9049 Cherry-Picked-From: c024af131b9e2538486eb605ba8af6a8d10fe76d Cherry-Picked-By: Niklas Hamb?chen Changes for the cherry-pick: * Commit d2b6e767 "Make the location in TcLclEnv and CtLoc into a RealSrcSpan" was cherry-picked before to ensure that EvCsPushCall, EvCsTop :: EvCallStack can indeed carry `RealSrcSpan`s instead of `SrcSpan`s. * The use of `setWantedEvBind` was replaced by `setEvBind`, as `setWantedEvBind` is not yet present in 7.10.1; it was added to the 7.12 series in commit 32973bf3. * docs/users_guide/7.10.1-notes.xml was adjusted to contain the documentation about CallStack, copied from the 7.12 notes. >--------------------------------------------------------------- e3dc28046373f3183dda56b096dbebec865e3be7 compiler/deSugar/DsBinds.hs | 62 +++++++- compiler/prelude/PrelNames.hs | 26 ++++ compiler/typecheck/TcBinds.hs | 7 +- compiler/typecheck/TcEvidence.hs | 172 ++++++++++++++++++++- compiler/typecheck/TcExpr.hs | 6 +- compiler/typecheck/TcHsSyn.hs | 8 + compiler/typecheck/TcInteract.hs | 45 +++++- docs/users_guide/7.10.1-notes.xml | 43 ++++++ docs/users_guide/glasgow_exts.xml | 50 ++++++ libraries/base/GHC/SrcLoc.hs | 33 ++++ libraries/base/GHC/Stack.hsc | 57 ++++++- libraries/base/base.cabal | 1 + testsuite/tests/typecheck/should_run/IPLocation.hs | 44 ++++++ .../tests/typecheck/should_run/IPLocation.stdout | 28 ++++ testsuite/tests/typecheck/should_run/all.T | 1 + 15 files changed, 566 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 e3dc28046373f3183dda56b096dbebec865e3be7 From git at git.haskell.org Wed Jul 15 11:30:29 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 15 Jul 2015 11:30:29 +0000 (UTC) Subject: [commit: ghc] master: Testsuite: mark T10294 conditionally expect_broken on #10301 (b1063b1) Message-ID: <20150715113029.67D5D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/b1063b1b64989749292d156b189eb64a73fb329a/ghc >--------------------------------------------------------------- commit b1063b1b64989749292d156b189eb64a73fb329a Author: Thomas Miedema Date: Wed Jul 15 13:27:59 2015 +0200 Testsuite: mark T10294 conditionally expect_broken on #10301 Fix 8e6a50339a4a61d4f2cbec645c78abc85098a294. >--------------------------------------------------------------- b1063b1b64989749292d156b189eb64a73fb329a testsuite/tests/plugins/all.T | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/tests/plugins/all.T b/testsuite/tests/plugins/all.T index 473bed3..bc3bcfa 100644 --- a/testsuite/tests/plugins/all.T +++ b/testsuite/tests/plugins/all.T @@ -53,7 +53,7 @@ test('T10420', test('T10294', [pre_cmd('$MAKE -s --no-print-directory -C annotation-plugin package.T10294'), clean_cmd('$MAKE -s --no-print-directory -C annotation-plugin clean.T10294'), - when(have_dynamic(),expect_broken(10301))], + unless(have_dynamic(),expect_broken(10301))], run_command, ['$MAKE -s --no-print-directory T10294']) From git at git.haskell.org Wed Jul 15 11:30:32 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 15 Jul 2015 11:30:32 +0000 (UTC) Subject: [commit: ghc] master: Build system: delete fingerprint.py [skip ci] (348f5ca) Message-ID: <20150715113032.47B033A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/348f5ca4c2bd4b99a1d74cbb932729687c53338e/ghc >--------------------------------------------------------------- commit 348f5ca4c2bd4b99a1d74cbb932729687c53338e Author: Thomas Miedema Date: Wed Jul 15 10:18:37 2015 +0200 Build system: delete fingerprint.py [skip ci] fingerprint makes no sense anymore w/ submodules. >--------------------------------------------------------------- 348f5ca4c2bd4b99a1d74cbb932729687c53338e utils/fingerprint/fingerprint.py | 255 --------------------------------------- 1 file changed, 255 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 348f5ca4c2bd4b99a1d74cbb932729687c53338e From git at git.haskell.org Wed Jul 15 11:30:35 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 15 Jul 2015 11:30:35 +0000 (UTC) Subject: [commit: ghc] master: Remove all references to sync-all (a592e9f) Message-ID: <20150715113035.38B523A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a592e9ffcfb288cd154bad60dc8003b781355533/ghc >--------------------------------------------------------------- commit a592e9ffcfb288cd154bad60dc8003b781355533 Author: Thomas Miedema Date: Tue Jul 14 17:15:12 2015 +0200 Remove all references to sync-all >--------------------------------------------------------------- a592e9ffcfb288cd154bad60dc8003b781355533 HACKING.md | 11 ++++++++--- README.md | 31 +++++++++++-------------------- boot | 2 +- packages | 14 ++------------ 4 files changed, 22 insertions(+), 36 deletions(-) diff --git a/HACKING.md b/HACKING.md index edd1d12..b59e747 100644 --- a/HACKING.md +++ b/HACKING.md @@ -30,9 +30,14 @@ find an overview here: Next, clone the repository and all the associated libraries: ``` -$ git clone http://git.haskell.org/ghc.git -$ cd ghc -$ ./sync-all get +$ git clone --recursive git://git.haskell.org/ghc.git +``` + +On Windows, you need an extra repository containing some build tools: + +``` +$ cd ghc/ +$ git clone git://git.haskell.org/ghc-tarballs.git ``` First copy `mk/build.mk.sample` to `mk/build.mk` and ensure it has diff --git a/README.md b/README.md index 32234c0..5ad1adb 100644 --- a/README.md +++ b/README.md @@ -26,21 +26,18 @@ There are two ways to get a source tree: 2. *Check out the source code from git* - The official mirror for GHC on GitHub is located at https://github.com/ghc/ghc. + $ git clone --recursive git://git.haskell.org/ghc.git - $ git clone git://github.com/ghc/ghc.git - $ cd ghc - $ ./sync-all get + On Windows, you need an extra repository containing some build tools: - If you want to clone your own fork instead, add an argument to `sync-all` to - tell it where it can find the other repositories it needs. + $ cd ghc/ + $ git clone git://git.haskell.org/ghc-tarballs.git - $ git clone ghc - $ cd ghc - $ ./sync-all -r git://github.com/ghc get + Note: cloning GHC from Github requires a special setup. See [Getting a GHC + repository from Github] [7]. **DO NOT submit pull request directly to the github repo.** - *See the GHC developer team's working conventions re [contributing patches](http://ghc.haskell.org/trac/ghc/wiki/WorkingConventions/Git#Contributingpatches "ghc.haskell.org/trac/ghc/wiki/WorkingConventions/Git#Contributingpatches").* + *See the GHC team's working conventions re [how to contribute a patch to GHC](http://ghc.haskell.org/trac/ghc/wiki/WorkingConventions/FixingBugs "ghc.haskell.org/trac/ghc/wiki/WorkingConventions/FixingBug").* Building & Installing @@ -64,7 +61,7 @@ dblatex. **Quick start**: the following gives you a default build: - $ perl boot + $ ./boot $ ./configure $ make # can also say 'make -jX' for X number of jobs $ make install @@ -74,7 +71,7 @@ save you hours of build time depending on your system configuration, and is almost always a win regardless of how many cores you have. As a simple rule, you should have about N+1 jobs, where `N` is the amount of cores you have.) -The `perl boot` step is only necessary if this is a tree checked out +The `./boot` step is only necessary if this is a tree checked out from git. For source distributions downloaded from [GHC's web site] [1], this step has already been performed. @@ -82,12 +79,6 @@ These steps give you the default build, which includes everything optimised and built in various ways (eg. profiling libs are built). It can take a long time. To customise the build, see the file `HACKING`. -Once you have a build you need to keep it going. You need to keep all -repos in sync with the [sync-all script] [7]. To get the latest changes: - - $ ./sync-all pull - $ ./sync-all get - Filing bugs and feature requests ================================ @@ -125,8 +116,8 @@ you to join! [4]: http://www.haskell.org/happy/ "www.haskell.org/happy/" [5]: http://www.haskell.org/alex/ "www.haskell.org/alex/" [6]: http://www.haskell.org/haddock/ "www.haskell.org/haddock/" - [7]: http://ghc.haskell.org/trac/ghc/wiki/Building/SyncAll - "http://ghc.haskell.org/trac/ghc/wiki/Building/SyncAll" + [7]: https://ghc.haskell.org/trac/ghc/wiki/Building/GettingTheSources#GettingaGHCrepositoryfromGitHub + "https://ghc.haskell.org/trac/ghc/wiki/Building/GettingTheSources#GettingaGHCrepositoryfromGitHub" [8]: http://ghc.haskell.org/trac/ghc/wiki/Building/Preparation "http://ghc.haskell.org/trac/ghc/wiki/Building/Preparation" [9]: http://www.haskell.org/cabal/ "http://www.haskell.org/cabal/" diff --git a/boot b/boot index af5ccc2..7bcc7a1 100755 --- a/boot +++ b/boot @@ -72,7 +72,7 @@ sub sanity_check_tree { # has a LICENSE file instead. if (! -f "$dir/LICENSE") { print STDERR "Error: $dir/LICENSE doesn't exist.\n"; - die "Maybe you haven't done './sync-all get'?"; + die "Maybe you haven't done 'git submodule update --init'?"; } } } diff --git a/packages b/packages index 33137d6..c621a67 100644 --- a/packages +++ b/packages @@ -1,7 +1,6 @@ # Despite the name "package", this file contains the master list of # the *repositories* that make up GHC. It is parsed by # * boot -# * sync-all # * rules/foreachLibrary.mk # # Some of this information is duplicated elsewhere in the build system: @@ -30,17 +29,8 @@ # GitHub and GHC developers are granted push-rights for are denoted by # being specified with the `ssh://` scheme. Thus, `https://` # repo urls denote read-only access. -# -# * The 'tag' determines when "sync-all get" will get the -# repo. If the tag is "-" then it will always get it, but if there -# is a tag then a corresponding flag must be given to "sync-all", e.g. -# if you want to get the packages with an "extralibs" -# tag then you need to use "sync-all --extra get". -# Support for new tags must be manually added to the "sync-all" script. -# -# 'tag' is also used to determine which packages the build system -# deems to have the EXTRA_PACKAGE property: tags 'dph' and 'extra' -# both give this property +# * 'tag', in combination with the variables BUILD_DPH and BUILD_EXTRA_PKGS, +# determines which packages are build by default. # # Lines that start with a '#' are comments. # From git at git.haskell.org Wed Jul 15 12:22:04 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 15 Jul 2015 12:22:04 +0000 (UTC) Subject: [commit: ghc] wip/impredicativity: Apply instantiation also when checking type classes from the inert set (3a4762f) Message-ID: <20150715122204.7B7B63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/impredicativity Link : http://ghc.haskell.org/trac/ghc/changeset/3a4762f44df65c886a4c0bfe8a2ab2af181097fb/ghc >--------------------------------------------------------------- commit 3a4762f44df65c886a4c0bfe8a2ab2af181097fb Author: Alejandro Serrano Date: Wed Jul 15 14:22:56 2015 +0200 Apply instantiation also when checking type classes from the inert set >--------------------------------------------------------------- 3a4762f44df65c886a4c0bfe8a2ab2af181097fb compiler/typecheck/TcInteract.hs | 44 ++++++++++++++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 9 deletions(-) diff --git a/compiler/typecheck/TcInteract.hs b/compiler/typecheck/TcInteract.hs index 706bc09..2df6354 100644 --- a/compiler/typecheck/TcInteract.hs +++ b/compiler/typecheck/TcInteract.hs @@ -673,7 +673,12 @@ 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 }) +interactDict inerts workItem + = do { lazyEqs <- inerts_to_lazy_eqs (inert_irreds inerts) + ; interactDict' inerts lazyEqs workItem } + +interactDict' :: InertCans -> LazyEqs [TcPredType] -> Ct -> TcS (StopOrContinue Ct) +interactDict' inerts lazyEqs workItem@(CDictCan { cc_ev = ev_w, cc_class = cls, cc_tyargs = tys }) -- don't ever try to solve CallStack IPs directly from other dicts, -- we always build new dicts instead. -- See Note [Overview of implicit CallStacks] @@ -693,8 +698,12 @@ interactDict inerts workItem@(CDictCan { cc_ev = ev_w, cc_class = cls, cc_tyargs setWantedEvBind (ctEvId ev_w) ev_tm stopWith ev_w "Wanted CallStack IP" - | Just ctev_i <- lookupInertDict inerts cls tys - = do { (inert_effect, stop_now) <- solveOneFromTheOther ctev_i ev_w + | Just (ctev_i, qs) <- over_lazy_eqs (lookupInertDict inerts cls) lazyEqs tys + = do { -- Apply obtained lazy equation + qs_evs <- mapM (newWantedEvVarNC (ctev_loc ev_w)) (extract_lazy_eqs qs) + ; emitWorkNC qs_evs + -- Perform interaction + ; (inert_effect, stop_now) <- solveOneFromTheOther ctev_i ev_w ; case inert_effect of IRKeep -> return () IRDelete -> updInertDicts $ \ ds -> delDict ds cls tys @@ -712,7 +721,7 @@ interactDict inerts workItem@(CDictCan { cc_ev = ev_w, cc_class = cls, cc_tyargs = do { addFunDepWork inerts ev_w cls ; continueWith workItem } -interactDict _ wi = pprPanic "interactDict" (ppr wi) +interactDict' _ _ wi = pprPanic "interactDict" (ppr wi) addFunDepWork :: InertCans -> CtEvidence -> Class -> TcS () -- Add derived constraints from type-class functional dependencies. @@ -1187,13 +1196,13 @@ doTopReact work_item doTopReactDict :: InertSet -> Ct -> TcS (StopOrContinue Ct) -- Try to use type-class instance declarations to simplify the constraint doTopReactDict inerts work_item@(CDictCan { cc_ev = fl, cc_class = cls - , cc_tyargs = xis }) + , cc_tyargs = xis }) | isGiven fl -- Never use instances for Given constraints = do { try_fundep_improvement ; continueWith work_item } | Just ev <- lookupSolvedDict inerts cls xis -- Cached - = do { setEvBindIfWanted fl (ctEvTerm ev); + = do { setEvBindIfWanted fl (ctEvTerm ev) ; stopWith fl "Dict/Top (cached)" } | isDerived fl -- Use type-class instances for Deriveds, in the hope @@ -1695,10 +1704,9 @@ matchClassInst _ _ clas [k,t] _ | className clas == typeableClassName = matchTypeableClass clas k t -matchClassInst dflags _ clas tys loc +matchClassInst dflags inerts clas tys loc = do { instEnvs <- getInstEnvs - ; inertCans <- getInertCans - ; lazyEqs <- inerts_to_lazy_eqs (inert_irreds inertCans) + ; lazyEqs <- inerts_to_lazy_eqs (inert_irreds (inert_cans inerts)) ; traceTcS "matchClassInst" $ vcat [ text "pred =" <+> ppr pred , text "lazy_eqs =" <+> ppr lazyEqs ] ; let safeOverlapCheck = safeHaskell dflags `elem` [Sf_Safe, Sf_Trustworthy] @@ -1760,6 +1768,24 @@ inerts_to_lazy_eqs = flatMapBagM $ \ct -> extract_lazy_eqs :: LazyEqs [TcPredType] -> [TcPredType] extract_lazy_eqs leqs = concatMap (\(_,_,qs) -> qs) (bagToList leqs) +over_lazy_eqs :: ([Type] -> Maybe a) -> LazyEqs l -> [Type] -> Maybe (a, LazyEqs l) +over_lazy_eqs f leqs tys + = go (subsets (bagToList leqs)) + where + subsets :: [(Type, Type, l)] -> [(TvSubst, LazyEqs l)] + subsets [] = [(emptyTvSubst, emptyBag)] + subsets (elt@(ty1,ty2,_):xs) + | Just v <- getTyVar_maybe ty1 + = let sxs = subsets xs + in sxs ++ flip map sxs (\(s, b) -> ( extendTvSubst s v ty2 + , consBag elt b )) + | otherwise = pprPanic "Lazy eqs without var in the LHS" (ppr ty1) + + go [] = Nothing + go ((subst, l):rest) = case f (substTys subst tys) of + Just x -> Just (x, l) + Nothing -> go rest + {- Note [Instance and Given overlap] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From git at git.haskell.org Wed Jul 15 13:11:11 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 15 Jul 2015 13:11:11 +0000 (UTC) Subject: [commit: ghc] wip/impredicativity: Add special rule for InstanceOf (forall a. a) (ad3678c) Message-ID: <20150715131111.7F6953A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/impredicativity Link : http://ghc.haskell.org/trac/ghc/changeset/ad3678c73c3c395d9e306cd0a619814b6ae727d8/ghc >--------------------------------------------------------------- commit ad3678c73c3c395d9e306cd0a619814b6ae727d8 Author: Alejandro Serrano Date: Wed Jul 15 15:09:43 2015 +0200 Add special rule for InstanceOf (forall a. a) In several cases we obtain constraints of the form (forall a. a) <= something (for example, by using undefined). If we instantiate the variables, we get alpha <= something. If this something is again a variable, we are stuck. However, (forall a. a) <= something is always true. So, we add a new special rule for this case. >--------------------------------------------------------------- ad3678c73c3c395d9e306cd0a619814b6ae727d8 compiler/typecheck/TcCanonical.hs | 30 +++++++++++++++++++++++++++--- docs/types/impredicativity.ltx | 18 ++++++++++++++++++ 2 files changed, 45 insertions(+), 3 deletions(-) diff --git a/compiler/typecheck/TcCanonical.hs b/compiler/typecheck/TcCanonical.hs index d7932a8..8bc348f 100644 --- a/compiler/typecheck/TcCanonical.hs +++ b/compiler/typecheck/TcCanonical.hs @@ -1660,11 +1660,16 @@ can_instance_of (CInstanceOfCan { cc_ev = ev, cc_lhs = lhs, cc_rhs = rhs }) -- case InstanceOf sigma sigma, for the exact same sigma | lhs `eqType` rhs = can_instance_to_eq ev lhs rhs + -- case InstanceOf (forall a. a) sigma -> nothing + | (vs, [], ty) <- tcSplitSigmaTy lhs + , Just v <- getTyVar_maybe ty + , v `elem` vs + = can_instance_null ev lhs rhs -- case InstanceOf (T ...) sigma --> T ... ~ sigma | is_not_forall lhs, Nothing <- getTyVar_maybe lhs = can_instance_to_eq ev lhs rhs - -- case InstanceOf (forall qvars. Q => ty) sigma - -- where sigma is T ..., F ... or a Skolem tyvar + -- case InstanceOf (forall qvars. Q => ty) sigma + -- where sigma is T ..., F ... or a Skolem tyvar | is_forall lhs , is_not_forall rhs -- RHS is not a forall , Nothing <- getTyVar_maybe rhs -- or a variabla @@ -1681,7 +1686,7 @@ can_instance_of (CInstanceOfCan { cc_ev = ev, cc_lhs = lhs, cc_rhs = rhs }) ; setWantedEvBind evar ev_let ; stopWith ev "can_instance_of/LET" } _ -> stopWith ev "Given/Derived instanceOf instantiation" - -- already canonical + -- already canonical | otherwise = continueWith (CIrredEvCan { cc_ev = ev }) where is_not_forall ty @@ -1722,3 +1727,22 @@ can_instance_inst ev lhs rhs ; traceTcS "can_instance_of/INST" (vcat [ ppr new_ev_ty, ppr new_ev_qs ]) ; canInstanceOfNC new_ev_ty } _ -> stopWith ev "Given/Derived instanceOf instantiation" + +can_instance_null :: CtEvidence -> TcType -> TcType -> TcS (StopOrContinue Ct) +can_instance_null ev lhs rhs + = case ev of + CtWanted { ctev_evar = evar, ctev_loc = loc } -> + do { (qvars, _, ty) <- splitInst lhs + -- generate new constraints + ; let inst = mkInstanceOfPred ty rhs + ; new_ev_inst <- newWantedEvVarNC loc inst + ; let eq = mkTcEqPredRole Nominal ty rhs + ; new_ev_eq <- newWantedEvVarNC loc eq + -- set the evidence for the instantiation + ; let qvars' = map mkTyVarTy qvars + ; setWantedEvBind evar (mkInstanceOfInst lhs qvars' (ctEvId new_ev_inst) []) + ; setWantedEvBind (ctEvId new_ev_inst) (mkInstanceOfEq ty (ctEvCoercion new_ev_eq)) + -- emit new work + ; traceTcS "can_instance_of/NULL" (vcat [ ppr new_ev_inst, ppr new_ev_eq ]) + ; canEqNC new_ev_eq NomEq ty rhs } + _ -> stopWith ev "Given/Derived instanceOf instantiation" diff --git a/docs/types/impredicativity.ltx b/docs/types/impredicativity.ltx index 9234351..b62bd75 100644 --- a/docs/types/impredicativity.ltx +++ b/docs/types/impredicativity.ltx @@ -87,6 +87,7 @@ $$ $$ \begin{array}{lrcl} \textsc{[$\leq$refl]} & canon\left[\sigma \leq \sigma\right] & = & \sigma \sim \sigma \\ +\textsc{[$\leq$trivial]} & canon\left[(\forall a. a) \leq \sigma_2 \right] & = & \epsilon \\ \textsc{[$\leq$lcon]} & canon\left[(\mathsf{D} \; \overline{\sigma_1}) \leq \sigma_2\right] & = & (\mathsf{D} \; \overline{\sigma_1}) \sim \sigma_2 \\ \textsc{[$\leq$l$\forall$]} & canon\left[(\forall \overline{a}. Q_1 \Rightarrow \sigma_1) \leq \sigma_2\right] & = & [\overline{a \mapsto \alpha}]\sigma_1 \leq \sigma_2 \, \wedge \, [\overline{a \mapsto \alpha}]Q_1 \\ & & & \textrm{where } \sigma_2 \textrm{ is } \mathsf{D} \; \overline{\sigma} \textrm{ or a Skolem variable} \\ @@ -94,6 +95,19 @@ $$ \end{array} $$ +\subsubsection*{Notes on the {\sc [$\leq$trivial]} rule} + +Consider the following code, taken from the {\tt GHC.List} module: +\begin{verbatim} +head :: [a] -> a +head (x:xs) = x +head [] = badHead + +badHead :: b +badHead = error "..." +\end{verbatim} +When type checking the second branch, we generate a constraint of the form $\forall b. b \leq a$. If we were to apply rule {\sc [$\leq$l$\forall$]}, we would get a constraint $\beta \leq a$, getting stuck. However, it is the case that \emph{any} type is an instance of $\forall a. a$, so we have included an extra rule for this case. It seems very specific, but this scenario is quite common when calling functions such as {\tt error} or {\tt raise}. + \subsubsection*{Notes on the {\sc [$\leq$l$\forall$]} rule} \begin{itemize} \item We disallow applying {\sc [$\leq$l$\forall$]} in the case of unification variables. If we did so, and later that variable was substituted by some other type, we would need to remember the instantiation done by this rule and apply it to the substituted value. Instead, we prefer to defer the instantiation of the constraint until the variable is changed to another type. @@ -127,6 +141,9 @@ In the constraint solving process we do not only need to find a solution for the $$W_1 = \lambda (x :: \sigma_1). \; x \rhd W_2$$ where $\rhd$ is the cast operator which applies a coercion $\rho_1 \to \rho_2$ to a value of type $\rho_1$ to produce the same value, but typed as $\rho_2$. +\paragraph{Rule {\sc [$\leq$trivial]}.} We need to build $W_1 :: (\forall a. a) \to \sigma_2$. This is simple type application: +$$W_1 = \lambda (x :: \forall a. a). \; x \; \sigma_2$$ + \paragraph{Rule and {\sc [$\leq$l$\forall$]}.} We need to build $W_1 :: (\forall \overline{a}. Q_1 \Rightarrow \sigma_1) \to \sigma_2$ given $W_2 :: [\overline{a \mapsto \alpha}]\sigma_1 \to \sigma_2$ and $W_3 :: [\overline{a \mapsto \alpha}]Q_1$. The first step is to get $[\overline{a \mapsto \alpha}]\sigma_1$ from $\forall \overline{a}. Q_1 \Rightarrow \sigma_1$, to do that we need to make a type application and afterwards apply the witness for $Q_1 \Rightarrow \sigma_1$: $$\lambda (x :: \forall \overline{a}. Q_1 \Rightarrow \sigma_1). \; x \; \alpha \; W_3 :: (\forall \overline{a}. Q_1 \Rightarrow \sigma_1) \to [\overline{a \mapsto \alpha}]\sigma_1$$ The last step is then applying $W_2$ to convert it to our desired type: @@ -473,6 +490,7 @@ f x = S (error x) If we apply {\sc [AppFunNonVar]} directly, we instantiate the type of $error :: \forall b. [Char] \to b$ to $[Char] \to \beta$. Since we are pushing down a unification variable $\alpha$ because of the previous application of {\sc [AppFunNonVar]} to $S :: \forall a. \, a \to S \; a$, we obtain a constraint $\beta \leq \alpha$. Since there are no more restrictions to either $\alpha$ or $\beta$, we are not stuck in solving. +\newpage \section*{Examples} \subsection*{\tt runST e} $$(\$)^{\alpha \to \beta \to \gamma} \; runST^\alpha \; \left( e \; :: \; \forall s. ST \; s \; Int \right)^\beta$$ From git at git.haskell.org Wed Jul 15 13:42:51 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 15 Jul 2015 13:42:51 +0000 (UTC) Subject: [commit: ghc] wip/impredicativity: Do right unification check in lookupInstEnv' (eeab23c) Message-ID: <20150715134251.39F363A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/impredicativity Link : http://ghc.haskell.org/trac/ghc/changeset/eeab23c3b3958de046a4e56761140ce7ade83010/ghc >--------------------------------------------------------------- commit eeab23c3b3958de046a4e56761140ce7ade83010 Author: Alejandro Serrano Date: Wed Jul 15 15:41:57 2015 +0200 Do right unification check in lookupInstEnv' Prior to this commit, lookupInstEnv' would not take into account the lazy equations when checking for unifying classes. For example, if you had instances instance Monoid Bool instance Monoid Int and you want to check Monoid a where a <~ Bool, the system incorrectly found that both instances unified. But only one should do it! >--------------------------------------------------------------- eeab23c3b3958de046a4e56761140ce7ade83010 compiler/types/InstEnv.hs | 3 ++- compiler/types/Unify.hs | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/compiler/types/InstEnv.hs b/compiler/types/InstEnv.hs index b265b1a..d30e346 100644 --- a/compiler/types/InstEnv.hs +++ b/compiler/types/InstEnv.hs @@ -820,11 +820,12 @@ lookupInstEnv' ie vis_mods cls tys leqs -- Unification will break badly if the variables overlap -- They shouldn't because we allocate separate uniques for them -- See Note [Template tyvars are fresh] - case tcUnifyTys instanceBindFun tpl_tys tys of + case tcUnifyTys instanceBindFun tpl_tys (substTys subst tys) of Just _ -> find ms (item:us) rest Nothing -> find ms us rest where tpl_tv_set = mkVarSet tpl_tvs + subst = lazyEqsToSubst leqs ---------------- lookup_tv :: TvSubst -> TyVar -> DFunInstType diff --git a/compiler/types/Unify.hs b/compiler/types/Unify.hs index aa71ba8..e3574ee 100644 --- a/compiler/types/Unify.hs +++ b/compiler/types/Unify.hs @@ -10,7 +10,7 @@ module Unify ( ruleMatchTyX, tcMatchPreds, MatchResult, MatchResult'(..), - LazyEqs, noLazyEqs, + LazyEqs, noLazyEqs, lazyEqsToSubst, MatchEnv(..), matchList, typesCantMatch, @@ -73,6 +73,12 @@ type LazyEqs l = Bag (Type, Type, l) noLazyEqs :: LazyEqs l noLazyEqs = emptyBag +lazyEqsToSubst :: LazyEqs l -> TvSubst +lazyEqsToSubst leqs = go (bagToList leqs) + where go [] = emptyTvSubst + go ((ty1,ty2,_):rs) + = extendTvSubst (go rs) (getTyVar "lazyEqsToSubst" ty1) ty2 + data MatchEnv l = ME { me_tmpls :: VarSet -- Template variables , me_env :: RnEnv2 -- Renaming envt for nested foralls From git at git.haskell.org Wed Jul 15 13:58:47 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 15 Jul 2015 13:58:47 +0000 (UTC) Subject: [commit: ghc] master: Don't get a new nursery if we exceeded large_alloc_lim (75fd5dc) Message-ID: <20150715135847.9AEC93A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/75fd5dc204fb6bb9014f6bba4d680facbc952faf/ghc >--------------------------------------------------------------- commit 75fd5dc204fb6bb9014f6bba4d680facbc952faf Author: Simon Marlow Date: Wed Jul 15 13:07:35 2015 +0100 Don't get a new nursery if we exceeded large_alloc_lim Summary: When using nursery chunks, if we failed a heap check due to large_alloc_lim, we would pointlessly keep grabbing new nursery chunks when we should just GC immediately. Test Plan: validate Reviewers: austin, bgamari, niteria Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1072 >--------------------------------------------------------------- 75fd5dc204fb6bb9014f6bba4d680facbc952faf rts/Schedule.c | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/rts/Schedule.c b/rts/Schedule.c index f1e95bf..257e39a 100644 --- a/rts/Schedule.c +++ b/rts/Schedule.c @@ -1084,6 +1084,17 @@ schedulePostRunThread (Capability *cap, StgTSO *t) static rtsBool scheduleHandleHeapOverflow( Capability *cap, StgTSO *t ) { + if (cap->r.rHpLim == NULL || cap->context_switch) { + // Sometimes we miss a context switch, e.g. when calling + // primitives in a tight loop, MAYBE_GC() doesn't check the + // context switch flag, and we end up waiting for a GC. + // See #1984, and concurrent/should_run/1984 + cap->context_switch = 0; + appendToRunQueue(cap,t); + } else { + pushOnRunQueue(cap,t); + } + // did the task ask for a large block? if (cap->r.rHpAlloc > BLOCK_SIZE) { // if so, get one and push it on the front of the nursery. @@ -1141,27 +1152,23 @@ scheduleHandleHeapOverflow( Capability *cap, StgTSO *t ) // run queue before us and steal the large block, but in that // case the thread will just end up requesting another large // block. - pushOnRunQueue(cap,t); return rtsFalse; /* not actually GC'ing */ } } + // if we got here because we exceeded large_alloc_lim, then + // proceed straight to GC. + if (g0->n_new_large_words >= large_alloc_lim) { + return rtsTrue; + } + + // Otherwise, we just ran out of space in the current nursery. + // Grab another nursery if we can. if (getNewNursery(cap)) { debugTrace(DEBUG_sched, "thread %ld got a new nursery", t->id); - pushOnRunQueue(cap,t); return rtsFalse; } - if (cap->r.rHpLim == NULL || cap->context_switch) { - // Sometimes we miss a context switch, e.g. when calling - // primitives in a tight loop, MAYBE_GC() doesn't check the - // context switch flag, and we end up waiting for a GC. - // See #1984, and concurrent/should_run/1984 - cap->context_switch = 0; - appendToRunQueue(cap,t); - } else { - pushOnRunQueue(cap,t); - } return rtsTrue; /* actual GC is done at the end of the while loop in schedule() */ } From git at git.haskell.org Wed Jul 15 16:02:40 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 15 Jul 2015 16:02:40 +0000 (UTC) Subject: [commit: ghc] master: Fix #10642. (9f978b6) Message-ID: <20150715160240.5CA173A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/9f978b67212a51fa34ef44db463351b959ff15e4/ghc >--------------------------------------------------------------- commit 9f978b67212a51fa34ef44db463351b959ff15e4 Author: Richard Eisenberg Date: Wed Jul 15 09:50:57 2015 -0400 Fix #10642. Representational equalities cannot discharge nominal ones. Even if, somehow, this didn't cause a type error (as reported in the ticket), it would surely cause a core lint error. >--------------------------------------------------------------- 9f978b67212a51fa34ef44db463351b959ff15e4 compiler/typecheck/TcFlatten.hs | 5 ++--- compiler/typecheck/TcRnTypes.hs | 19 ++++++++++--------- compiler/typecheck/TcSMonad.hs | 3 ++- testsuite/tests/typecheck/should_compile/T10642.hs | 12 ++++++++++++ testsuite/tests/typecheck/should_compile/all.T | 1 + 5 files changed, 27 insertions(+), 13 deletions(-) diff --git a/compiler/typecheck/TcFlatten.hs b/compiler/typecheck/TcFlatten.hs index 5ecec90..9df0690 100644 --- a/compiler/typecheck/TcFlatten.hs +++ b/compiler/typecheck/TcFlatten.hs @@ -1086,10 +1086,10 @@ flatten_exact_fam_app_fully tc tys -- Now, look in the cache ; mb_ct <- liftTcS $ lookupFlatCache tc xis - ; flavour <- getFlavour + ; flavour_role <- getFlavourRole ; case mb_ct of Just (co, rhs_ty, flav) -- co :: F xis ~ fsk - | flav `canDischargeF` flavour + | (flav, NomEq) `canDischargeFR` flavour_role -> -- Usable hit in the flat-cache -- We certainly *can* use a Wanted for a Wanted do { traceFlat "flatten/flat-cache hit" $ (ppr tc <+> ppr xis $$ ppr rhs_ty) @@ -1500,4 +1500,3 @@ unsolved constraints. The flat form will be Flatten using the fun-eqs first. -} - diff --git a/compiler/typecheck/TcRnTypes.hs b/compiler/typecheck/TcRnTypes.hs index c2d5da0..4d36243 100644 --- a/compiler/typecheck/TcRnTypes.hs +++ b/compiler/typecheck/TcRnTypes.hs @@ -89,7 +89,7 @@ module TcRnTypes( CtFlavour(..), ctEvFlavour, CtFlavourRole, ctEvFlavourRole, ctFlavourRole, - eqCanRewrite, eqCanRewriteFR, canDischarge, canDischargeF, + eqCanRewrite, eqCanRewriteFR, canDischarge, canDischargeFR, -- Pretty printing pprEvVarTheta, @@ -1903,14 +1903,15 @@ eqCanRewriteFR _ _ = False canDischarge :: CtEvidence -> CtEvidence -> Bool -- See Note [canRewriteOrSame] -canDischarge ev1 ev2 = ctEvFlavour ev1 `canDischargeF` ctEvFlavour ev2 - -canDischargeF :: CtFlavour -> CtFlavour -> Bool -canDischargeF Given _ = True -canDischargeF Wanted Wanted = True -canDischargeF Wanted Derived = True -canDischargeF Derived Derived = True -canDischargeF _ _ = False +canDischarge ev1 ev2 = ctEvFlavourRole ev1 `canDischargeFR` ctEvFlavourRole ev2 + +canDischargeFR :: CtFlavourRole -> CtFlavourRole -> Bool +canDischargeFR (_, ReprEq) (_, NomEq) = False +canDischargeFR (Given, _) _ = True +canDischargeFR (Wanted, _) (Wanted, _) = True +canDischargeFR (Wanted, _) (Derived, _) = True +canDischargeFR (Derived, _) (Derived, _) = True +canDischargeFR _ _ = False {- diff --git a/compiler/typecheck/TcSMonad.hs b/compiler/typecheck/TcSMonad.hs index 8c06cd9..8c0d2f9 100644 --- a/compiler/typecheck/TcSMonad.hs +++ b/compiler/typecheck/TcSMonad.hs @@ -2755,7 +2755,8 @@ newWantedEvVarNC :: CtLoc -> TcPredType -> TcS CtEvidence newWantedEvVarNC loc pty = do { -- checkReductionDepth loc pty ; new_ev <- newEvVar pty - ; traceTcS "Emitting new wanted" (ppr new_ev $$ pprCtLoc loc) + ; traceTcS "Emitting new wanted" (ppr new_ev <+> dcolon <+> ppr pty $$ + pprCtLoc loc) ; return (CtWanted { ctev_pred = pty, ctev_evar = new_ev, ctev_loc = loc })} newWantedEvVar :: CtLoc -> TcPredType -> TcS (CtEvidence, Freshness) diff --git a/testsuite/tests/typecheck/should_compile/T10642.hs b/testsuite/tests/typecheck/should_compile/T10642.hs new file mode 100644 index 0000000..628cfb3 --- /dev/null +++ b/testsuite/tests/typecheck/should_compile/T10642.hs @@ -0,0 +1,12 @@ +{-# LANGUAGE TypeFamilies #-} +module T10642 where + +import Data.Coerce + +type family F a + +newtype D a = D (F a) + +-- | This works on 7.10.1, but fails on HEAD (20150711) +coerceD :: F a -> D a +coerceD = coerce diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T index 48ac16e..a277b33 100644 --- a/testsuite/tests/typecheck/should_compile/all.T +++ b/testsuite/tests/typecheck/should_compile/all.T @@ -466,3 +466,4 @@ test('T10428', normal, compile, ['']) test('RepArrow', normal, compile, ['']) test('T10562', normal, compile, ['']) test('T10564', normal, compile, ['']) +test('T10642', normal, compile, ['']) From git at git.haskell.org Wed Jul 15 19:22:10 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 15 Jul 2015 19:22:10 +0000 (UTC) Subject: [commit: ghc] master: initGroup: only initialize the first and last blocks of a group (74a00bc) Message-ID: <20150715192210.5E3B93A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/74a00bc8f96069f7205f091a02f3c571362f9522/ghc >--------------------------------------------------------------- commit 74a00bc8f96069f7205f091a02f3c571362f9522 Author: Simon Marlow Date: Wed Jul 15 12:57:18 2015 +0100 initGroup: only initialize the first and last blocks of a group Summary: Initialising the whole group is expensive and unnecessary. Test Plan: validate Reviewers: austin, bgamari, rwbarton Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1071 >--------------------------------------------------------------- 74a00bc8f96069f7205f091a02f3c571362f9522 rts/sm/BlockAlloc.c | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/rts/sm/BlockAlloc.c b/rts/sm/BlockAlloc.c index 81cf0c4..c2a5913 100644 --- a/rts/sm/BlockAlloc.c +++ b/rts/sm/BlockAlloc.c @@ -183,23 +183,19 @@ void initBlockAllocator(void) STATIC_INLINE void initGroup(bdescr *head) { - bdescr *bd; - W_ i, n; - - // If this block group fits in a single megablock, initialize - // all of the block descriptors. Otherwise, initialize *only* - // the first block descriptor, since for large allocations we don't - // need to give the invariant that Bdescr(p) is valid for any p in the - // block group. (This is because it is impossible to do, as the - // block descriptor table for the second mblock will get overwritten - // by contiguous user data.) - n = head->blocks > BLOCKS_PER_MBLOCK ? 1 : head->blocks; head->free = head->start; head->link = NULL; - for (i=1, bd = head+1; i < n; i++, bd++) { - bd->free = 0; - bd->blocks = 0; - bd->link = head; + + // If this is a block group (but not a megablock group), we + // make the last block of the group point to the head. This is used + // when coalescing blocks in freeGroup(). We don't do this for + // megablock groups because blocks in the second and subsequent + // mblocks don't have bdescrs; freeing these is handled in a + // different way by free_mblock_group(). + if (head->blocks > 1 && head->blocks <= BLOCKS_PER_MBLOCK) { + bdescr *last = head + head->blocks-1; + last->blocks = 0; + last->link = head; } } From git at git.haskell.org Thu Jul 16 07:46:34 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 16 Jul 2015 07:46:34 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Merge remote-tracking branch 'origin/master' into wip/orf-reboot (1b0d5b3) Message-ID: <20150716074634.B6E123A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/1b0d5b380e2d9c0cff057867f17a1785c4a4c865/ghc >--------------------------------------------------------------- commit 1b0d5b380e2d9c0cff057867f17a1785c4a4c865 Merge: e9aab57 74a00bc Author: Adam Gundry Date: Thu Jul 16 07:58:08 2015 +0100 Merge remote-tracking branch 'origin/master' into wip/orf-reboot >--------------------------------------------------------------- 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 1b0d5b380e2d9c0cff057867f17a1785c4a4c865 From git at git.haskell.org Thu Jul 16 07:46:37 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 16 Jul 2015 07:46:37 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Drop the Allow to leave DuplicateRecordFields (25f45c4) Message-ID: <20150716074637.9E6DA3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/25f45c471276f40ed47c09faef5cbd8ad858ba4b/ghc >--------------------------------------------------------------- commit 25f45c471276f40ed47c09faef5cbd8ad858ba4b Author: Adam Gundry Date: Thu Jul 16 08:36:16 2015 +0100 Drop the Allow to leave DuplicateRecordFields >--------------------------------------------------------------- 25f45c471276f40ed47c09faef5cbd8ad858ba4b compiler/basicTypes/Avail.hs | 4 ++-- compiler/basicTypes/FieldLabel.hs | 8 ++++---- compiler/basicTypes/RdrName.hs | 4 ++-- compiler/hsSyn/HsImpExp.hs | 4 ++-- compiler/hsSyn/HsPat.hs | 2 +- compiler/hsSyn/HsTypes.hs | 4 ++-- compiler/iface/IfaceSyn.hs | 4 ++-- compiler/main/DynFlags.hs | 6 +++--- compiler/rename/RnEnv.hs | 2 +- compiler/rename/RnNames.hs | 8 ++++---- compiler/rename/RnPat.hs | 2 +- compiler/typecheck/TcExpr.hs | 4 ++-- compiler/typecheck/TcRnTypes.hs | 2 +- testsuite/tests/driver/T4437.hs | 2 +- .../tests/overloadedrecflds/ghci/overloadedrecfldsghci01.script | 4 ++-- .../overloadedrecflds/should_fail/OverloadedRecFldsFail04_A.hs | 2 +- .../overloadedrecflds/should_fail/OverloadedRecFldsFail06_A.hs | 2 +- .../overloadedrecflds/should_fail/overloadedrecfldsfail01.hs | 2 +- .../overloadedrecflds/should_fail/overloadedrecfldsfail02.hs | 2 +- .../overloadedrecflds/should_fail/overloadedrecfldsfail03.hs | 2 +- .../overloadedrecflds/should_fail/overloadedrecfldsfail04.hs | 2 +- .../overloadedrecflds/should_fail/overloadedrecfldsfail05.hs | 2 +- .../overloadedrecflds/should_fail/overloadedrecfldsfail06.hs | 4 ++-- .../overloadedrecflds/should_fail/overloadedrecfldsfail07.hs | 2 +- .../overloadedrecflds/should_fail/overloadedrecfldsfail08.hs | 4 ++-- .../overloadedrecflds/should_fail/overloadedrecfldsfail09.hs | 2 +- .../overloadedrecflds/should_run/OverloadedRecFldsRun02_A.hs | 2 +- .../tests/overloadedrecflds/should_run/overloadedrecfldsrun01.hs | 4 ++-- .../tests/overloadedrecflds/should_run/overloadedrecfldsrun02.hs | 2 +- .../tests/overloadedrecflds/should_run/overloadedrecfldsrun03.hs | 4 ++-- .../tests/overloadedrecflds/should_run/overloadedrecfldsrun04.hs | 4 ++-- .../tests/overloadedrecflds/should_run/overloadedrecfldsrun05.hs | 4 ++-- 32 files changed, 53 insertions(+), 53 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 25f45c471276f40ed47c09faef5cbd8ad858ba4b From git at git.haskell.org Thu Jul 16 07:46:40 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 16 Jul 2015 07:46:40 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot's head updated: Drop the Allow to leave DuplicateRecordFields (25f45c4) Message-ID: <20150716074640.7421C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Branch 'wip/orf-reboot' now includes: bbf6078 disable check for .init_array section on OpenBSD 9aa0e4b ghc-pkg: use read/writeUTF8File from Cabal bdd0b71 bin-package-db: copy paste writeFileAtomic from Cabal bdf7f13 Build system: rename bindist to bindist-list... d3c1dda Implement PowerPC 64-bit native code backend for Linux b5e1944 Use `+RTS -G1` for more stable residency measurements (#9675) 1d6ead7 Enable using qualified field of constructor in GHCi f856383 Fix Trac #10519 f07b7a8 Remove unnecessary OrdList from decl parser. 6400c76 users_guide: Describe order-dependence of -f and -O flags e4bf4bf Remove redundant parser entry point 8b55788 Add "since" column for LANGUAGE extensions in user guide 39d83f2 Generalize traceM, traceShowM (fixes #10023) 6b01d3c parser: Allow Lm (MODIFIER LETTER) category in identifiers 889c81c Fix some validation errors. 69beef5 Replace usages of `-w` by `-fno-warn`s b1d1c65 Support MO_{Add,Sub}IntC and MO_Add2 in the LLVM backend 124f399 Testsuite: add -ignore-dot-ghci to some tests ced27de Remove dead code / overlapping pattern (#9723) a4b0342 Lexer: remove -fno-warn-unused-do-bind aa778c8 Comments only [skip ci] c875b08 Use -fno-warn-unused-imports instead of hiding `ord` 8e12a21 Lexer.x and Parser.y: delete dead code 5d48e67 Easy way to defer type errors (implements #8353) 3fabb71 Fix typo [skip ci] (#10605) 75de613 rts: fix incorrect checking start for -x arguments (#9839) edb2c54 Remove Hugs specific test setups (omit_compiler_type) 7a3d85e Remove all *.stderr/stdout-hugs files 4681f55 Specialise: Avoid unnecessary recomputation of free variable information 2765fcf Remove warnings for -fwarn-incomplete-patterns a07898e Spelling in comments 9180df1 Fix offset calculation in __stg_gc_fun aaa0cd2 Don't eagerly blackhole single-entry thunks (#10414) d27e7fd Add more discussion of black-holing logic for #10414 d59cf4e Fix "CPP directive" in comment db530f1 Add Note [Warnings in code generated by Alex] 37de4ad Build system: don't set GhcLibWays explicitly in build.mk.sample (#10536) 62fcf05 Fix word repetitions in comments ebfc2fb Update comments around blackholes f753cf1 Allow deferred type error warnings to be suppressed 31580e2 Fix todo in compiler/nativeGen: Rename Size to Format 9a3e165 Deferred type errors now throw TypeError (#10284) 5857e0a fix EBADF unqueueing in select backend (Trac #10590) 6d69c3a Generalize `Control.Monad.forever` d03bcfa always use -fPIC on OpenBSD/AMD64 platform 00c8d4d Fix #10596 by looking up 'Int' not 'Maybe Int' in the map. 1967a52 Export more types from GHC.RTS.Flags (#9970) 8800a73 Backpack: Flesh out more Cabal details d71b65f holePackageKey and isHoleModule utility functions. 3d5f8e7 Unbreak Windows build: delete unusud throwIOIO 6f9efcb Delete duplicate "Note [Unpack equality predicates]" f3bfa3b Broaden Outputable instance for Termination 85b14a7 Comments only 4f9d600 Fix Trac #10618 (out of scope operator) b29633f Bitmap: Fix thunk explosion 889824d Document RULES and class methods c58dc1a White space only b5aabfb Infer types with flexible contexts 7dcf86f users_guide: Fix errant "a" in RULES/class methods docs a6359f2 Add testcase for #10602 6f1c076 Make mkQualPackage more robust when package key is bad. 0a3c43f Comments only 9e86bf1 Better type wildcard errors 888026d Update .mailmap [skip ci] 2d06a9f Improve error message for fundeps 9b1ebba Delete the WayPar way d69dfba Fix self-contained handling of ASCII encoding ee28a79 T1969: Update max_bytes_used a846088 T876 (32-bit): Update bytes allocated de6597e perf/compiler: Switch to -G1 and update performance metrics b935497 T9872d: Update 32-bit allocations d073c77 Do not optimise RULE lhs in substRule e922847 Add Linting for Rules 7da7b0e Make sure rule LHSs are simplified 875723b Reformat a leading # in a comment d7335f7 Test Trac #10463 02a6b29 Test Trac #10634 946c8b1 Another comment with a leading # (sigh) 2e52057 Build system: comments only [skip ci] ec197d3 Build system: add `make show!` command (#7810) f70f1b6 Build system: delete two unused files 47ebe26 Build system: delete REGULAR_INSTALL_DYNLIBS and INSTALL_DYNLIBS 392ff06 Build system: do not build stm and parallel by default 5764ade Testsuite: delete unused with_namebase 322ae32 Testsuite: delete remaining only_compiler_types(['ghc']) setups 783b79b traivs: Use the new container based travis setup 4dc3877 Testsuite: rename *.stderr-ghc to *.stderr ab5257b Testsuite: delete *.stderr-ghc-7.0 *.stdout-ghc-7.0 4ee658a0 Mark test case for #10294 expect_broken on #10301 0a40278 Flush stdout in test case for #10596 8e6a503 Mark test case for #10294 conditionally expect_broken on #10301 b1063b1 Testsuite: mark T10294 conditionally expect_broken on #10301 348f5ca Build system: delete fingerprint.py [skip ci] a592e9f Remove all references to sync-all 75fd5dc Don't get a new nursery if we exceeded large_alloc_lim 9f978b6 Fix #10642. 74a00bc initGroup: only initialize the first and last blocks of a group 1b0d5b3 Merge remote-tracking branch 'origin/master' into wip/orf-reboot 25f45c4 Drop the Allow to leave DuplicateRecordFields From git at git.haskell.org Thu Jul 16 08:11:17 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 16 Jul 2015 08:11:17 +0000 (UTC) Subject: [commit: ghc] master: Docs: `sortOn = sortBy (comparing f)` [skip ci] (504c2ae) Message-ID: <20150716081117.3C0D73A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/504c2aeb8bf36e031c0751e33b85bab58680542e/ghc >--------------------------------------------------------------- commit 504c2aeb8bf36e031c0751e33b85bab58680542e Author: Thomas Miedema Date: Thu Jul 16 10:10:18 2015 +0200 Docs: `sortOn = sortBy (comparing f)` [skip ci] >--------------------------------------------------------------- 504c2aeb8bf36e031c0751e33b85bab58680542e libraries/base/Data/OldList.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/base/Data/OldList.hs b/libraries/base/Data/OldList.hs index 7e79c34..a377b4f 100644 --- a/libraries/base/Data/OldList.hs +++ b/libraries/base/Data/OldList.hs @@ -973,7 +973,7 @@ rqpart cmp x (y:ys) rle rgt r = #endif /* USE_REPORT_PRELUDE */ -- | Sort a list by comparing the results of a key function applied to each --- element. @sortOn f@ is equivalent to @sortBy . comparing f@, but has the +-- element. @sortOn f@ is equivalent to @sortBy (comparing f)@, but has the -- performance advantage of only evaluating @f@ once for each element in the -- input list. This is called the decorate-sort-undecorate paradigm, or -- Schwartzian transform. From git at git.haskell.org Thu Jul 16 13:24:56 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 16 Jul 2015 13:24:56 +0000 (UTC) Subject: [commit: ghc] wip/impredicativity: Merge remote-tracking branch 'origin/master' into wip/impredicativity (e90efd0) Message-ID: <20150716132456.C4F9F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/impredicativity Link : http://ghc.haskell.org/trac/ghc/changeset/e90efd08825e03f790ec98794213220e1730aaf6/ghc >--------------------------------------------------------------- commit e90efd08825e03f790ec98794213220e1730aaf6 Merge: eeab23c 74a00bc Author: Alejandro Serrano Date: Thu Jul 16 15:25:28 2015 +0200 Merge remote-tracking branch 'origin/master' into wip/impredicativity Conflicts: compiler/deSugar/DsBinds.hs compiler/typecheck/TcErrors.hs compiler/typecheck/TcInteract.hs compiler/typecheck/TcRules.hs compiler/typecheck/TcSimplify.hs compiler/typecheck/TcType.hs compiler/typecheck/TcValidity.hs compiler/types/FamInstEnv.hs >--------------------------------------------------------------- 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 e90efd08825e03f790ec98794213220e1730aaf6 From git at git.haskell.org Thu Jul 16 13:24:59 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 16 Jul 2015 13:24:59 +0000 (UTC) Subject: [commit: ghc] wip/impredicativity's head updated: Merge remote-tracking branch 'origin/master' into wip/impredicativity (e90efd0) Message-ID: <20150716132459.E9DE53A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Branch 'wip/impredicativity' now includes: 023a0ba Care with impossible-cons in combineIdenticalAlts 5879d5a Report arity errors correctly despite kinds f4370c6 Comments only 4a7a6c3 Rename getCtLoc, setCtLoc 02bac02 Remove some horrible munging of origins for Coercible 760b079 A bit more tracing 0899911 Comments plus tiny refactoring ee64369 Refactor filterAlts into two parts 5d98b68 Trac #4945 is working again 72b21c3 Parser: commas_tup_tail duplicate SrcSpan on "Missing" value ba7c8e5 Test Trac #10503 c45f8ce Elaborate test for Trac #10403 40698fe Spelling in comments e283cec testsuite: mark T4945 as expect_broken 440d1bc docs: Unbreak the PS/PDF builds for the User's Guide (#10509) 7d5a845 should_run/allocLimit4: disable ghci way e491803 Amend tcrun024, tcrun025 after Trac #7854 fix 7c2293a Amend tcrun037 after Trac #7854 fix 2c6a041 Fix a couple of tests for GHCi/-O* (Trac #10052) 5cc08eb Recognise 'hardhloat' as a valid vendor in a host tuple f2ffdc6 Updated output for test ghci024 85d5397 Make GHC install libraries to e.g. xhtml-3000.2.1-0ACfOp3hebWD9jGWE4v4Gh. 0cb1f5c Filter orphan rules based on imports, fixes #10294 and #10420. 29bc13a Fix all.T for T8131/T8131b. 15ef5fc Remove duplicate test. 13ba87f Build system: unset HADDOCK when haddock is not found 4854fce Change `Typeable` instance for type-lis to use the Known* classes. 38f3745 Add parsePattern parser entry point b5a2e87 Documentation: add section on .haskeline file (#2531) e60dbf3 Check KnownSymbol => Typeable deduction f70fb68 Use -package-id to specify libraries on command line. 6c5a66a Fix #10551 by using LIB_NAMES. 01f7e44 Rename $1_$2_$3_LIB_NAME to LIB_FILE. 55843f1 Further elaborate Trac #10403 test c084796 powerpc: add basic support for PLT relocations (#10402) 73a6265 Make $1 in $1_$2_$3_FOO actually be directory. 95d5031 Build system: delete unused variables in config.mk.in ece2c43 Drop prefix from package keys. aa26731 Clean outdated ext-core references in comments. 4d1316a driver: pass '-fPIC' option to all CC invocations 9a34864 Improve kind-checking for 'deriving' clauses c7b6fb5 Test Trac #10562 a2f828a Be aware of overlapping global STG registers in CmmSink (#10521) a7eee0d Comments only 3edc186 White space only 9195927 Improve pretty-printing for CoPat ff8a671 Use a Representaional coercion for data families 0b7e538 Allow recursive unwrapping of data families cc0dba1 Minor fix to free-vars in RnTypes 9014a7e Fix addDataConStrictness b69dc73 Don't float out alpha[sig] ~ Int 97e313c Add module header to test 2f16a3b Get rid of irrlevant result type signature 95fc6d5 Get rid of irrelevant impredicative polymoprhism fb7b692 Treat out-of-scope variables as holes b98ff25 Error message wibbles from out-of-scope changes 0aaea5b Tiny refactor plus comments be0ce87 Fix for crash in setnumcapabilities001 111ba4b Fix deadlock (#10545) 7c8ffd3 GHCi docs: layout rule is respected inside :{ :} cbd9278 Comments only caf9d42 Small doc fixes 0696fc6 Improve CPR behavior for strict constructors 7c07cf1 closeOverKinds *before* oclose in coverage check 614ba3c Kill off sizePred 8e34783 Make fvType ignore kinds a64a26f Better tracing and tiny refactoring ceb3c84 Improve error message for Typeable k (T k) 0e1e798 Test Trac #10524 8d221bb Test #10582 89834d6 Add -fcross-module-specialise flag 302d937 Add -fcross-module-specialise flag bb0e462 Mask to avoid uncaught ^C exceptions 9b5df2a Update performance numbers due to #10482 c6bb2fc Correct BangPat SrcSpan calculation c495c67 Build system: remove unused variable CHECK_PACKAGES 897a46c Testsuite: accept T2592.stderr (minor changes) 6b9fc65 Testsuite: put extra_run_opts last on command line daa5097 Build system: prevent "warning: overriding commands for target..." bbf6078 disable check for .init_array section on OpenBSD 9aa0e4b ghc-pkg: use read/writeUTF8File from Cabal bdd0b71 bin-package-db: copy paste writeFileAtomic from Cabal bdf7f13 Build system: rename bindist to bindist-list... d3c1dda Implement PowerPC 64-bit native code backend for Linux b5e1944 Use `+RTS -G1` for more stable residency measurements (#9675) 1d6ead7 Enable using qualified field of constructor in GHCi f856383 Fix Trac #10519 f07b7a8 Remove unnecessary OrdList from decl parser. 6400c76 users_guide: Describe order-dependence of -f and -O flags e4bf4bf Remove redundant parser entry point 8b55788 Add "since" column for LANGUAGE extensions in user guide 39d83f2 Generalize traceM, traceShowM (fixes #10023) 6b01d3c parser: Allow Lm (MODIFIER LETTER) category in identifiers 889c81c Fix some validation errors. 69beef5 Replace usages of `-w` by `-fno-warn`s b1d1c65 Support MO_{Add,Sub}IntC and MO_Add2 in the LLVM backend 124f399 Testsuite: add -ignore-dot-ghci to some tests ced27de Remove dead code / overlapping pattern (#9723) a4b0342 Lexer: remove -fno-warn-unused-do-bind aa778c8 Comments only [skip ci] c875b08 Use -fno-warn-unused-imports instead of hiding `ord` 8e12a21 Lexer.x and Parser.y: delete dead code 5d48e67 Easy way to defer type errors (implements #8353) 3fabb71 Fix typo [skip ci] (#10605) 75de613 rts: fix incorrect checking start for -x arguments (#9839) edb2c54 Remove Hugs specific test setups (omit_compiler_type) 7a3d85e Remove all *.stderr/stdout-hugs files 4681f55 Specialise: Avoid unnecessary recomputation of free variable information 2765fcf Remove warnings for -fwarn-incomplete-patterns a07898e Spelling in comments 9180df1 Fix offset calculation in __stg_gc_fun aaa0cd2 Don't eagerly blackhole single-entry thunks (#10414) d27e7fd Add more discussion of black-holing logic for #10414 d59cf4e Fix "CPP directive" in comment db530f1 Add Note [Warnings in code generated by Alex] 37de4ad Build system: don't set GhcLibWays explicitly in build.mk.sample (#10536) 62fcf05 Fix word repetitions in comments ebfc2fb Update comments around blackholes f753cf1 Allow deferred type error warnings to be suppressed 31580e2 Fix todo in compiler/nativeGen: Rename Size to Format 9a3e165 Deferred type errors now throw TypeError (#10284) 5857e0a fix EBADF unqueueing in select backend (Trac #10590) 6d69c3a Generalize `Control.Monad.forever` d03bcfa always use -fPIC on OpenBSD/AMD64 platform 00c8d4d Fix #10596 by looking up 'Int' not 'Maybe Int' in the map. 1967a52 Export more types from GHC.RTS.Flags (#9970) 8800a73 Backpack: Flesh out more Cabal details d71b65f holePackageKey and isHoleModule utility functions. 3d5f8e7 Unbreak Windows build: delete unusud throwIOIO 6f9efcb Delete duplicate "Note [Unpack equality predicates]" f3bfa3b Broaden Outputable instance for Termination 85b14a7 Comments only 4f9d600 Fix Trac #10618 (out of scope operator) b29633f Bitmap: Fix thunk explosion 889824d Document RULES and class methods c58dc1a White space only b5aabfb Infer types with flexible contexts 7dcf86f users_guide: Fix errant "a" in RULES/class methods docs a6359f2 Add testcase for #10602 6f1c076 Make mkQualPackage more robust when package key is bad. 0a3c43f Comments only 9e86bf1 Better type wildcard errors 888026d Update .mailmap [skip ci] 2d06a9f Improve error message for fundeps 9b1ebba Delete the WayPar way d69dfba Fix self-contained handling of ASCII encoding ee28a79 T1969: Update max_bytes_used a846088 T876 (32-bit): Update bytes allocated de6597e perf/compiler: Switch to -G1 and update performance metrics b935497 T9872d: Update 32-bit allocations d073c77 Do not optimise RULE lhs in substRule e922847 Add Linting for Rules 7da7b0e Make sure rule LHSs are simplified 875723b Reformat a leading # in a comment d7335f7 Test Trac #10463 02a6b29 Test Trac #10634 946c8b1 Another comment with a leading # (sigh) 2e52057 Build system: comments only [skip ci] ec197d3 Build system: add `make show!` command (#7810) f70f1b6 Build system: delete two unused files 47ebe26 Build system: delete REGULAR_INSTALL_DYNLIBS and INSTALL_DYNLIBS 392ff06 Build system: do not build stm and parallel by default 5764ade Testsuite: delete unused with_namebase 322ae32 Testsuite: delete remaining only_compiler_types(['ghc']) setups 783b79b traivs: Use the new container based travis setup 4dc3877 Testsuite: rename *.stderr-ghc to *.stderr ab5257b Testsuite: delete *.stderr-ghc-7.0 *.stdout-ghc-7.0 4ee658a0 Mark test case for #10294 expect_broken on #10301 0a40278 Flush stdout in test case for #10596 8e6a503 Mark test case for #10294 conditionally expect_broken on #10301 b1063b1 Testsuite: mark T10294 conditionally expect_broken on #10301 348f5ca Build system: delete fingerprint.py [skip ci] a592e9f Remove all references to sync-all 75fd5dc Don't get a new nursery if we exceeded large_alloc_lim 9f978b6 Fix #10642. 74a00bc initGroup: only initialize the first and last blocks of a group e90efd0 Merge remote-tracking branch 'origin/master' into wip/impredicativity From git at git.haskell.org Thu Jul 16 13:57:25 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 16 Jul 2015 13:57:25 +0000 (UTC) Subject: [commit: ghc] master: Failing test case: idArity invariant check, #10181 (02897c5) Message-ID: <20150716135725.F21003A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/02897c586f091de5ba2b73bbef4c6054b28955d4/ghc >--------------------------------------------------------------- commit 02897c586f091de5ba2b73bbef4c6054b28955d4 Author: Joachim Breitner Date: Thu Jul 16 15:57:42 2015 +0200 Failing test case: idArity invariant check, #10181 This was found Thomas Miedema. >--------------------------------------------------------------- 02897c586f091de5ba2b73bbef4c6054b28955d4 testsuite/tests/simplCore/should_compile/T10181.hs | 3 +++ testsuite/tests/simplCore/should_compile/all.T | 1 + 2 files changed, 4 insertions(+) diff --git a/testsuite/tests/simplCore/should_compile/T10181.hs b/testsuite/tests/simplCore/should_compile/T10181.hs new file mode 100644 index 0000000..1983507 --- /dev/null +++ b/testsuite/tests/simplCore/should_compile/T10181.hs @@ -0,0 +1,3 @@ +module T10181 where + +t a = t a diff --git a/testsuite/tests/simplCore/should_compile/all.T b/testsuite/tests/simplCore/should_compile/all.T index ee2f631..9029710 100644 --- a/testsuite/tests/simplCore/should_compile/all.T +++ b/testsuite/tests/simplCore/should_compile/all.T @@ -214,3 +214,4 @@ test('T10176', only_ways(['optasm']), compile, ['']) test('T10180', only_ways(['optasm']), compile, ['']) test('T10602', only_ways(['optasm']), multimod_compile, ['T10602','-v0']) test('T10627', only_ways(['optasm']), compile, ['']) +test('T10181', [expect_broken(10181), only_ways(['optasm'])], compile, ['']) From git at git.haskell.org Thu Jul 16 15:38:12 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 16 Jul 2015 15:38:12 +0000 (UTC) Subject: [commit: packages/hpc] master: Tests: capture all output (a9ecba1) Message-ID: <20150716153812.57CC23A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/hpc On branch : master Link : http://git.haskell.org/packages/hpc.git/commitdiff/a9ecba162ae307acf12a1a783dbe1cf6ebb5729d >--------------------------------------------------------------- commit a9ecba162ae307acf12a1a783dbe1cf6ebb5729d Author: Thomas Miedema Date: Thu Jul 16 13:14:35 2015 +0200 Tests: capture all output >--------------------------------------------------------------- a9ecba162ae307acf12a1a783dbe1cf6ebb5729d tests/simple/tixs/hpc_hand_overlay.stdout | 1 + tests/simple/tixs/hpc_overlay.stdout | 2 ++ tests/simple/tixs/hpc_overlay2.stdout | 1 + tests/simple/tixs/test.T | 22 +++++++++++----------- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/tests/simple/tixs/hpc_hand_overlay.stdout b/tests/simple/tixs/hpc_hand_overlay.stdout index d6c16e6..fe4d77f 100644 --- a/tests/simple/tixs/hpc_hand_overlay.stdout +++ b/tests/simple/tixs/hpc_hand_overlay.stdout @@ -1,3 +1,4 @@ +Tix [TixModule "Main" 2454134535 5 [0,1,0,0,0]] 100% expressions used (4/4) 100% boolean coverage (0/0) 100% guards (0/0) diff --git a/tests/simple/tixs/hpc_overlay.stdout b/tests/simple/tixs/hpc_overlay.stdout index d6c16e6..8fda52f 100644 --- a/tests/simple/tixs/hpc_overlay.stdout +++ b/tests/simple/tixs/hpc_overlay.stdout @@ -1,3 +1,5 @@ +Tix [TixModule "Main" 2454134535 5 [0,1,0,0,0]] + 100% expressions used (4/4) 100% boolean coverage (0/0) 100% guards (0/0) diff --git a/tests/simple/tixs/hpc_overlay2.stdout b/tests/simple/tixs/hpc_overlay2.stdout index d6c16e6..fe4d77f 100644 --- a/tests/simple/tixs/hpc_overlay2.stdout +++ b/tests/simple/tixs/hpc_overlay2.stdout @@ -1,3 +1,4 @@ +Tix [TixModule "Main" 2454134535 5 [0,1,0,0,0]] 100% expressions used (4/4) 100% boolean coverage (0/0) 100% guards (0/0) diff --git a/tests/simple/tixs/test.T b/tests/simple/tixs/test.T index da88911..f1e82ef 100644 --- a/tests/simple/tixs/test.T +++ b/tests/simple/tixs/test.T @@ -23,9 +23,9 @@ test('hpc_markup_error_001', exit_code(1), run_command, test('hpc_markup_error_002', exit_code(1), run_command, ["{hpc} markup hpc001.hs"]) # bad .tix file test('hpc_markup_001', normal, run_command, - ["{hpc} markup hpc_sample.tix --highlight-covered; cat Main.hs.html"]) + ["{hpc} markup --verbosity=0 hpc_sample.tix --highlight-covered; cat Main.hs.html"]) test('hpc_markup_002', normal, run_command, - ["{hpc} markup hpc_sample.tix --fun-entry-count; cat Main.hs.html"]) + ["{hpc} markup --verbosity=0 hpc_sample.tix --fun-entry-count; cat Main.hs.html"]) test('hpc_help_show', normal, run_command, ["{hpc} help show"]) test('hpc_show', normal, run_command, ["{hpc} show hpc_sample.tix"]) @@ -45,26 +45,26 @@ test('hpc_help_overlay', normal, run_command, ["{hpc} help overlay"]) test('hpc_overlay', [extra_clean(['sample_overlay1.tix', 'total1.tix'])], run_command, - ["{hpc} overlay sample_overlay.ovr > sample_overlay1.tix; " - "cat sample_overlay1.tix; " + ["({hpc} overlay sample_overlay.ovr > sample_overlay1.tix; " + "cat sample_overlay1.tix; echo; " "{hpc} combine hpc_sample.tix sample_overlay1.tix > total1.tix; " - "{hpc} report total1.tix"]) + "{hpc} report total1.tix)"]) test('hpc_overlay2', [extra_clean(['sample_overlay2.tix', 'total2.tix'])], run_command, - ["{hpc} overlay sample_overlay.ovr --output=sample_overlay2.tix; " - "cat sample_overlay2.tix; " + ["({hpc} overlay sample_overlay.ovr --output=sample_overlay2.tix; " + "cat sample_overlay2.tix; echo; " "{hpc} combine hpc_sample.tix sample_overlay2.tix --output=total2.tix; " - "{hpc} report total2.tix"]) + "{hpc} report total2.tix)"]) test('hpc_hand_overlay', [extra_clean(['sample_overlay3.tix', 'total3.tix'])], run_command, - ["{hpc} overlay hand_overlay.ovr --output=sample_overlay3.tix; " - "cat sample_overlay3.tix; " + ["({hpc} overlay hand_overlay.ovr --output=sample_overlay3.tix; " + "cat sample_overlay3.tix; echo; " "{hpc} combine hpc_sample.tix sample_overlay3.tix --output=total3.tix; " - "{hpc} report total3.tix"]) + "{hpc} report total3.tix)"]) test('hpc_bad_001', exit_code(1), run_command, ["{hpc} bad arguments"]) From git at git.haskell.org Thu Jul 16 15:38:14 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 16 Jul 2015 15:38:14 +0000 (UTC) Subject: [commit: packages/hpc] master's head updated: Tests: capture all output (a9ecba1) Message-ID: <20150716153814.5CBF83A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/hpc Branch 'master' now includes: 6b88e91 Improve error messages in readMix (#10529) a9ecba1 Tests: capture all output From git at git.haskell.org Thu Jul 16 15:38:33 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 16 Jul 2015 15:38:33 +0000 (UTC) Subject: [commit: packages/hpc] branch 'wip/T10529' deleted Message-ID: <20150716153833.AEE543A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/hpc Deleted branch: wip/T10529 From git at git.haskell.org Thu Jul 16 22:07:44 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 16 Jul 2015 22:07:44 +0000 (UTC) Subject: [commit: ghc] master: PprCore: Add size annotations for top-level bindings (fa33f45) Message-ID: <20150716220744.4454D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/fa33f4541ecae660027719fe1854da6b42c982c1/ghc >--------------------------------------------------------------- commit fa33f4541ecae660027719fe1854da6b42c982c1 Author: Ben Gamari Date: Mon Jun 22 12:47:33 2015 +0200 PprCore: Add size annotations for top-level bindings >--------------------------------------------------------------- fa33f4541ecae660027719fe1854da6b42c982c1 compiler/coreSyn/PprCore.hs | 65 ++++++++++++++++++++++++++++++--------------- 1 file changed, 44 insertions(+), 21 deletions(-) diff --git a/compiler/coreSyn/PprCore.hs b/compiler/coreSyn/PprCore.hs index c0af968..e33c115 100644 --- a/compiler/coreSyn/PprCore.hs +++ b/compiler/coreSyn/PprCore.hs @@ -10,10 +10,12 @@ Printing of Core syntax module PprCore ( pprCoreExpr, pprParendExpr, pprCoreBinding, pprCoreBindings, pprCoreAlt, + pprCoreBindingWithSize, pprCoreBindingsWithSize, pprRules ) where import CoreSyn +import CoreStats (exprStats) import Literal( pprLiteral ) import Name( pprInfixName, pprPrefixName ) import Var @@ -46,11 +48,17 @@ pprCoreBinding :: OutputableBndr b => Bind b -> SDoc pprCoreExpr :: OutputableBndr b => Expr b -> SDoc pprParendExpr :: OutputableBndr b => Expr b -> SDoc -pprCoreBindings = pprTopBinds -pprCoreBinding = pprTopBind +pprCoreBindings = pprTopBinds noAnn +pprCoreBinding = pprTopBind noAnn + +pprCoreBindingsWithSize :: [CoreBind] -> SDoc +pprCoreBindingWithSize :: CoreBind -> SDoc + +pprCoreBindingsWithSize = pprTopBinds sizeAnn +pprCoreBindingWithSize = pprTopBind sizeAnn instance OutputableBndr b => Outputable (Bind b) where - ppr bind = ppr_bind bind + ppr bind = ppr_bind noAnn bind instance OutputableBndr b => Outputable (Expr b) where ppr expr = pprCoreExpr expr @@ -63,32 +71,47 @@ instance OutputableBndr b => Outputable (Expr b) where ************************************************************************ -} -pprTopBinds :: OutputableBndr a => [Bind a] -> SDoc -pprTopBinds binds = vcat (map pprTopBind binds) +-- | A function to produce an annotation for a given right-hand-side +type Annotation b = Expr b -> SDoc + +-- | Annotate with the size of the right-hand-side +sizeAnn :: CoreExpr -> SDoc +sizeAnn e = ptext (sLit "-- RHS size:") <+> ppr (exprStats e) + +-- | No annotation +noAnn :: Expr b -> SDoc +noAnn _ = empty + +pprTopBinds :: OutputableBndr a + => Annotation a -- ^ generate an annotation to place before the + -- binding + -> [Bind a] -- ^ bindings to show + -> SDoc -- ^ the pretty result +pprTopBinds ann binds = vcat (map (pprTopBind ann) binds) -pprTopBind :: OutputableBndr a => Bind a -> SDoc -pprTopBind (NonRec binder expr) - = ppr_binding (binder,expr) $$ blankLine +pprTopBind :: OutputableBndr a => Annotation a -> Bind a -> SDoc +pprTopBind ann (NonRec binder expr) + = ppr_binding ann (binder,expr) $$ blankLine -pprTopBind (Rec []) +pprTopBind _ (Rec []) = ptext (sLit "Rec { }") -pprTopBind (Rec (b:bs)) +pprTopBind ann (Rec (b:bs)) = vcat [ptext (sLit "Rec {"), - ppr_binding b, - vcat [blankLine $$ ppr_binding b | b <- bs], + ppr_binding ann b, + vcat [blankLine $$ ppr_binding ann b | b <- bs], ptext (sLit "end Rec }"), blankLine] -ppr_bind :: OutputableBndr b => Bind b -> SDoc +ppr_bind :: OutputableBndr b => Annotation b -> Bind b -> SDoc -ppr_bind (NonRec val_bdr expr) = ppr_binding (val_bdr, expr) -ppr_bind (Rec binds) = vcat (map pp binds) - where - pp bind = ppr_binding bind <> semi +ppr_bind ann (NonRec val_bdr expr) = ppr_binding ann (val_bdr, expr) +ppr_bind ann (Rec binds) = vcat (map pp binds) + where + pp bind = ppr_binding ann bind <> semi -ppr_binding :: OutputableBndr b => (b, Expr b) -> SDoc -ppr_binding (val_bdr, expr) - = pprBndr LetBind val_bdr $$ +ppr_binding :: OutputableBndr b => Annotation b -> (b, Expr b) -> SDoc +ppr_binding ann (val_bdr, expr) + = ann expr $$ pprBndr LetBind val_bdr $$ hang (ppr val_bdr <+> equals) 2 (pprCoreExpr expr) pprParendExpr expr = ppr_expr parens expr @@ -210,7 +233,7 @@ ppr_expr add_par (Let bind@(NonRec val_bdr rhs) expr@(Let _ _)) -- General case (recursive case, too) ppr_expr add_par (Let bind expr) = add_par $ - sep [hang (ptext keyword) 2 (ppr_bind bind <+> ptext (sLit "} in")), + sep [hang (ptext keyword) 2 (ppr_bind noAnn bind <+> ptext (sLit "} in")), pprCoreExpr expr] where keyword = case bind of From git at git.haskell.org Thu Jul 16 22:07:47 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 16 Jul 2015 22:07:47 +0000 (UTC) Subject: [commit: ghc] master: CoreUtils: Move seq* functions to CoreSeq (e29c2ac) Message-ID: <20150716220747.901A23A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e29c2acce0635565f549c917054203d0237bc803/ghc >--------------------------------------------------------------- commit e29c2acce0635565f549c917054203d0237bc803 Author: Ben Gamari Date: Tue Jul 7 20:25:50 2015 +0200 CoreUtils: Move seq* functions to CoreSeq These seem to sit near the top of the import graph and have been causing import cycles. >--------------------------------------------------------------- e29c2acce0635565f549c917054203d0237bc803 compiler/coreSyn/CoreSeq.hs | 111 ++++++++++++++++++++++++++++++++++++++++++ compiler/coreSyn/CoreSubst.hs | 1 + compiler/coreSyn/CoreUtils.hs | 108 ---------------------------------------- compiler/ghc.cabal.in | 1 + compiler/ghc.mk | 1 + 5 files changed, 114 insertions(+), 108 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 e29c2acce0635565f549c917054203d0237bc803 From git at git.haskell.org Thu Jul 16 22:07:50 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 16 Jul 2015 22:07:50 +0000 (UTC) Subject: [commit: ghc] master: CoreLint: Use size-annotated ppr variant (29f8225) Message-ID: <20150716220750.5CED83A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/29f82250d81ace982d3231378bfb2eb4976fd456/ghc >--------------------------------------------------------------- commit 29f82250d81ace982d3231378bfb2eb4976fd456 Author: Ben Gamari Date: Mon Jun 22 12:48:07 2015 +0200 CoreLint: Use size-annotated ppr variant >--------------------------------------------------------------- 29f82250d81ace982d3231378bfb2eb4976fd456 compiler/coreSyn/CoreLint.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/coreSyn/CoreLint.hs b/compiler/coreSyn/CoreLint.hs index e5d0127..b00e1ac 100644 --- a/compiler/coreSyn/CoreLint.hs +++ b/compiler/coreSyn/CoreLint.hs @@ -210,7 +210,7 @@ dumpPassResult dflags unqual mb_flag hdr extra_info binds rules dump_doc = vcat [ nest 2 extra_info , size_doc , blankLine - , pprCoreBindings binds + , pprCoreBindingsWithSize binds , ppUnless (null rules) pp_rules ] pp_rules = vcat [ blankLine , ptext (sLit "------ Local rules for imported ids --------") From git at git.haskell.org Thu Jul 16 22:07:53 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 16 Jul 2015 22:07:53 +0000 (UTC) Subject: [commit: ghc] master: CoreUtils: Move size utilities to CoreStats (ae0e340) Message-ID: <20150716220753.8B91A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/ae0e340195b3af8e34daecf4ecd21e571f9ccf74/ghc >--------------------------------------------------------------- commit ae0e340195b3af8e34daecf4ecd21e571f9ccf74 Author: Ben Gamari Date: Mon Jun 22 12:35:02 2015 +0200 CoreUtils: Move size utilities to CoreStats This allows PprCore to use these functions. It will soon do so to enable CoreLint to output size annotations on top-level bindings. >--------------------------------------------------------------- ae0e340195b3af8e34daecf4ecd21e571f9ccf74 compiler/coreSyn/CoreLint.hs | 1 + compiler/coreSyn/CoreStats.hs | 128 ++++++++++++++++++++++++++++++++++++++++ compiler/coreSyn/CoreUtils.hs | 117 ------------------------------------ compiler/ghc.cabal.in | 1 + compiler/ghc.mk | 1 + compiler/main/TidyPgm.hs | 3 +- compiler/simplCore/SimplCore.hs | 4 +- 7 files changed, 135 insertions(+), 120 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 ae0e340195b3af8e34daecf4ecd21e571f9ccf74 From git at git.haskell.org Thu Jul 16 22:07:56 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 16 Jul 2015 22:07:56 +0000 (UTC) Subject: [commit: ghc] master: Fix tests (82f1c78) Message-ID: <20150716220756.5353A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/82f1c78718828e0b49fc6f6ed140234e016e4c7a/ghc >--------------------------------------------------------------- commit 82f1c78718828e0b49fc6f6ed140234e016e4c7a Author: Ben Gamari Date: Fri Jul 10 13:48:24 2015 +0200 Fix tests >--------------------------------------------------------------- 82f1c78718828e0b49fc6f6ed140234e016e4c7a testsuite/tests/deSugar/should_compile/T2431.stderr | 2 ++ testsuite/tests/numeric/should_compile/T7116.stdout | 4 ++++ testsuite/tests/roles/should_compile/Roles13.stderr | 2 ++ testsuite/tests/simplCore/should_compile/T3717.stderr | 2 ++ testsuite/tests/simplCore/should_compile/T3772.stdout | 2 ++ testsuite/tests/simplCore/should_compile/T4908.stderr | 3 +++ testsuite/tests/simplCore/should_compile/T4930.stderr | 3 +++ testsuite/tests/simplCore/should_compile/T7360.stderr | 5 +++++ testsuite/tests/simplCore/should_compile/T9400.stderr | 1 + testsuite/tests/simplCore/should_compile/spec-inline.stderr | 7 +++++++ 10 files changed, 31 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 82f1c78718828e0b49fc6f6ed140234e016e4c7a From git at git.haskell.org Thu Jul 16 22:08:00 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 16 Jul 2015 22:08:00 +0000 (UTC) Subject: [commit: ghc] master: Implement -fprint-expanded-synonyms (ae96c75) Message-ID: <20150716220800.7C6A73A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/ae96c751c869813ab95e712f8daac8516bb4795f/ghc >--------------------------------------------------------------- commit ae96c751c869813ab95e712f8daac8516bb4795f Author: ?mer Sinan A?acan Date: Fri Jul 17 00:02:09 2015 +0200 Implement -fprint-expanded-synonyms Add a flag to print type-synonyms-expanded versions of types in type error messages (in addition to old error messages with synonyms) * Mailing list discussion: https://mail.haskell.org/pipermail/ghc-devs/2015-June/009247.html * Wiki page: https://wiki.haskell.org/Expanding_type_synonyms_in_error_messages_proposal * Trac: https://ghc.haskell.org/trac/ghc/ticket/10547 Test Plan: * I'll find some examples and add tests. Reviewers: austin, simonpj, goldfire, bgamari Reviewed By: austin, simonpj, goldfire, bgamari Subscribers: rodlogic, thomie, bgamari Differential Revision: https://phabricator.haskell.org/D1016 GHC Trac Issues: #10547 >--------------------------------------------------------------- ae96c751c869813ab95e712f8daac8516bb4795f compiler/main/DynFlags.hs | 2 + compiler/typecheck/TcErrors.hs | 181 +++++++++++++++++++-- compiler/typecheck/TcType.hs | 22 +-- docs/users_guide/7.12.1-notes.xml | 8 + docs/users_guide/flags.xml | 6 + docs/users_guide/using.xml | 42 ++++- .../tests/typecheck/should_fail/ExpandSynsFail1.hs | 4 + .../typecheck/should_fail/ExpandSynsFail1.stderr | 11 ++ .../tests/typecheck/should_fail/ExpandSynsFail2.hs | 19 +++ .../typecheck/should_fail/ExpandSynsFail2.stderr | 9 + .../tests/typecheck/should_fail/ExpandSynsFail3.hs | 23 +++ .../typecheck/should_fail/ExpandSynsFail3.stderr | 11 ++ .../tests/typecheck/should_fail/ExpandSynsFail4.hs | 11 ++ .../typecheck/should_fail/ExpandSynsFail4.stderr | 7 + testsuite/tests/typecheck/should_fail/all.T | 5 + 15 files changed, 327 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 ae96c751c869813ab95e712f8daac8516bb4795f From git at git.haskell.org Thu Jul 16 22:08:03 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 16 Jul 2015 22:08:03 +0000 (UTC) Subject: [commit: ghc] master: Fix off-by-one error in GHCi line reporting (Trac #10578) (a5e9da8) Message-ID: <20150716220803.7730F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a5e9da8feb5110ab8ee8fe3821e6b6d53946f983/ghc >--------------------------------------------------------------- commit a5e9da8feb5110ab8ee8fe3821e6b6d53946f983 Author: ?mer Sinan A?acan Date: Fri Jul 17 00:06:28 2015 +0200 Fix off-by-one error in GHCi line reporting (Trac #10578) Test Plan: I couldn't add tests because apparently line number reporting was already working correctly when loading script files. I don't know how to test by running commands using stdin, is this supported? Reviewers: austin, thomie, bgamari Reviewed By: thomie, bgamari Subscribers: hvr, thomie Differential Revision: https://phabricator.haskell.org/D1067 >--------------------------------------------------------------- a5e9da8feb5110ab8ee8fe3821e6b6d53946f983 ghc/InteractiveUI.hs | 9 +++++--- .../tests/ghci.debugger/scripts/break003.stderr | 2 +- .../tests/ghci.debugger/scripts/break006.stderr | 8 ++++---- .../tests/ghci.debugger/scripts/print019.stderr | 4 ++-- testsuite/tests/ghci/prog009/ghci.prog009.stderr | 2 +- testsuite/tests/ghci/prog013/prog013.stderr | 2 +- testsuite/tests/ghci/scripts/Defer02.stderr | 4 ++-- testsuite/tests/ghci/scripts/T10248.stderr | 4 ++-- testsuite/tests/ghci/scripts/T2182ghci.stderr | 10 ++++----- testsuite/tests/ghci/scripts/T2182ghci2.stderr | 4 ++-- testsuite/tests/ghci/scripts/T2816.stderr | 2 +- testsuite/tests/ghci/scripts/T4127a.stderr | 6 +++--- testsuite/tests/ghci/scripts/T5564.stderr | 8 ++++---- testsuite/tests/ghci/scripts/T6027ghci.stdout | 2 +- testsuite/tests/ghci/scripts/T7730.stdout | 4 ++-- testsuite/tests/ghci/scripts/T7872.stdout | 4 ++-- testsuite/tests/ghci/scripts/T7873.stdout | 4 ++-- testsuite/tests/ghci/scripts/T8485.stderr | 2 +- testsuite/tests/ghci/scripts/T8579.stdout | 4 ++-- testsuite/tests/ghci/scripts/T8649.stderr | 6 +++--- testsuite/tests/ghci/scripts/T8959.stderr | 6 +++--- testsuite/tests/ghci/scripts/T9140.stdout | 4 ++-- testsuite/tests/ghci/scripts/T9293.stderr | 2 +- testsuite/tests/ghci/scripts/ghci012.stdout | 2 +- testsuite/tests/ghci/scripts/ghci040.stdout | 2 +- testsuite/tests/ghci/scripts/ghci041.stdout | 2 +- testsuite/tests/ghci/scripts/ghci042.stdout | 10 ++++----- testsuite/tests/ghci/scripts/ghci044.stderr | 6 +++--- testsuite/tests/ghci/scripts/ghci047.stderr | 4 ++-- testsuite/tests/ghci/scripts/ghci048.stderr | 12 +++++------ testsuite/tests/ghci/scripts/ghci050.stderr | 10 ++++----- testsuite/tests/ghci/scripts/ghci051.stderr | 6 +++--- testsuite/tests/ghci/scripts/ghci051.stdout | 18 ++++++++-------- testsuite/tests/ghci/scripts/ghci052.stderr | 24 +++++++++++----------- testsuite/tests/ghci/scripts/ghci053.stderr | 12 +++++------ testsuite/tests/ghci/scripts/ghci057.stderr | 2 +- testsuite/tests/ghci/should_run/T9914.stdout | 4 ++-- testsuite/tests/ghci/should_run/T9915.stderr | 2 +- testsuite/tests/patsyn/should_run/ghci.stderr | 2 +- testsuite/tests/patsyn/should_run/ghci.stdout | 2 +- testsuite/tests/safeHaskell/ghci/p10.stderr | 2 +- testsuite/tests/safeHaskell/ghci/p13.stderr | 4 ++-- testsuite/tests/safeHaskell/ghci/p14.stderr | 2 +- testsuite/tests/safeHaskell/ghci/p16.stderr | 8 ++++---- testsuite/tests/safeHaskell/ghci/p4.stderr | 6 +++--- testsuite/tests/safeHaskell/ghci/p6.stderr | 6 +++--- testsuite/tests/safeHaskell/ghci/p9.stderr | 2 +- testsuite/tests/th/T7276a.stdout | 4 ++-- 48 files changed, 130 insertions(+), 127 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 a5e9da8feb5110ab8ee8fe3821e6b6d53946f983 From git at git.haskell.org Thu Jul 16 22:08:07 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 16 Jul 2015 22:08:07 +0000 (UTC) Subject: [commit: ghc] master: Handle Char#, Addr# in TH quasiquoter (fixes #10620) (2c9de9c) Message-ID: <20150716220807.686263A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/2c9de9c9a3df8e855c883139b0cb2fd41801bd67/ghc >--------------------------------------------------------------- commit 2c9de9c9a3df8e855c883139b0cb2fd41801bd67 Author: RyanGlScott Date: Fri Jul 17 00:05:14 2015 +0200 Handle Char#, Addr# in TH quasiquoter (fixes #10620) DsMeta does not attempt to handle quasiquoted Char# or Addr# values, which causes expressions like `$([| 'a'# |])` or `$([| "abc"# |])` to fail with an `Exotic literal not (yet) handled by Template Haskell` error. To fix this, the API of `template-haskell` had to be changed so that `Lit` now has an extra constructor `CharPrimL` (a `StringPrimL` constructor already existed, but it wasn't used). In addition, `DsMeta` has to manipulate `CoreExpr`s directly that involve `Word8`s. In order to do this, `Word8` had to be added as a wired-in type to `TysWiredIn`. Actually converting from `HsCharPrim` and `HsStringPrim` to `CharPrimL` and `StringPrimL`, respectively, is pretty straightforward after that, since both `HsCharPrim` and `CharPrimL` use `Char` internally, and `HsStringPrim` uses a `ByteString` internally, which can easily be converted to `[Word8]`, which is what `StringPrimL` uses. Reviewers: goldfire, austin, simonpj, bgamari Reviewed By: simonpj, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1054 GHC Trac Issues: #10620 >--------------------------------------------------------------- 2c9de9c9a3df8e855c883139b0cb2fd41801bd67 compiler/deSugar/DsMeta.hs | 13 ++++++++ compiler/hsSyn/Convert.hs | 1 + compiler/prelude/PrelNames.hs | 9 ++--- compiler/prelude/THNames.hs | 15 ++++++--- compiler/prelude/TysWiredIn.hs | 20 +++++++++++- docs/users_guide/glasgow_exts.xml | 38 +++++++++++++++++++++- libraries/template-haskell/Language/Haskell/TH.hs | 2 +- .../template-haskell/Language/Haskell/TH/Lib.hs | 2 ++ .../template-haskell/Language/Haskell/TH/Ppr.hs | 1 + .../template-haskell/Language/Haskell/TH/Syntax.hs | 1 + testsuite/tests/th/T10620.hs | 9 +++++ testsuite/tests/th/T10620.stdout | 2 ++ testsuite/tests/th/all.T | 1 + 13 files changed, 103 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 2c9de9c9a3df8e855c883139b0cb2fd41801bd67 From git at git.haskell.org Thu Jul 16 22:08:11 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 16 Jul 2015 22:08:11 +0000 (UTC) Subject: [commit: ghc] master: DeriveFoldable for data types with existential constraints (#10447) (2c5c297) Message-ID: <20150716220811.089463A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/2c5c29722c78e089eda0baa7ff89154b58f23165/ghc >--------------------------------------------------------------- commit 2c5c29722c78e089eda0baa7ff89154b58f23165 Author: RyanGlScott Date: Fri Jul 17 00:04:24 2015 +0200 DeriveFoldable for data types with existential constraints (#10447) Reviewers: dolio, shachaf, ekmett, austin, #core_libraries_committee, simonpj, bgamari Reviewed By: simonpj, bgamari Subscribers: thomie, bgamari Differential Revision: https://phabricator.haskell.org/D1031 GHC Trac Issues: #10447 >--------------------------------------------------------------- 2c5c29722c78e089eda0baa7ff89154b58f23165 compiler/typecheck/TcDeriv.hs | 31 ++- compiler/typecheck/TcGenDeriv.hs | 112 +++++++++- docs/users_guide/glasgow_exts.xml | 259 +++++++++++++++++++++- testsuite/tests/deriving/should_run/T10447.hs | 41 ++++ testsuite/tests/deriving/should_run/T10447.stdout | 9 + testsuite/tests/deriving/should_run/all.T | 1 + 6 files changed, 440 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 2c5c29722c78e089eda0baa7ff89154b58f23165 From git at git.haskell.org Thu Jul 16 22:08:13 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 16 Jul 2015 22:08:13 +0000 (UTC) Subject: [commit: ghc] master: Put Opt_Static into defaultFlags if not pc_DYNAMIC_BY_DEFAULT (#7478) (415351a) Message-ID: <20150716220813.E2B103A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/415351a938e86c4def60228552f121d91bbe7e59/ghc >--------------------------------------------------------------- commit 415351a938e86c4def60228552f121d91bbe7e59 Author: Bernhard Herzog Date: Fri Jul 17 00:04:05 2015 +0200 Put Opt_Static into defaultFlags if not pc_DYNAMIC_BY_DEFAULT (#7478) The test for Trac issue #7478 fails on some systems due to inconsistent default flags for dynamic vs. static linking. Test Plan: validate Reviewers: austin, thomie Reviewed By: thomie Subscribers: thomie, bgamari Differential Revision: https://phabricator.haskell.org/D1017 GHC Trac Issues: #7478 >--------------------------------------------------------------- 415351a938e86c4def60228552f121d91bbe7e59 compiler/main/DynFlags.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index ecc7bbd..70981e7 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -3208,7 +3208,8 @@ defaultFlags settings ++ (if pc_DYNAMIC_BY_DEFAULT (sPlatformConstants settings) then wayGeneralFlags platform WayDyn - else []) + else [Opt_Static]) + -- Opt_Static needs to be set if and only if WayDyn is not used (#7478) where platform = sTargetPlatform settings From git at git.haskell.org Fri Jul 17 10:58:22 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 17 Jul 2015 10:58:22 +0000 (UTC) Subject: [commit: ghc] wip/impredicativity: Update impredicativity design document (69d8f5b) Message-ID: <20150717105822.F37843A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/impredicativity Link : http://ghc.haskell.org/trac/ghc/changeset/69d8f5bb7189731b5e364ba614bc86ca7082911d/ghc >--------------------------------------------------------------- commit 69d8f5bb7189731b5e364ba614bc86ca7082911d Author: Alejandro Serrano Date: Fri Jul 17 12:59:00 2015 +0200 Update impredicativity design document >--------------------------------------------------------------- 69d8f5bb7189731b5e364ba614bc86ca7082911d docs/types/impredicativity.ltx | 42 ++++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/docs/types/impredicativity.ltx b/docs/types/impredicativity.ltx index b62bd75..cef5b1c 100644 --- a/docs/types/impredicativity.ltx +++ b/docs/types/impredicativity.ltx @@ -46,15 +46,15 @@ \begin{mdframed} \noindent \begin{tabular}{ll} Type variables & $\alpha$, $\beta$, $\gamma$ \\ -Type constuctors & $\mathsf{T}$ \\ +Type constuctors & $\mathsf{T}$, $\mathsf{S}$ \\ Type families & $\mathsf{F}$ \\ -Type constructor or families & $\mathsf{D}$ \\ Type classes & $\mathtt{C}$ \end{tabular} \vspace{0.3cm} \noindent \begin{tabular}{lrcl} +Family-free types & $\xi$ & $\coloncolonequals$ & $\alpha \alt a \alt \xi_1 \to \xi_2 \alt \mathsf{T} \; \overline{\xi}$ \\ Monomorphic types & $\mu$ & $\coloncolonequals$ & $\alpha \alt a \alt \mu_1 \to \mu_2 \alt \mathsf{T} \; \overline{\mu} \alt \mathsf{F} \; \overline{\mu}$ \\ Types without top-level $\forall$ & $\tau$ & $\coloncolonequals$ & $\alpha \alt a \alt \sigma_1 \to \sigma_2 \alt \mathsf{T} \; \overline{\sigma} \alt \mathsf{F} \; \overline{\mu}$ \\ Polymorphic types & $\sigma$ & $\coloncolonequals$ & $\forall \overline{a}. Q \Rightarrow \sigma \alt \tau$ \\ @@ -69,31 +69,42 @@ Canonical constraints & $Q^*$ & $\coloncolonequals$ & $\alpha \sim \sigma \alt \ \section*{Changes to constraint solving} -\subsection*{New rules for $\sim$} - +\begin{figure} $$ -\begin{array}{rcl} -canon\left[(\mathsf{T} \; \overline{\sigma_1}) \sim (\mathsf{T} \; \overline{\sigma_2})\right] & = & \overline{\sigma_1 \sim \sigma_2} \\ -canon\left[\sigma \sim a\right] & = & a \sim \sigma \\ -canon\left[(\forall \overline{a}. Q \Rightarrow \sigma_1) \sim (\forall \overline{a}. Q \Rightarrow \sigma_2)\right] & = & \forall \overline{a}. \, (Q \supset \sigma_1 \sim \sigma_2) \\ -canon\left[(\mathsf{T} \; \overline{\sigma_1}) \sim (\mathsf{S} \; \overline{\sigma_2})\right] & = & \bot \\ -canon\left[(\mathsf{T} \; \overline{\sigma_1}) \sim (\forall \overline{a}. Q_2 \Rightarrow \sigma_2)\right] & = & \bot \\ -canon\left[(\forall \overline{a}. Q_1 \Rightarrow \sigma_1) \sim (\mathsf{T} \; \overline{\sigma_2})\right] & = & \bot \\ +\begin{array}{lrclr} +\textsc{[$\sim$refl]} & canon\left[\sigma \sim \sigma\right] & = & \epsilon \\ +\textsc{[$\sim$orient]} & canon\left[\sigma_1 \sim \sigma_2\right] & = & \sigma_2 \sim \sigma_1 +& \textrm{where } \sigma_2 \prec \sigma_1 \\ + +\textsc{[$\sim$tdec]} & canon\left[(\mathsf{T} \; \overline{\sigma_1}) \sim (\mathsf{T} \; \overline{\sigma_2})\right] & = & \overline{\sigma_1 \sim \sigma_2} \\ +\textsc{[$\sim$faildec]} & canon\left[(\mathsf{T} \; \overline{\sigma_1}) \sim (\mathsf{S} \; \overline{\sigma_2})\right] & = & \bot + & \textrm{where } \mathsf{T} \neq \mathsf{S} \\ +\textsc{[$\sim$occ]} & canon\left[tv \sim \xi \right] & = & \bot & \textrm{where } tv \in \xi, \xi \neq tv \\ + +\textsc{[$\sim$$\forall$dec]} & canon\left[(\forall \overline{a}. Q \Rightarrow \sigma_1) \sim (\forall \overline{a}. Q \Rightarrow \sigma_2)\right] & = & \multicolumn{2}{l}{\forall \overline{a}. \, (Q \supset \sigma_1 \sim \sigma_2)} \\ +\textsc{[$\sim$$\forall$fail]} & canon\left[(\mathsf{T} \; \overline{\sigma_1}) \sim (\forall \overline{a}. Q_2 \Rightarrow \sigma_2)\right] & = & \bot \\ \end{array} $$ +\caption{Canonicalization rules for $\sim$} +\label{fig:sim} +\end{figure} -\subsection*{Rules for $\leq$} - +\begin{figure} $$ \begin{array}{lrcl} \textsc{[$\leq$refl]} & canon\left[\sigma \leq \sigma\right] & = & \sigma \sim \sigma \\ \textsc{[$\leq$trivial]} & canon\left[(\forall a. a) \leq \sigma_2 \right] & = & \epsilon \\ -\textsc{[$\leq$lcon]} & canon\left[(\mathsf{D} \; \overline{\sigma_1}) \leq \sigma_2\right] & = & (\mathsf{D} \; \overline{\sigma_1}) \sim \sigma_2 \\ +\textsc{[$\leq$lcon]} & canon\left[(\mathsf{T} \; \overline{\sigma_1}) \leq \sigma_2\right] & = & (\mathsf{T} \; \overline{\sigma_1}) \sim \sigma_2 \\ \textsc{[$\leq$l$\forall$]} & canon\left[(\forall \overline{a}. Q_1 \Rightarrow \sigma_1) \leq \sigma_2\right] & = & [\overline{a \mapsto \alpha}]\sigma_1 \leq \sigma_2 \, \wedge \, [\overline{a \mapsto \alpha}]Q_1 \\ -& & & \textrm{where } \sigma_2 \textrm{ is } \mathsf{D} \; \overline{\sigma} \textrm{ or a Skolem variable} \\ +& & & \textrm{where } \sigma_2 \textrm{ is } \mathsf{T} \; \overline{\sigma} \textrm{ or a Skolem variable} \\ \textsc{[$\leq$r$\forall$]} & canon\left[\sigma_1 \leq (\forall \overline{a}. Q_2 \Rightarrow \sigma_2)\right] & = & \forall \overline{a}. \, (Q_2 \supset \sigma_1 \leq \sigma_2) \\ \end{array} $$ +\caption{Canonicalization rules for $\leq$} +\label{fig:leq} +\end{figure} + +A subset of the canonicalization rules is given in Figures \ref{fig:sim} and \ref{fig:leq}. The only missing ones are those related to flattening of constraints. \subsubsection*{Notes on the {\sc [$\leq$trivial]} rule} @@ -490,7 +501,6 @@ f x = S (error x) If we apply {\sc [AppFunNonVar]} directly, we instantiate the type of $error :: \forall b. [Char] \to b$ to $[Char] \to \beta$. Since we are pushing down a unification variable $\alpha$ because of the previous application of {\sc [AppFunNonVar]} to $S :: \forall a. \, a \to S \; a$, we obtain a constraint $\beta \leq \alpha$. Since there are no more restrictions to either $\alpha$ or $\beta$, we are not stuck in solving. -\newpage \section*{Examples} \subsection*{\tt runST e} $$(\$)^{\alpha \to \beta \to \gamma} \; runST^\alpha \; \left( e \; :: \; \forall s. ST \; s \; Int \right)^\beta$$ From git at git.haskell.org Fri Jul 17 12:53:49 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 17 Jul 2015 12:53:49 +0000 (UTC) Subject: [commit: ghc] wip/impredicativity: Rework some canonicalization of InstanceOf constraints (276ec46) Message-ID: <20150717125349.0F81E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/impredicativity Link : http://ghc.haskell.org/trac/ghc/changeset/276ec4628059f68891d0909b627490df751902b0/ghc >--------------------------------------------------------------- commit 276ec4628059f68891d0909b627490df751902b0 Author: Alejandro Serrano Date: Fri Jul 17 14:53:00 2015 +0200 Rework some canonicalization of InstanceOf constraints - Removed <=Trivial rule - Added new rule which for the case of (forall a. Q => a) <= sigma where a in a variable, produces alpha ~ sigma instead of the default alpha <= sigma. - Updated design document >--------------------------------------------------------------- 276ec4628059f68891d0909b627490df751902b0 compiler/typecheck/TcCanonical.hs | 80 +++++++++++++++++---------------------- compiler/typecheck/TcInteract.hs | 36 ++---------------- docs/types/impredicativity.ltx | 75 ++++++++++++++++++++++-------------- 3 files changed, 84 insertions(+), 107 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 276ec4628059f68891d0909b627490df751902b0 From git at git.haskell.org Fri Jul 17 15:50:35 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 17 Jul 2015 15:50:35 +0000 (UTC) Subject: [commit: ghc] master: Reduce non-determinism in ABI hashes with RULES and instance decls (3448f98) Message-ID: <20150717155035.733413A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/3448f9827d2364b91bc60134aa38b74849b9d54e/ghc >--------------------------------------------------------------- commit 3448f9827d2364b91bc60134aa38b74849b9d54e Author: Bartosz Nitka Date: Fri Jul 17 16:50:52 2015 +0100 Reduce non-determinism in ABI hashes with RULES and instance decls Summary: Before this change the `RULES` would be attached to one for the names from the module that appear on the left hand side. The choice depended on the `uniq` that was generated, which are known to be non-deterministic (a separate, bigger problem). Now we use `OccName`s which should be stable. Analogously for instance declarations, but they are attached to one of the types involved. Test Plan: contbuild it made `Data.Text.Internal.Fusion.Common` interface stable, previously stream fusion rule would be attached either to `streamList` or `unstreamList` depending on if the module was compiled after `cabal clean` or after `find | grep '\.o$' | xargs rm`. Reviewers: simonpj, austin, bgamari, simonmar Subscribers: puffnfresh, thomie Differential Revision: https://phabricator.haskell.org/D1073 GHC Trac Issues: #4012 >--------------------------------------------------------------- 3448f9827d2364b91bc60134aa38b74849b9d54e compiler/specialise/Rules.hs | 12 +++++++++--- compiler/types/InstEnv.hs | 13 ++++++++++--- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/compiler/specialise/Rules.hs b/compiler/specialise/Rules.hs index cb71e3a..7cf6e56 100644 --- a/compiler/specialise/Rules.hs +++ b/compiler/specialise/Rules.hs @@ -180,9 +180,15 @@ mkRule this_mod is_auto is_local name act fn bndrs args rhs lhs_names = nameSetElems (extendNameSet (exprsOrphNames args) fn) -- TODO: copied from ruleLhsOrphNames - orph = case filter (nameIsLocalOrFrom this_mod) lhs_names of - (n : _) -> NotOrphan (nameOccName n) - [] -> IsOrphan + -- Since rules get eventually attached to one of the free names + -- from the definition when compiling the ABI hash, we should make + -- it deterministic. This chooses the one with minimal OccName + -- as opposed to uniq value. + local_lhs_names = filter (nameIsLocalOrFrom this_mod) lhs_names + anchor = minimum $ map nameOccName local_lhs_names + orph = case local_lhs_names of + (_ : _) -> NotOrphan anchor + [] -> IsOrphan -------------- roughTopNames :: [CoreExpr] -> [Maybe Name] diff --git a/compiler/types/InstEnv.hs b/compiler/types/InstEnv.hs index f810850..db8f531 100644 --- a/compiler/types/InstEnv.hs +++ b/compiler/types/InstEnv.hs @@ -236,10 +236,17 @@ mkLocalInstance dfun oflag tvs cls tys do_one (_ltvs, rtvs) = choose_one [ns | (tv,ns) <- cls_tvs `zip` arg_names , not (tv `elem` rtvs)] + -- Since instance declarations get eventually attached to one of the types + -- from the definition when compiling the ABI hash, we should make + -- it deterministic. This chooses the one with minimal OccName + -- as opposed to uniq value. choose_one :: [NameSet] -> IsOrphan - choose_one nss = case nameSetElems (unionNameSets nss) of - [] -> IsOrphan - (n : _) -> NotOrphan (nameOccName n) + choose_one nss = case local_names of + [] -> IsOrphan + (_ : _) -> NotOrphan anchor + where + local_names = nameSetElems (unionNameSets nss) + anchor = minimum $ map nameOccName local_names mkImportedInstance :: Name -> [Maybe Name] From git at git.haskell.org Fri Jul 17 23:56:53 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 17 Jul 2015 23:56:53 +0000 (UTC) Subject: [commit: ghc] master: Update assert to fix retc001 and retc002 (#9243) (bc604bd) Message-ID: <20150717235653.097BD3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/bc604bdb0144010e8582caa6ea159ca0446c04f2/ghc >--------------------------------------------------------------- commit bc604bdb0144010e8582caa6ea159ca0446c04f2 Author: Thomas Miedema Date: Fri Jul 17 11:42:24 2015 +0200 Update assert to fix retc001 and retc002 (#9243) Since 2223e196b2dc5340d70e58be011c279d381b4319, maybe_old_linkable can be Nothing even with an up-to-date interface file. This happens when compiling with --make -fno-code -fwrite-interface. See also Note [Recompilation checking when typechecking only] in GhcMake.hs. This fixes retc001 and retc002 when ghc_debugged. Differential Revision: https://phabricator.haskell.org/D1077 >--------------------------------------------------------------- bc604bdb0144010e8582caa6ea159ca0446c04f2 compiler/main/DriverPipeline.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs index 3affcb1..ff6e81d 100644 --- a/compiler/main/DriverPipeline.hs +++ b/compiler/main/DriverPipeline.hs @@ -186,7 +186,7 @@ compileOne' m_tc_result mHscMessage case e of Left iface -> do details <- genModDetails hsc_env iface - MASSERT(isJust maybe_old_linkable) + MASSERT(isJust maybe_old_linkable || isNoLink (ghcLink dflags)) return (HomeModInfo{ hm_details = details, hm_iface = iface, hm_linkable = maybe_old_linkable }) From git at git.haskell.org Fri Jul 17 23:56:55 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 17 Jul 2015 23:56:55 +0000 (UTC) Subject: [commit: ghc] master: Travis: actually do debug builds (0d4b074) Message-ID: <20150717235655.C19133A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/0d4b0742f33dc6f358d89aa52b8c8b5e39892a4a/ghc >--------------------------------------------------------------- commit 0d4b0742f33dc6f358d89aa52b8c8b5e39892a4a Author: Thomas Miedema Date: Fri Jul 17 11:34:46 2015 +0200 Travis: actually do debug builds >--------------------------------------------------------------- 0d4b0742f33dc6f358d89aa52b8c8b5e39892a4a .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b283937..5e56226 100644 --- a/.travis.yml +++ b/.travis.yml @@ -47,7 +47,7 @@ script: # do not build dynamic libraries - echo 'DYNAMIC_GHC_PROGRAMS = NO' >> mk/validate.mk - echo 'GhcLibWays = v' >> mk/validate.mk - - if [ "$DEBUG_STAGE" = "YES" ]; then echo 'GhcStage2HcOpts += -DDEBUG' >> mk/validate.mk; fi + - if [ "$DEBUG_STAGE2" = "YES" ]; then echo 'GhcStage2HcOpts += -DDEBUG' >> mk/validate.mk; fi # Don't use --quiet, as it might cause the testsuite to not print output for # over 10 minutes, causing Travis to kill our job. - CPUS=2 SKIP_PERF_TESTS=YES ./validate --fast From git at git.haskell.org Fri Jul 17 23:56:58 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 17 Jul 2015 23:56:58 +0000 (UTC) Subject: [commit: ghc] master: Testsuite: small test cleanups (ac0feec) Message-ID: <20150717235658.B3D983A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/ac0feece3659c41d546f8e519d05e2167d3b3cc4/ghc >--------------------------------------------------------------- commit ac0feece3659c41d546f8e519d05e2167d3b3cc4 Author: Thomas Miedema Date: Thu Jul 16 17:41:56 2015 +0200 Testsuite: small test cleanups * don't print anything to stdout * add missing Makefile * also ignore mk/ghcconfig*.mk when using installed compiler * prevent warning: -rtsopts and -with-rtsopts have no effect with -shared >--------------------------------------------------------------- ac0feece3659c41d546f8e519d05e2167d3b3cc4 testsuite/.gitignore | 5 ++--- testsuite/tests/annotations/should_run/Makefile | 1 - testsuite/tests/{annotations => ghc-e}/Makefile | 0 testsuite/tests/rts/Makefile | 2 +- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/testsuite/.gitignore b/testsuite/.gitignore index 3583a06..d4ef22b 100644 --- a/testsuite/.gitignore +++ b/testsuite/.gitignore @@ -55,9 +55,8 @@ tmp.d *.so *bindisttest_install___dir_bin_ghc.mk *bindisttest_install___dir_bin_ghc.exe.mk -mk/ghcconfig*_inplace_bin_ghc-stage1.mk -mk/ghcconfig*_inplace_bin_ghc-stage2.mk -mk/ghcconfig*_inplace_bin_ghc-stage2.exe.mk +mk/ghcconfig*_bin_ghc-*.mk +mk/ghcconfig*_bin_ghc-*.exe.mk *.imports # ----------------------------------------------------------------------------- diff --git a/testsuite/tests/annotations/should_run/Makefile b/testsuite/tests/annotations/should_run/Makefile index 71e065f..49339a5 100644 --- a/testsuite/tests/annotations/should_run/Makefile +++ b/testsuite/tests/annotations/should_run/Makefile @@ -6,7 +6,6 @@ CONFIG_HS=Config.hs config : rm -f $(CONFIG_HS) - @echo "Creating $(CONFIG_HS) ... " echo "module Config where" >>$(CONFIG_HS) echo "cTop :: String" >> $(CONFIG_HS) echo 'cTop = "$(subst \,\\,$(shell '$(TEST_HC)' --print-libdir))"' >> $(CONFIG_HS) diff --git a/testsuite/tests/annotations/Makefile b/testsuite/tests/ghc-e/Makefile similarity index 100% copy from testsuite/tests/annotations/Makefile copy to testsuite/tests/ghc-e/Makefile diff --git a/testsuite/tests/rts/Makefile b/testsuite/tests/rts/Makefile index 644d741..5e5782a 100644 --- a/testsuite/tests/rts/Makefile +++ b/testsuite/tests/rts/Makefile @@ -19,7 +19,7 @@ outofmem2:: T2615-prep: $(RM) libfoo_T2615.so '$(TEST_HC)' $(TEST_HC_OPTS) -fPIC -c libfoo_T2615.c -o libfoo_T2615.o - '$(TEST_HC)' $(TEST_HC_OPTS) -shared -no-auto-link-packages libfoo_T2615.o -o libfoo_T2615.so + '$(TEST_HC)' $(filter-out -rtsopts, $(TEST_HC_OPTS)) -shared -no-auto-link-packages libfoo_T2615.o -o libfoo_T2615.so .PHONY: T4059 T4059: From git at git.haskell.org Fri Jul 17 23:57:01 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 17 Jul 2015 23:57:01 +0000 (UTC) Subject: [commit: ghc] master: Build system: fail when encountering an unknown package tag (a0371c0) Message-ID: <20150717235701.712293A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a0371c066f72b9cd4bb8f8ccad9bc4db6657c452/ghc >--------------------------------------------------------------- commit a0371c066f72b9cd4bb8f8ccad9bc4db6657c452 Author: Thomas Miedema Date: Wed Jul 15 11:05:57 2015 +0200 Build system: fail when encountering an unknown package tag >--------------------------------------------------------------- a0371c066f72b9cd4bb8f8ccad9bc4db6657c452 ghc.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ghc.mk b/ghc.mk index db077bc..2a0adb9 100644 --- a/ghc.mk +++ b/ghc.mk @@ -444,7 +444,7 @@ ifeq "$$(BUILD_EXTRA_PKGS)" "YES" PACKAGES_STAGE2 += $1 endif else -PACKAGES_STAGE2 += $1 +$$(error Unknown package tag: $2) endif endef $(eval $(call foreachLibrary,addExtraPackage)) From git at git.haskell.org Fri Jul 17 23:57:04 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 17 Jul 2015 23:57:04 +0000 (UTC) Subject: [commit: ghc] master: Testsuite: accept new stderr for T9497{a, b, c}-run (#10224) (f607393) Message-ID: <20150717235704.4FC573A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/f607393b7ffa8a06417e3f1263d2610d6bfe8279/ghc >--------------------------------------------------------------- commit f607393b7ffa8a06417e3f1263d2610d6bfe8279 Author: Thomas Miedema Date: Thu Jul 16 10:42:22 2015 +0200 Testsuite: accept new stderr for T9497{a,b,c}-run (#10224) >--------------------------------------------------------------- f607393b7ffa8a06417e3f1263d2610d6bfe8279 testsuite/tests/typecheck/should_run/T9497a-run.stderr | 4 ++-- testsuite/tests/typecheck/should_run/T9497b-run.stderr | 4 ++-- testsuite/tests/typecheck/should_run/T9497c-run.stderr | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/testsuite/tests/typecheck/should_run/T9497a-run.stderr b/testsuite/tests/typecheck/should_run/T9497a-run.stderr index 192f78f..43f720b 100644 --- a/testsuite/tests/typecheck/should_run/T9497a-run.stderr +++ b/testsuite/tests/typecheck/should_run/T9497a-run.stderr @@ -1,5 +1,5 @@ -T9497a-run: T9497a-run.hs:2:8: - Found hole ?_main? with type: IO () +T9497a-run: T9497a-run.hs:2:8: error: + Found hole: _main :: IO () Or perhaps ?_main? is mis-spelled, or not in scope Relevant bindings include main :: IO () (bound at T9497a-run.hs:2:1) diff --git a/testsuite/tests/typecheck/should_run/T9497b-run.stderr b/testsuite/tests/typecheck/should_run/T9497b-run.stderr index a53262e..02fda34 100644 --- a/testsuite/tests/typecheck/should_run/T9497b-run.stderr +++ b/testsuite/tests/typecheck/should_run/T9497b-run.stderr @@ -1,5 +1,5 @@ -T9497b-run: T9497b-run.hs:2:8: - Found hole ?_main? with type: IO () +T9497b-run: T9497b-run.hs:2:8: error: + Found hole: _main :: IO () Or perhaps ?_main? is mis-spelled, or not in scope Relevant bindings include main :: IO () (bound at T9497b-run.hs:2:1) diff --git a/testsuite/tests/typecheck/should_run/T9497c-run.stderr b/testsuite/tests/typecheck/should_run/T9497c-run.stderr index f991cd6..5fe0743 100644 --- a/testsuite/tests/typecheck/should_run/T9497c-run.stderr +++ b/testsuite/tests/typecheck/should_run/T9497c-run.stderr @@ -1,5 +1,5 @@ -T9497c-run: T9497c-run.hs:2:8: - Found hole ?_main? with type: IO () +T9497c-run: T9497c-run.hs:2:8: error: + Found hole: _main :: IO () Or perhaps ?_main? is mis-spelled, or not in scope Relevant bindings include main :: IO () (bound at T9497c-run.hs:2:1) From git at git.haskell.org Sat Jul 18 14:03:52 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 18 Jul 2015 14:03:52 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: 7.10.2-notes: Fix description of iconv bypass (295f5b8) Message-ID: <20150718140352.866CC3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/295f5b846ceb1f01ab4539c52d310496968eef65/ghc >--------------------------------------------------------------- commit 295f5b846ceb1f01ab4539c52d310496968eef65 Author: Ben Gamari Date: Fri Jul 17 19:46:56 2015 +0200 7.10.2-notes: Fix description of iconv bypass We now only handle ascii ourselves if iconv is unavailable. >--------------------------------------------------------------- 295f5b846ceb1f01ab4539c52d310496968eef65 docs/users_guide/7.10.2-notes.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/users_guide/7.10.2-notes.xml b/docs/users_guide/7.10.2-notes.xml index 37a498a..83a7889 100644 --- a/docs/users_guide/7.10.2-notes.xml +++ b/docs/users_guide/7.10.2-notes.xml @@ -183,7 +183,7 @@ has been fixed, so these programs will now terminate with an error. As a result of this change, however, GHC compiled programs now also specifically recognize ASCII - encodings, and can bypass iconv in these cases. This + encodings, and can function without iconv in these cases. This allows statically compiled programs to exist inside an initramfs, for example (issues #10298, #7695). From git at git.haskell.org Sat Jul 18 14:03:55 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 18 Jul 2015 14:03:55 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Rewrite announce file (82ffb39) Message-ID: <20150718140355.435273A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/82ffb39b2ba25eed806ff150b44a9051fa0ac95c/ghc >--------------------------------------------------------------- commit 82ffb39b2ba25eed806ff150b44a9051fa0ac95c 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 >--------------------------------------------------------------- 82ffb39b2ba25eed806ff150b44a9051fa0ac95c ANNOUNCE | 47 ++++++++++++++++++++++------------------------- 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index f9f1c57..85282a2 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,35 +1,33 @@ ============================================================== - The (Interactive) Glasgow Haskell Compiler -- version 6.10.1 + The (Interactive) Glasgow Haskell Compiler -- version 7.10.2 ============================================================== -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 minor release of GHC. This is a +bug-fix release and contains a number of important fixes, - * Some new language features have been implemented: - * Record syntax: wild-card patterns, punning, and field disambiguation - * Generalised quasi-quotes - * Generalised list comprehensions - * View patterns + * Various typechecker issues have been fixed, including some bugs which allowed + the user to write unsafeCoerce - * Type families have been completely re-implemented + * DWARF debug information is now more correct and supported on Windows - * Now comes with Haddock 2, which supports all GHC extensions + * Portability issues resulting in crashes on SPARC, Linux/i386, ARM, AArch64, + and PowerPC have been fixed - * Parallel garbage collection + * The event manager's multi-shot event registration functionality now works + correctly - * Base provides extensible exceptions + * A bug where unaccounted for register aliasing could result in incorrect + floating-point results has been fixed - * The GHC API is easier to use + * An infinite loop during program startup when iconv is unavailable hsa been + fixed - * External core (output only) now works again +A more thorough list of the changes in the release can be found in the release +notes, - * Data Parallel Haskell (DPH) comes as part of GHC + http://haskell.org/ghc/docs/7.10.2/html/users_guide/release-7-10-2.html -The full release notes are here: - - http://haskell.org/ghc/docs/6.10.1/html/users_guide/release-6-10-1.html How to get it ~~~~~~~~~~~~~ @@ -52,13 +50,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 +104,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 Sat Jul 18 14:03:58 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 18 Jul 2015 14:03:58 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: haddock: Pull in fix for source link rendering (b1424cc) Message-ID: <20150718140358.2D5FF3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/b1424cc8f17b053da602c8659615ea5d4d3450f6/ghc >--------------------------------------------------------------- commit b1424cc8f17b053da602c8659615ea5d4d3450f6 Author: Ben Gamari Date: Sat Jul 18 16:03:20 2015 +0200 haddock: Pull in fix for source link rendering Update haddock submodule >--------------------------------------------------------------- b1424cc8f17b053da602c8659615ea5d4d3450f6 utils/haddock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/haddock b/utils/haddock index f48474f..4343f6c 160000 --- a/utils/haddock +++ b/utils/haddock @@ -1 +1 @@ -Subproject commit f48474f640387dca4b42182c1ac78ba30865742d +Subproject commit 4343f6c86225b6e283c73afcd8adc007fafebeff From git at git.haskell.org Sat Jul 18 18:49:32 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 18 Jul 2015 18:49:32 +0000 (UTC) Subject: [commit: ghc] master: Testsuite: mark T2497 expect_broken_for(#10657, ['optasm', 'optllvm']) (dc6e556) Message-ID: <20150718184932.74CE83A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/dc6e55626cf25bcda1cab52f92591e16bddd101d/ghc >--------------------------------------------------------------- commit dc6e55626cf25bcda1cab52f92591e16bddd101d Author: Thomas Miedema Date: Sat Jul 18 19:01:13 2015 +0200 Testsuite: mark T2497 expect_broken_for(#10657, ['optasm', 'optllvm']) >--------------------------------------------------------------- dc6e55626cf25bcda1cab52f92591e16bddd101d testsuite/tests/typecheck/should_compile/all.T | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T index a277b33..f1c7c4c 100644 --- a/testsuite/tests/typecheck/should_compile/all.T +++ b/testsuite/tests/typecheck/should_compile/all.T @@ -283,7 +283,7 @@ test('T2433', extra_clean(['T2433_Help.hi', 'T2433_Help.o']), multimod_compile, ['T2433', '-v0']) test('T2494', normal, compile_fail, ['']) test('T2494-2', normal, compile, ['']) -test('T2497', normal, compile, ['']) +test('T2497', expect_broken_for(10657, ['optasm', 'optllvm']), compile, ['']) # Omitting temporarily From git at git.haskell.org Sat Jul 18 18:49:35 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 18 Jul 2015 18:49:35 +0000 (UTC) Subject: [commit: ghc] master: Testsuite: mark T7919 expect_broken_for(#7919, ['optasm', 'dyn', 'optllvm']) (dcaa486) Message-ID: <20150718184935.4CEA93A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/dcaa4865a4ee99888e90a80b7f09e11e71689f6c/ghc >--------------------------------------------------------------- commit dcaa4865a4ee99888e90a80b7f09e11e71689f6c Author: Thomas Miedema Date: Sat Jul 18 19:25:37 2015 +0200 Testsuite: mark T7919 expect_broken_for(#7919, ['optasm','dyn','optllvm']) It fails with a segmentation fault. Occasionally also for WAY=threaded2. >--------------------------------------------------------------- dcaa4865a4ee99888e90a80b7f09e11e71689f6c testsuite/tests/rts/all.T | 1 + 1 file changed, 1 insertion(+) diff --git a/testsuite/tests/rts/all.T b/testsuite/tests/rts/all.T index 0e89249..5be3634 100644 --- a/testsuite/tests/rts/all.T +++ b/testsuite/tests/rts/all.T @@ -217,6 +217,7 @@ test('ffishutdown', [ ignore_output, only_ways(['threaded1','threaded2']) ], com test('T7919', [extra_clean(['T7919A.o','T7919A.hi', 'T7919A.dyn_o','T7919A.dyn_hi']), + expect_broken_for(7919, ['optasm','dyn','optllvm']), when(fast(),skip) ], compile_and_run, [config.ghc_th_way_flags]) From git at git.haskell.org Sat Jul 18 18:49:38 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 18 Jul 2015 18:49:38 +0000 (UTC) Subject: [commit: ghc] master: Testsuite: mark 3 tests expect_broken_for(#10181, ['optasm', 'optllvm']) (11f8612) Message-ID: <20150718184938.15A253A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/11f86125d7fda92d1d9962ef5c07a58eb9a2901f/ghc >--------------------------------------------------------------- commit 11f86125d7fda92d1d9962ef5c07a58eb9a2901f Author: Thomas Miedema Date: Sat Jul 18 20:38:57 2015 +0200 Testsuite: mark 3 tests expect_broken_for(#10181, ['optasm', 'optllvm']) >--------------------------------------------------------------- 11f86125d7fda92d1d9962ef5c07a58eb9a2901f testsuite/tests/parser/should_compile/all.T | 2 +- testsuite/tests/rename/should_compile/all.T | 2 +- testsuite/tests/typecheck/should_compile/all.T | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/testsuite/tests/parser/should_compile/all.T b/testsuite/tests/parser/should_compile/all.T index 521b5a4..0030040 100644 --- a/testsuite/tests/parser/should_compile/all.T +++ b/testsuite/tests/parser/should_compile/all.T @@ -41,7 +41,7 @@ test('read025', normal, compile, ['']) test('read026', normal, compile, ['']) test('read027', normal, compile, ['']) test('read028', normal, compile, ['']) -test('read029', normal, compile, ['']) +test('read029', expect_broken_for(10181, ['optasm', 'optllvm']), compile, ['']) test('read030', normal, compile, ['']) test('read031', normal, compile, ['']) test('read032', normal, compile, ['']) diff --git a/testsuite/tests/rename/should_compile/all.T b/testsuite/tests/rename/should_compile/all.T index 7f0d410..8a59782 100644 --- a/testsuite/tests/rename/should_compile/all.T +++ b/testsuite/tests/rename/should_compile/all.T @@ -53,7 +53,7 @@ test('rn037', normal, compile, ['']) test('rn039', normal, compile, ['']) test('rn040', normal, compile, ['-fwarn-unused-binds -fwarn-unused-matches']) -test('rn041', normal, compile, ['']) +test('rn041', expect_broken_for(10181, ['optasm', 'optllvm']), compile, ['']) test('rn042', extra_clean(['Rn042_A.hi', 'Rn042_A.o']), multimod_compile, diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T index f1c7c4c..5674d87 100644 --- a/testsuite/tests/typecheck/should_compile/all.T +++ b/testsuite/tests/typecheck/should_compile/all.T @@ -165,7 +165,7 @@ test('tc161', normal, compile, ['']) test('tc162', normal, compile, ['']) test('tc163', normal, compile, ['']) test('tc164', normal, compile, ['']) -test('tc165', normal, compile, ['']) +test('tc165', expect_broken_for(10181, ['optasm', 'optllvm']), compile, ['']) test('tc166', normal, compile, ['']) test('tc167', normal, compile_fail, ['']) test('tc168', normal, compile_fail, ['']) From git at git.haskell.org Sat Jul 18 18:49:40 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 18 Jul 2015 18:49:40 +0000 (UTC) Subject: [commit: ghc] master: Testsuite: mark qq007 and qq008 expect_broken(#10181) (16a8739) Message-ID: <20150718184940.D7A943A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/16a87397295fa92bcbe7a2c6277f938622b93969/ghc >--------------------------------------------------------------- commit 16a87397295fa92bcbe7a2c6277f938622b93969 Author: Thomas Miedema Date: Sat Jul 18 20:45:14 2015 +0200 Testsuite: mark qq007 and qq008 expect_broken(#10181) >--------------------------------------------------------------- 16a87397295fa92bcbe7a2c6277f938622b93969 testsuite/tests/quasiquotation/qq007/test.T | 1 + testsuite/tests/quasiquotation/qq008/test.T | 1 + 2 files changed, 2 insertions(+) diff --git a/testsuite/tests/quasiquotation/qq007/test.T b/testsuite/tests/quasiquotation/qq007/test.T index 0b4448c..ce1b0ff 100644 --- a/testsuite/tests/quasiquotation/qq007/test.T +++ b/testsuite/tests/quasiquotation/qq007/test.T @@ -2,6 +2,7 @@ test('qq007', [when(fast(), skip), extra_clean(['QQ.hi', 'QQ.o', 'Test.hi', 'Test.o']), pre_cmd('$MAKE -s --no-print-directory TH_QQ'), + expect_broken(10181), ], multimod_compile, ['Test', '-v0']) diff --git a/testsuite/tests/quasiquotation/qq008/test.T b/testsuite/tests/quasiquotation/qq008/test.T index 8cac1a9..b1bc5d2 100644 --- a/testsuite/tests/quasiquotation/qq008/test.T +++ b/testsuite/tests/quasiquotation/qq008/test.T @@ -2,6 +2,7 @@ test('qq008', [when(fast(), skip), extra_clean(['QQ.hi', 'QQ.o', 'Test.hi', 'Test.o']), pre_cmd('$MAKE -s --no-print-directory TH_QQ'), + expect_broken(10181), ], multimod_compile, ['Test', '-v0']) From git at git.haskell.org Sat Jul 18 18:56:22 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 18 Jul 2015 18:56:22 +0000 (UTC) Subject: [commit: ghc] master: Testsuite: mark qq007 and qq008 expect_broken(#10047) (cbb4d78) Message-ID: <20150718185622.376DE3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/cbb4d7887e6ff039c9a482178435a688b4c5d4f8/ghc >--------------------------------------------------------------- commit cbb4d7887e6ff039c9a482178435a688b4c5d4f8 Author: Thomas Miedema Date: Sat Jul 18 20:55:24 2015 +0200 Testsuite: mark qq007 and qq008 expect_broken(#10047) This fixes the wrong ticket number in 16a87397295fa92bcbe7a2c6277f938622b93969 (#10181). >--------------------------------------------------------------- cbb4d7887e6ff039c9a482178435a688b4c5d4f8 testsuite/tests/quasiquotation/qq007/test.T | 2 +- testsuite/tests/quasiquotation/qq008/test.T | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/testsuite/tests/quasiquotation/qq007/test.T b/testsuite/tests/quasiquotation/qq007/test.T index ce1b0ff..d9a2df3 100644 --- a/testsuite/tests/quasiquotation/qq007/test.T +++ b/testsuite/tests/quasiquotation/qq007/test.T @@ -2,7 +2,7 @@ test('qq007', [when(fast(), skip), extra_clean(['QQ.hi', 'QQ.o', 'Test.hi', 'Test.o']), pre_cmd('$MAKE -s --no-print-directory TH_QQ'), - expect_broken(10181), + expect_broken(10047), ], multimod_compile, ['Test', '-v0']) diff --git a/testsuite/tests/quasiquotation/qq008/test.T b/testsuite/tests/quasiquotation/qq008/test.T index b1bc5d2..5bdd2a9 100644 --- a/testsuite/tests/quasiquotation/qq008/test.T +++ b/testsuite/tests/quasiquotation/qq008/test.T @@ -2,7 +2,7 @@ test('qq008', [when(fast(), skip), extra_clean(['QQ.hi', 'QQ.o', 'Test.hi', 'Test.o']), pre_cmd('$MAKE -s --no-print-directory TH_QQ'), - expect_broken(10181), + expect_broken(10047), ], multimod_compile, ['Test', '-v0']) From git at git.haskell.org Sat Jul 18 20:32:54 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 18 Jul 2015 20:32:54 +0000 (UTC) Subject: [commit: packages/array] master: Testsuite: mark array001 expect_broken_for(#10659, ['optasm', ...]) (604afd5) Message-ID: <20150718203254.419D03A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/array On branch : master Link : http://git.haskell.org/packages/array.git/commitdiff/604afd531aba4a96b066f6e59a08813107a9eed3 >--------------------------------------------------------------- commit 604afd531aba4a96b066f6e59a08813107a9eed3 Author: Thomas Miedema Date: Sat Jul 18 22:33:01 2015 +0200 Testsuite: mark array001 expect_broken_for(#10659, ['optasm',...]) >--------------------------------------------------------------- 604afd531aba4a96b066f6e59a08813107a9eed3 tests/all.T | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/all.T b/tests/all.T index c563441..7324fdf 100644 --- a/tests/all.T +++ b/tests/all.T @@ -1,6 +1,10 @@ test('T2120', normal, compile_and_run, ['']) test('largeArray', normal, compile_and_run, ['']) -test('array001', extra_clean(['array001.data']), compile_and_run, ['']) +test('array001', [ + extra_clean(['array001.data']), + expect_broken_for(10659, ['hpc', 'optasm', 'threaded2', 'dyn', 'optllvm']), + ], + compile_and_run, ['']) test('T9220', normal, ghci_script, ['T9220.script']) From git at git.haskell.org Sat Jul 18 20:36:49 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 18 Jul 2015 20:36:49 +0000 (UTC) Subject: [commit: ghc] master: Testsuite: mark gadt/termination expect_broken_for(#10658, ['optasm', 'optllvm']) (43dafc9) Message-ID: <20150718203649.194613A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/43dafc93b201e193e83792d2461bf4e45805b5c3/ghc >--------------------------------------------------------------- commit 43dafc93b201e193e83792d2461bf4e45805b5c3 Author: Thomas Miedema Date: Sat Jul 18 21:28:10 2015 +0200 Testsuite: mark gadt/termination expect_broken_for(#10658, ['optasm','optllvm']) >--------------------------------------------------------------- 43dafc93b201e193e83792d2461bf4e45805b5c3 testsuite/tests/gadt/all.T | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/tests/gadt/all.T b/testsuite/tests/gadt/all.T index 9a48e69..f458553 100644 --- a/testsuite/tests/gadt/all.T +++ b/testsuite/tests/gadt/all.T @@ -70,7 +70,7 @@ test('karl2', normal, compile, ['']) test('data1', normal, compile, ['']) test('data2', normal, compile, ['']) -test('termination', normal, compile, ['']) +test('termination', expect_broken_for(10658, ['optasm', 'optllvm']), compile, ['']) test('set', normal, compile, ['']) test('scoped', normal, compile, ['']) test('gadt-escape1', normal, compile_fail, ['']) From git at git.haskell.org Sat Jul 18 20:36:51 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 18 Jul 2015 20:36:51 +0000 (UTC) Subject: [commit: ghc] master: Testsuite: mark array001 and conc034 expect_broken_for(#10659, ['optasm', ...]) (34bb460) Message-ID: <20150718203651.C7CFB3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/34bb4605d4ec5b131df57ca4c91d6840b7539194/ghc >--------------------------------------------------------------- commit 34bb4605d4ec5b131df57ca4c91d6840b7539194 Author: Thomas Miedema Date: Sat Jul 18 22:19:01 2015 +0200 Testsuite: mark array001 and conc034 expect_broken_for(#10659, ['optasm',...]) Update submodule array. >--------------------------------------------------------------- 34bb4605d4ec5b131df57ca4c91d6840b7539194 libraries/array | 2 +- testsuite/tests/concurrent/should_run/all.T | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/libraries/array b/libraries/array index 0b23a9b..604afd5 160000 --- a/libraries/array +++ b/libraries/array @@ -1 +1 @@ -Subproject commit 0b23a9b9a0a8e89336687aa318d9142e2f542db3 +Subproject commit 604afd531aba4a96b066f6e59a08813107a9eed3 diff --git a/testsuite/tests/concurrent/should_run/all.T b/testsuite/tests/concurrent/should_run/all.T index 7fe4b3c..196c7c8 100644 --- a/testsuite/tests/concurrent/should_run/all.T +++ b/testsuite/tests/concurrent/should_run/all.T @@ -174,6 +174,8 @@ test('conc033', normal, compile_and_run, ['']) # Omit for GHCi, because it just sits there waiting for you to press ^C test('conc034', [ + expect_broken_for(10659, + ['optasm', 'threaded2', 'dyn', 'optllvm']), omit_ways(['ghci']), extra_run_opts('+RTS -C0 -RTS')], compile_and_run, ['']) From git at git.haskell.org Sun Jul 19 08:47:26 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 19 Jul 2015 08:47:26 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Another comment with a leading # (sigh) (3648e9f) Message-ID: <20150719084726.B295F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/3648e9fa36333e9e2c41ce8758988aac1390f33a/ghc >--------------------------------------------------------------- commit 3648e9fa36333e9e2c41ce8758988aac1390f33a Author: Simon Peyton Jones Date: Mon Jul 13 13:30:47 2015 +0100 Another comment with a leading # (sigh) >--------------------------------------------------------------- 3648e9fa36333e9e2c41ce8758988aac1390f33a compiler/specialise/SpecConstr.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/specialise/SpecConstr.hs b/compiler/specialise/SpecConstr.hs index c5d286d..6a69136 100644 --- a/compiler/specialise/SpecConstr.hs +++ b/compiler/specialise/SpecConstr.hs @@ -1740,8 +1740,8 @@ or because both of these will be optimised by Simplify.simplRule. In the former case such optimisation benign, because the rule will match more terms; but in the latter we may lose a binding of 'g1' or 'g2', and -end up with a rule LHS that doesn't bind the template variables (Trac -#10602). +end up with a rule LHS that doesn't bind the template variables +(Trac #10602). The simplifier eliminates such things, but SpecConstr itself constructs new terms by substituting. So the 'mkCast' in the Cast case of scExpr From git at git.haskell.org Mon Jul 20 02:35:55 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 20 Jul 2015 02:35:55 +0000 (UTC) Subject: [commit: ghc] master: Add regression test for unused implicit parameter warning (#10632) (9834fea) Message-ID: <20150720023555.7EA2C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/9834fea4d8fa00eb55f864287aa323ec7412e578/ghc >--------------------------------------------------------------- commit 9834fea4d8fa00eb55f864287aa323ec7412e578 Author: Reid Barton Date: Sun Jul 19 22:36:08 2015 -0400 Add regression test for unused implicit parameter warning (#10632) >--------------------------------------------------------------- 9834fea4d8fa00eb55f864287aa323ec7412e578 testsuite/tests/typecheck/should_compile/T10632.hs | 7 +++++++ testsuite/tests/typecheck/should_compile/T10632.stderr | 4 ++++ testsuite/tests/typecheck/should_compile/all.T | 1 + 3 files changed, 12 insertions(+) diff --git a/testsuite/tests/typecheck/should_compile/T10632.hs b/testsuite/tests/typecheck/should_compile/T10632.hs new file mode 100644 index 0000000..5c1a177 --- /dev/null +++ b/testsuite/tests/typecheck/should_compile/T10632.hs @@ -0,0 +1,7 @@ +{-# LANGUAGE ImplicitParams #-} + +f :: (?file1 :: String) => IO () +f = putStrLn $ "f2: " + +main :: IO () +main = let ?file1 = "A" in f diff --git a/testsuite/tests/typecheck/should_compile/T10632.stderr b/testsuite/tests/typecheck/should_compile/T10632.stderr new file mode 100644 index 0000000..81377b3 --- /dev/null +++ b/testsuite/tests/typecheck/should_compile/T10632.stderr @@ -0,0 +1,4 @@ + +T10632.hs:3:6: warning: + Redundant constraint: ?file1::String + In the type signature for: f :: (?file1::String) => IO () diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T index 5674d87..db9ad0e 100644 --- a/testsuite/tests/typecheck/should_compile/all.T +++ b/testsuite/tests/typecheck/should_compile/all.T @@ -466,4 +466,5 @@ test('T10428', normal, compile, ['']) test('RepArrow', normal, compile, ['']) test('T10562', normal, compile, ['']) test('T10564', normal, compile, ['']) +test('T10632', normal, compile, ['']) test('T10642', normal, compile, ['']) From git at git.haskell.org Mon Jul 20 15:05:59 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 20 Jul 2015 15:05:59 +0000 (UTC) Subject: [commit: ghc] master: Testsuite: add regression test for missing class constraint (029367e) Message-ID: <20150720150559.456F23A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/029367e5894d4ac3ea3845f39f2cc1b5a6a9fac1/ghc >--------------------------------------------------------------- commit 029367e5894d4ac3ea3845f39f2cc1b5a6a9fac1 Author: Thomas Miedema Date: Mon Jul 20 15:40:59 2015 +0200 Testsuite: add regression test for missing class constraint The following program is accepted by ghc-7.0 to ghc-7.10, but rejected by ghc-6.12.3 and HEAD (and rightfully so): class Class1 a class Class1 a => Class2 a class Class2 a => Class3 a instance Class3 a => Class2 a The last line is missing a `Class1 a` constraint. Add a regression test for this (typechecker/should_fail/tcfail223). Add similar missing class constraints to T7126 and T5751. I verified that the these changes don't interfer with the intention of the tests (they still result in a loop with ghc-7.4.1). Reviewers: austin, simonpj, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D1078 >--------------------------------------------------------------- 029367e5894d4ac3ea3845f39f2cc1b5a6a9fac1 testsuite/tests/typecheck/should_fail/all.T | 1 + testsuite/tests/typecheck/should_fail/tcfail223.hs | 10 ++++++++++ testsuite/tests/typecheck/should_fail/tcfail223.stderr | 9 +++++++++ testsuite/tests/typecheck/should_run/T5751.hs | 2 +- testsuite/tests/typecheck/should_run/T7126.hs | 2 +- 5 files changed, 22 insertions(+), 2 deletions(-) diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T index d1bf03b..fbbeddb 100644 --- a/testsuite/tests/typecheck/should_fail/all.T +++ b/testsuite/tests/typecheck/should_fail/all.T @@ -246,6 +246,7 @@ test('tcfail219', normal, multimod_compile_fail, ['tcfail219.hsig', '-sig-of "Sh test('tcfail220', normal, multimod_compile_fail, ['tcfail220.hsig', '-sig-of "ShouldFail is base:Prelude"']) test('tcfail221', normal, multimod_compile_fail, ['tcfail221.hsig', '-sig-of "ShouldFail is base:Prelude"']) test('tcfail222', normal, multimod_compile_fail, ['tcfail222.hsig', '-sig-of "ShouldFail is base:Data.STRef"']) +test('tcfail223', normal, compile_fail, ['']) test('SilentParametersOverlapping', normal, compile, ['']) test('FailDueToGivenOverlapping', normal, compile_fail, ['']) diff --git a/testsuite/tests/typecheck/should_fail/tcfail223.hs b/testsuite/tests/typecheck/should_fail/tcfail223.hs new file mode 100644 index 0000000..e5e0d5c --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/tcfail223.hs @@ -0,0 +1,10 @@ +{-# LANGUAGE FlexibleInstances, UndecidableInstances #-} +module ShouldFail where + +class Class1 a +class Class1 a => Class2 a +class Class2 a => Class3 a + +-- This was wrongfully accepted by ghc-7.0 to ghc-7.10. +-- It is missing a `Class1 a` constraint. +instance Class3 a => Class2 a diff --git a/testsuite/tests/typecheck/should_fail/tcfail223.stderr b/testsuite/tests/typecheck/should_fail/tcfail223.stderr new file mode 100644 index 0000000..e4a4fcd --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/tcfail223.stderr @@ -0,0 +1,9 @@ + +tcfail223.hs:10:10: error: + Could not deduce (Class1 a) + arising from the superclasses of an instance declaration + from the context: Class3 a + bound by the instance declaration at tcfail223.hs:10:10-29 + Possible fix: + add (Class1 a) to the context of the instance declaration + In the instance declaration for ?Class2 a? diff --git a/testsuite/tests/typecheck/should_run/T5751.hs b/testsuite/tests/typecheck/should_run/T5751.hs index 423a407..7c7d8ab 100644 --- a/testsuite/tests/typecheck/should_run/T5751.hs +++ b/testsuite/tests/typecheck/should_run/T5751.hs @@ -25,7 +25,7 @@ main = class (Widgets x) => MonadRender x class (XMLGenerator m) => Widgets m -- instance Widgets (IdentityT IO) -- if you uncomment this, it will work -instance MonadRender m => Widgets m +instance (XMLGenerator m, MonadRender m) => Widgets m instance MonadRender (IdentityT IO) web :: ( MonadIO m diff --git a/testsuite/tests/typecheck/should_run/T7126.hs b/testsuite/tests/typecheck/should_run/T7126.hs index ce9792d..184d5df 100644 --- a/testsuite/tests/typecheck/should_run/T7126.hs +++ b/testsuite/tests/typecheck/should_run/T7126.hs @@ -24,7 +24,7 @@ class Class2 a => Class3 a where instance Class1 Int where func1 = id -instance Class3 a => Class2 a where +instance (Class1 a, Class3 a) => Class2 a where func2 = func3 instance Class3 Int where From git at git.haskell.org Mon Jul 20 15:06:02 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 20 Jul 2015 15:06:02 +0000 (UTC) Subject: [commit: ghc] master: Testsuite: add -XUndecidableInstances to T3500a (7f37274) Message-ID: <20150720150602.190A93A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/7f37274d9f6de8c53cbf7fce3c39ad19cebdbbb5/ghc >--------------------------------------------------------------- commit 7f37274d9f6de8c53cbf7fce3c39ad19cebdbbb5 Author: Thomas Miedema Date: Mon Jul 20 15:40:26 2015 +0200 Testsuite: add -XUndecidableInstances to T3500a This makes the test pass again with HEAD (7.11), instead of resulting in: T3500a.hs:11:10: error: The constraint ?C (F a)? is no smaller than the instance head (Use UndecidableInstances to permit this) In the instance declaration for ?C (a, b)? Test Plan: I verified that ghc-6.12.3's typechecker still loops on this test. Reviewers: austin, bgamari, simonpj Reviewed By: simonpj Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1079 >--------------------------------------------------------------- 7f37274d9f6de8c53cbf7fce3c39ad19cebdbbb5 testsuite/tests/typecheck/should_run/T3500a.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/testsuite/tests/typecheck/should_run/T3500a.hs b/testsuite/tests/typecheck/should_run/T3500a.hs index c3adeb0..b614008 100644 --- a/testsuite/tests/typecheck/should_run/T3500a.hs +++ b/testsuite/tests/typecheck/should_run/T3500a.hs @@ -1,5 +1,6 @@ {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE UndecidableInstances #-} module Main where From git at git.haskell.org Mon Jul 20 15:06:05 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 20 Jul 2015 15:06:05 +0000 (UTC) Subject: [commit: ghc] master: Testsuite: add ImpredicativeTypes to T7861 (#7861) (4c96e7c) Message-ID: <20150720150605.1DA6A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/4c96e7cf56fc67ad09efaf8c5de1c8d7a0f5cedd/ghc >--------------------------------------------------------------- commit 4c96e7cf56fc67ad09efaf8c5de1c8d7a0f5cedd Author: Thomas Miedema Date: Mon Jul 20 15:39:52 2015 +0200 Testsuite: add ImpredicativeTypes to T7861 (#7861) The test was failing with: T7861: T7861.hs:15:13: Cannot instantiate unification variable ?t0? with a type involving foralls: A a0 -> a0 GHC doesn't yet support impredicative polymorphism In the first argument of ?seq?, namely ?f? In a stmt of a 'do' block: f `seq` print "Hello 2" It requires ImpredicativeTypes, at least since 7.8, because we instantiate seq's type (c->d->d) with f's type (c:= (forall b. a) -> a), which is polymorphic (it has foralls). I simplified the test a bit by removing the type synonym, and verified that ghc-7.6.3 still panics on this test. Reviewers: simonpj, austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1080 GHC Trac Issues: #7861 >--------------------------------------------------------------- 4c96e7cf56fc67ad09efaf8c5de1c8d7a0f5cedd testsuite/tests/typecheck/should_run/T7861.hs | 12 +++++++----- testsuite/tests/typecheck/should_run/T7861.stderr | 13 +++++++------ 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/testsuite/tests/typecheck/should_run/T7861.hs b/testsuite/tests/typecheck/should_run/T7861.hs index 9ff9a43..19a9c9d 100644 --- a/testsuite/tests/typecheck/should_run/T7861.hs +++ b/testsuite/tests/typecheck/should_run/T7861.hs @@ -1,20 +1,22 @@ {-# LANGUAGE RankNTypes #-} +{-# LANGUAGE ImpredicativeTypes #-} {-# OPTIONS_GHC -fdefer-type-errors #-} module Main where -type A a = forall b. a - -doA :: A a -> [a] +doA :: (forall b. a) -> [a] doA = undefined -f :: A a -> a +f :: (forall b. a) -> a f = doA main = do { print "Hello 1" ; f `seq` print "Hello 2" -- The casts are pushed inside the lambda - -- for f, so this seq succeds fine + -- for f, so this seq succeeds fine + -- It does require ImpredicativeTypes, because we instantiate + -- seq's type (c->d->d) with f's type (c:= (forall b. a) -> a), + -- which is polymorphic (it has foralls). ; f (error "urk") `seq` print "Bad" -- But when we *call* f we get a type error diff --git a/testsuite/tests/typecheck/should_run/T7861.stderr b/testsuite/tests/typecheck/should_run/T7861.stderr index f9f2386..62b0dcd 100644 --- a/testsuite/tests/typecheck/should_run/T7861.stderr +++ b/testsuite/tests/typecheck/should_run/T7861.stderr @@ -1,10 +1,11 @@ -T7861: T7861.hs:11:5: +T7861: T7861.hs:10:5: error: Couldn't match type ?a? with ?[a]? - ?a? is a rigid type variable bound by - the type signature for: f :: A a -> a at T7861.hs:10:6 - Expected type: A a -> a - Actual type: A a -> [a] - Relevant bindings include f :: A a -> a (bound at T7861.hs:11:1) + ?a? is a rigid type variable bound by + the type signature for: f :: (forall b. a) -> a at T7861.hs:9:6 + Expected type: (forall b. a) -> a + Actual type: (forall b. a) -> [a] + Relevant bindings include + f :: (forall b. a) -> a (bound at T7861.hs:10:1) In the expression: doA In an equation for ?f?: f = doA (deferred type error) From git at git.haskell.org Mon Jul 20 15:06:08 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 20 Jul 2015 15:06:08 +0000 (UTC) Subject: [commit: ghc] master: Support wild cards in TH splices (49373ff) Message-ID: <20150720150608.162113A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/49373ffe4cbc87b46468d2372e850138e151a9ae/ghc >--------------------------------------------------------------- commit 49373ffe4cbc87b46468d2372e850138e151a9ae Author: Thomas Winant Date: Mon Jul 20 15:43:53 2015 +0200 Support wild cards in TH splices - Declaration splices: partial type signatures are fully supported in TH declaration splices. For example, the wild cards in the example below will unify with `Eq a` and `a -> a -> Bool`, as expected: ``` [d| foo :: _ => _ foo x y = x == y |] ``` - Expression splices: anonymous and named wild cards are supported in expression signatures, but extra-constraints wild cards aren't. Just as is the case for regular expression signatures. ``` [e | Just True :: _a _ |] ``` - Typed expression splices: the same wildcards as in (untyped) expression splices are supported. - Pattern splices: TH doesn't support type signatures in pattern splices, consequently, partial type signatures aren't supported either. - Type splices: partial type signatures are only partially supported in type splices, specifically: only anonymous wild cards are allowed. So `[t| _ |]`, `[t| _ -> Maybe _ |]` will work, but `[t| _ => _ |]` or `[| _a |]` won't (without `-XNamedWildCards`, the latter will work as the named wild card is treated as a type variable). Normally, named wild cards are collected before renaming a (partial) type signature. However, TH type splices are run during renaming, i.e. after the initial traversal, leading to out of scope errors for named wild cards. We can't just extend the initial traversal to collect the named wild cards in TH type splices, as we'd need to expand them, which is supposed to happen only once, during renaming. Similarly, the extra-constraints wild card is handled right before renaming too, and is therefore also not supported in a TH type splice. Another reason not to support extra-constraints wild cards in TH type splices is that a single signature can contain many TH type splices, whereas it mustn't contain more than one extra-constraints wild card. Enforcing would this be hard the way things are currently organised. Anonymous wild cards pose no problem, because they start without names and are given names during renaming. These names are collected right after renaming. The names generated for anonymous wild cards in TH type splices will thus be collected as well. With a more invasive refactoring of the renaming, partial type signatures could be fully supported in TH type splices. As only anonymous wild cards have been requested so far, these small changes satisfying this request will do for now. Also don't forget that a TH declaration splices support all kinds of wild cards. - Extra-constraints wild cards were silently ignored in expression and pattern signatures, appropriate error messages are now generated. Test Plan: run new tests Reviewers: austin, goldfire, adamgundry, bgamari Reviewed By: goldfire, adamgundry, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1048 GHC Trac Issues: #10094, #10548 >--------------------------------------------------------------- 49373ffe4cbc87b46468d2372e850138e151a9ae compiler/deSugar/DsMeta.hs | 35 ++++++++--- compiler/hsSyn/Convert.hs | 6 ++ compiler/hsSyn/HsTypes.hs | 9 ++- compiler/prelude/THNames.hs | 44 +++++++------ compiler/rename/RnSplice.hs | 60 ++++++++++++++++++ compiler/rename/RnTypes.hs | 57 ++++++++++------- docs/users_guide/7.12.1-notes.xml | 7 ++- docs/users_guide/glasgow_exts.xml | 41 +++++++++++- .../template-haskell/Language/Haskell/TH/Lib.hs | 6 ++ .../template-haskell/Language/Haskell/TH/Ppr.hs | 1 + .../template-haskell/Language/Haskell/TH/Syntax.hs | 1 + .../tests/partial-sigs/should_compile/Splices.hs | 30 +++++++++ .../partial-sigs/should_compile/SplicesUsed.hs | 18 ++++++ .../partial-sigs/should_compile/SplicesUsed.stderr | 73 ++++++++++++++++++++++ .../partial-sigs/should_compile/TypedSplice.hs | 9 +++ .../partial-sigs/should_compile/TypedSplice.stderr | 16 +++++ testsuite/tests/partial-sigs/should_compile/all.T | 4 ++ ...xtraConstraintsWildcardInExpressionSignature.hs | 3 + ...ConstraintsWildcardInExpressionSignature.stderr | 6 ++ .../ExtraConstraintsWildcardInPatternSignature.hs | 4 ++ ...traConstraintsWildcardInPatternSignature.stderr | 6 ++ .../ExtraConstraintsWildcardInPatternSplice.hs | 5 ++ .../ExtraConstraintsWildcardInPatternSplice.stderr | 4 ++ .../ExtraConstraintsWildcardInTypeSplice.hs | 7 +++ .../ExtraConstraintsWildcardInTypeSplice2.hs | 7 +++ .../ExtraConstraintsWildcardInTypeSplice2.stderr | 4 ++ .../ExtraConstraintsWildcardInTypeSpliceUsed.hs | 8 +++ ...ExtraConstraintsWildcardInTypeSpliceUsed.stderr | 8 +++ .../should_fail/NamedWildcardInTypeSplice.hs | 8 +++ .../should_fail/NamedWildcardInTypeSplice.stderr | 5 ++ .../should_fail/WildcardInTypeBrackets.hs | 4 -- .../should_fail/WildcardInTypeBrackets.stderr | 2 - testsuite/tests/partial-sigs/should_fail/all.T | 12 +++- 33 files changed, 451 insertions(+), 59 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 49373ffe4cbc87b46468d2372e850138e151a9ae From git at git.haskell.org Mon Jul 20 15:06:10 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 20 Jul 2015 15:06:10 +0000 (UTC) Subject: [commit: ghc] master: LlvmCodeGen: add support for MO_U_Mul2 CallishMachOp (82ffc80) Message-ID: <20150720150610.EB8183A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/82ffc80df573512f788524c4616db3c08fc9f125/ghc >--------------------------------------------------------------- commit 82ffc80df573512f788524c4616db3c08fc9f125 Author: Michal Terepeta Date: Mon Jul 20 15:43:31 2015 +0200 LlvmCodeGen: add support for MO_U_Mul2 CallishMachOp This adds support MO_U_Mul2 to the LLVM backend by simply using 'mul' instruction but operating at twice the bit width (e.g., for 64 bit words we will generate mul that operates on 128 bits and then extract the two 64 bit values for the result of the CallishMachOp). Test Plan: validate Reviewers: rwbarton, austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1068 GHC Trac Issues: #9430 >--------------------------------------------------------------- 82ffc80df573512f788524c4616db3c08fc9f125 compiler/codeGen/StgCmmPrim.hs | 3 ++- compiler/llvmGen/LlvmCodeGen/CodeGen.hs | 34 +++++++++++++++++++++++++++++ testsuite/tests/primops/should_run/T9430.hs | 18 +++++++++++++++ 3 files changed, 54 insertions(+), 1 deletion(-) diff --git a/compiler/codeGen/StgCmmPrim.hs b/compiler/codeGen/StgCmmPrim.hs index 563f6dc..243e2a3 100644 --- a/compiler/codeGen/StgCmmPrim.hs +++ b/compiler/codeGen/StgCmmPrim.hs @@ -823,7 +823,8 @@ callishPrimOpSupported dflags op || llvm -> Left (MO_SubIntC (wordWidth dflags)) | otherwise -> Right genericIntSubCOp - WordMul2Op | ncg && x86ish -> Left (MO_U_Mul2 (wordWidth dflags)) + WordMul2Op | ncg && x86ish + || llvm -> Left (MO_U_Mul2 (wordWidth dflags)) | otherwise -> Right genericWordMul2Op _ -> pprPanic "emitPrimOp: can't translate PrimOp " (ppr op) diff --git a/compiler/llvmGen/LlvmCodeGen/CodeGen.hs b/compiler/llvmGen/LlvmCodeGen/CodeGen.hs index 15350bc..fb02120 100644 --- a/compiler/llvmGen/LlvmCodeGen/CodeGen.hs +++ b/compiler/llvmGen/LlvmCodeGen/CodeGen.hs @@ -256,6 +256,38 @@ genCall t@(PrimTarget op) [] args `appOL` stmts4 `snocOL` call return (stmts, top1 ++ top2) +-- We handle MO_U_Mul2 by simply using a 'mul' instruction, but with operands +-- twice the width (we first zero-extend them), e.g., on 64-bit arch we will +-- generate 'mul' on 128-bit operands. Then we only need some plumbing to +-- extract the two 64-bit values out of 128-bit result. +genCall (PrimTarget (MO_U_Mul2 w)) [dstH, dstL] [lhs, rhs] = do + let width = widthToLlvmInt w + bitWidth = widthInBits w + width2x = LMInt (bitWidth * 2) + -- First zero-extend the operands ('mul' instruction requires the operands + -- and the result to be of the same type). Note that we don't use 'castVars' + -- because it tries to do LM_Sext. + (lhsVar, stmts1, decls1) <- exprToVar lhs + (rhsVar, stmts2, decls2) <- exprToVar rhs + (lhsExt, stmt3) <- doExpr width2x $ Cast LM_Zext lhsVar width2x + (rhsExt, stmt4) <- doExpr width2x $ Cast LM_Zext rhsVar width2x + -- Do the actual multiplication (note that the result is also 2x width). + (retV, stmt5) <- doExpr width2x $ LlvmOp LM_MO_Mul lhsExt rhsExt + -- Extract the lower bits of the result into retL. + (retL, stmt6) <- doExpr width $ Cast LM_Trunc retV width + -- Now we right-shift the higher bits by width. + let widthLlvmLit = LMLitVar $ LMIntLit (fromIntegral bitWidth) width + (retShifted, stmt7) <- doExpr width2x $ LlvmOp LM_MO_LShr retV widthLlvmLit + -- And extract them into retH. + (retH, stmt8) <- doExpr width $ Cast LM_Trunc retShifted width + dstRegL <- getCmmReg (CmmLocal dstL) + dstRegH <- getCmmReg (CmmLocal dstH) + let storeL = Store retL dstRegL + storeH = Store retH dstRegH + stmts = stmts1 `appOL` stmts2 `appOL` + toOL [ stmt3 , stmt4, stmt5, stmt6, stmt7, stmt8, storeL, storeH ] + return (stmts, decls1 ++ decls2) + -- Handle the MO_{Add,Sub}IntC separately. LLVM versions return a record from -- which we need to extract the actual values. genCall t@(PrimTarget (MO_AddIntC w)) [dstV, dstO] [lhs, rhs] = @@ -621,6 +653,8 @@ cmmPrimOpFunctions mop = do MO_S_QuotRem {} -> unsupported MO_U_QuotRem {} -> unsupported MO_U_QuotRem2 {} -> unsupported + -- We support MO_U_Mul2 through ordinary LLVM mul instruction, see the + -- appropriate case of genCall. MO_U_Mul2 {} -> unsupported MO_WriteBarrier -> unsupported MO_Touch -> unsupported diff --git a/testsuite/tests/primops/should_run/T9430.hs b/testsuite/tests/primops/should_run/T9430.hs index 571b6db..aec2d26 100644 --- a/testsuite/tests/primops/should_run/T9430.hs +++ b/testsuite/tests/primops/should_run/T9430.hs @@ -73,3 +73,21 @@ main = do checkW (1, minBound + 1) plusWord2# maxBound 2 check "plusWord2# 2 maxBound" $ checkW (1, minBound + 1) plusWord2# 2 maxBound + + check "timesWord2# maxBound 0" $ checkW (0, 0) timesWord2# maxBound 0 + check "timesWord2# 0 maxBound" $ checkW (0, 0) timesWord2# 0 maxBound + check "timesWord2# maxBound 1" $ checkW (0, maxBound) timesWord2# maxBound 1 + check "timesWord2# 1 maxBound" $ checkW (0, maxBound) timesWord2# 1 maxBound + -- Overflows + check "timesWord2# " $ checkW (1, 0) timesWord2# (2 ^ 63) 2 + check "timesWord2# " $ checkW (2, 0) timesWord2# (2 ^ 63) (2 ^ 2) + check "timesWord2# " $ checkW (4, 0) timesWord2# (2 ^ 63) (2 ^ 3) + check "timesWord2# " $ checkW (8, 0) timesWord2# (2 ^ 63) (2 ^ 4) + check "timesWord2# maxBound 2" $ + checkW (1, maxBound - 1) timesWord2# maxBound 2 + check "timesWord2# 2 maxBound" $ + checkW (1, maxBound - 1) timesWord2# 2 maxBound + check "timesWord2# maxBound 3" $ + checkW (2, maxBound - 2) timesWord2# maxBound 3 + check "timesWord2# 3 maxBound" $ + checkW (2, maxBound - 2) timesWord2# 3 maxBound From git at git.haskell.org Mon Jul 20 15:06:13 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 20 Jul 2015 15:06:13 +0000 (UTC) Subject: [commit: ghc] master: primops: Add haddocks to BCO primops (c526e09) Message-ID: <20150720150613.CAE193A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/c526e095c5762cc6feb3066779c2f919d66d40e5/ghc >--------------------------------------------------------------- commit c526e095c5762cc6feb3066779c2f919d66d40e5 Author: Ben Gamari Date: Mon Jul 20 16:45:01 2015 +0200 primops: Add haddocks to BCO primops Test Plan: none Reviewers: simonmar, austin, hvr Subscribers: hvr, thomie Differential Revision: https://phabricator.haskell.org/D1082 GHC Trac Issues: #10640 >--------------------------------------------------------------- c526e095c5762cc6feb3066779c2f919d66d40e5 compiler/prelude/primops.txt.pp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/compiler/prelude/primops.txt.pp b/compiler/prelude/primops.txt.pp index 162063e..d8ae6d6 100644 --- a/compiler/prelude/primops.txt.pp +++ b/compiler/prelude/primops.txt.pp @@ -2439,7 +2439,11 @@ primop TagToEnumOp "tagToEnum#" GenPrimOp ------------------------------------------------------------------------ section "Bytecode operations" - {Support for the bytecode interpreter and linker.} + {Support for manipulating bytecode objects used by the interpreter and + linker. + + Bytecode objects are heap objects which represent top-level bindings and + contain a list of instructions and data needed by these instructions.} ------------------------------------------------------------------------ primtype BCO# @@ -2453,11 +2457,17 @@ primop AddrToAnyOp "addrToAny#" GenPrimOp primop MkApUpd0_Op "mkApUpd0#" GenPrimOp BCO# -> (# a #) + {Wrap a BCO in a {\tt AP_UPD} thunk which will be updated with the vaule of + the BCO when evaluated.} with out_of_line = True primop NewBCOOp "newBCO#" GenPrimOp ByteArray# -> ByteArray# -> Array# a -> Int# -> ByteArray# -> State# s -> (# State# s, BCO# #) + {{\tt newBCO\#} instrs lits ptrs arity bitmap} creates a new bytecode object. The + resulting object encodes a function of the given arity with the instructions + encoded in {\tt instrs}, and a static reference table usage bitmap given by + {\tt bitmap}.} with has_side_effects = True out_of_line = True From git at git.haskell.org Mon Jul 20 15:06:17 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 20 Jul 2015 15:06:17 +0000 (UTC) Subject: [commit: ghc] master: Do not treat prim and javascript imports as C imports in TH and QQ (4cd008b) Message-ID: <20150720150617.6A2D73A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/4cd008b6c1751c5533ab7eac32d17c9749e4758e/ghc >--------------------------------------------------------------- commit 4cd008b6c1751c5533ab7eac32d17c9749e4758e Author: Luite Stegeman Date: Mon Jul 20 17:01:06 2015 +0200 Do not treat prim and javascript imports as C imports in TH and QQ Reviewers: austin, hvr, goldfire, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1070 GHC Trac Issues: #10638 >--------------------------------------------------------------- 4cd008b6c1751c5533ab7eac32d17c9749e4758e compiler/deSugar/DsMeta.hs | 8 +++++--- compiler/hsSyn/Convert.hs | 17 +++++++++++++---- testsuite/tests/th/T10638.hs | 31 +++++++++++++++++++++++++++++++ testsuite/tests/th/T10638.stderr | 6 ++++++ testsuite/tests/th/all.T | 1 + 5 files changed, 56 insertions(+), 7 deletions(-) diff --git a/compiler/deSugar/DsMeta.hs b/compiler/deSugar/DsMeta.hs index d9dc02f..d4a811f 100644 --- a/compiler/deSugar/DsMeta.hs +++ b/compiler/deSugar/DsMeta.hs @@ -489,12 +489,14 @@ repForD (L loc (ForeignImport name typ _ (CImport (L _ cc) (L _ s) mch cis _))) conv_cimportspec (CFunction (StaticTarget _ _ _ False)) = panic "conv_cimportspec: values not supported yet" conv_cimportspec CWrapper = return "wrapper" + -- these calling conventions do not support headers and the static keyword + raw_cconv = cc == PrimCallConv || cc == JavaScriptCallConv static = case cis of - CFunction (StaticTarget _ _ _ _) -> "static " + CFunction (StaticTarget _ _ _ _) | not raw_cconv -> "static " _ -> "" chStr = case mch of - Nothing -> "" - Just (Header _ h) -> unpackFS h ++ " " + Just (Header _ h) | not raw_cconv -> unpackFS h ++ " " + _ -> "" repForD decl = notHandled "Foreign declaration" (ppr decl) repCCallConv :: CCallConv -> DsM (Core TH.Callconv) diff --git a/compiler/hsSyn/Convert.hs b/compiler/hsSyn/Convert.hs index 7245a1d..4a0e013 100644 --- a/compiler/hsSyn/Convert.hs +++ b/compiler/hsSyn/Convert.hs @@ -473,16 +473,25 @@ noExistentials = [] cvtForD :: Foreign -> CvtM (ForeignDecl RdrName) cvtForD (ImportF callconv safety from nm ty) + -- the prim and javascript calling conventions do not support headers + -- and are inserted verbatim, analogous to mkImport in RdrHsSyn + | callconv == TH.Prim || callconv == TH.JavaScript + = mk_imp (CImport (noLoc (cvt_conv callconv)) (noLoc safety') Nothing + (CFunction (StaticTarget from (mkFastString from) Nothing + True)) + (noLoc from)) | Just impspec <- parseCImport (noLoc (cvt_conv callconv)) (noLoc safety') (mkFastString (TH.nameBase nm)) from (noLoc from) - = do { nm' <- vNameL nm - ; ty' <- cvtType ty - ; return (ForeignImport nm' ty' noForeignImportCoercionYet impspec) - } + = mk_imp impspec | otherwise = failWith $ text (show from) <+> ptext (sLit "is not a valid ccall impent") where + mk_imp impspec + = do { nm' <- vNameL nm + ; ty' <- cvtType ty + ; return (ForeignImport nm' ty' noForeignImportCoercionYet impspec) + } safety' = case safety of Unsafe -> PlayRisky Safe -> PlaySafe diff --git a/testsuite/tests/th/T10638.hs b/testsuite/tests/th/T10638.hs new file mode 100644 index 0000000..7dd17eb --- /dev/null +++ b/testsuite/tests/th/T10638.hs @@ -0,0 +1,31 @@ +{-# LANGUAGE GHCForeignImportPrim, UnliftedFFITypes, QuasiQuotes, MagicHash #-} + +import Language.Haskell.TH +import Language.Haskell.TH.Syntax + +import GHC.Exts + +{- + the prim and javascript calling conventions do not support + headers and the static keyword. +-} + +-- check that quasiquoting roundtrips succesfully and that the declaration +-- does not include the static keyword +test1 :: String +test1 = $(do (ds@[ForeignD (ImportF _ _ p _ _)]) <- + [d| foreign import prim "test1" cmm_test1 :: Int# -> Int# |] + addTopDecls ds + case p of + "test1" -> return (LitE . stringL $ p) + _ -> error $ "unexpected value: " ++ show p + ) + +-- check that constructed prim imports with the static keyword are rejected +test2 :: String +test2 = $(do t <- [t| Int# -> Int# |] + cmm_test2 <- newName "cmm_test2" + addTopDecls + [ForeignD (ImportF Prim Safe "static test2" cmm_test2 t)] + [| test1 |] + ) diff --git a/testsuite/tests/th/T10638.stderr b/testsuite/tests/th/T10638.stderr new file mode 100644 index 0000000..3a626ce --- /dev/null +++ b/testsuite/tests/th/T10638.stderr @@ -0,0 +1,6 @@ + +T10638.hs:26:11: + ?static test2? is not a valid C identifier + When checking declaration: + foreign import prim safe "static static test2" cmm_test2 + :: Int# -> Int# diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index 55627f0..9e8f92d 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -346,3 +346,4 @@ test('T10279', normal, compile_fail, ['-v0']) test('T10306', normal, compile, ['-v0']) test('T10596', normal, compile, ['-v0']) test('T10620', normal, compile_and_run, ['-v0']) +test('T10638', normal, compile_fail, ['-v0']) From git at git.haskell.org Mon Jul 20 15:09:04 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 20 Jul 2015 15:09:04 +0000 (UTC) Subject: [commit: ghc] wip/T9858-typeable-spj: Wibbles in response to Richard's comments (d11a9e7) Message-ID: <20150720150904.301383A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/T9858-typeable-spj Link : http://ghc.haskell.org/trac/ghc/changeset/d11a9e7e95989a1e6341aee9fea9765291cb5fc8/ghc >--------------------------------------------------------------- commit d11a9e7e95989a1e6341aee9fea9765291cb5fc8 Author: Simon Peyton Jones Date: Tue Apr 14 17:43:54 2015 +0100 Wibbles in response to Richard's comments >--------------------------------------------------------------- d11a9e7e95989a1e6341aee9fea9765291cb5fc8 compiler/coreSyn/CorePrep.hs | 2 +- compiler/deSugar/DsBinds.hs | 1 - compiler/prelude/PrelNames.hs | 13 ++++++++----- compiler/prelude/TysPrim.hs | 7 +++++-- compiler/prelude/TysWiredIn.hs | 8 ++++---- compiler/typecheck/TcEvidence.hs | 15 ++++++++++++++- compiler/typecheck/TcInteract.hs | 7 ++++--- compiler/typecheck/TcTypeNats.hs | 2 +- compiler/typecheck/TcTypeable.hs | 16 +++++++++++----- compiler/types/TyCon.hs | 2 +- compiler/types/Type.hs | 7 ++----- compiler/types/TypeRep.hs | 14 ++++++++++++-- 12 files changed, 63 insertions(+), 31 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 d11a9e7e95989a1e6341aee9fea9765291cb5fc8 From git at git.haskell.org Mon Jul 20 16:40:20 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 20 Jul 2015 16:40:20 +0000 (UTC) Subject: [commit: ghc] master: Fix primops documentation syntax (96de809) Message-ID: <20150720164020.9DBB63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/96de8098c58a04dd028d6fc005dafda29c7a13ba/ghc >--------------------------------------------------------------- commit 96de8098c58a04dd028d6fc005dafda29c7a13ba Author: Ben Gamari Date: Mon Jul 20 12:39:54 2015 -0400 Fix primops documentation syntax >--------------------------------------------------------------- 96de8098c58a04dd028d6fc005dafda29c7a13ba compiler/prelude/primops.txt.pp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/compiler/prelude/primops.txt.pp b/compiler/prelude/primops.txt.pp index d8ae6d6..6f870c6 100644 --- a/compiler/prelude/primops.txt.pp +++ b/compiler/prelude/primops.txt.pp @@ -2447,27 +2447,27 @@ section "Bytecode operations" ------------------------------------------------------------------------ primtype BCO# - {Primitive bytecode type.} + { Primitive bytecode type. } primop AddrToAnyOp "addrToAny#" GenPrimOp Addr# -> (# a #) - {Convert an {\tt Addr\#} to a followable Any type.} + { Convert an {\tt Addr\#} to a followable Any type. } with code_size = 0 primop MkApUpd0_Op "mkApUpd0#" GenPrimOp BCO# -> (# a #) - {Wrap a BCO in a {\tt AP_UPD} thunk which will be updated with the vaule of - the BCO when evaluated.} + { Wrap a BCO in a {\tt AP_UPD} thunk which will be updated with the vaule of + the BCO when evaluated. } with out_of_line = True primop NewBCOOp "newBCO#" GenPrimOp ByteArray# -> ByteArray# -> Array# a -> Int# -> ByteArray# -> State# s -> (# State# s, BCO# #) - {{\tt newBCO\#} instrs lits ptrs arity bitmap} creates a new bytecode object. The - resulting object encodes a function of the given arity with the instructions - encoded in {\tt instrs}, and a static reference table usage bitmap given by - {\tt bitmap}.} + { {\tt newBCO\# instrs lits ptrs arity bitmap} creates a new bytecode object. The + resulting object encodes a function of the given arity with the instructions + encoded in {\tt instrs}, and a static reference table usage bitmap given by + {\tt bitmap}. } with has_side_effects = True out_of_line = True From git at git.haskell.org Mon Jul 20 20:53:52 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 20 Jul 2015 20:53:52 +0000 (UTC) Subject: [commit: ghc] master: Testsuite: fix concprog002 (AMP) (d71d9a9) Message-ID: <20150720205352.8F9703A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d71d9a9e2966f56d13cbe7a4642562d3abddb60c/ghc >--------------------------------------------------------------- commit d71d9a9e2966f56d13cbe7a4642562d3abddb60c Author: Thomas Miedema Date: Sun Jul 19 19:44:56 2015 +0200 Testsuite: fix concprog002 (AMP) Requires random to be installed. >--------------------------------------------------------------- d71d9a9e2966f56d13cbe7a4642562d3abddb60c testsuite/tests/concurrent/prog002/Thread.hs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/testsuite/tests/concurrent/prog002/Thread.hs b/testsuite/tests/concurrent/prog002/Thread.hs index 9e342ac..301e844 100644 --- a/testsuite/tests/concurrent/prog002/Thread.hs +++ b/testsuite/tests/concurrent/prog002/Thread.hs @@ -14,6 +14,13 @@ data ThreadTree req rsp m = ---------------------------------- newtype ContM req rsp m a = ContM ((a-> ThreadTree req rsp m)-> ThreadTree req rsp m) +instance Functor (ContM req rsp m) where + fmap = undefined + +instance Applicative (ContM req rsp m) where + pure = undefined + (<*>) = undefined + instance Monad m => Monad (ContM req rsp m) where m >>= f = contmBind m f return = contmReturn From git at git.haskell.org Mon Jul 20 20:53:55 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 20 Jul 2015 20:53:55 +0000 (UTC) Subject: [commit: ghc] master: Testsuite: simplify T8089 (#8089) (d0cf8f1) Message-ID: <20150720205355.71E553A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d0cf8f1a41957a0d30475f7220facdec9efaa3a0/ghc >--------------------------------------------------------------- commit d0cf8f1a41957a0d30475f7220facdec9efaa3a0 Author: Thomas Miedema Date: Thu Jul 16 20:16:17 2015 +0200 Testsuite: simplify T8089 (#8089) The previous implementation wasn't working for the `ghci` test way, causing a fulltest failure. Differential Revision: https://phabricator.haskell.org/D1075 >--------------------------------------------------------------- d0cf8f1a41957a0d30475f7220facdec9efaa3a0 libraries/base/tests/T8089.hs | 30 +----------------------------- libraries/base/tests/all.T | 13 ++++++++++++- 2 files changed, 13 insertions(+), 30 deletions(-) diff --git a/libraries/base/tests/T8089.hs b/libraries/base/tests/T8089.hs index 2b98f94..3273bdb 100644 --- a/libraries/base/tests/T8089.hs +++ b/libraries/base/tests/T8089.hs @@ -1,32 +1,4 @@ -import Control.Applicative import Control.Concurrent -import Control.Exception -import Control.Monad -import System.Environment -import System.Exit -import System.Process -import System.Timeout - -testLoop :: Int -> IO (Maybe a) -> IO (Maybe a) -testLoop 0 _ = return Nothing -testLoop i act = do - result <- act - case result of - Nothing -> threadDelay 100000 >> testLoop (i-1) act - Just x -> return (Just x) - - -forkTestChild :: IO () -forkTestChild = do - (_, _, _, hnd) <- createProcess (proc "./T8089" ["test"]) - result <- testLoop 50 $ getProcessExitCode hnd - case result of - Nothing -> terminateProcess hnd >> exitSuccess - Just exitCode -> exitWith exitCode main :: IO () -main = do - numArgs <- length <$> getArgs - if numArgs > 0 - then threadDelay maxBound - else forkTestChild +main = threadDelay maxBound diff --git a/libraries/base/tests/all.T b/libraries/base/tests/all.T index 1c90d14..34176d0 100644 --- a/libraries/base/tests/all.T +++ b/libraries/base/tests/all.T @@ -178,5 +178,16 @@ test('T9395', normal, compile_and_run, ['']) test('T9532', omit_ways(['debug']), compile_and_run, ['']) test('T9586', normal, compile, ['']) test('T9681', normal, compile_fail, ['']) -test('T8089', normal, compile_and_run, ['']) +# Test no runtime crash. Report success and kill with `timeout` (exit code 99) +# after a few seconds. From https://phabricator.haskell.org/D1075: +# +# "I used a fairly conservative timeout. IF there is a regression it will +# crash as soon as the timeout's C call is done. The tricky bit is +# guesstimating how much time it needs to run to guarantee it's reached the +# C call. +# Probably something like 1s is already enough, but I don't know enough to +# make an educated guess how long it needs to be guaranteed to reach the C +# call." +test('T8089', [exit_code(99), run_timeout_multiplier(0.01)], + compile_and_run, ['']) test('T9826',normal, compile_and_run,['']) From git at git.haskell.org Mon Jul 20 20:53:58 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 20 Jul 2015 20:53:58 +0000 (UTC) Subject: [commit: ghc] master: Testsuite: mark concprog002 expect_broken_for(#10661, ['threaded2_hT']) (2f18b197) Message-ID: <20150720205358.3F1BF3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/2f18b19784fba161b143d8961d805ffb94a5be0a/ghc >--------------------------------------------------------------- commit 2f18b19784fba161b143d8961d805ffb94a5be0a Author: Thomas Miedema Date: Sun Jul 19 21:43:55 2015 +0200 Testsuite: mark concprog002 expect_broken_for(#10661, ['threaded2_hT']) >--------------------------------------------------------------- 2f18b19784fba161b143d8961d805ffb94a5be0a testsuite/tests/concurrent/prog002/all.T | 1 + 1 file changed, 1 insertion(+) diff --git a/testsuite/tests/concurrent/prog002/all.T b/testsuite/tests/concurrent/prog002/all.T index 54613a7..5eb6238 100644 --- a/testsuite/tests/concurrent/prog002/all.T +++ b/testsuite/tests/concurrent/prog002/all.T @@ -11,6 +11,7 @@ else: test('concprog002', [only_ways(['threaded2','threaded2_hT']), + expect_broken_for(10661, ['threaded2_hT']), extra_ways(ways), exit_code(1), when(fast(), skip), From git at git.haskell.org Mon Jul 20 20:54:01 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 20 Jul 2015 20:54:01 +0000 (UTC) Subject: [commit: ghc] master: Update submodule hpc with fix for #10529 (b4ef8b8) Message-ID: <20150720205401.0625A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/b4ef8b8badaa43872a843778e8fa9da943955d38/ghc >--------------------------------------------------------------- commit b4ef8b8badaa43872a843778e8fa9da943955d38 Author: Thomas Miedema Date: Thu Jul 16 17:40:50 2015 +0200 Update submodule hpc with fix for #10529 >--------------------------------------------------------------- b4ef8b8badaa43872a843778e8fa9da943955d38 libraries/hpc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/hpc b/libraries/hpc index 154eecf..a9ecba1 160000 --- a/libraries/hpc +++ b/libraries/hpc @@ -1 +1 @@ -Subproject commit 154eecf3ca10f9252bf75213d091221ee3c551d6 +Subproject commit a9ecba162ae307acf12a1a783dbe1cf6ebb5729d From git at git.haskell.org Tue Jul 21 03:53:33 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 21 Jul 2015 03:53:33 +0000 (UTC) Subject: [commit: ghc] master: Revert "Revert "Change loadSrcInterface to return a list of ModIface"" (0c6c015) Message-ID: <20150721035333.39C3A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/0c6c015d42c2bd0ee008f790c7c0cb4c5b78ca6b/ghc >--------------------------------------------------------------- commit 0c6c015d42c2bd0ee008f790c7c0cb4c5b78ca6b Author: Edward Z. Yang Date: Mon Jul 20 20:16:35 2015 -0700 Revert "Revert "Change loadSrcInterface to return a list of ModIface"" This reverts commit c60704fc405149407c155e297433f1cc299ae58a. >--------------------------------------------------------------- 0c6c015d42c2bd0ee008f790c7c0cb4c5b78ca6b compiler/iface/LoadIface.hs | 50 +++++++++++++++++++++++---- compiler/rename/RnEnv.hs | 5 +-- compiler/rename/RnNames.hs | 74 +++++++++++++++++++++++++--------------- compiler/typecheck/TcRnDriver.hs | 5 +-- 4 files changed, 96 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 0c6c015d42c2bd0ee008f790c7c0cb4c5b78ca6b From git at git.haskell.org Tue Jul 21 03:53:36 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 21 Jul 2015 03:53:36 +0000 (UTC) Subject: [commit: ghc] master: Revert "Revert "Support for multiple signature files in scope."" (214596d) Message-ID: <20150721035336.310783A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/214596de224afa576a9c295bcf53c6941d6892e0/ghc >--------------------------------------------------------------- commit 214596de224afa576a9c295bcf53c6941d6892e0 Author: Edward Z. Yang Date: Mon Jul 20 20:16:40 2015 -0700 Revert "Revert "Support for multiple signature files in scope."" This reverts commit bac927b9770ff769128b66d13a3e72bf5a9bc514. As it turns out, we need these commits for separate compilation and accurate dependency tracking. So back in they go! >--------------------------------------------------------------- 214596de224afa576a9c295bcf53c6941d6892e0 compiler/deSugar/DsMonad.hs | 2 +- compiler/ghci/Linker.hs | 46 +++-- compiler/iface/LoadIface.hs | 18 +- compiler/iface/MkIface.hs | 18 +- compiler/main/DriverMkDepend.hs | 5 +- compiler/main/DynamicLoading.hs | 21 +- compiler/main/Finder.hs | 77 +++++--- compiler/main/GHC.hs | 30 ++- compiler/main/GhcMake.hs | 19 +- compiler/main/HscTypes.hs | 36 +++- compiler/main/Packages.hs | 214 ++++++++++++++------- docs/users_guide/separate_compilation.xml | 5 + ghc/Main.hs | 5 +- testsuite/.gitignore | 6 + testsuite/tests/cabal/sigcabal02/Main.hs | 7 + testsuite/tests/cabal/sigcabal02/Makefile | 34 ++++ .../tests/cabal/{cabal05 => sigcabal02}/Setup.hs | 0 testsuite/tests/cabal/sigcabal02/ShouldFail.hs | 1 + testsuite/tests/cabal/sigcabal02/all.T | 9 + .../tests/cabal/{cabal05 => sigcabal02}/p/LICENSE | 0 testsuite/tests/cabal/sigcabal02/p/Map.hsig | 18 ++ testsuite/tests/cabal/sigcabal02/p/P.hs | 12 ++ testsuite/tests/cabal/sigcabal02/p/Set.hsig | 13 ++ testsuite/tests/cabal/sigcabal02/p/p.cabal | 14 ++ .../cabal/{cabal05/p => sigcabal02/q}/LICENSE | 0 testsuite/tests/cabal/sigcabal02/q/Map.hsig | 7 + testsuite/tests/cabal/sigcabal02/q/Q.hs | 7 + testsuite/tests/cabal/sigcabal02/q/q.cabal | 13 ++ testsuite/tests/cabal/sigcabal02/sigcabal02.stderr | 4 + testsuite/tests/cabal/sigcabal02/sigcabal02.stdout | 5 + testsuite/tests/driver/recomp014/Makefile | 31 +++ testsuite/tests/driver/recomp014/all.T | 4 + testsuite/tests/driver/recomp014/recomp014.stdout | 4 + testsuite/tests/driver/sigof01/Makefile | 6 + testsuite/tests/driver/sigof01/all.T | 10 + testsuite/tests/driver/sigof01/sigof01i.script | 1 + .../sigof01/{sigof01.stdout => sigof01i.stdout} | 0 testsuite/tests/driver/sigof01/sigof01i2.script | 3 + testsuite/tests/driver/sigof01/sigof01i2.stdout | 8 + testsuite/tests/package/package09e.stderr | 2 +- 40 files changed, 576 insertions(+), 139 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 214596de224afa576a9c295bcf53c6941d6892e0 From git at git.haskell.org Tue Jul 21 10:27:56 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 21 Jul 2015 10:27:56 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: build: fix 'make help' (7603074) Message-ID: <20150721102756.E511B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/760307483d04aa91d8e4793c037ba149bdc03e36/ghc >--------------------------------------------------------------- commit 760307483d04aa91d8e4793c037ba149bdc03e36 Author: Austin Seipp Date: Sat Mar 7 11:18:44 2015 -0600 build: fix 'make help' Summary: This fixes the usage of `make help` in the top-level and subdirectories. Signed-off-by: Austin Seipp Test Plan: It worked now and didn't before. Reviewers: hvr Reviewed By: hvr Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D692 >--------------------------------------------------------------- 760307483d04aa91d8e4793c037ba149bdc03e36 Makefile | 2 +- mk/sub-makefile.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 2cc62b5..de9bcf3 100644 --- a/Makefile +++ b/Makefile @@ -31,7 +31,7 @@ default : all # For help, type 'make help' .PHONY: help help: - @cat MAKEHELP + @cat MAKEHELP.md ifneq "$(filter maintainer-clean distclean clean help,$(MAKECMDGOALS))" "" -include mk/config.mk diff --git a/mk/sub-makefile.mk b/mk/sub-makefile.mk index fdaf830..0ed85c8 100644 --- a/mk/sub-makefile.mk +++ b/mk/sub-makefile.mk @@ -59,4 +59,4 @@ help : sub-help sub-help : @echo "You are in subdirectory \"$(dir)\"." @echo "Useful targets in this directory:" - @cat $(TOP)/SUBMAKEHELP + @sed '1,/Using `make` in subdirectories/d' $(TOP)/MAKEHELP.md From git at git.haskell.org Tue Jul 21 10:27:59 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 21 Jul 2015 10:27:59 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Describe IP SrcLoc change in release notes (9724555) Message-ID: <20150721102759.B35903A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/9724555fe6d741ae6c7612ef5a7f4de9b08f639d/ghc >--------------------------------------------------------------- commit 9724555fe6d741ae6c7612ef5a7f4de9b08f639d Author: Ben Gamari Date: Tue Jul 21 11:43:29 2015 +0200 Describe IP SrcLoc change in release notes >--------------------------------------------------------------- 9724555fe6d741ae6c7612ef5a7f4de9b08f639d ANNOUNCE | 3 +++ docs/users_guide/7.10.2-notes.xml | 21 +++++++++++++++++++++ docs/users_guide/glasgow_exts.xml | 3 ++- 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/ANNOUNCE b/ANNOUNCE index 85282a2..7812eba 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -23,6 +23,9 @@ bug-fix release and contains a number of important fixes, * An infinite loop during program startup when iconv is unavailable hsa been fixed + * The source location of the caller of a function is now available as an implicit + parameter to allow for better error reporting in the future + A more thorough list of the changes in the release can be found in the release notes, diff --git a/docs/users_guide/7.10.2-notes.xml b/docs/users_guide/7.10.2-notes.xml index 83a7889..18cbc48 100644 --- a/docs/users_guide/7.10.2-notes.xml +++ b/docs/users_guide/7.10.2-notes.xml @@ -16,6 +16,16 @@ + The source location of a function's caller can now be made + available to the callee as an implicit parameter. This will + enable better location information in runtime errors (e.g. from + error and partial functions like + head). For more details see + . + + + + A bug in the typechecker which could result in strange, inconsistent reduction of type families has been fixed (issue #10488). @@ -247,6 +257,17 @@ features). + + + The source location functionality above required an breaking change + to the GHC API. Namely, the SrcSpans of + CtLoc and TcLclEnv are now + RealSrcSpans. While usually API changes like this + are avoided in bugfix releases, it was decided that the benefits + offered by the source location functionality outweighed the cost of + a small change to this rarely-used interface. + + diff --git a/docs/users_guide/glasgow_exts.xml b/docs/users_guide/glasgow_exts.xml index adb152b..fb4837a 100644 --- a/docs/users_guide/glasgow_exts.xml +++ b/docs/users_guide/glasgow_exts.xml @@ -7681,7 +7681,8 @@ inner binding of ?x, so (f 9) will return -Special implicit parameters + +Special implicit parameters GHC treats implicit parameters of type GHC.Stack.CallStack specially, by resolving them to the current location in the program. Consider: From git at git.haskell.org Tue Jul 21 10:44:21 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 21 Jul 2015 10:44:21 +0000 (UTC) Subject: [commit: ghc] wip/impredicativity: Add defaulting of <~ constraints (4355551) Message-ID: <20150721104421.239CF3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/impredicativity Link : http://ghc.haskell.org/trac/ghc/changeset/435555107bdf62990862e6e12d33e6143c7fd53f/ghc >--------------------------------------------------------------- commit 435555107bdf62990862e6e12d33e6143c7fd53f Author: Alejandro Serrano Date: Tue Jul 21 12:45:06 2015 +0200 Add defaulting of <~ constraints >--------------------------------------------------------------- 435555107bdf62990862e6e12d33e6143c7fd53f compiler/typecheck/TcSimplify.hs | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/compiler/typecheck/TcSimplify.hs b/compiler/typecheck/TcSimplify.hs index 34207c5..1bc3701 100644 --- a/compiler/typecheck/TcSimplify.hs +++ b/compiler/typecheck/TcSimplify.hs @@ -121,10 +121,28 @@ simpl_top wanteds ; meta_tvs' <- mapM defaultTyVar meta_tvs -- Has unification side effects ; if meta_tvs' == meta_tvs -- No defaulting took place; -- (defaulting returns fresh vars) - then try_class_defaulting wc + then try_instance_of_defaulting wc else do { wc_residual <- nestTcS (solveWantedsAndDrop wc) -- See Note [Must simplify after defaulting] - ; try_class_defaulting wc_residual } } + ; try_instance_of_defaulting wc_residual } } + + try_instance_of_defaulting :: WantedConstraints -> TcS WantedConstraints + try_instance_of_defaulting wc + | isEmptyWC wc + = return wc + | otherwise + = do { let approx = bagToList (approximateWC_ wc) + ; something_happened <- foldlM (\something ct -> + case (isWantedCt ct, classifyPredType (ctPred ct)) of + (True, InstanceOfPred lhs rhs) + | Just v <- tcGetTyVar_maybe rhs + -> do { unifyTyVar v lhs + ; return True } + _ -> return something) False approx + ; if something_happened + then do { wc_residual <- nestTcS (solveWantedsAndDrop wc) + ; try_class_defaulting wc_residual } + else try_class_defaulting wc } try_class_defaulting :: WantedConstraints -> TcS WantedConstraints try_class_defaulting wc From git at git.haskell.org Tue Jul 21 11:57:31 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 21 Jul 2015 11:57:31 +0000 (UTC) Subject: [commit: ghc] master: primops: Fix spelling mistake (9ade087) Message-ID: <20150721115731.CD94A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/9ade087108afe2eec2698b6ce41146df02524810/ghc >--------------------------------------------------------------- commit 9ade087108afe2eec2698b6ce41146df02524810 Author: Ben Gamari Date: Tue Jul 21 12:27:28 2015 +0200 primops: Fix spelling mistake >--------------------------------------------------------------- 9ade087108afe2eec2698b6ce41146df02524810 compiler/prelude/primops.txt.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/prelude/primops.txt.pp b/compiler/prelude/primops.txt.pp index 6f870c6..72110fe 100644 --- a/compiler/prelude/primops.txt.pp +++ b/compiler/prelude/primops.txt.pp @@ -2457,7 +2457,7 @@ primop AddrToAnyOp "addrToAny#" GenPrimOp primop MkApUpd0_Op "mkApUpd0#" GenPrimOp BCO# -> (# a #) - { Wrap a BCO in a {\tt AP_UPD} thunk which will be updated with the vaule of + { Wrap a BCO in a {\tt AP_UPD} thunk which will be updated with the value of the BCO when evaluated. } with out_of_line = True From git at git.haskell.org Tue Jul 21 11:57:34 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 21 Jul 2015 11:57:34 +0000 (UTC) Subject: [commit: ghc] master: Delete __GLASGOW_HASKELL__ ifdefs for stage0 < 7.8 (e0a3c44) Message-ID: <20150721115734.8DE6E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e0a3c441412923bb8b422281cf2e0f8f2841d6c1/ghc >--------------------------------------------------------------- commit e0a3c441412923bb8b422281cf2e0f8f2841d6c1 Author: Thomas Miedema Date: Tue Jul 21 13:02:29 2015 +0200 Delete __GLASGOW_HASKELL__ ifdefs for stage0 < 7.8 Reviewers: austin, goldfire, bgamari Reviewed By: bgamari Subscribers: bgamari, thomie Differential Revision: https://phabricator.haskell.org/D904 >--------------------------------------------------------------- e0a3c441412923bb8b422281cf2e0f8f2841d6c1 compiler/hsSyn/HsExpr.hs-boot | 12 ------- compiler/hsSyn/HsPat.hs-boot | 8 ----- compiler/utils/Fingerprint.hsc | 39 +--------------------- compiler/utils/Serialized.hs | 10 ------ ghc/hschooks.c | 4 --- .../template-haskell/Language/Haskell/TH/Syntax.hs | 6 ---- 6 files changed, 1 insertion(+), 78 deletions(-) diff --git a/compiler/hsSyn/HsExpr.hs-boot b/compiler/hsSyn/HsExpr.hs-boot index 4b9f968..eb9d23a 100644 --- a/compiler/hsSyn/HsExpr.hs-boot +++ b/compiler/hsSyn/HsExpr.hs-boot @@ -3,9 +3,7 @@ {-# LANGUAGE UndecidableInstances #-} -- Note [Pass sensitive types] -- in module PlaceHolder {-# LANGUAGE ConstraintKinds #-} -#if __GLASGOW_HASKELL__ > 706 {-# LANGUAGE RoleAnnotations #-} -#endif module HsExpr where @@ -15,31 +13,21 @@ import {-# SOURCE #-} HsPat ( LPat ) import PlaceHolder ( DataId ) import Data.Data hiding ( Fixity ) -#if __GLASGOW_HASKELL__ > 706 type role HsExpr nominal type role HsCmd nominal type role MatchGroup nominal representational type role GRHSs nominal representational type role HsSplice nominal -#endif data HsExpr (i :: *) data HsCmd (i :: *) data HsSplice (i :: *) data MatchGroup (a :: *) (body :: *) data GRHSs (a :: *) (body :: *) -#if __GLASGOW_HASKELL__ > 706 instance Typeable HsSplice instance Typeable HsExpr instance Typeable MatchGroup instance Typeable GRHSs -#else -instance Typeable1 HsSplice -instance Typeable1 HsExpr -instance Typeable1 HsCmd -instance Typeable2 MatchGroup -instance Typeable2 GRHSs -#endif instance (DataId id) => Data (HsSplice id) instance (DataId id) => Data (HsExpr id) diff --git a/compiler/hsSyn/HsPat.hs-boot b/compiler/hsSyn/HsPat.hs-boot index 114425b..c6ab5a5 100644 --- a/compiler/hsSyn/HsPat.hs-boot +++ b/compiler/hsSyn/HsPat.hs-boot @@ -3,9 +3,7 @@ {-# LANGUAGE UndecidableInstances #-} -- Note [Pass sensitive types] -- in module PlaceHolder {-# LANGUAGE ConstraintKinds #-} -#if __GLASGOW_HASKELL__ > 706 {-# LANGUAGE RoleAnnotations #-} -#endif module HsPat where import SrcLoc( Located ) @@ -14,17 +12,11 @@ import Data.Data hiding (Fixity) import Outputable import PlaceHolder ( DataId ) -#if __GLASGOW_HASKELL__ > 706 type role Pat nominal -#endif data Pat (i :: *) type LPat i = Located (Pat i) -#if __GLASGOW_HASKELL__ > 706 instance Typeable Pat -#else -instance Typeable1 Pat -#endif instance (DataId id) => Data (Pat id) instance (OutputableBndr name) => Outputable (Pat name) diff --git a/compiler/utils/Fingerprint.hsc b/compiler/utils/Fingerprint.hsc index 464337b..ed4cd6f 100644 --- a/compiler/utils/Fingerprint.hsc +++ b/compiler/utils/Fingerprint.hsc @@ -15,7 +15,7 @@ module Fingerprint ( readHexFingerprint, fingerprintData, fingerprintString, - -- Re-exported from GHC.Fingerprint for GHC >= 7.7, local otherwise + -- Re-exported from GHC.Fingerprint getFileHash ) where @@ -23,13 +23,6 @@ module Fingerprint ( ##include "HsVersions.h" import Numeric ( readHex ) -#if __GLASGOW_HASKELL__ < 707 --- Only needed for getFileHash below. -import Foreign -import Panic -import System.IO -import Control.Monad ( when ) -#endif import GHC.Fingerprint @@ -39,33 +32,3 @@ readHexFingerprint s = Fingerprint w1 w2 where (s1,s2) = splitAt 16 s [(w1,"")] = readHex s1 [(w2,"")] = readHex (take 16 s2) - - -#if __GLASGOW_HASKELL__ < 707 --- Only use this if we're smaller than GHC 7.7, otherwise --- GHC.Fingerprint exports a better version of this function. - --- | Computes the hash of a given file. --- It loads the full file into memory an does not work with files bigger than --- MAXINT. -getFileHash :: FilePath -> IO Fingerprint -getFileHash path = withBinaryFile path ReadMode $ \h -> do - - fileSize <- toIntFileSize `fmap` hFileSize h - - allocaBytes fileSize $ \bufPtr -> do - n <- hGetBuf h bufPtr fileSize - when (n /= fileSize) readFailedError - fingerprintData bufPtr fileSize - - where - toIntFileSize :: Integer -> Int - toIntFileSize size - | size > fromIntegral (maxBound :: Int) = throwGhcException $ - Sorry $ "Fingerprint.getFileHash: Tried to calculate hash of file " - ++ path ++ " with size > maxBound :: Int. This is not supported." - | otherwise = fromIntegral size - - readFailedError = throwGhcException $ - Panic $ "Fingerprint.getFileHash: hGetBuf failed on interface file" -#endif diff --git a/compiler/utils/Serialized.hs b/compiler/utils/Serialized.hs index d4e0048..01fa071 100644 --- a/compiler/utils/Serialized.hs +++ b/compiler/utils/Serialized.hs @@ -96,26 +96,16 @@ deserializeConstr bytes k = deserializeWord8 bytes $ \constr_ix bytes -> x -> error $ "deserializeConstr: unrecognised serialized constructor type " ++ show x ++ " in context " ++ show bytes -#if __GLASGOW_HASKELL__ < 707 -serializeFixedWidthNum :: forall a. (Num a, Integral a, Bits a) => a -> [Word8] -> [Word8] -serializeFixedWidthNum what = go (bitSize what) what -#else serializeFixedWidthNum :: forall a. (Integral a, FiniteBits a) => a -> [Word8] -> [Word8] serializeFixedWidthNum what = go (finiteBitSize what) what -#endif where go :: Int -> a -> [Word8] -> [Word8] go size current rest | size <= 0 = rest | otherwise = fromIntegral (current .&. 255) : go (size - 8) (current `shiftR` 8) rest -#if __GLASGOW_HASKELL__ < 707 -deserializeFixedWidthNum :: forall a b. (Num a, Integral a, Bits a) => [Word8] -> (a -> [Word8] -> b) -> b -deserializeFixedWidthNum bytes k = go (bitSize (undefined :: a)) bytes k -#else deserializeFixedWidthNum :: forall a b. (Integral a, FiniteBits a) => [Word8] -> (a -> [Word8] -> b) -> b deserializeFixedWidthNum bytes k = go (finiteBitSize (undefined :: a)) bytes k -#endif where go :: Int -> [Word8] -> (a -> [Word8] -> b) -> b go size bytes k diff --git a/ghc/hschooks.c b/ghc/hschooks.c index 2ebbace..46a0944 100644 --- a/ghc/hschooks.c +++ b/ghc/hschooks.c @@ -30,14 +30,10 @@ initGCStatistics(void) void defaultsHook (void) { -#if __GLASGOW_HASKELL__ >= 707 // This helps particularly with large compiles, but didn't work // very well with earlier GHCs because it caused large amounts of // fragmentation. See rts/sm/BlockAlloc.c:allocLargeChunk(). RtsFlags.GcFlags.heapSizeSuggestionAuto = rtsTrue; -#else - RtsFlags.GcFlags.heapSizeSuggestion = 6*1024*1024 / BLOCK_SIZE; -#endif RtsFlags.GcFlags.maxStkSize = 512*1024*1024 / sizeof(W_); diff --git a/libraries/template-haskell/Language/Haskell/TH/Syntax.hs b/libraries/template-haskell/Language/Haskell/TH/Syntax.hs index b1f70f8..d2233a1 100644 --- a/libraries/template-haskell/Language/Haskell/TH/Syntax.hs +++ b/libraries/template-haskell/Language/Haskell/TH/Syntax.hs @@ -2,12 +2,8 @@ DeriveGeneric, FlexibleInstances, DefaultSignatures, ScopedTypeVariables, Rank2Types #-} -#if __GLASGOW_HASKELL__ >= 707 {-# LANGUAGE RoleAnnotations #-} {-# OPTIONS_GHC -fno-warn-inline-rule-shadowing #-} -#else -{-# OPTIONS_GHC -w #-} -- -fno-warn-inline-rule-shadowing doesn't exist -#endif #if MIN_VERSION_base(4,8,0) #define HAS_NATURAL @@ -178,9 +174,7 @@ instance Applicative Q where -- ----------------------------------------------------- -#if __GLASGOW_HASKELL__ >= 707 type role TExp nominal -- See Note [Role of TExp] -#endif newtype TExp a = TExp { unType :: Exp } unTypeQ :: Q (TExp a) -> Q Exp From git at git.haskell.org Tue Jul 21 11:58:48 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 21 Jul 2015 11:58:48 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: always use -fPIC on OpenBSD/AMD64 platform (0cfee53) Message-ID: <20150721115848.911403A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/0cfee536e5261af873485e7150be4a4ac26cd0e3/ghc >--------------------------------------------------------------- commit 0cfee536e5261af873485e7150be4a4ac26cd0e3 Author: Karel Gardas Date: Tue Jul 7 18:35:09 2015 +0200 always use -fPIC on OpenBSD/AMD64 platform Summary: This patch switches -fPIC on for every invocation of GHC on OpenBSD/AMD64 platform. The reason is OpenBSD's support for PIE (PIC for executables) hence -fPIC is also needed for GHC compiled code. Fixes #10597 Reviewers: austin Subscribers: thomie, bgamari Differential Revision: https://phabricator.haskell.org/D1027 >--------------------------------------------------------------- 0cfee536e5261af873485e7150be4a4ac26cd0e3 compiler/main/DynFlags.hs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 07cb23a..992e7da 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -3218,6 +3218,12 @@ default_PIC :: Platform -> [GeneralFlag] default_PIC platform = case (platformOS platform, platformArch platform) of (OSDarwin, ArchX86_64) -> [Opt_PIC] + (OSOpenBSD, ArchX86_64) -> [Opt_PIC] -- Due to PIE support in + -- OpenBSD since 5.3 release + -- (1 May 2013) we need to + -- always generate PIC. See + -- #10597 for more + -- information. _ -> [] impliedGFlags :: [(GeneralFlag, TurnOnFlag, GeneralFlag)] From git at git.haskell.org Tue Jul 21 12:20:36 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 21 Jul 2015 12:20:36 +0000 (UTC) Subject: [commit: ghc] master: Comments only (superclasses and improvement) (3fbf496) Message-ID: <20150721122036.546913A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/3fbf496564f5f8ee358bdf7fb998618fa773ddea/ghc >--------------------------------------------------------------- commit 3fbf496564f5f8ee358bdf7fb998618fa773ddea Author: Simon Peyton Jones Date: Mon Jul 20 23:37:42 2015 +0100 Comments only (superclasses and improvement) >--------------------------------------------------------------- 3fbf496564f5f8ee358bdf7fb998618fa773ddea compiler/typecheck/TcCanonical.hs | 31 ++++++++++++++++++++-------- compiler/typecheck/TcInteract.hs | 43 --------------------------------------- 2 files changed, 22 insertions(+), 52 deletions(-) diff --git a/compiler/typecheck/TcCanonical.hs b/compiler/typecheck/TcCanonical.hs index e91304a..6f02325 100644 --- a/compiler/typecheck/TcCanonical.hs +++ b/compiler/typecheck/TcCanonical.hs @@ -229,18 +229,13 @@ place to add their superclasses is canonicalisation. See Note [Add superclasses only during canonicalisation]. Here is what we do: Givens: Add all their superclasses as Givens. - They may be needed to prove Wanteds + They may be needed to prove Wanteds. - Wanteds: Do nothing. - - Deriveds: Add all their superclasses as Derived. + Wanteds/Derived: + Add all their superclasses as Derived. The sole reason is to expose functional dependencies in superclasses or equality superclasses. - We only do this in the improvement phase, if solving has - not succeeded; see Note [The improvement story] in - TcInteract - Examples of how adding superclasses as Derived is useful --- Example 1 @@ -260,6 +255,24 @@ Examples of how adding superclasses as Derived is useful [D] F a ~ beta Now we we get [D] beta ~ b, and can solve that. + -- Example (tcfail138) + class L a b | a -> b + class (G a, L a b) => C a b + + instance C a b' => G (Maybe a) + instance C a b => C (Maybe a) a + instance L (Maybe a) a + + When solving the superclasses of the (C (Maybe a) a) instance, we get + [G] C a b, and hance by superclasses, [G] G a, [G] L a b + [W] G (Maybe a) + Use the instance decl to get + [W] C a beta + Generate its derived superclass + [D] L a beta. Now using fundeps, combine with [G] L a b to get + [D] beta ~ b + which is what we want. + ---------- Historical note ----------- Example of why adding superclass of a Wanted as a Given would be terrible, see Note [Do not add superclasses of solved dictionaries] @@ -280,7 +293,7 @@ Then we'll use the instance decl to give [W] d4: Ord [a] ANd now we could bogusly solve d4 from d3. - +---------- End of historical note ----------- Note [Add superclasses only during canonicalisation] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/compiler/typecheck/TcInteract.hs b/compiler/typecheck/TcInteract.hs index b68dd34..6be3a2c 100644 --- a/compiler/typecheck/TcInteract.hs +++ b/compiler/typecheck/TcInteract.hs @@ -1523,49 +1523,6 @@ Then it is solvable, but its very hard to detect this on the spot. It's exactly the same with implicit parameters, except that the "aggressive" approach would be much easier to implement. -Note [When improvement happens during solving] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -During solving we maintain at "model" in the InertCans -Improvement for functional dependencies or type-function injectivity -means emitting a Derived equality constraint by interacting the work -item with an inert item, or with the top-level instances. e.g. - - class C a b | a -> b - [W] C a b, [W] C a c ==> [D] b ~ c - -We fire the fundep improvement if the "work item" is Given or Derived, -but not Wanted. Reason: - - * Given: we want to spot Given/Given inconsistencies because that means - unreachable code. See typecheck/should_fail/FDsFromGivens - - * Derived: during the improvement phase (i.e. when handling Derived - constraints) we also do improvement for functional dependencies. e.g. - And similarly wrt top-level instances. - - * Wanted: spotting fundep improvements is somewhat inefficient, and - and if we can solve without improvement so much the better. - So we don't bother to do this when solving Wanteds, instead - leaving it for the try_improvement loop - -Example (tcfail138) - class L a b | a -> b - class (G a, L a b) => C a b - - instance C a b' => G (Maybe a) - instance C a b => C (Maybe a) a - instance L (Maybe a) a - -When solving the superclasses of the (C (Maybe a) a) instance, we get - [G] C a b, and hance by superclasses, [G] G a, [G] L a b - [W] G (Maybe a) -Use the instance decl to get - [W] C a beta - -During improvement (see Note [The improvement story]) we generate the superclasses -of (C a beta): [D] L a beta. Now using fundeps, combine with [G] L a b to get -[D] beta ~ b, which is what we want. - Note [Weird fundeps] ~~~~~~~~~~~~~~~~~~~~ From git at git.haskell.org Tue Jul 21 12:20:39 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 21 Jul 2015 12:20:39 +0000 (UTC) Subject: [commit: ghc] master: Use varToCoreExpr in mkWWcpr_help (8f48fdc) Message-ID: <20150721122039.171C83A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/8f48fdc8f97c1f6f59e12a703e380d27760810b1/ghc >--------------------------------------------------------------- commit 8f48fdc8f97c1f6f59e12a703e380d27760810b1 Author: Simon Peyton Jones Date: Mon Jul 20 23:34:31 2015 +0100 Use varToCoreExpr in mkWWcpr_help Lacking this cuased Trac #10658. The fix is easy; it was a simple omission. >--------------------------------------------------------------- 8f48fdc8f97c1f6f59e12a703e380d27760810b1 compiler/stranal/WwLib.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/stranal/WwLib.hs b/compiler/stranal/WwLib.hs index 304a3cb..b442f3d 100644 --- a/compiler/stranal/WwLib.hs +++ b/compiler/stranal/WwLib.hs @@ -635,7 +635,9 @@ mkWWcpr_help (data_con, inst_tys, arg_tys, co) ; return ( True , \ wkr_call -> Case wkr_call arg (exprType con_app) [(DEFAULT, [], con_app)] - , \ body -> mkUnpackCase body co work_uniq data_con [arg] (Var arg) + , \ body -> mkUnpackCase body co work_uniq data_con [arg] (varToCoreExpr arg) + -- varToCoreExpr important here: arg can be a coercion + -- Lacking this caused Trac #10658 , arg_ty1 ) } | otherwise -- The general case From git at git.haskell.org Tue Jul 21 12:20:41 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 21 Jul 2015 12:20:41 +0000 (UTC) Subject: [commit: ghc] master: Refactor newSCWorkFromFlavoured (3509191) Message-ID: <20150721122041.DF0D63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/3509191250d60a3e04a9ef9e126ecd7cc5974250/ghc >--------------------------------------------------------------- commit 3509191250d60a3e04a9ef9e126ecd7cc5974250 Author: Simon Peyton Jones Date: Mon Jul 20 23:39:44 2015 +0100 Refactor newSCWorkFromFlavoured No change in behaviour is intended here >--------------------------------------------------------------- 3509191250d60a3e04a9ef9e126ecd7cc5974250 compiler/typecheck/TcCanonical.hs | 40 +++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/compiler/typecheck/TcCanonical.hs b/compiler/typecheck/TcCanonical.hs index 6f02325..f37ad3e 100644 --- a/compiler/typecheck/TcCanonical.hs +++ b/compiler/typecheck/TcCanonical.hs @@ -331,36 +331,40 @@ newSCWorkFromFlavored :: CtEvidence -> Class -> [Xi] -> TcS () -- Returns superclasses, see Note [Adding superclasses] newSCWorkFromFlavored flavor cls xis | CtGiven { ctev_evar = evar, ctev_loc = loc } <- flavor - = do { let size = sizeTypes xis - loc' | isCTupleClass cls - = loc -- For tuple predicates, just take them apart, without - -- adding their (large) size into the chain. When we - -- get down to a base predicate, we'll include its size. - -- Trac #10335 - | otherwise - = case ctLocOrigin loc of - GivenOrigin InstSkol - -> loc { ctl_origin = GivenOrigin (InstSC size) } - GivenOrigin (InstSC n) - -> loc { ctl_origin = GivenOrigin (InstSC (n `max` size)) } - _ -> loc - -- See Note [Solving superclass constraints] in TcInstDcls - -- for explantation of loc' - - ; given_evs <- newGivenEvVars loc' (mkEvScSelectors (EvId evar) cls xis) + = do { given_evs <- newGivenEvVars (mk_given_loc loc) + (mkEvScSelectors (EvId evar) cls xis) ; emitWorkNC given_evs } | isEmptyVarSet (tyVarsOfTypes xis) = return () -- Wanteds with no variables yield no deriveds. -- See Note [Improvement from Ground Wanteds] - | otherwise -- Derived case, just add those SC that can lead to improvement. + | otherwise -- Wanted/Derived case, just add those SC that can lead to improvement. = do { let sc_rec_theta = transSuperClasses cls xis impr_theta = filter isImprovementPred sc_rec_theta loc = ctEvLoc flavor ; traceTcS "newSCWork/Derived" $ text "impr_theta =" <+> ppr impr_theta ; emitNewDeriveds loc impr_theta } + where + size = sizeTypes xis + mk_given_loc loc + | isCTupleClass cls + = loc -- For tuple predicates, just take them apart, without + -- adding their (large) size into the chain. When we + -- get down to a base predicate, we'll include its size. + -- Trac #10335 + + | GivenOrigin skol_info <- ctLocOrigin loc + -- See Note [Solving superclass constraints] in TcInstDcls + -- for explantation of this transformation for givens + = case skol_info of + InstSkol -> loc { ctl_origin = GivenOrigin (InstSC size) } + InstSC n -> loc { ctl_origin = GivenOrigin (InstSC (n `max` size)) } + _ -> loc + + | otherwise -- Probably doesn't happen, since this function + = loc -- is only used for Givens, but does no harm {- ************************************************************************ From git at git.haskell.org Tue Jul 21 12:26:01 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 21 Jul 2015 12:26:01 +0000 (UTC) Subject: [commit: ghc] master: Improve strictness analysis for exceptions (7c0fff4) Message-ID: <20150721122601.E07C63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/7c0fff41789669450b02dc1db7f5d7babba5dee6/ghc >--------------------------------------------------------------- commit 7c0fff41789669450b02dc1db7f5d7babba5dee6 Author: Simon Peyton Jones Date: Tue Jul 21 12:28:42 2015 +0100 Improve strictness analysis for exceptions Two things here: * For exceptions-catching primops like catch#, we know that the main argument function will be called, so we can use strictApply1Dmd, rather than lazy Changes in primops.txt.pp * When a 'case' scrutinises a I/O-performing primop, the Note [IO hack in the demand analyser] was throwing away all strictness from the code that followed. I found that this was causing quite a bit of unnecessary reboxing in the (heavily used) function GHC.IO.Handle.Internals.wantReadableHandle So this patch prevents the hack applying when the case scrutinises a primop. See the revised Note [IO hack in the demand analyser] Thse two things buy us quite a lot in programs that do a lot of IO. Program Size Allocs Runtime Elapsed TotalMem -------------------------------------------------------------------------------- hpg -0.4% -2.9% -0.9% -1.0% +0.0% reverse-complem -0.4% -10.9% +10.7% +10.9% +0.0% simple -0.3% -0.0% +26.2% +26.2% +3.7% sphere -0.3% -6.3% 0.09 0.09 +0.0% -------------------------------------------------------------------------------- Min -0.7% -10.9% -4.6% -4.7% -1.7% Max -0.2% +0.0% +26.2% +26.2% +6.5% Geometric Mean -0.4% -0.3% +2.1% +2.1% +0.1% I think the increase in runtime for 'simple' is measurement error. >--------------------------------------------------------------- 7c0fff41789669450b02dc1db7f5d7babba5dee6 compiler/basicTypes/Demand.hs | 10 +++--- compiler/prelude/primops.txt.pp | 33 +++++++++++++---- compiler/stranal/DmdAnal.hs | 79 +++++++++++++++++++++++++++-------------- 3 files changed, 85 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 7c0fff41789669450b02dc1db7f5d7babba5dee6 From git at git.haskell.org Tue Jul 21 13:20:51 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 21 Jul 2015 13:20:51 +0000 (UTC) Subject: [commit: ghc] master: Comments and white space only (cd48797) Message-ID: <20150721132051.B0A363A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/cd48797a59b715ca13054d68b995cd4a2fdbc636/ghc >--------------------------------------------------------------- commit cd48797a59b715ca13054d68b995cd4a2fdbc636 Author: Simon Peyton Jones Date: Mon Jul 20 14:40:20 2015 +0100 Comments and white space only >--------------------------------------------------------------- cd48797a59b715ca13054d68b995cd4a2fdbc636 compiler/main/HscTypes.hs | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/compiler/main/HscTypes.hs b/compiler/main/HscTypes.hs index 0dd6341..cf2c64b 100644 --- a/compiler/main/HscTypes.hs +++ b/compiler/main/HscTypes.hs @@ -1080,23 +1080,24 @@ data ModGuts -- (produced by desugarer & consumed by vectoriser) mg_vect_info :: !VectInfo, -- ^ Pool of vectorised declarations in the module - -- The next two fields are unusual, because they give instance - -- environments for *all* modules in the home package, including - -- this module, rather than for *just* this module. - -- Reason: when looking up an instance we don't want to have to - -- look at each module in the home package in turn - mg_inst_env :: InstEnv, - -- ^ Class instance environment from /home-package/ modules (including - -- this one); c.f. 'tcg_inst_env' - mg_fam_inst_env :: FamInstEnv, - -- ^ Type-family instance environment for /home-package/ modules - -- (including this one); c.f. 'tcg_fam_inst_env' - mg_safe_haskell :: SafeHaskellMode, - -- ^ Safe Haskell mode - mg_trust_pkg :: Bool, - -- ^ Do we need to trust our own package for Safe Haskell? - -- See Note [RnNames . Trust Own Package] - mg_dependent_files :: [FilePath] -- ^ dependencies from addDependentFile + -- The next two fields are unusual, because they give instance + -- environments for *all* modules in the home package, including + -- this module, rather than for *just* this module. + -- Reason: when looking up an instance we don't want to have to + -- look at each module in the home package in turn + mg_inst_env :: InstEnv, -- ^ Class instance environment for + -- /home-package/ modules (including this + -- one); c.f. 'tcg_inst_env' + mg_fam_inst_env :: FamInstEnv, -- ^ Type-family instance environment for + -- /home-package/ modules (including this + -- one); c.f. 'tcg_fam_inst_env' + + mg_safe_haskell :: SafeHaskellMode, -- ^ Safe Haskell mode + mg_trust_pkg :: Bool, -- ^ Do we need to trust our + -- own package for Safe Haskell? + -- See Note [RnNames . Trust Own Package] + + mg_dependent_files :: [FilePath] -- ^ Dependencies from addDependentFile } -- The ModGuts takes on several slightly different forms: @@ -1105,7 +1106,6 @@ data ModGuts -- mg_rules Orphan rules only (local ones now attached to binds) -- mg_binds With rules attached - --------------------------------------------------------- -- The Tidy pass forks the information about this module: -- * one lot goes to interface file generation (ModIface) From git at git.haskell.org Tue Jul 21 13:20:54 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 21 Jul 2015 13:20:54 +0000 (UTC) Subject: [commit: ghc] master: Refactor self-boot info (3c44a46) Message-ID: <20150721132054.BB24C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/3c44a46b352a4eb7ff72eb3aa5495b25dee8351f/ghc >--------------------------------------------------------------- commit 3c44a46b352a4eb7ff72eb3aa5495b25dee8351f Author: Simon Peyton Jones Date: Mon Jul 20 15:38:12 2015 +0100 Refactor self-boot info This patch is a simple refactoring that prepares for a later one, related to Trac #10083. * Add a field tcg_self_boot :: SelfBootInfo to TcGblEnv, where SelfBootInfo is a new data type, describing the hi-boot file, if any, for the module being compiled. * Make tcHiBootIface return SelfBootInfo, a new data type * Make other functions get SelfBootInfo from the monad. * Remove tcg_mod_name from TcGblEnv; it was barely used and simpler to pass around explicitly. >--------------------------------------------------------------- 3c44a46b352a4eb7ff72eb3aa5495b25dee8351f compiler/iface/TcIface.hs | 28 ++++-- compiler/rename/RnSource.hs | 62 +++++++----- compiler/rename/RnSplice.hs | 2 +- compiler/typecheck/TcRnDriver.hs | 200 ++++++++++++++++++------------------- compiler/typecheck/TcRnMonad.hs | 5 +- compiler/typecheck/TcRnTypes.hs | 15 ++- compiler/typecheck/TcTyClsDecls.hs | 16 +-- compiler/typecheck/TcTyDecls.hs | 9 +- 8 files changed, 184 insertions(+), 153 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 3c44a46b352a4eb7ff72eb3aa5495b25dee8351f From git at git.haskell.org Tue Jul 21 13:20:58 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 21 Jul 2015 13:20:58 +0000 (UTC) Subject: [commit: ghc] master: Add NOINLINE for hs-boot functions (efa7b3a) Message-ID: <20150721132058.7FA413A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/efa7b3a474bc373201ab145c129262a73c86f959/ghc >--------------------------------------------------------------- commit efa7b3a474bc373201ab145c129262a73c86f959 Author: Simon Peyton Jones Date: Mon Jul 20 16:18:05 2015 +0100 Add NOINLINE for hs-boot functions This fixes Trac #10083. The key change is in TcBinds.tcValBinds, where we construct the prag_fn. With this patch we add a NOINLINE pragma for any functions that were exported by the hs-boot file for this module. See Note [Inlining and hs-boot files], and #10083, for details. The commit touches several other files becuase I also changed the representation of the "pragma function" from a function TcPragFun to an environment, TcPragEnv. This makes it easer to extend during construction. >--------------------------------------------------------------- efa7b3a474bc373201ab145c129262a73c86f959 compiler/typecheck/TcBinds.hs | 128 +++++++++++++++------ compiler/typecheck/TcClassDcl.hs | 12 +- compiler/typecheck/TcInstDcls.hs | 14 +-- compiler/typecheck/TcPat.hs | 64 +++++++---- compiler/typecheck/TcPatSyn.hs | 2 +- testsuite/tests/simplCore/should_compile/Makefile | 6 + testsuite/tests/simplCore/should_compile/T10083.hs | 5 + .../tests/simplCore/should_compile/T10083.hs-boot | 3 + .../tests/simplCore/should_compile/T10083a.hs | 4 + testsuite/tests/simplCore/should_compile/all.T | 4 + 10 files changed, 169 insertions(+), 73 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 efa7b3a474bc373201ab145c129262a73c86f959 From git at git.haskell.org Tue Jul 21 16:42:42 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 21 Jul 2015 16:42:42 +0000 (UTC) Subject: [commit: ghc] master: Documents -dsuppress-unfoldings (aa78cd6) Message-ID: <20150721164242.0EC0A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/aa78cd64af14b227fa982ce9a35c56d4d2ffcf7b/ghc >--------------------------------------------------------------- commit aa78cd64af14b227fa982ce9a35c56d4d2ffcf7b Author: Simon Peyton Jones Date: Thu Jul 9 13:19:03 2015 +0100 Documents -dsuppress-unfoldings >--------------------------------------------------------------- aa78cd64af14b227fa982ce9a35c56d4d2ffcf7b docs/users_guide/debugging.xml | 10 ++++++++++ docs/users_guide/flags.xml | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/docs/users_guide/debugging.xml b/docs/users_guide/debugging.xml index a0fee40..4e33987 100644 --- a/docs/users_guide/debugging.xml +++ b/docs/users_guide/debugging.xml @@ -579,6 +579,16 @@ + + + + + Suppress the printing of the stable unfolding of a variable at its binding site. + + + + + diff --git a/docs/users_guide/flags.xml b/docs/users_guide/flags.xml index e3ae927..c918600 100644 --- a/docs/users_guide/flags.xml +++ b/docs/users_guide/flags.xml @@ -3380,6 +3380,12 @@ - + + Suppress the printing of the stable unfolding of a variable at its binding site + dynamic + - + + Suppress the printing of module qualification prefixes dynamic From git at git.haskell.org Tue Jul 21 16:42:44 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 21 Jul 2015 16:42:44 +0000 (UTC) Subject: [commit: ghc] master: Comments and layout only (0df2348) Message-ID: <20150721164244.E7AE33A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/0df2348a329ed5f4b3893e6b8dc77066a0d77242/ghc >--------------------------------------------------------------- commit 0df2348a329ed5f4b3893e6b8dc77066a0d77242 Author: Simon Peyton Jones Date: Thu Jul 9 13:19:53 2015 +0100 Comments and layout only This patch adds a lot of visual structure to this key module >--------------------------------------------------------------- 0df2348a329ed5f4b3893e6b8dc77066a0d77242 libraries/ghc-prim/GHC/Types.hs | 187 +++++++++++++++++++++++++++------------- 1 file changed, 125 insertions(+), 62 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 0df2348a329ed5f4b3893e6b8dc77066a0d77242 From git at git.haskell.org Tue Jul 21 16:42:47 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 21 Jul 2015 16:42:47 +0000 (UTC) Subject: [commit: ghc] master: Implement -dsuppress-unfoldings (a0e8bb7) Message-ID: <20150721164247.CCB7D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a0e8bb74e734c65e8f7466f6f2d4f64666f871d8/ghc >--------------------------------------------------------------- commit a0e8bb74e734c65e8f7466f6f2d4f64666f871d8 Author: Simon Peyton Jones Date: Thu Jul 9 13:22:24 2015 +0100 Implement -dsuppress-unfoldings This extra "suppress" flag helps when there are a lot of Ids with big unfoldings that clutter up the dump Also slightly refactor printing of coercions in Core >--------------------------------------------------------------- a0e8bb74e734c65e8f7466f6f2d4f64666f871d8 compiler/coreSyn/PprCore.hs | 32 ++++++++++------------ compiler/main/DynFlags.hs | 3 ++ .../tests/deSugar/should_compile/T2431.stderr | 4 +-- 3 files changed, 19 insertions(+), 20 deletions(-) diff --git a/compiler/coreSyn/PprCore.hs b/compiler/coreSyn/PprCore.hs index e33c115..2ae1577 100644 --- a/compiler/coreSyn/PprCore.hs +++ b/compiler/coreSyn/PprCore.hs @@ -120,6 +120,12 @@ pprCoreExpr expr = ppr_expr noParens expr noParens :: SDoc -> SDoc noParens pp = pp +pprOptCo :: Coercion -> SDoc +pprOptCo co = sdocWithDynFlags $ \dflags -> + if gopt Opt_SuppressCoercions dflags + then ptext (sLit "...") + else parens (sep [ppr co, dcolon <+> ppr (coercionType co)]) + ppr_expr :: OutputableBndr b => (SDoc -> SDoc) -> Expr b -> SDoc -- The function adds parens in context that need -- an atomic value (e.g. function args) @@ -130,16 +136,7 @@ ppr_expr add_par (Coercion co) = add_par (ptext (sLit "CO") <+> ppr co) ppr_expr add_par (Lit lit) = pprLiteral add_par lit ppr_expr add_par (Cast expr co) - = add_par $ - sep [pprParendExpr expr, - ptext (sLit "`cast`") <+> pprCo co] - where - pprCo co = sdocWithDynFlags $ \dflags -> - if gopt Opt_SuppressCoercions dflags - then ptext (sLit "...") - else parens $ - sep [ppr co, dcolon <+> ppr (coercionType co)] - + = add_par $ sep [pprParendExpr expr, ptext (sLit "`cast`") <+> pprOptCo co] ppr_expr add_par expr@(Lam _ _) = let @@ -271,7 +268,7 @@ pprArg (Type ty) if gopt Opt_SuppressTypeApplications dflags then empty else ptext (sLit "@") <+> pprParendType ty -pprArg (Coercion co) = ptext (sLit "@~") <+> pprParendCo co +pprArg (Coercion co) = ptext (sLit "@~") <+> pprOptCo co pprArg expr = pprParendExpr expr {- @@ -361,9 +358,8 @@ pprIdBndr id = ppr id <+> pprIdBndrInfo (idInfo id) pprIdBndrInfo :: IdInfo -> SDoc pprIdBndrInfo info = sdocWithDynFlags $ \dflags -> - if gopt Opt_SuppressIdInfo dflags - then empty - else info `seq` doc -- The seq is useful for poking on black holes + ppUnless (gopt Opt_SuppressIdInfo dflags) $ + info `seq` doc -- The seq is useful for poking on black holes where prag_info = inlinePragInfo info occ_info = occInfo info @@ -391,9 +387,7 @@ pprIdBndrInfo info ppIdInfo :: Id -> IdInfo -> SDoc ppIdInfo id info = sdocWithDynFlags $ \dflags -> - if gopt Opt_SuppressIdInfo dflags - then empty - else + ppUnless (gopt Opt_SuppressIdInfo dflags) $ showAttributes [ (True, pp_scope <> ppr (idDetails id)) , (has_arity, ptext (sLit "Arity=") <> int arity) @@ -478,7 +472,9 @@ instance Outputable Unfolding where , ptext (sLit "WorkFree=") <> ppr wf , ptext (sLit "Expandable=") <> ppr exp , ptext (sLit "Guidance=") <> ppr g ] - pp_tmpl = ptext (sLit "Tmpl=") <+> ppr rhs + pp_tmpl = sdocWithDynFlags $ \dflags -> + ppUnless (gopt Opt_SuppressUnfoldings dflags) $ + ptext (sLit "Tmpl=") <+> ppr rhs pp_rhs | isStableSource src = pp_tmpl | otherwise = empty -- Don't print the RHS or we get a quadratic diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 70981e7..ad604c8 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -442,6 +442,8 @@ data GeneralFlag | Opt_SuppressIdInfo -- Suppress separate type signatures in core, but leave types on -- lambda bound vars + | Opt_SuppressUnfoldings + -- Suppress the details of even stable unfoldings | Opt_SuppressTypeSignatures -- Suppress unique ids on variables. -- Except for uniques, as some simplifier phases introduce new @@ -2905,6 +2907,7 @@ dFlags = [ flagSpec "ppr-ticks" Opt_PprShowTicks, flagSpec "suppress-coercions" Opt_SuppressCoercions, flagSpec "suppress-idinfo" Opt_SuppressIdInfo, + flagSpec "suppress-unfoldings" Opt_SuppressUnfoldings, flagSpec "suppress-module-prefixes" Opt_SuppressModulePrefixes, flagSpec "suppress-type-applications" Opt_SuppressTypeApplications, flagSpec "suppress-type-signatures" Opt_SuppressTypeSignatures, diff --git a/testsuite/tests/deSugar/should_compile/T2431.stderr b/testsuite/tests/deSugar/should_compile/T2431.stderr index f2b5ee6..cd14bd1 100644 --- a/testsuite/tests/deSugar/should_compile/T2431.stderr +++ b/testsuite/tests/deSugar/should_compile/T2431.stderr @@ -10,8 +10,8 @@ T2431.$WRefl [InlPrag=INLINE] :: forall a. a :~: a Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=ALWAYS_IF(arity=0,unsat_ok=False,boring_ok=False) - Tmpl= \ (@ a) -> T2431.Refl @ a @ a @~ _N}] -T2431.$WRefl = \ (@ a) -> T2431.Refl @ a @ a @~ _N + Tmpl= \ (@ a) -> T2431.Refl @ a @ a @~ (_N :: a ~# a)}] +T2431.$WRefl = \ (@ a) -> T2431.Refl @ a @ a @~ (_N :: a ~# a) -- RHS size: {terms: 4, types: 7, coercions: 0} absurd :: forall a. Int :~: Bool -> a From git at git.haskell.org Tue Jul 21 16:42:50 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 21 Jul 2015 16:42:50 +0000 (UTC) Subject: [commit: ghc] master: Comments and white space only (b5c1400) Message-ID: <20150721164250.99EF53A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/b5c1400fadccb0402678ea9eed83b03c79df761b/ghc >--------------------------------------------------------------- commit b5c1400fadccb0402678ea9eed83b03c79df761b Author: Simon Peyton Jones Date: Thu Jul 9 13:23:08 2015 +0100 Comments and white space only >--------------------------------------------------------------- b5c1400fadccb0402678ea9eed83b03c79df761b compiler/coreSyn/CoreFVs.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/compiler/coreSyn/CoreFVs.hs b/compiler/coreSyn/CoreFVs.hs index 688728a..f5f58dc 100644 --- a/compiler/coreSyn/CoreFVs.hs +++ b/compiler/coreSyn/CoreFVs.hs @@ -175,7 +175,7 @@ expr_fvs (Type ty) = someVars (tyVarsOfType ty) expr_fvs (Coercion co) = someVars (tyCoVarsOfCo co) expr_fvs (Var var) = oneVar var expr_fvs (Lit _) = noVars -expr_fvs (Tick t expr) = tickish_fvs t `union` expr_fvs expr +expr_fvs (Tick t expr) = tickish_fvs t `union` expr_fvs expr expr_fvs (App fun arg) = expr_fvs fun `union` expr_fvs arg expr_fvs (Lam bndr body) = addBndr bndr (expr_fvs body) expr_fvs (Cast expr co) = expr_fvs expr `union` someVars (tyCoVarsOfCo co) @@ -279,9 +279,11 @@ ruleRhsFreeVars (Rule { ru_fn = _, ru_bndrs = bndrs, ru_rhs = rhs }) -- | Those variables free in the both the left right hand sides of a rule ruleFreeVars :: CoreRule -> VarSet ruleFreeVars (BuiltinRule {}) = noFVs -ruleFreeVars (Rule { ru_fn = _, ru_bndrs = bndrs, ru_rhs = rhs, ru_args = args }) +ruleFreeVars (Rule { ru_fn = _do_not_include -- See Note [Rule free var hack] + , ru_bndrs = bndrs + , ru_rhs = rhs, ru_args = args }) = addBndrs bndrs (exprs_fvs (rhs:args)) isLocalVar emptyVarSet - -- See Note [Rule free var hack] + idRuleRhsVars :: (Activation -> Bool) -> Id -> VarSet -- Just the variables free on the *rhs* of a rule From git at git.haskell.org Tue Jul 21 16:42:53 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 21 Jul 2015 16:42:53 +0000 (UTC) Subject: [commit: ghc] master: Avoid out-of-scope top-level Ids (f1d0480) Message-ID: <20150721164253.9E7733A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/f1d0480971dff8a410f3ec0ffdecb14cc6050b57/ghc >--------------------------------------------------------------- commit f1d0480971dff8a410f3ec0ffdecb14cc6050b57 Author: Simon Peyton Jones Date: Tue Jul 21 14:34:05 2015 +0100 Avoid out-of-scope top-level Ids Pass the top-level SpecEnv to specImports/specImport, so that top-level Ids are in scope. Otherwise we get annoying (but correct) WARNINGS. >--------------------------------------------------------------- f1d0480971dff8a410f3ec0ffdecb14cc6050b57 compiler/specialise/Specialise.hs | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/compiler/specialise/Specialise.hs b/compiler/specialise/Specialise.hs index b2193e3..fe9cba6 100644 --- a/compiler/specialise/Specialise.hs +++ b/compiler/specialise/Specialise.hs @@ -584,8 +584,7 @@ specProgram guts@(ModGuts { mg_module = this_mod -- Specialise imported functions ; hpt_rules <- getRuleBase ; let rule_base = extendRuleBaseList hpt_rules local_rules - - ; (new_rules, spec_binds) <- specImports dflags this_mod emptyVarSet + ; (new_rules, spec_binds) <- specImports dflags this_mod top_env emptyVarSet rule_base (ud_calls uds) -- Don't forget to wrap the specialized bindings with bindings @@ -606,13 +605,13 @@ specProgram guts@(ModGuts { mg_module = this_mod -- accidentally re-use a unique that's already in use -- Easiest thing is to do it all at once, as if all the top-level -- decls were mutually recursive - top_subst = SE { se_subst = CoreSubst.mkEmptySubst $ mkInScopeSet $ mkVarSet $ - bindersOfBinds binds - , se_interesting = emptyVarSet } + top_env = SE { se_subst = CoreSubst.mkEmptySubst $ mkInScopeSet $ mkVarSet $ + bindersOfBinds binds + , se_interesting = emptyVarSet } go [] = return ([], emptyUDs) go (bind:binds) = do (binds', uds) <- go binds - (bind', uds') <- specBind top_subst bind uds + (bind', uds') <- specBind top_env bind uds return (bind' ++ binds', uds') {- @@ -639,6 +638,7 @@ See Trac #10491 -- | Specialise a set of calls to imported bindings specImports :: DynFlags -> Module + -> SpecEnv -- Passed in so that all top-level Ids are in scope -> VarSet -- Don't specialise these ones -- See Note [Avoiding recursive specialisation] -> RuleBase -- Rules from this module and the home package @@ -647,7 +647,7 @@ specImports :: DynFlags -> CoreM ( [CoreRule] -- New rules , [CoreBind] ) -- Specialised bindings -- See Note [Wrapping bindings returned by specImports] -specImports dflags this_mod done rule_base cds +specImports dflags this_mod top_env done rule_base cds -- See Note [Disabling cross-module specialisation] | not $ gopt Opt_CrossModuleSpecialise dflags = return ([], []) @@ -660,20 +660,21 @@ specImports dflags this_mod done rule_base cds go :: RuleBase -> [CallInfoSet] -> CoreM ([CoreRule], [CoreBind]) go _ [] = return ([], []) go rb (CIS fn calls_for_fn : other_calls) - = do { (rules1, spec_binds1) <- specImport dflags this_mod done rb fn $ + = do { (rules1, spec_binds1) <- specImport dflags this_mod top_env done rb fn $ Map.toList calls_for_fn ; (rules2, spec_binds2) <- go (extendRuleBaseList rb rules1) other_calls ; return (rules1 ++ rules2, spec_binds1 ++ spec_binds2) } specImport :: DynFlags -> Module + -> SpecEnv -- Passed in so that all top-level Ids are in scope -> VarSet -- Don't specialise these -- See Note [Avoiding recursive specialisation] -> RuleBase -- Rules from this module -> Id -> [CallInfo] -- Imported function and calls for it -> CoreM ( [CoreRule] -- New rules , [CoreBind] ) -- Specialised bindings -specImport dflags this_mod done rb fn calls_for_fn +specImport dflags this_mod top_env done rb fn calls_for_fn | fn `elemVarSet` done = return ([], []) -- No warning. This actually happens all the time -- when specialising a recursive function, because @@ -694,16 +695,17 @@ specImport dflags this_mod done rb fn calls_for_fn ; let full_rb = unionRuleBase rb (eps_rule_base eps) rules_for_fn = getRules (RuleEnv full_rb vis_orphs) fn - ; (rules1, spec_pairs, uds) <- runSpecM dflags this_mod $ - specCalls (Just this_mod) emptySpecEnv rules_for_fn calls_for_fn fn rhs + ; (rules1, spec_pairs, uds) <- -- pprTrace "specImport1" (vcat [ppr fn, ppr calls_for_fn, ppr rhs]) $ + runSpecM dflags this_mod $ + specCalls (Just this_mod) top_env rules_for_fn calls_for_fn fn rhs ; let spec_binds1 = [NonRec b r | (b,r) <- spec_pairs] -- After the rules kick in we may get recursion, but -- we rely on a global GlomBinds to sort that out later -- See Note [Glom the bindings if imported functions are specialised] -- Now specialise any cascaded calls - ; (rules2, spec_binds2) <- -- pprTrace "specImport" (ppr fn $$ ppr uds $$ ppr rhs) $ - specImports dflags this_mod (extendVarSet done fn) + ; (rules2, spec_binds2) <- -- pprTrace "specImport 2" (ppr fn $$ ppr rules1 $$ ppr spec_binds1) $ + specImports dflags this_mod top_env (extendVarSet done fn) (extendRuleBaseList rb rules1) (ud_calls uds) @@ -807,9 +809,6 @@ data SpecEnv -- See Note [Interesting dictionary arguments] } -emptySpecEnv :: SpecEnv -emptySpecEnv = SE { se_subst = CoreSubst.emptySubst, se_interesting = emptyVarSet} - specVar :: SpecEnv -> Id -> CoreExpr specVar env v = CoreSubst.lookupIdSubst (text "specVar") (se_subst env) v From git at git.haskell.org Tue Jul 21 16:42:56 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 21 Jul 2015 16:42:56 +0000 (UTC) Subject: [commit: ghc] master: Comments only (7a6ed66) Message-ID: <20150721164256.777F63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/7a6ed665dc08721cf36a39eb5c35559f7919d185/ghc >--------------------------------------------------------------- commit 7a6ed665dc08721cf36a39eb5c35559f7919d185 Author: Simon Peyton Jones Date: Tue Jul 21 14:34:31 2015 +0100 Comments only >--------------------------------------------------------------- 7a6ed665dc08721cf36a39eb5c35559f7919d185 compiler/typecheck/TcErrors.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compiler/typecheck/TcErrors.hs b/compiler/typecheck/TcErrors.hs index 464db67..9f4cb4d 100644 --- a/compiler/typecheck/TcErrors.hs +++ b/compiler/typecheck/TcErrors.hs @@ -694,14 +694,15 @@ mkIrredErr ctxt cts ---------------- mkHoleError :: ReportErrCtxt -> Ct -> TcM ErrMsg mkHoleError ctxt ct@(CHoleCan { cc_occ = occ, cc_hole = hole_sort }) - | isOutOfScopeCt ct + | isOutOfScopeCt ct -- Out of scope variables, like 'a', where 'a' isn't bound + -- Suggest possible in-scope variables in the message = do { dflags <- getDynFlags ; rdr_env <- getGlobalRdrEnv ; mkLongErrAt (RealSrcSpan (tcl_loc lcl_env)) out_of_scope_msg (unknownNameSuggestions dflags rdr_env (tcl_rdr lcl_env) (mkRdrUnqual occ)) } - | otherwise + | otherwise -- Explicit holes, like "_" or "_f" = do { (ctxt, binds_doc, ct) <- relevantBindings False ctxt ct -- The 'False' means "don't filter the bindings"; see Trac #8191 ; mkErrorMsgFromCt ctxt ct (hole_msg $$ binds_doc) } From git at git.haskell.org Tue Jul 21 16:42:59 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 21 Jul 2015 16:42:59 +0000 (UTC) Subject: [commit: ghc] master: Fix test T2497 to avoid infinite loop in RULES (55754ea) Message-ID: <20150721164259.4C36D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/55754ea34bd42ae88121311e9d0f29e90cce8166/ghc >--------------------------------------------------------------- commit 55754ea34bd42ae88121311e9d0f29e90cce8166 Author: Simon Peyton Jones Date: Tue Jul 21 14:39:17 2015 +0100 Fix test T2497 to avoid infinite loop in RULES >--------------------------------------------------------------- 55754ea34bd42ae88121311e9d0f29e90cce8166 testsuite/tests/typecheck/should_compile/T2497.hs | 6 +++++- testsuite/tests/typecheck/should_compile/T2497.stderr | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/testsuite/tests/typecheck/should_compile/T2497.hs b/testsuite/tests/typecheck/should_compile/T2497.hs index 24933e0..87b717d 100644 --- a/testsuite/tests/typecheck/should_compile/T2497.hs +++ b/testsuite/tests/typecheck/should_compile/T2497.hs @@ -14,9 +14,13 @@ foo x = x -- Trac #2213; eq should not be reported as unused eq,beq :: Eq a => a -> a -> Bool +{-# NOINLINE [0] eq #-} +-- The pragma and [~1] in the RULE are to prevent an infinite loo +-- in the simplifier, where the RULE fires infinitely in its +-- own RHS eq = (==) -- Used beq = (==) -- Unused {-# RULES - "rule 1" forall x y. x == y = y `eq` x + "rule 1" [~1] forall x y. x == y = y `eq` x #-} diff --git a/testsuite/tests/typecheck/should_compile/T2497.stderr b/testsuite/tests/typecheck/should_compile/T2497.stderr index cd7ad8b..da730a0 100644 --- a/testsuite/tests/typecheck/should_compile/T2497.stderr +++ b/testsuite/tests/typecheck/should_compile/T2497.stderr @@ -1,2 +1,2 @@ -T2497.hs:18:1: Warning: Defined but not used: ?beq? +T2497.hs:22:1: warning: Defined but not used: ?beq? From git at git.haskell.org Tue Jul 21 16:43:02 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 21 Jul 2015 16:43:02 +0000 (UTC) Subject: [commit: ghc] master: Do occurrence analysis on result of BuiltInRule (feaa095) Message-ID: <20150721164302.1B2C73A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/feaa0951f5cb6d54fffc5df822c03dfcb6db0e58/ghc >--------------------------------------------------------------- commit feaa0951f5cb6d54fffc5df822c03dfcb6db0e58 Author: Simon Peyton Jones Date: Tue Jul 21 14:41:08 2015 +0100 Do occurrence analysis on result of BuiltInRule Previously we did occurrence analysis on the result of a non-built-in RULE, but not of a built-in one. It makes a difference if the rule returns something with binders (which admittedly it usually does not). I'm about to introduce just such a rule for 'seq'. >--------------------------------------------------------------- feaa0951f5cb6d54fffc5df822c03dfcb6db0e58 compiler/specialise/Rules.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compiler/specialise/Rules.hs b/compiler/specialise/Rules.hs index 7cf6e56..f1288cc 100644 --- a/compiler/specialise/Rules.hs +++ b/compiler/specialise/Rules.hs @@ -483,7 +483,7 @@ matchRule :: DynFlags -> InScopeEnv -> (Activation -> Bool) -- then (f args) matches the rule, and the corresponding -- rewritten RHS is rhs -- --- The bndrs and rhs is occurrence-analysed +-- The returned expression is occurrence-analysed -- -- Example -- @@ -505,8 +505,9 @@ matchRule dflags rule_env _is_active fn args _rough_args (BuiltinRule { ru_try = match_fn }) -- Built-in rules can't be switched off, it seems = case match_fn dflags rule_env fn args of - Just expr -> Just expr Nothing -> Nothing + Just expr -> Just (occurAnalyseExpr expr) + -- We could do this when putting things into the rulebase, I guess matchRule _ in_scope is_active _ args rough_args (Rule { ru_act = act, ru_rough = tpl_tops From git at git.haskell.org Tue Jul 21 16:43:04 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 21 Jul 2015 16:43:04 +0000 (UTC) Subject: [commit: ghc] master: Make seq-of-cast rule generate a case (00f3187) Message-ID: <20150721164304.DA8AA3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/00f3187a615813b5dbc870f0477124c9cf76c9f2/ghc >--------------------------------------------------------------- commit 00f3187a615813b5dbc870f0477124c9cf76c9f2 Author: Simon Peyton Jones Date: Tue Jul 21 15:05:42 2015 +0100 Make seq-of-cast rule generate a case Previously it generated another call to seq, which triggered a lint failure (Trac #10659) >--------------------------------------------------------------- 00f3187a615813b5dbc870f0477124c9cf76c9f2 compiler/basicTypes/MkId.hs | 21 ++++++++++++++------- compiler/typecheck/TcExpr.hs | 18 ++++++++---------- testsuite/tests/concurrent/should_run/all.T | 3 +-- 3 files changed, 23 insertions(+), 19 deletions(-) diff --git a/compiler/basicTypes/MkId.hs b/compiler/basicTypes/MkId.hs index 1564d66..5f2cae8 100644 --- a/compiler/basicTypes/MkId.hs +++ b/compiler/basicTypes/MkId.hs @@ -1086,7 +1086,6 @@ seqId = pcMiscPrelId seqName ty info ty = mkForAllTys [alphaTyVar,betaTyVar] (mkFunTy alphaTy (mkFunTy betaTy betaTy)) - -- NB argBetaTyVar; see Note [seqId magic] [x,y] = mkTemplateLocals [alphaTy, betaTy] rhs = mkLams [alphaTyVar,betaTyVar,x,y] (Case (Var x) x betaTy [(DEFAULT, [], Var y)]) @@ -1102,8 +1101,15 @@ seqId = pcMiscPrelId seqName ty info match_seq_of_cast :: RuleFun -- See Note [Built-in RULES for seq] match_seq_of_cast _ _ _ [Type _, Type res_ty, Cast scrut co] - = Just (Var seqId `mkApps` [Type (pFst (coercionKind co)), Type res_ty, - scrut]) + = Just (fun `App` scrut) + where + fun = Lam x $ Lam y $ + Case (Var x) x res_ty [(DEFAULT,[],Var y)] + -- Generate a Case directly, not a call to seq, which + -- might be ill-kinded if res_ty is unboxed + [x,y] = mkTemplateLocals [scrut_ty, res_ty] + scrut_ty = pFst (coercionKind co) + match_seq_of_cast _ _ _ _ = Nothing ------------------------------------------------ @@ -1184,9 +1190,12 @@ Note [seqId magic] ~~~~~~~~~~~~~~~~~~ 'GHC.Prim.seq' is special in several ways. -a) Its second arg can have an unboxed type +a) In source Haskell its second arg can have an unboxed type x `seq` (v +# w) - Hence its second type variable has ArgKind + But see Note [Typing rule for seq] in TcExpr, which + explains why we give seq itself an ordinary type + seq :: forall a b. a -> b -> b + and treat it as a language construct from a typing point of view. b) Its fixity is set in LoadIface.ghcPrimIface @@ -1195,8 +1204,6 @@ c) It has quite a bit of desugaring magic. d) There is some special rule handing: Note [User-defined RULES for seq] -e) See Note [Typing rule for seq] in TcExpr. - Note [User-defined RULES for seq] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Roman found situations where he had diff --git a/compiler/typecheck/TcExpr.hs b/compiler/typecheck/TcExpr.hs index 826d143..cc09d23 100644 --- a/compiler/typecheck/TcExpr.hs +++ b/compiler/typecheck/TcExpr.hs @@ -282,18 +282,15 @@ Note [Typing rule for seq] We want to allow x `seq` (# p,q #) which suggests this type for seq: - seq :: forall (a:*) (b:??). a -> b -> b, -with (b:??) meaning that be can be instantiated with an unboxed tuple. -But that's ill-kinded! Function arguments can't be unboxed tuples. -And indeed, you could not expect to do this with a partially-applied -'seq'; it's only going to work when it's fully applied. so it turns -into + seq :: forall (a:*) (b:Open). a -> b -> b, +with (b:Open) meaning that be can be instantiated with an unboxed +tuple. The trouble is that this might accept a partially-applied +'seq', and I'm just not certain that would work. I'm only sure it's +only going to work when it's fully applied, so it turns into case x of _ -> (# p,q #) -For a while I slid by by giving 'seq' an ill-kinded type, but then -the simplifier eta-reduced an application of seq and Lint blew up -with a kind error. It seems more uniform to treat 'seq' as it it -was a language construct. +So it seems more uniform to treat 'seq' as it it was a language +construct. See Note [seqId magic] in MkId, and -} @@ -1183,6 +1180,7 @@ tcSeq :: SrcSpan -> Name -> LHsExpr Name -> LHsExpr Name -> TcRhoType -> TcM (HsExpr TcId) -- (seq e1 e2) :: res_ty -- We need a special typing rule because res_ty can be unboxed +-- See Note [Typing rule for seq] tcSeq loc fun_name arg1 arg2 res_ty = do { fun <- tcLookupId fun_name ; (arg1', arg1_ty) <- tcInfer (tcMonoExpr arg1) diff --git a/testsuite/tests/concurrent/should_run/all.T b/testsuite/tests/concurrent/should_run/all.T index 196c7c8..80734ad 100644 --- a/testsuite/tests/concurrent/should_run/all.T +++ b/testsuite/tests/concurrent/should_run/all.T @@ -174,8 +174,7 @@ test('conc033', normal, compile_and_run, ['']) # Omit for GHCi, because it just sits there waiting for you to press ^C test('conc034', [ - expect_broken_for(10659, - ['optasm', 'threaded2', 'dyn', 'optllvm']), + normal, omit_ways(['ghci']), extra_run_opts('+RTS -C0 -RTS')], compile_and_run, ['']) From git at git.haskell.org Tue Jul 21 16:43:07 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 21 Jul 2015 16:43:07 +0000 (UTC) Subject: [commit: ghc] master: T4945 is working again (35eb736) Message-ID: <20150721164307.A227F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/35eb736b3a171ce70bf4ddfe4717b0968cb1d1c6/ghc >--------------------------------------------------------------- commit 35eb736b3a171ce70bf4ddfe4717b0968cb1d1c6 Author: Simon Peyton Jones Date: Tue Jul 21 17:39:49 2015 +0100 T4945 is working again This test keeps flipping between ok and not-ok. In some ways this isn't surprising, since it greps in the output of -ddump-simpl, but I wish I knew exactly why. Anyway, it's currently working again. >--------------------------------------------------------------- 35eb736b3a171ce70bf4ddfe4717b0968cb1d1c6 testsuite/tests/simplCore/should_compile/all.T | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/testsuite/tests/simplCore/should_compile/all.T b/testsuite/tests/simplCore/should_compile/all.T index ba2244e..d912a42 100644 --- a/testsuite/tests/simplCore/should_compile/all.T +++ b/testsuite/tests/simplCore/should_compile/all.T @@ -106,8 +106,12 @@ test('T4918', run_command, ['$MAKE -s --no-print-directory T4918']) +# This test flips too and fro about whether it passes +# I'm not sure why it is so delicate, but it greps the +# result of -ddump-simpl, which is never advertised to +# be very stable test('T4945', - expect_broken(4945), + normal, run_command, ['$MAKE -s --no-print-directory T4945']) From git at git.haskell.org Tue Jul 21 19:42:13 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 21 Jul 2015 19:42:13 +0000 (UTC) Subject: [commit: ghc] master: configure: Bump minimum bootstrap GHC version to 7.8 (97a50d5) Message-ID: <20150721194213.0C7123A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/97a50d5096e134a1b713a085a7ba859bdd7143d1/ghc >--------------------------------------------------------------- commit 97a50d5096e134a1b713a085a7ba859bdd7143d1 Author: Ben Gamari Date: Tue Jul 21 18:23:01 2015 +0200 configure: Bump minimum bootstrap GHC version to 7.8 >--------------------------------------------------------------- 97a50d5096e134a1b713a085a7ba859bdd7143d1 configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 7553fc1..8d66f3f 100644 --- a/configure.ac +++ b/configure.ac @@ -136,8 +136,8 @@ if test "$WithGhc" = "" then AC_MSG_ERROR([GHC is required.]) fi -FP_COMPARE_VERSIONS([$GhcVersion],[-lt],[7.6], - [AC_MSG_ERROR([GHC version 7.6 or later is required to compile GHC.])]) +FP_COMPARE_VERSIONS([$GhcVersion],[-lt],[7.8], + [AC_MSG_ERROR([GHC version 7.8 or later is required to compile GHC.])]) if test `expr $GhcMinVersion % 2` = "1" then From git at git.haskell.org Tue Jul 21 19:42:17 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 21 Jul 2015 19:42:17 +0000 (UTC) Subject: [commit: ghc] master: When iconv is unavailable, use an ASCII encoding to encode ASCII (dbe6dac) Message-ID: <20150721194217.093093A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/dbe6dac96543f426297a59d8d16c3f5afacf42d4/ghc >--------------------------------------------------------------- commit dbe6dac96543f426297a59d8d16c3f5afacf42d4 Author: Reid Barton Date: Tue Jul 21 19:13:20 2015 +0200 When iconv is unavailable, use an ASCII encoding to encode ASCII D898 and D1059 implemented a fallback behavior to handle the case that the end user's iconv installation is broken (typically due to running inside a chroot in which the necessary locale files and/or gconv modules have not been installed). In this case, if the program requests an ASCII locale, GHC's char8 encoding is used rather than the program failing. However, silently mangling data like char8 does when the programmer did not ask for it is poor behavior, for reasons described in D1059. This commit implements an ASCII encoding and uses it in the fallback case when iconv is unavailable and the user has requested ASCII. Test Plan: Added tests for the encodings defined in Latin1. Also, manually ran a statically-linked executable of that test in a chroot and the tests passed (up to the ones that call mkTextEncoding "LATIN1", since there is no fallback from iconv for that case yet). Reviewers: austin, hvr, hsyl20, bgamari Reviewed By: hsyl20, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1085 GHC Trac Issues: #7695, #10623 >--------------------------------------------------------------- dbe6dac96543f426297a59d8d16c3f5afacf42d4 libraries/base/GHC/IO/Encoding.hs | 4 +- libraries/base/GHC/IO/Encoding/Latin1.hs | 83 ++++++++++++++++++++- libraries/base/tests/.gitignore | 1 + libraries/base/tests/IO/all.T | 1 + libraries/base/tests/IO/encoding005.hs | 115 +++++++++++++++++++++++++++++ libraries/base/tests/IO/encoding005.stdout | 5 ++ 6 files changed, 203 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 dbe6dac96543f426297a59d8d16c3f5afacf42d4 From git at git.haskell.org Tue Jul 21 19:42:19 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 21 Jul 2015 19:42:19 +0000 (UTC) Subject: [commit: ghc] master: testsuite: Show killed command line on timeout (f519cb5) Message-ID: <20150721194219.E09C63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/f519cb551c5b17feb7dbc12d5c08ee64a64c6a92/ghc >--------------------------------------------------------------- commit f519cb551c5b17feb7dbc12d5c08ee64a64c6a92 Author: Ben Gamari Date: Tue Jul 21 17:37:03 2015 +0200 testsuite: Show killed command line on timeout >--------------------------------------------------------------- f519cb551c5b17feb7dbc12d5c08ee64a64c6a92 testsuite/timeout/timeout.hs | 8 ++++---- testsuite/timeout/timeout.py | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/testsuite/timeout/timeout.hs b/testsuite/timeout/timeout.hs index f78baa1..3532497 100644 --- a/testsuite/timeout/timeout.hs +++ b/testsuite/timeout/timeout.hs @@ -33,8 +33,8 @@ main = do _ -> die ("Can't parse " ++ show secs ++ " as a number of seconds") _ -> die ("Bad arguments " ++ show args) -timeoutMsg :: String -timeoutMsg = "Timeout happened...killing process..." +timeoutMsg :: String -> String +timeoutMsg cmd = "Timeout happened...killing process "++cmd++"..." run :: Int -> String -> IO () #if !defined(mingw32_HOST_OS) @@ -61,7 +61,7 @@ run secs cmd = do r <- takeMVar m case r of Nothing -> do - hPutStrLn stderr timeoutMsg + hPutStrLn stderr (timeoutMsg cmd) killProcess pid exitWith (ExitFailure 99) Just (Exited r) -> exitWith r @@ -122,7 +122,7 @@ run secs cmd = let millisecs = secs * 1000 rc <- waitForSingleObject handle (fromIntegral millisecs) if rc == cWAIT_TIMEOUT - then do hPutStrLn stderr timeoutMsg + then do hPutStrLn stderr (timeoutMsg cmd) terminateJobObject job 99 exitWith (ExitFailure 99) else alloca $ \p_exitCode -> diff --git a/testsuite/timeout/timeout.py b/testsuite/timeout/timeout.py index df50806..1016e2d 100644 --- a/testsuite/timeout/timeout.py +++ b/testsuite/timeout/timeout.py @@ -35,7 +35,8 @@ try: else: # parent def handler(signum, frame): - sys.stderr.write('Timeout happened...killing process...\n') + msg = 'Timeout happened...killing process %s...\n' % cmd + sys.stderr.write(msg) killProcess(pid) sys.exit(99) old = signal.signal(signal.SIGALRM, handler) From git at git.haskell.org Tue Jul 21 21:22:36 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 21 Jul 2015 21:22:36 +0000 (UTC) Subject: [commit: ghc] master: Travis: use ghc-7.8.4 as stage0 to fix the build (18c6ee2) Message-ID: <20150721212236.1CDE83A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/18c6ee2abc305feb98013f06b6e85117271097ea/ghc >--------------------------------------------------------------- commit 18c6ee2abc305feb98013f06b6e85117271097ea Author: Thomas Miedema Date: Tue Jul 21 14:05:32 2015 +0200 Travis: use ghc-7.8.4 as stage0 to fix the build >--------------------------------------------------------------- 18c6ee2abc305feb98013f06b6e85117271097ea .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5e56226..5c847da 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,13 +16,13 @@ addons: - ubuntu-toolchain-r-test packages: - cabal-install-1.18 - - ghc-7.6.3 + - ghc-7.8.4 - alex-3.1.3 - happy-1.19.4 - llvm-3.6 before_install: - - export PATH=/opt/ghc/7.6.3/bin:/opt/cabal/1.18/bin:/opt/alex/3.1.3/bin:/opt/happy/1.19.4/bin:/usr/lib/llvm-3.6/bin:$PATH + - export PATH=/opt/ghc/7.8.4/bin:/opt/cabal/1.18/bin:/opt/alex/3.1.3/bin:/opt/happy/1.19.4/bin:/usr/lib/llvm-3.6/bin:$PATH # Be explicit about which protocol to use, such that we don't have to repeat the rewrite command for each. - git config remote.origin.url git://github.com/${TRAVIS_REPO_SLUG}.git From git at git.haskell.org Tue Jul 21 21:22:38 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 21 Jul 2015 21:22:38 +0000 (UTC) Subject: [commit: ghc] master: Validate: by default do show commands (d941a89) Message-ID: <20150721212238.E0C9E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d941a8993d1301949e6e64c92fa54324803754f6/ghc >--------------------------------------------------------------- commit d941a8993d1301949e6e64c92fa54324803754f6 Author: Thomas Miedema Date: Tue Jul 21 22:45:07 2015 +0200 Validate: by default do show commands Show commands being run by default, so you can copy/paste and rerun them on build failures/warnings. See Note [Default build system verbosity]. >--------------------------------------------------------------- d941a8993d1301949e6e64c92fa54324803754f6 validate | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/validate b/validate index e72a578..6c33b06 100755 --- a/validate +++ b/validate @@ -140,9 +140,14 @@ fi if type gmake > /dev/null 2> /dev/null then - make="gmake -s" + make="gmake" else - make="make -s" + make="make" +fi + +if [ $be_quiet -eq 1 ]; then + # See Note [Default build system verbosity]. + make="$make -s" fi if [ $testsuite_only -eq 0 ]; then @@ -169,7 +174,21 @@ 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 -echo "V=0" >> mk/are-validating.mk # Less gunk + +# Note [Default build system verbosity]. +# +# From https://ghc.haskell.org/trac/ghc/wiki/Design/BuildSystem: +# +# "The build system should clearly report what it's doing (and sometimes +# why), without being too verbose. It should emit actual command lines as +# much as possible, so that they can be inspected and cut & pasted." +# +# That should be the default. Only suppress commands, by setting V=0 and using +# `make -s`, when user explicitly asks for it with `./validate --quiet`. +if [ $be_quiet -eq 1 ]; then + # See Note [Default build system verbosity]. + echo "V=0" >> mk/are-validating.mk # Less gunk +fi if [ $speed != "FAST" ]; then # Build the "extra" packages (see ./packages), to enable more tests. From git at git.haskell.org Tue Jul 21 22:02:17 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 21 Jul 2015 22:02:17 +0000 (UTC) Subject: [commit: ghc] master: Validate: document --quiet [skip ci] (a7e0326) Message-ID: <20150721220217.945603A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a7e0326645bde1cc0a12f81a337ce797b159987e/ghc >--------------------------------------------------------------- commit a7e0326645bde1cc0a12f81a337ce797b159987e Author: Thomas Miedema Date: Wed Jul 22 00:00:01 2015 +0200 Validate: document --quiet [skip ci] >--------------------------------------------------------------- a7e0326645bde1cc0a12f81a337ce797b159987e validate | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/validate b/validate index 6c33b06..57977fa 100755 --- a/validate +++ b/validate @@ -18,12 +18,13 @@ Flags: compiler the test suite covers. 2008-07-01: 63% slower than the default. HTML generated here: testsuite/hpc_output/hpc_index.html - --normal Default settings --fast Omit dyn way, omit binary distribution --slow Build stage2 with -DDEBUG. Skips tests that call `compiler_stats_num_field`. 2008-07-01: 14% slower than the default. --dph: Also build libraries/dph and run associated tests. + --quiet: More pretty build log. + See Note [Default build system verbosity]. --help shows this usage help. Set environment variable 'CPUS' to number of cores, to exploit @@ -59,7 +60,7 @@ do --fast) speed=FAST ;; - --normal) + --normal) # for backward compat speed=NORMAL ;; --no-dph) # for backward compat From git at git.haskell.org Tue Jul 21 23:48:04 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 21 Jul 2015 23:48:04 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: base: Mention SrcLoc in changelog (ec991a7) Message-ID: <20150721234804.250853A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/ec991a7ed3089c1b0661d2bbd6666b01a228f0d4/ghc >--------------------------------------------------------------- commit ec991a7ed3089c1b0661d2bbd6666b01a228f0d4 Author: Ben Gamari Date: Tue Jul 21 18:31:46 2015 +0200 base: Mention SrcLoc in changelog >--------------------------------------------------------------- ec991a7ed3089c1b0661d2bbd6666b01a228f0d4 libraries/base/changelog.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libraries/base/changelog.md b/libraries/base/changelog.md index f7f1b5b..8882c5a 100644 --- a/libraries/base/changelog.md +++ b/libraries/base/changelog.md @@ -1,11 +1,14 @@ # Changelog for [`base` package](http://hackage.haskell.org/package/base) -## 4.8.1.0 *TBA* +## 4.8.1.0 *Jul 2015* * Bundled with GHC 7.10.2 * `Lifetime` is now exported from `GHC.Event` + * Implicit-parameter based source location support exposed in `GHC.SrcLoc`. + See GHC User's Manual for more information. + ## 4.8.0.0 *Mar 2015* * Bundled with GHC 7.10.1 From git at git.haskell.org Tue Jul 21 23:48:06 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 21 Jul 2015 23:48:06 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: 7.10.2-notes: Mention API annotations fixes (6146daa) Message-ID: <20150721234806.E7CEF3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/6146daa9cc83f3b0bb3036dfb06eb1c654157d5f/ghc >--------------------------------------------------------------- commit 6146daa9cc83f3b0bb3036dfb06eb1c654157d5f Author: Ben Gamari Date: Tue Jul 21 20:18:00 2015 +0200 7.10.2-notes: Mention API annotations fixes >--------------------------------------------------------------- 6146daa9cc83f3b0bb3036dfb06eb1c654157d5f docs/users_guide/7.10.2-notes.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/users_guide/7.10.2-notes.xml b/docs/users_guide/7.10.2-notes.xml index 18cbc48..27d0ad6 100644 --- a/docs/users_guide/7.10.2-notes.xml +++ b/docs/users_guide/7.10.2-notes.xml @@ -33,6 +33,11 @@ + A variety of fixes of the new API annotations support. + + + + A bug which caused GHC to generate bad DWARF unwinding information has been fixed (issue #10236). From git at git.haskell.org Tue Jul 21 23:48:10 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 21 Jul 2015 23:48:10 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: When iconv is unavailable, use an ASCII encoding to encode ASCII (2c67c68) Message-ID: <20150721234810.939353A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/2c67c68eb93e7ca44a9eb66e287cfdec4d1bd24c/ghc >--------------------------------------------------------------- commit 2c67c68eb93e7ca44a9eb66e287cfdec4d1bd24c Author: Ben Gamari Date: Tue Jul 21 21:46:38 2015 +0200 When iconv is unavailable, use an ASCII encoding to encode ASCII D898 and D1059 implemented a fallback behavior to handle the case that the end user's iconv installation is broken (typically due to running inside a chroot in which the necessary locale files and/or gconv modules have not been installed). In this case, if the program requests an ASCII locale, GHC's char8 encoding is used rather than the program failing. However, silently mangling data like char8 does when the programmer did not ask for it is poor behavior, for reasons described in D1059. This commit implements an ASCII encoding and uses it in the fallback case when iconv is unavailable and the user has requested ASCII. Test Plan: Added tests for the encodings defined in Latin1. Also, manually ran a statically-linked executable of that test in a chroot and the tests passed (up to the ones that call mkTextEncoding "LATIN1", since there is no fallback from iconv for that case yet). Reviewers: austin, hvr, hsyl20, bgamari Reviewed By: hsyl20, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1085 GHC Trac Issues: #7695, #10623 >--------------------------------------------------------------- 2c67c68eb93e7ca44a9eb66e287cfdec4d1bd24c libraries/base/GHC/IO/Encoding.hs | 14 ++-- libraries/base/GHC/IO/Encoding/Iconv.hs | 25 +++++-- libraries/base/GHC/IO/Encoding/Latin1.hs | 83 ++++++++++++++++++++- libraries/base/GHC/TopHandler.hs | 3 +- libraries/base/tests/.gitignore | 1 + libraries/base/tests/IO/all.T | 1 + libraries/base/tests/IO/encoding005.hs | 115 +++++++++++++++++++++++++++++ libraries/base/tests/IO/encoding005.stdout | 5 ++ 8 files changed, 227 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 2c67c68eb93e7ca44a9eb66e287cfdec4d1bd24c From git at git.haskell.org Tue Jul 21 23:48:13 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 21 Jul 2015 23:48:13 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Release 7.10.2 (0da488c) Message-ID: <20150721234813.6573B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/0da488c4438d88c9252e0b860426b8e74b5fc9e8/ghc >--------------------------------------------------------------- commit 0da488c4438d88c9252e0b860426b8e74b5fc9e8 Author: Ben Gamari Date: Tue Jul 21 21:46:00 2015 +0200 Release 7.10.2 >--------------------------------------------------------------- 0da488c4438d88c9252e0b860426b8e74b5fc9e8 configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index bbf346b..84194f7 100644 --- a/configure.ac +++ b/configure.ac @@ -13,10 +13,10 @@ dnl # see what flags are available. (Better yet, read the documentation!) # -AC_INIT([The Glorious Glasgow Haskell Compilation System], [7.10.1], [glasgow-haskell-bugs at haskell.org], [ghc]) +AC_INIT([The Glorious Glasgow Haskell Compilation System], [7.10.2], [glasgow-haskell-bugs at haskell.org], [ghc]) # Set this to YES for a released version, otherwise NO -: ${RELEASE=NO} +: ${RELEASE=YES} # The primary version (e.g. 7.5, 7.4.1) is set in the AC_INIT line # above. If this is not a released version, then we will append the From git at git.haskell.org Tue Jul 21 23:49:04 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 21 Jul 2015 23:49:04 +0000 (UTC) Subject: [commit: ghc] master: Add utility function isHoleName. (1224bb5) Message-ID: <20150721234904.8AB143A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/1224bb55cac502fe04005345aad47a6bc5c4a297/ghc >--------------------------------------------------------------- commit 1224bb55cac502fe04005345aad47a6bc5c4a297 Author: Edward Z. Yang Date: Tue Jul 21 16:15:32 2015 -0700 Add utility function isHoleName. Signed-off-by: Edward Z. Yang >--------------------------------------------------------------- 1224bb55cac502fe04005345aad47a6bc5c4a297 compiler/basicTypes/Name.hs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compiler/basicTypes/Name.hs b/compiler/basicTypes/Name.hs index 88b6e68..ce8619a 100644 --- a/compiler/basicTypes/Name.hs +++ b/compiler/basicTypes/Name.hs @@ -60,6 +60,7 @@ module Name ( isTyVarName, isTyConName, isDataConName, isValName, isVarName, isWiredInName, isBuiltInSyntax, + isHoleName, wiredInNameTyThing_maybe, nameIsLocalOrFrom, nameIsHomePackageImport, nameIsFromExternalPackage, stableNameCmp, @@ -212,6 +213,9 @@ isExternalName _ = False isInternalName name = not (isExternalName name) +isHoleName :: Name -> Bool +isHoleName = isHoleModule . nameModule + nameModule name = nameModule_maybe name `orElse` pprPanic "nameModule" (ppr name) nameModule_maybe :: Name -> Maybe Module nameModule_maybe (Name { n_sort = External mod}) = Just mod From git at git.haskell.org Wed Jul 22 08:04:39 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 22 Jul 2015 08:04:39 +0000 (UTC) Subject: [commit: ghc] tag 'ghc-7.10.2-release' created Message-ID: <20150722080439.8565E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New tag : ghc-7.10.2-release Referencing: 0becc9c5765973584ad0b7b9f0c64b83ddb2d399 From git at git.haskell.org Wed Jul 22 08:43:03 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 22 Jul 2015 08:43:03 +0000 (UTC) Subject: [commit: haddock] tag 'haddock-2.16.1-release' created Message-ID: <20150722084303.16DA53A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock New tag : haddock-2.16.1-release Referencing: d3188a5a00431761f21c32b885679bc6e66ff53a From git at git.haskell.org Wed Jul 22 08:43:05 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 22 Jul 2015 08:43:05 +0000 (UTC) Subject: [commit: haddock] master: Fix expansion icon for user-collapsible sections (06e0766) Message-ID: <20150722084305.20AF73A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/haddock On branch : master Link : http://git.haskell.org/haddock.git/commitdiff/06e0766810779180dbc52d15c0df5a2eaaf1881e >--------------------------------------------------------------- commit 06e0766810779180dbc52d15c0df5a2eaaf1881e Author: Mateusz Kowalczyk Date: Sat Jul 11 14:23:05 2015 +0100 Fix expansion icon for user-collapsible sections Closes #412 >--------------------------------------------------------------- 06e0766810779180dbc52d15c0df5a2eaaf1881e CHANGES | 2 ++ haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs | 5 +++-- html-test/ref/Bug335.html | 6 +++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index ff49b6f..be829ad 100644 --- a/CHANGES +++ b/CHANGES @@ -23,6 +23,8 @@ Changes in version 2.16.1 * Generate hyperlinked source ourselves (#410, part of GSOC 2015) + * Fix expansion icon for user-collapsible sections (#412) + Changes in version 2.16.0 * Experimental collapsible header support (#335) diff --git a/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs b/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs index c23f3f0..3fe74a8 100644 --- a/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs +++ b/haddock-api/src/Haddock/Backends/Xhtml/DocMarkup.hs @@ -161,8 +161,9 @@ hackMarkup fmt' h' = UntouchedDoc d -> (markup fmt $ _doc d, [_meta d]) CollapsingHeader (Header lvl titl) par n nm -> let id_ = makeAnchorId $ "ch:" ++ fromMaybe "noid:" nm ++ show n - col' = collapseControl id_ True "caption" - instTable = (thediv ! collapseSection id_ False [] <<) + expanded = False + col' = collapseControl id_ expanded "caption" + instTable = (thediv ! collapseSection id_ expanded [] <<) lvs = zip [1 .. ] [h1, h2, h3, h4, h5, h6] getHeader = fromMaybe caption (lookup lvl lvs) subCaption = getHeader ! col' << markup fmt titl diff --git a/html-test/ref/Bug335.html b/html-test/ref/Bug335.html index 6f3d382..dbe9742 100644 --- a/html-test/ref/Bug335.html +++ b/html-test/ref/Bug335.html @@ -64,7 +64,7 @@ window.onload = function () {pageLoad();setSynopsis("mini_Bug335.html");}; >f :: ()

    ExF:

    g :: ()

    ExG:

    Produced by Haddock version 2.16.0

    version 2.16.1

    Repository : ssh://git at git.haskell.org/haddock On branch : wip/orf-reboot Link : http://git.haskell.org/haddock.git/commitdiff/eb0a6a5e9866db38d811123c9fd55bceaf913b49 >--------------------------------------------------------------- commit eb0a6a5e9866db38d811123c9fd55bceaf913b49 Author: Adam Gundry Date: Tue Jul 14 21:34:07 2015 +0100 Roughly fix up for GHC API changes >--------------------------------------------------------------- eb0a6a5e9866db38d811123c9fd55bceaf913b49 haddock-api/src/Haddock/Backends/Hoogle.hs | 4 ++-- haddock-api/src/Haddock/Backends/LaTeX.hs | 4 ++-- haddock-api/src/Haddock/Backends/Xhtml/Decl.hs | 7 ++++--- haddock-api/src/Haddock/Convert.hs | 2 +- haddock-api/src/Haddock/GhcUtils.hs | 3 ++- haddock-api/src/Haddock/Interface/Create.hs | 17 +++++++++-------- haddock-api/src/Haddock/Interface/Rename.hs | 7 +++++-- haddock-api/src/Haddock/Types.hs | 1 + haddock-api/src/Haddock/Utils.hs | 4 +++- 9 files changed, 29 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 eb0a6a5e9866db38d811123c9fd55bceaf913b49 From git at git.haskell.org Wed Jul 22 08:45:24 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 22 Jul 2015 08:45:24 +0000 (UTC) Subject: [commit: ghc] wip/impredicativity: Fix bug on record construction typechecking (b9c79af) Message-ID: <20150722084524.BADD43A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/impredicativity Link : http://ghc.haskell.org/trac/ghc/changeset/b9c79afcf1492f5a916c8d3cb48fd7db521fc8e4/ghc >--------------------------------------------------------------- commit b9c79afcf1492f5a916c8d3cb48fd7db521fc8e4 Author: Alejandro Serrano Date: Wed Jul 22 10:46:12 2015 +0200 Fix bug on record construction typechecking >--------------------------------------------------------------- b9c79afcf1492f5a916c8d3cb48fd7db521fc8e4 compiler/typecheck/TcExpr.hs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/compiler/typecheck/TcExpr.hs b/compiler/typecheck/TcExpr.hs index 987eb2c..c8de8a5 100644 --- a/compiler/typecheck/TcExpr.hs +++ b/compiler/typecheck/TcExpr.hs @@ -484,14 +484,18 @@ tcExpr (RecordCon (L loc con_name) _ rbinds) res_ty -- Check for missing fields ; checkMissingFields data_con rbinds - ; con_expr <- tcCheckId con_name res_ty + -- Get type of the constructor + ; (con_expr, _, con_sigma) <- tcIdOcc (OccurrenceOf con_name) con_name + ; (wrap, con_rho) <- instFunTy con_sigma -- Eagerly instantiate + ; let arity = dataConSourceArity data_con - (arg_tys, _actual_res_ty) = tcSplitFunTysN res_ty arity + (arg_tys, actual_res_ty) = tcSplitFunTysN con_rho arity con_id = dataConWrapId data_con - - -- ; co_res <- unifyType actual_res_ty res_ty + ; co_res <- unifyType actual_res_ty res_ty ; rbinds' <- tcRecordBinds data_con arg_tys rbinds - ; return $ RecordCon (L loc con_id) con_expr rbinds' } + + ; let record_con = RecordCon (L loc con_id) (mkHsWrap wrap con_expr) rbinds' + ; return $ mkHsWrapCo co_res record_con } {- Note [Type of a record update] From git at git.haskell.org Wed Jul 22 16:33:01 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 22 Jul 2015 16:33:01 +0000 (UTC) Subject: [commit: ghc] master: Revert "Trac #4945 is working again" (50b9a7a) Message-ID: <20150722163301.76C123A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/50b9a7a355d6fbcb539d4f5aa8313fc0536e8fc3/ghc >--------------------------------------------------------------- commit 50b9a7a355d6fbcb539d4f5aa8313fc0536e8fc3 Author: Thomas Miedema Date: Wed Jul 22 18:10:42 2015 +0200 Revert "Trac #4945 is working again" This reverts commit 5d98b6828f65ce6eea45e93880928b7031955d38. >--------------------------------------------------------------- 50b9a7a355d6fbcb539d4f5aa8313fc0536e8fc3 testsuite/tests/simplCore/should_compile/all.T | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/tests/simplCore/should_compile/all.T b/testsuite/tests/simplCore/should_compile/all.T index d912a42..b675077 100644 --- a/testsuite/tests/simplCore/should_compile/all.T +++ b/testsuite/tests/simplCore/should_compile/all.T @@ -111,7 +111,7 @@ test('T4918', # result of -ddump-simpl, which is never advertised to # be very stable test('T4945', - normal, + expect_broken(4945), run_command, ['$MAKE -s --no-print-directory T4945']) From git at git.haskell.org Wed Jul 22 16:33:04 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 22 Jul 2015 16:33:04 +0000 (UTC) Subject: [commit: ghc] master: Testsuite: recenter haddock.base allocation numbers (1b76997) Message-ID: <20150722163304.4D8713A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/1b76997dba5c35ee956960e1948ee247dc57c500/ghc >--------------------------------------------------------------- commit 1b76997dba5c35ee956960e1948ee247dc57c500 Author: Thomas Miedema Date: Wed Jul 22 18:21:44 2015 +0200 Testsuite: recenter haddock.base allocation numbers >--------------------------------------------------------------- 1b76997dba5c35ee956960e1948ee247dc57c500 testsuite/tests/perf/haddock/all.T | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/testsuite/tests/perf/haddock/all.T b/testsuite/tests/perf/haddock/all.T index 94f7cbd..1e5a16c 100644 --- a/testsuite/tests/perf/haddock/all.T +++ b/testsuite/tests/perf/haddock/all.T @@ -5,7 +5,7 @@ test('haddock.base', [unless(in_tree_compiler(), skip), req_haddock ,stats_num_field('bytes allocated', - [(wordsize(64), 9014511528, 5) + [(wordsize(64), 9418857192, 5) # 2012-08-14: 5920822352 (amd64/Linux) # 2012-09-20: 5829972376 (amd64/Linux) # 2012-10-08: 5902601224 (amd64/Linux) @@ -23,6 +23,7 @@ test('haddock.base', # 2014-10-07: 8322584616 (x86_64/Linux) # 2014-12-14: 9502647104 (x86_64/Linux) - Update to Haddock 2.16 # 2014-01-08: 9014511528 (x86_64/Linux) - Eliminate so-called "silent superclass parameters" (and others) + # 2015-07-22: 9418857192 (x86_64/Linux) - Just slowly creeping up. ,(platform('i386-unknown-mingw32'), 4434804940, 5) # 2013-02-10: 3358693084 (x86/Windows) From git at git.haskell.org Wed Jul 22 16:33:56 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 22 Jul 2015 16:33:56 +0000 (UTC) Subject: [commit: ghc] master: Eliminate zero_static_objects_list() (b949c96) Message-ID: <20150722163356.456573A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/b949c96b4960168a3b399fe14485b24a2167b982/ghc >--------------------------------------------------------------- commit b949c96b4960168a3b399fe14485b24a2167b982 Author: Simon Marlow Date: Thu Jul 16 15:01:49 2015 +0100 Eliminate zero_static_objects_list() Summary: In a workload with a large amount of code, zero_static_objects_list() takes a significant amount of time, and furthermore it is in the single-threaded part of the GC. This patch uses a slightly fiddly scheme for marking objects on the static object lists, using a flag in the low 2 bits that flips between two states to indicate whether an object has been visited during this GC or not. We also have to take into account objects that have not been visited yet, which might appear at any time due to runtime linking. Test Plan: validate Reviewers: austin, bgamari, ezyang, rwbarton Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1076 >--------------------------------------------------------------- b949c96b4960168a3b399fe14485b24a2167b982 compiler/codeGen/StgCmmHeap.hs | 5 ++- rts/CheckUnload.c | 6 ++- rts/RetainerProfile.c | 2 +- rts/sm/Compact.c | 4 +- rts/sm/Evac.c | 95 ++++++++++++++++-------------------------- rts/sm/GC.c | 48 ++++++--------------- rts/sm/GCAux.c | 10 +++-- rts/sm/GCThread.h | 7 +++- rts/sm/Sanity.c | 3 +- rts/sm/Scav.c | 11 ++--- rts/sm/Storage.c | 10 ++--- rts/sm/Storage.h | 57 +++++++++++++++++++++++-- 12 files changed, 137 insertions(+), 121 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 b949c96b4960168a3b399fe14485b24a2167b982 From git at git.haskell.org Wed Jul 22 16:50:13 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 22 Jul 2015 16:50:13 +0000 (UTC) Subject: [commit: ghc] master: Two step allocator for 64-bit systems (0d1a8d0) Message-ID: <20150722165013.B6B093A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/0d1a8d09f452977aadef7897aa12a8d41c7a4af0/ghc >--------------------------------------------------------------- commit 0d1a8d09f452977aadef7897aa12a8d41c7a4af0 Author: Giovanni Campagna Date: Fri Jul 17 11:55:49 2015 +0100 Two step allocator for 64-bit systems Summary: The current OS memory allocator conflates the concepts of allocating address space and allocating memory, which makes the HEAP_ALLOCED() implementation excessively complicated (as the only thing it cares about is address space layout) and slow. Instead, what we want is to allocate a single insanely large contiguous block of address space (to make HEAP_ALLOCED() checks fast), and then commit subportions of that in 1MB blocks as we did before. This is currently behind a flag, USE_LARGE_ADDRESS_SPACE, that is only enabled for certain OSes. Test Plan: validate Reviewers: simonmar, ezyang, austin Subscribers: thomie, carter Differential Revision: https://phabricator.haskell.org/D524 GHC Trac Issues: #9706 >--------------------------------------------------------------- 0d1a8d09f452977aadef7897aa12a8d41c7a4af0 configure.ac | 36 ++ includes/rts/storage/MBlock.h | 194 +--------- rts/Sparks.c | 1 + rts/posix/OSMem.c | 200 +++++++++-- rts/sm/BlockAlloc.c | 14 +- rts/sm/GC.h | 2 + .../rts/storage/MBlock.h => rts/sm/HeapAlloc.h | 65 ++-- rts/sm/MBlock.c | 399 +++++++++++++++++++-- rts/sm/OSMem.h | 41 +++ rts/win32/OSMem.c | 77 +++- testsuite/tests/rts/Makefile | 4 +- testsuite/tests/rts/all.T | 7 + testsuite/tests/rts/outofmem.stderr-ws-64 | 2 +- testsuite/tests/rts/outofmem.stdout | 2 +- testsuite/tests/rts/testmblockalloc.c | 75 ++++ 15 files changed, 840 insertions(+), 279 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 0d1a8d09f452977aadef7897aa12a8d41c7a4af0 From git at git.haskell.org Wed Jul 22 17:31:17 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 22 Jul 2015 17:31:17 +0000 (UTC) Subject: [commit: ghc] master: Validate: explain THREADS instead of CPUS in --help (e3df1b1) Message-ID: <20150722173117.626C03A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e3df1b1e847fe3ae7793b2d56ff9976343d58985/ghc >--------------------------------------------------------------- commit e3df1b1e847fe3ae7793b2d56ff9976343d58985 Author: Thomas Miedema Date: Wed Jul 22 01:34:17 2015 +0200 Validate: explain THREADS instead of CPUS in --help >--------------------------------------------------------------- e3df1b1e847fe3ae7793b2d56ff9976343d58985 .travis.yml | 2 +- validate | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5c847da..f8829fe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -50,4 +50,4 @@ script: - if [ "$DEBUG_STAGE2" = "YES" ]; then echo 'GhcStage2HcOpts += -DDEBUG' >> mk/validate.mk; fi # Don't use --quiet, as it might cause the testsuite to not print output for # over 10 minutes, causing Travis to kill our job. - - CPUS=2 SKIP_PERF_TESTS=YES ./validate --fast + - THREADS=3 SKIP_PERF_TESTS=YES ./validate --fast diff --git a/validate b/validate index 57977fa..ab1cc01 100755 --- a/validate +++ b/validate @@ -20,17 +20,18 @@ Flags: HTML generated here: testsuite/hpc_output/hpc_index.html --fast Omit dyn way, omit binary distribution --slow Build stage2 with -DDEBUG. Skips tests that call - `compiler_stats_num_field`. + compiler_stats_num_field. 2008-07-01: 14% slower than the default. - --dph: Also build libraries/dph and run associated tests. - --quiet: More pretty build log. + --dph Also build libraries/dph and run associated tests. + --quiet More pretty build log. See Note [Default build system verbosity]. --help shows this usage help. - Set environment variable 'CPUS' to number of cores, to exploit - multiple cpu cores, e.g. + validate runs 'make -j\$THREADS', where by default THREADS is the number of + cpus your computer has +1. You can set the environment variable THREADS to + override this. For a sequential build you would for example use - CPUS=8 ./validate + THREADS=1 ./validate EOF } @@ -121,8 +122,6 @@ detect_cpu_count () { # nothing helped CPUS="1" fi - - echo "using ${CPUS} CPUs" >&2 } detect_cpu_count @@ -139,6 +138,8 @@ else threads="$THREADS" fi +echo "using THREADS=${threads}" >&2 + if type gmake > /dev/null 2> /dev/null then make="gmake" From git at git.haskell.org Wed Jul 22 17:31:20 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 22 Jul 2015 17:31:20 +0000 (UTC) Subject: [commit: ghc] master: Travis: do pass `--quiet` to validate (cf57f8f) Message-ID: <20150722173120.2694A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/cf57f8f9e9a649d7ffdfe0be09e503f6ed468a5d/ghc >--------------------------------------------------------------- commit cf57f8f9e9a649d7ffdfe0be09e503f6ed468a5d Author: Thomas Miedema Date: Wed Jul 22 01:54:40 2015 +0200 Travis: do pass `--quiet` to validate It's failing at the moment with "The log length has exceeded the limit of 4 Megabytes". We don't seem to have periods of >10 minutes without output after all, which was the initial reason of not using `--quiet`. >--------------------------------------------------------------- cf57f8f9e9a649d7ffdfe0be09e503f6ed468a5d .travis.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index f8829fe..4527708 100644 --- a/.travis.yml +++ b/.travis.yml @@ -48,6 +48,4 @@ script: - echo 'DYNAMIC_GHC_PROGRAMS = NO' >> mk/validate.mk - echo 'GhcLibWays = v' >> mk/validate.mk - if [ "$DEBUG_STAGE2" = "YES" ]; then echo 'GhcStage2HcOpts += -DDEBUG' >> mk/validate.mk; fi - # Don't use --quiet, as it might cause the testsuite to not print output for - # over 10 minutes, causing Travis to kill our job. - - THREADS=3 SKIP_PERF_TESTS=YES ./validate --fast + - THREADS=3 SKIP_PERF_TESTS=YES ./validate --fast --quiet From git at git.haskell.org Wed Jul 22 20:03:36 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 22 Jul 2015 20:03:36 +0000 (UTC) Subject: [commit: ghc] master: Switch from recording IsBootInterface to recording full HscSource. (0b12aca) Message-ID: <20150722200336.3ED2A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/0b12aca09efd4c151a8c2682b7534bda9bdc99ad/ghc >--------------------------------------------------------------- commit 0b12aca09efd4c151a8c2682b7534bda9bdc99ad Author: Edward Z. Yang Date: Tue Jul 21 16:51:51 2015 -0700 Switch from recording IsBootInterface to recording full HscSource. Note: ModIface format change is BC, no need to recompile. Signed-off-by: Edward Z. Yang >--------------------------------------------------------------- 0b12aca09efd4c151a8c2682b7534bda9bdc99ad compiler/deSugar/Desugar.hs | 2 +- compiler/ghci/Linker.hs | 2 +- compiler/iface/LoadIface.hs | 7 ++++--- compiler/iface/MkIface.hs | 12 ++++++------ compiler/main/DriverPhases.hs | 12 ++++++++++++ compiler/main/HscMain.hs | 2 +- compiler/main/HscTypes.hs | 21 +++++++++++++-------- 7 files changed, 38 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 0b12aca09efd4c151a8c2682b7534bda9bdc99ad From git at git.haskell.org Wed Jul 22 20:03:38 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 22 Jul 2015 20:03:38 +0000 (UTC) Subject: [commit: ghc] master: Use lookupIfaceTop for loading IfaceDecls. (dd365b1) Message-ID: <20150722200338.F32F93A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/dd365b1baab08b44e8feb1715ecacf7407628d5c/ghc >--------------------------------------------------------------- commit dd365b1baab08b44e8feb1715ecacf7407628d5c Author: Edward Z. Yang Date: Tue Jul 21 17:16:52 2015 -0700 Use lookupIfaceTop for loading IfaceDecls. Summary: It's shorter! And then when Backpack overrides lookupIfaceTop everyone will see the right information. Signed-off-by: Edward Z. Yang Test Plan: validate Reviewers: simonpj, austin, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1090 >--------------------------------------------------------------- dd365b1baab08b44e8feb1715ecacf7407628d5c compiler/iface/IfaceEnv.hs | 5 ++++- compiler/iface/LoadIface.hs | 10 ++++------ compiler/iface/TcIface.hs | 4 ++-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/compiler/iface/IfaceEnv.hs b/compiler/iface/IfaceEnv.hs index 1bd9316..a822b10 100644 --- a/compiler/iface/IfaceEnv.hs +++ b/compiler/iface/IfaceEnv.hs @@ -151,7 +151,10 @@ newImplicitBinder base_name mk_sys_occ ifaceExportNames :: [IfaceExport] -> TcRnIf gbl lcl [AvailInfo] ifaceExportNames exports = return exports -lookupOrig :: Module -> OccName -> TcRnIf a b Name +-- | Look up the 'Name' for a given 'Module' and 'OccName'. +-- Consider alternately using 'lookupIfaceTop' if you're in the 'IfL' monad +-- and 'Module' is simply that of the 'ModIface' you are typechecking. +lookupOrig :: Module -> OccName -> TcRnIf a b Name lookupOrig mod occ = do { -- First ensure that mod and occ are evaluated -- If not, chaos can ensue: diff --git a/compiler/iface/LoadIface.hs b/compiler/iface/LoadIface.hs index ad81357..9da1175 100644 --- a/compiler/iface/LoadIface.hs +++ b/compiler/iface/LoadIface.hs @@ -585,20 +585,18 @@ loadDecls :: Bool -> [(Fingerprint, IfaceDecl)] -> IfL [(Name,TyThing)] loadDecls ignore_prags ver_decls - = do { mod <- getIfModule - ; thingss <- mapM (loadDecl ignore_prags mod) ver_decls + = do { thingss <- mapM (loadDecl ignore_prags) ver_decls ; return (concat thingss) } loadDecl :: Bool -- Don't load pragmas into the decl pool - -> Module -> (Fingerprint, IfaceDecl) -> IfL [(Name,TyThing)] -- The list can be poked eagerly, but the -- TyThings are forkM'd thunks -loadDecl ignore_prags mod (_version, decl) +loadDecl ignore_prags (_version, decl) = do { -- Populate the name cache with final versions of all -- the names associated with the decl - main_name <- lookupOrig mod (ifName decl) + main_name <- lookupIfaceTop (ifName decl) -- Typecheck the thing, lazily -- NB. Firstly, the laziness is there in case we never need the @@ -671,7 +669,7 @@ loadDecl ignore_prags mod (_version, decl) Nothing -> pprPanic "loadDecl" (ppr main_name <+> ppr n $$ ppr (decl)) - ; implicit_names <- mapM (lookupOrig mod) (ifaceDeclImplicitBndrs decl) + ; implicit_names <- mapM lookupIfaceTop (ifaceDeclImplicitBndrs decl) -- ; traceIf (text "Loading decl for " <> ppr main_name $$ ppr implicit_names) ; return $ (main_name, thing) : diff --git a/compiler/iface/TcIface.hs b/compiler/iface/TcIface.hs index 9480aec..a7c340f 100644 --- a/compiler/iface/TcIface.hs +++ b/compiler/iface/TcIface.hs @@ -736,7 +736,7 @@ tcIfaceVectInfo mod typeEnv (IfaceVectInfo } where vectVarMapping name - = do { vName <- lookupOrig mod (mkLocalisedOccName mod mkVectOcc name) + = do { vName <- lookupIfaceTop (mkLocalisedOccName mod mkVectOcc name) ; var <- forkM (ptext (sLit "vect var") <+> ppr name) $ tcIfaceExtId name ; vVar <- forkM (ptext (sLit "vect vVar [mod =") <+> @@ -764,7 +764,7 @@ tcIfaceVectInfo mod typeEnv (IfaceVectInfo tcIfaceExtId name vectTyConVectMapping vars name - = do { vName <- lookupOrig mod (mkLocalisedOccName mod mkVectTyConOcc name) + = do { vName <- lookupIfaceTop (mkLocalisedOccName mod mkVectTyConOcc name) ; vectTyConMapping vars name vName } From git at git.haskell.org Wed Jul 22 20:03:41 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 22 Jul 2015 20:03:41 +0000 (UTC) Subject: [commit: ghc] master: Some utility functions for testing IfaceType equality. (939f1b2) Message-ID: <20150722200341.BBD293A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/939f1b2ed3c7a9e6ca7150d8c26a555c5b23a20c/ghc >--------------------------------------------------------------- commit 939f1b2ed3c7a9e6ca7150d8c26a555c5b23a20c Author: Edward Z. Yang Date: Tue Jul 21 17:04:38 2015 -0700 Some utility functions for testing IfaceType equality. Summary: These are going to be used by Backpack, but someone else might find them useful. They do the "obvious thing". Signed-off-by: Edward Z. Yang Test Plan: validate Reviewers: goldfire, bgamari, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1089 >--------------------------------------------------------------- 939f1b2ed3c7a9e6ca7150d8c26a555c5b23a20c compiler/iface/IfaceType.hs | 140 +++++++++++++++++++++++++++++++++++++++- compiler/prelude/ForeignCall.hs | 2 +- 2 files changed, 140 insertions(+), 2 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 939f1b2ed3c7a9e6ca7150d8c26a555c5b23a20c From git at git.haskell.org Wed Jul 22 20:03:44 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 22 Jul 2015 20:03:44 +0000 (UTC) Subject: [commit: ghc] master: Give more informative panic for checkFamInstConsistency. (144096e) Message-ID: <20150722200344.9F2F43A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/144096e1da595a7a612755b5abc7604fcbeb8e6e/ghc >--------------------------------------------------------------- commit 144096e1da595a7a612755b5abc7604fcbeb8e6e Author: Edward Z. Yang Date: Tue Jul 21 17:06:39 2015 -0700 Give more informative panic for checkFamInstConsistency. Signed-off-by: Edward Z. Yang >--------------------------------------------------------------- 144096e1da595a7a612755b5abc7604fcbeb8e6e compiler/typecheck/FamInst.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/typecheck/FamInst.hs b/compiler/typecheck/FamInst.hs index 9b7acac..3af2358 100644 --- a/compiler/typecheck/FamInst.hs +++ b/compiler/typecheck/FamInst.hs @@ -32,6 +32,7 @@ import Maybes import TcMType import TcType import Name +import Panic import Control.Monad import Data.Map (Map) import qualified Data.Map as Map @@ -134,7 +135,8 @@ checkFamInstConsistency famInstMods directlyImpMods -- all directly imported modules must already have been loaded. modIface mod = case lookupIfaceByModule dflags hpt (eps_PIT eps) mod of - Nothing -> panic "FamInst.checkFamInstConsistency" + Nothing -> panicDoc "FamInst.checkFamInstConsistency" + (ppr mod $$ pprHPT hpt) Just iface -> iface ; hmiModule = mi_module . hm_iface From git at git.haskell.org Wed Jul 22 20:03:47 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 22 Jul 2015 20:03:47 +0000 (UTC) Subject: [commit: ghc] master: Add ExceptionMonad instance for IOEnv. (adea827) Message-ID: <20150722200347.745C83A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/adea827955c714140e862fe86f94579c55321aab/ghc >--------------------------------------------------------------- commit adea827955c714140e862fe86f94579c55321aab Author: Edward Z. Yang Date: Tue Jul 21 17:05:16 2015 -0700 Add ExceptionMonad instance for IOEnv. Signed-off-by: Edward Z. Yang >--------------------------------------------------------------- adea827955c714140e862fe86f94579c55321aab compiler/utils/IOEnv.hs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/compiler/utils/IOEnv.hs b/compiler/utils/IOEnv.hs index 1ddf170..fae3b96 100644 --- a/compiler/utils/IOEnv.hs +++ b/compiler/utils/IOEnv.hs @@ -93,6 +93,16 @@ instance Show IOEnvFailure where instance Exception IOEnvFailure +instance ExceptionMonad (IOEnv a) where + gcatch act handle = + IOEnv $ \s -> unIOEnv act s `gcatch` \e -> unIOEnv (handle e) s + gmask f = + IOEnv $ \s -> gmask $ \io_restore -> + let + g_restore (IOEnv m) = IOEnv $ \s -> io_restore (m s) + in + unIOEnv (f g_restore) s + instance ContainsDynFlags env => HasDynFlags (IOEnv env) where getDynFlags = do env <- getEnv return $ extractDynFlags env From git at git.haskell.org Wed Jul 22 20:03:50 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 22 Jul 2015 20:03:50 +0000 (UTC) Subject: [commit: ghc] master: Export alwaysQualifyPackages and neverQualifyPackages. (4a9b40d) Message-ID: <20150722200350.3CA8E3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/4a9b40d17b07f5d4397e787506c5413e72f215ff/ghc >--------------------------------------------------------------- commit 4a9b40d17b07f5d4397e787506c5413e72f215ff Author: Edward Z. Yang Date: Tue Jul 21 17:09:38 2015 -0700 Export alwaysQualifyPackages and neverQualifyPackages. Signed-off-by: Edward Z. Yang >--------------------------------------------------------------- 4a9b40d17b07f5d4397e787506c5413e72f215ff compiler/utils/Outputable.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/utils/Outputable.hs b/compiler/utils/Outputable.hs index 36ac627..2bed1d1 100644 --- a/compiler/utils/Outputable.hs +++ b/compiler/utils/Outputable.hs @@ -61,6 +61,7 @@ module Outputable ( reallyAlwaysQualify, reallyAlwaysQualifyNames, alwaysQualify, alwaysQualifyNames, alwaysQualifyModules, neverQualify, neverQualifyNames, neverQualifyModules, + alwaysQualifyPackages, neverQualifyPackages, QualifyName(..), queryQual, sdocWithDynFlags, sdocWithPlatform, getPprStyle, withPprStyle, withPprStyleDoc, From git at git.haskell.org Thu Jul 23 07:33:38 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 23 Jul 2015 07:33:38 +0000 (UTC) Subject: [commit: ghc] master: Fix Trac #10670 (5c3fc92) Message-ID: <20150723073338.1E4D33A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/5c3fc921aeeeec392a89914783b2be9ea3dade27/ghc >--------------------------------------------------------------- commit 5c3fc921aeeeec392a89914783b2be9ea3dade27 Author: Simon Peyton Jones Date: Thu Jul 23 08:33:43 2015 +0100 Fix Trac #10670 In dataConCannotMatch we were using a GADT data con without properly instantiating the existential type variables. The fix is easy, and the code is tighter. >--------------------------------------------------------------- 5c3fc921aeeeec392a89914783b2be9ea3dade27 compiler/basicTypes/DataCon.hs | 33 ++++++++++++++++------ compiler/typecheck/TcSplice.hs | 16 ++++------- testsuite/tests/polykinds/T10670.hs | 24 ++++++++++++++++ testsuite/tests/polykinds/T10670a.hs | 54 ++++++++++++++++++++++++++++++++++++ testsuite/tests/polykinds/all.T | 2 ++ 5 files changed, 110 insertions(+), 19 deletions(-) diff --git a/compiler/basicTypes/DataCon.hs b/compiler/basicTypes/DataCon.hs index 5a72458..a70bcbd 100644 --- a/compiler/basicTypes/DataCon.hs +++ b/compiler/basicTypes/DataCon.hs @@ -19,7 +19,7 @@ module DataCon ( buildAlgTyCon, -- ** Type deconstruction - dataConRepType, dataConSig, dataConFullSig, + dataConRepType, dataConSig, dataConInstSig, dataConFullSig, dataConName, dataConIdentity, dataConTag, dataConTyCon, dataConOrigTyCon, dataConUserType, dataConUnivTyVars, dataConExTyVars, dataConAllTyVars, @@ -73,6 +73,7 @@ import qualified Data.Typeable import Data.Maybe import Data.Char import Data.Word +import Data.List( mapAccumL ) {- Data constructor representation @@ -857,6 +858,25 @@ dataConSig (MkData {dcUnivTyVars = univ_tvs, dcExTyVars = ex_tvs, dcOrigArgTys = arg_tys, dcOrigResTy = res_ty}) = (univ_tvs ++ ex_tvs, eqSpecPreds eq_spec ++ theta, arg_tys, res_ty) +dataConInstSig + :: DataCon + -> [Type] -- Instantiate the *universal* tyvars with these types + -> ([TyVar], ThetaType, [Type]) -- Return instantiated existentials + -- theta and arg tys +-- ^ Instantantiate the universal tyvars of a data con, +-- returning the instantiated existentials, constraints, and args +dataConInstSig (MkData { dcUnivTyVars = univ_tvs, dcExTyVars = ex_tvs + , dcEqSpec = eq_spec, dcOtherTheta = theta + , dcOrigArgTys = arg_tys }) + univ_tys + = (ex_tvs' + , substTheta subst (eqSpecPreds eq_spec ++ theta) + , substTys subst arg_tys) + where + univ_subst = zipTopTvSubst univ_tvs univ_tys + (subst, ex_tvs') = mapAccumL Type.substTyVarBndr univ_subst ex_tvs + + -- | The \"full signature\" of the 'DataCon' returns, in order: -- -- 1) The result of 'dataConUnivTyVars' @@ -990,16 +1010,11 @@ dataConCannotMatch :: [Type] -> DataCon -> Bool -- NB: look at *all* equality constraints, not only those -- in dataConEqSpec; see Trac #5168 dataConCannotMatch tys con - | null theta = False -- Common + | null inst_theta = False -- Common | all isTyVarTy tys = False -- Also common - | otherwise - = typesCantMatch [(Type.substTy subst ty1, Type.substTy subst ty2) - | (ty1, ty2) <- concatMap predEqs theta ] + | otherwise = typesCantMatch (concatMap predEqs inst_theta) where - dc_tvs = dataConUnivTyVars con - theta = dataConTheta con - subst = ASSERT2( length dc_tvs == length tys, ppr con $$ ppr dc_tvs $$ ppr tys ) - zipTopTvSubst dc_tvs tys + (_, inst_theta, _) = dataConInstSig con tys -- TODO: could gather equalities from superclasses too predEqs pred = case classifyPredType pred of diff --git a/compiler/typecheck/TcSplice.hs b/compiler/typecheck/TcSplice.hs index 2e368a9..586b2b8 100644 --- a/compiler/typecheck/TcSplice.hs +++ b/compiler/typecheck/TcSplice.hs @@ -1136,16 +1136,12 @@ reifyTyCon tc reifyDataCon :: [Type] -> DataCon -> TcM TH.Con -- For GADTs etc, see Note [Reifying data constructors] reifyDataCon tys dc - = do { let (tvs, theta, arg_tys, _) = dataConSig dc - subst = mkTopTvSubst (tvs `zip` tys) -- Dicard ex_tvs - (subst', ex_tvs') = mapAccumL substTyVarBndr subst (dropList tys tvs) - theta' = substTheta subst' theta - arg_tys' = substTys subst' arg_tys + = do { let (ex_tvs, theta, arg_tys) = dataConInstSig dc tys stricts = map reifyStrict (dataConSrcBangs dc) fields = dataConFieldLabels dc name = reifyName dc - ; r_arg_tys <- reifyTypes arg_tys' + ; r_arg_tys <- reifyTypes arg_tys ; let main_con | not (null fields) = TH.RecC name (zip3 (map reifyName fields) stricts r_arg_tys) @@ -1158,12 +1154,12 @@ reifyDataCon tys dc [s1, s2] = stricts ; ASSERT( length arg_tys == length stricts ) - if null ex_tvs' && null theta then + if null ex_tvs && null theta then return main_con else do - { cxt <- reifyCxt theta' - ; ex_tvs'' <- reifyTyVars ex_tvs' - ; return (TH.ForallC ex_tvs'' cxt main_con) } } + { cxt <- reifyCxt theta + ; ex_tvs' <- reifyTyVars ex_tvs + ; return (TH.ForallC ex_tvs' cxt main_con) } } ------------------------------ reifyClass :: Class -> TcM TH.Info diff --git a/testsuite/tests/polykinds/T10670.hs b/testsuite/tests/polykinds/T10670.hs new file mode 100644 index 0000000..5b9cc72 --- /dev/null +++ b/testsuite/tests/polykinds/T10670.hs @@ -0,0 +1,24 @@ +{-# LANGUAGE ScopedTypeVariables, RankNTypes, GADTs, PolyKinds #-} + +module T10670 where + +import Unsafe.Coerce + +data TypeRepT (a::k) where + TRCon :: TypeRepT a + +data G2 c a where + G2 :: TypeRepT a -> TypeRepT b -> G2 c (c a b) + +getT2 :: TypeRepT (c :: k2 -> k1 -> k) -> TypeRepT (a :: k) -> Maybe (G2 c a) +{-# NOINLINE getT2 #-} +getT2 c t = Nothing + +tyRepTArr :: TypeRepT (->) +{-# NOINLINE tyRepTArr #-} +tyRepTArr = TRCon + +s :: forall a x. TypeRepT (a :: *) -> Maybe x +s tf = case getT2 tyRepTArr tf :: Maybe (G2 (->) a) of + Just (G2 _ _) -> Nothing + _ -> Nothing diff --git a/testsuite/tests/polykinds/T10670a.hs b/testsuite/tests/polykinds/T10670a.hs new file mode 100644 index 0000000..d398cb7 --- /dev/null +++ b/testsuite/tests/polykinds/T10670a.hs @@ -0,0 +1,54 @@ +{-# LANGUAGE GADTs , PolyKinds #-} + +module Bug2 where + +import Unsafe.Coerce + +data TyConT (a::k) = TyConT String + +eqTyConT :: TyConT a -> TyConT b -> Bool +eqTyConT (TyConT a) (TyConT b) = a == b + + + +tyConTArr :: TyConT (->) +tyConTArr = TyConT "(->)" + + +data TypeRepT (a::k) where + TRCon :: TyConT a -> TypeRepT a + TRApp :: TypeRepT a -> TypeRepT b -> TypeRepT (a b) + + +data GetAppT a where + GA :: TypeRepT a -> TypeRepT b -> GetAppT (a b) + +getAppT :: TypeRepT a -> Maybe (GetAppT a) +getAppT (TRApp a b) = Just $ GA a b +getAppT _ = Nothing + + + +eqTT :: TypeRepT (a::k1) -> TypeRepT (b::k2) -> Bool +eqTT (TRCon a) (TRCon b) = eqTyConT a b +eqTT (TRApp c a) (TRApp d b) = eqTT c d && eqTT a b +eqTT _ _ = False + + +data G2 c a where + G2 :: TypeRepT a -> TypeRepT b -> G2 c (c a b) + + +getT2 :: TypeRepT (c :: k2 -> k1 -> k) -> TypeRepT (a :: k) -> Maybe (G2 c a) +getT2 c t = do GA t' b <- getAppT t + GA c' a <- getAppT t' + if eqTT c c' + then Just (unsafeCoerce $ G2 a b :: G2 c a) + else Nothing + +tyRepTArr :: TypeRepT (->) +tyRepTArr = TRCon tyConTArr + +s tf = case getT2 tyRepTArr tf + of Just (G2 _ _) -> Nothing + _ -> Nothing diff --git a/testsuite/tests/polykinds/all.T b/testsuite/tests/polykinds/all.T index c05e47e..3c8096c 100644 --- a/testsuite/tests/polykinds/all.T +++ b/testsuite/tests/polykinds/all.T @@ -117,3 +117,5 @@ test('T10451', normal, compile_fail, ['']) test('T10516', normal, compile_fail, ['']) test('T10503', normal, compile_fail, ['']) test('T10570', normal, compile_fail, ['']) +test('T10670', normal, compile, ['']) +test('T10670a', normal, compile, ['']) From git at git.haskell.org Thu Jul 23 07:33:40 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 23 Jul 2015 07:33:40 +0000 (UTC) Subject: [commit: ghc] master: Comments only (9851275) Message-ID: <20150723073340.F01723A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/985127510685c3e7ed462260bd69d2e6557430f4/ghc >--------------------------------------------------------------- commit 985127510685c3e7ed462260bd69d2e6557430f4 Author: Simon Peyton Jones Date: Thu Jul 23 08:34:10 2015 +0100 Comments only >--------------------------------------------------------------- 985127510685c3e7ed462260bd69d2e6557430f4 compiler/typecheck/FunDeps.hs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/compiler/typecheck/FunDeps.hs b/compiler/typecheck/FunDeps.hs index 9d4ef1c..997dcc0 100644 --- a/compiler/typecheck/FunDeps.hs +++ b/compiler/typecheck/FunDeps.hs @@ -225,12 +225,18 @@ checkClsFD :: FunDep TyVar -> [TyVar] -- One functional dependency f -> ClsInst -- An instance template -> TyVarSet -> [Type] -> [Maybe Name] -- Arguments of this (C tys) predicate -- TyVarSet are extra tyvars that can be instantiated - -> [([TyVar], [Pair Type])] + -> [([TyVar], [Pair Type])] -- Empty or singleton checkClsFD fd clas_tvs (ClsInst { is_tvs = qtvs, is_tys = tys_inst, is_tcs = rough_tcs_inst }) extra_qtvs tys_actual rough_tcs_actual +-- Compare instance {a,b} C sx sp sy sq +-- with {c,d,e} C tx tp ty tq +-- for fundep (x,y -> p,q) from class (C x p y q) +-- If (sx,sy) unifies with (tx,ty), take the subst S +-- + -- 'qtvs' are the quantified type variables, the ones which an be instantiated -- to make the types match. For example, given -- class C a b | a->b where ... From git at git.haskell.org Thu Jul 23 12:54:56 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 23 Jul 2015 12:54:56 +0000 (UTC) Subject: [commit: ghc] master: Lexer: support consecutive references to Haddock chunks (#10398) (d784bde) Message-ID: <20150723125456.D2D533A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d784bdeb62a6b11831c5235a97449ff2a86dcc52/ghc >--------------------------------------------------------------- commit d784bdeb62a6b11831c5235a97449ff2a86dcc52 Author: Thomas Miedema Date: Thu Jul 23 11:40:37 2015 +0200 Lexer: support consecutive references to Haddock chunks (#10398) Reviewers: austin, bgamari, Fuuzetsu Reviewed By: bgamari Subscribers: thomie, bgamari Differential Revision: https://phabricator.haskell.org/D1025 GHC Trac Issues: #10398 >--------------------------------------------------------------- d784bdeb62a6b11831c5235a97449ff2a86dcc52 compiler/parser/Lexer.x | 2 +- .../haddock/should_compile_flag_haddock/T10398.hs | 25 ++++++++++++++++++++++ .../should_compile_flag_haddock/T10398.stderr | 13 +++++++++++ .../haddock/should_compile_flag_haddock/all.T | 1 + 4 files changed, 40 insertions(+), 1 deletion(-) diff --git a/compiler/parser/Lexer.x b/compiler/parser/Lexer.x index a9293da..7dce81c 100644 --- a/compiler/parser/Lexer.x +++ b/compiler/parser/Lexer.x @@ -1012,7 +1012,7 @@ withLexedDocType lexDocComment = do case prevChar buf ' ' of '|' -> lexDocComment input ITdocCommentNext False '^' -> lexDocComment input ITdocCommentPrev False - '$' -> lexDocComment input ITdocCommentNamed False + '$' -> lexDocComment input ITdocCommentNamed True '*' -> lexDocSection 1 input '#' -> lexDocComment input ITdocOptionsOld False _ -> panic "withLexedDocType: Bad doc type" diff --git a/testsuite/tests/haddock/should_compile_flag_haddock/T10398.hs b/testsuite/tests/haddock/should_compile_flag_haddock/T10398.hs new file mode 100644 index 0000000..bbd498c --- /dev/null +++ b/testsuite/tests/haddock/should_compile_flag_haddock/T10398.hs @@ -0,0 +1,25 @@ +module Foo +( + -- The reference to chunk2 should show up in the -ddump-parsed output. + -- $chunk1 + -- $chunk2 + foo, + -- $chunk3 + bar +) +where + +{- $chunk1 +This is chunk 1. +-} + +{- $chunk2 +This is chunk 2. +-} + +{- $chunk3 +This is chunk 3. +-} + +foo = 3 +bar = 7 diff --git a/testsuite/tests/haddock/should_compile_flag_haddock/T10398.stderr b/testsuite/tests/haddock/should_compile_flag_haddock/T10398.stderr new file mode 100644 index 0000000..4a51fcd --- /dev/null +++ b/testsuite/tests/haddock/should_compile_flag_haddock/T10398.stderr @@ -0,0 +1,13 @@ + +==================== Parser ==================== +module Foo ( + , , foo, + , bar + ) where + + + +foo = 3 +bar = 7 + + diff --git a/testsuite/tests/haddock/should_compile_flag_haddock/all.T b/testsuite/tests/haddock/should_compile_flag_haddock/all.T index 61b6c6c..d803e9d 100644 --- a/testsuite/tests/haddock/should_compile_flag_haddock/all.T +++ b/testsuite/tests/haddock/should_compile_flag_haddock/all.T @@ -31,3 +31,4 @@ test('haddockA030', normal, compile, ['-haddock -ddump-parsed']) test('haddockA031', normal, compile, ['-haddock -ddump-parsed -XExistentialQuantification']) test('haddockA032', normal, compile, ['-haddock -ddump-parsed']) test('haddockA033', normal, compile, ['-haddock -ddump-parsed']) +test('T10398', normal, compile, ['-haddock -ddump-parsed']) From git at git.haskell.org Thu Jul 23 12:55:00 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 23 Jul 2015 12:55:00 +0000 (UTC) Subject: [commit: ghc] master: Generate .dyn_o files for .hsig files with -dynamic-too (d2b4df1) Message-ID: <20150723125500.775F33A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d2b4df157532adf014789ae9b2496f88369e43ea/ghc >--------------------------------------------------------------- commit d2b4df157532adf014789ae9b2496f88369e43ea Author: Michael Smith Date: Thu Jul 23 11:41:16 2015 +0200 Generate .dyn_o files for .hsig files with -dynamic-too With -dynamic-too, .dyn_o files were not being generated for .hsig files. Normally, this is handled in the pipeline; however, the branch for .hsig files called compileEmptyStub directly instead of going through runPipeline. When compiling a Cabal package that included .hsig files, this triggered a linker error later on, as it expected a .dyn_o file to have been generated for each .hsig. The fix is to use runPipeline for .hsig files, just as with .hs files. Alternately, one could duplicate the logic for handling -dynamic-too in the .hsig branch, but simply calling runPipeline ends up being much cleaner. Test Plan: validate Reviewers: austin, ezyang, bgamari, thomie Reviewed By: ezyang, thomie Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1084 GHC Trac Issues: #10660 >--------------------------------------------------------------- d2b4df157532adf014789ae9b2496f88369e43ea compiler/main/DriverPipeline.hs | 13 ++++++++++++- .../tests/driver/dynamicToo/dynamicToo005/A005.hsig | 5 +++++ testsuite/tests/driver/dynamicToo/dynamicToo005/Makefile | 16 ++++++++++++++++ testsuite/tests/driver/dynamicToo/dynamicToo005/test.T | 8 ++++++++ testsuite/tests/driver/dynamicToo/dynamicToo006/A.hsig | 5 +++++ testsuite/tests/driver/dynamicToo/dynamicToo006/B.hs | 8 ++++++++ .../dynamicToo/{dynamicToo002 => dynamicToo006}/Makefile | 15 ++++++--------- testsuite/tests/driver/dynamicToo/dynamicToo006/test.T | 9 +++++++++ 8 files changed, 69 insertions(+), 10 deletions(-) diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs index ff6e81d..97e64c4 100644 --- a/compiler/main/DriverPipeline.hs +++ b/compiler/main/DriverPipeline.hs @@ -251,7 +251,18 @@ compileOne' m_tc_result mHscMessage do (iface, changed, details) <- hscSimpleIface hsc_env tc_result mb_old_hash hscWriteIface dflags iface changed summary - compileEmptyStub dflags hsc_env basename location + + -- #10660: Use the pipeline instead of calling + -- compileEmptyStub directly, so -dynamic-too gets + -- handled properly + let mod_name = ms_mod_name summary + _ <- runPipeline StopLn hsc_env + (output_fn, + Just (HscOut src_flavour mod_name HscUpdateSig)) + (Just basename) + Persistent + (Just location) + Nothing -- Same as Hs o_time <- getModificationUTCTime object_filename diff --git a/testsuite/tests/driver/dynamicToo/dynamicToo005/A005.hsig b/testsuite/tests/driver/dynamicToo/dynamicToo005/A005.hsig new file mode 100644 index 0000000..75d621c --- /dev/null +++ b/testsuite/tests/driver/dynamicToo/dynamicToo005/A005.hsig @@ -0,0 +1,5 @@ + +module A005 where + +data Maybe a = Nothing | Just a + diff --git a/testsuite/tests/driver/dynamicToo/dynamicToo005/Makefile b/testsuite/tests/driver/dynamicToo/dynamicToo005/Makefile new file mode 100644 index 0000000..617510e --- /dev/null +++ b/testsuite/tests/driver/dynamicToo/dynamicToo005/Makefile @@ -0,0 +1,16 @@ +TOP=../../../.. +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/test.mk + +checkExists = [ -f $1 ] || echo $1 missing + +.PHONY: dynamicToo005 +# Check that "-c -dynamic-too" works with .hsig +dynamicToo005: + "$(TEST_HC)" $(TEST_HC_OPTS) -dynamic-too -v0 \ + -sig-of A005=base:Prelude \ + -c A005.hsig + $(call checkExists,A005.o) + $(call checkExists,A005.hi) + $(call checkExists,A005.dyn_o) + $(call checkExists,A005.dyn_hi) diff --git a/testsuite/tests/driver/dynamicToo/dynamicToo005/test.T b/testsuite/tests/driver/dynamicToo/dynamicToo005/test.T new file mode 100644 index 0000000..48460f5 --- /dev/null +++ b/testsuite/tests/driver/dynamicToo/dynamicToo005/test.T @@ -0,0 +1,8 @@ + +test('dynamicToo005', + [extra_clean(['A005.o', 'A005.hi', 'A005.dyn_o', 'A005.dyn_hi']), + unless(have_vanilla(), skip), + unless(have_dynamic(), skip)], + run_command, + ['$MAKE -s --no-print-directory dynamicToo005']) + diff --git a/testsuite/tests/driver/dynamicToo/dynamicToo006/A.hsig b/testsuite/tests/driver/dynamicToo/dynamicToo006/A.hsig new file mode 100644 index 0000000..f79d5d3 --- /dev/null +++ b/testsuite/tests/driver/dynamicToo/dynamicToo006/A.hsig @@ -0,0 +1,5 @@ + +module A where + +data Maybe a = Nothing | Just a + diff --git a/testsuite/tests/driver/dynamicToo/dynamicToo006/B.hs b/testsuite/tests/driver/dynamicToo/dynamicToo006/B.hs new file mode 100644 index 0000000..65900e7 --- /dev/null +++ b/testsuite/tests/driver/dynamicToo/dynamicToo006/B.hs @@ -0,0 +1,8 @@ +{-# LANGUAGE NoImplicitPrelude #-} + +module B where + +import A + +b :: Maybe a +b = Nothing diff --git a/testsuite/tests/driver/dynamicToo/dynamicToo002/Makefile b/testsuite/tests/driver/dynamicToo/dynamicToo006/Makefile similarity index 58% copy from testsuite/tests/driver/dynamicToo/dynamicToo002/Makefile copy to testsuite/tests/driver/dynamicToo/dynamicToo006/Makefile index 8705c87..497f2c0 100644 --- a/testsuite/tests/driver/dynamicToo/dynamicToo002/Makefile +++ b/testsuite/tests/driver/dynamicToo/dynamicToo006/Makefile @@ -4,20 +4,17 @@ include $(TOP)/mk/test.mk checkExists = [ -f $1 ] || echo $1 missing -.PHONY: dynamicToo002 -# Check that "--make -dynamic-too" works -dynamicToo002: - "$(TEST_HC)" $(TEST_HC_OPTS) -dynamic-too -v0 --make C +.PHONY: dynamicToo006 +# Check that "--make -dynamic-too" works with .hsig +dynamicToo006: + "$(TEST_HC)" $(TEST_HC_OPTS) -dynamic-too -v0 \ + -sig-of A=base:Prelude \ + --make B $(call checkExists,A.o) $(call checkExists,B.o) - $(call checkExists,C.o) $(call checkExists,A.hi) $(call checkExists,B.hi) - $(call checkExists,C.hi) $(call checkExists,A.dyn_o) $(call checkExists,B.dyn_o) - $(call checkExists,C.dyn_o) $(call checkExists,A.dyn_hi) $(call checkExists,B.dyn_hi) - $(call checkExists,C.dyn_hi) - diff --git a/testsuite/tests/driver/dynamicToo/dynamicToo006/test.T b/testsuite/tests/driver/dynamicToo/dynamicToo006/test.T new file mode 100644 index 0000000..72e06ca --- /dev/null +++ b/testsuite/tests/driver/dynamicToo/dynamicToo006/test.T @@ -0,0 +1,9 @@ + +test('dynamicToo006', + [extra_clean(['A.o', 'A.hi', 'A.dyn_o', 'A.dyn_hi', + 'B.o', 'B.hi', 'B.dyn_o', 'B.dyn_hi']), + unless(have_vanilla(), skip), + unless(have_dynamic(), skip)], + run_command, + ['$MAKE -s --no-print-directory dynamicToo006']) + From git at git.haskell.org Thu Jul 23 12:55:03 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 23 Jul 2015 12:55:03 +0000 (UTC) Subject: [commit: ghc] master: Accept next-docstrings on GADT constructors. (76e2341) Message-ID: <20150723125503.AE3803A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/76e2341afdc050549067a18cac41373f64daf4c2/ghc >--------------------------------------------------------------- commit 76e2341afdc050549067a18cac41373f64daf4c2 Author: Ben Gamari Date: Thu Jul 23 11:42:07 2015 +0200 Accept next-docstrings on GADT constructors. Accept next docstrings (`-- | Docstring`) on GADT constructors. I have confirmed that this adds no shift/reduce conflicts. Test Plan: haddockA034 Reviewers: austin, simonpj, simonmar Reviewed By: simonmar Subscribers: Fuuzetsu, simonmar, thomie, mpickering, edsko Differential Revision: https://phabricator.haskell.org/D1086 >--------------------------------------------------------------- 76e2341afdc050549067a18cac41373f64daf4c2 compiler/hsSyn/HsDecls.hs | 9 +++++---- compiler/parser/Parser.y | 13 ++++++++++--- docs/users_guide/7.12.1-notes.xml | 10 ++++++++++ testsuite/tests/haddock/should_compile_flag_haddock/all.T | 1 + .../haddock/should_compile_flag_haddock/haddockA034.hs | 8 ++++++++ .../haddock/should_compile_flag_haddock/haddockA034.stderr | 5 +++++ 6 files changed, 39 insertions(+), 7 deletions(-) diff --git a/compiler/hsSyn/HsDecls.hs b/compiler/hsSyn/HsDecls.hs index 9233f4f..79b0dee 100644 --- a/compiler/hsSyn/HsDecls.hs +++ b/compiler/hsSyn/HsDecls.hs @@ -981,16 +981,17 @@ pprConDecl (ConDecl { con_names = cons, con_explicit = expl, con_qvars = tvs pprConDecl (ConDecl { con_names = cons, con_explicit = expl, con_qvars = tvs , con_cxt = cxt, con_details = PrefixCon arg_tys - , con_res = ResTyGADT _ res_ty }) - = ppr_con_names cons <+> dcolon <+> + , con_res = ResTyGADT _ res_ty, con_doc = doc }) + = ppr_mbDoc doc <+> ppr_con_names cons <+> dcolon <+> sep [pprHsForAll expl tvs cxt, ppr (foldr mk_fun_ty res_ty arg_tys)] where mk_fun_ty a b = noLoc (HsFunTy a b) pprConDecl (ConDecl { con_names = cons, con_explicit = expl, con_qvars = tvs , con_cxt = cxt, con_details = RecCon fields - , con_res = ResTyGADT _ res_ty }) - = sep [ppr_con_names cons <+> dcolon <+> pprHsForAll expl tvs cxt, + , con_res = ResTyGADT _ res_ty, con_doc = doc }) + = sep [ppr_mbDoc doc <+> ppr_con_names cons <+> dcolon + <+> pprHsForAll expl tvs cxt, pprConDeclFields (unLoc fields) <+> arrow <+> ppr res_ty] pprConDecl decl@(ConDecl { con_details = InfixCon ty1 ty2, con_res = ResTyGADT {} }) diff --git a/compiler/parser/Parser.y b/compiler/parser/Parser.y index d697253..99abf16 100644 --- a/compiler/parser/Parser.y +++ b/compiler/parser/Parser.y @@ -1870,10 +1870,10 @@ gadt_constrlist :: { Located ([AddAnn] | {- empty -} { noLoc ([],[]) } gadt_constrs :: { Located [LConDecl RdrName] } - : gadt_constr ';' gadt_constrs + : gadt_constr_with_doc ';' gadt_constrs {% addAnnotation (gl $1) AnnSemi (gl $2) >> return (L (comb2 $1 $3) ($1 : unLoc $3)) } - | gadt_constr { L (gl $1) [$1] } + | gadt_constr_with_doc { L (gl $1) [$1] } | {- empty -} { noLoc [] } -- We allow the following forms: @@ -1882,11 +1882,18 @@ gadt_constrs :: { Located [LConDecl RdrName] } -- D { x,y :: a } :: T a -- forall a. Eq a => D { x,y :: a } :: T a +gadt_constr_with_doc :: { LConDecl RdrName } +gadt_constr_with_doc + : maybe_docnext ';' gadt_constr + {% return $ addConDoc $3 $1 } + | gadt_constr + {% return $1 } + gadt_constr :: { LConDecl RdrName } -- Returns a list because of: C,D :: ty : con_list '::' sigtype {% do { (anns,gadtDecl) <- mkGadtDecl (unLoc $1) $3 - ; ams (sLL $1 $> $ gadtDecl) + ; ams (sLL $1 $> gadtDecl) (mj AnnDcolon $2:anns) } } -- Deprecated syntax for GADT record declarations diff --git a/docs/users_guide/7.12.1-notes.xml b/docs/users_guide/7.12.1-notes.xml index cfe98b5..27ad849 100644 --- a/docs/users_guide/7.12.1-notes.xml +++ b/docs/users_guide/7.12.1-notes.xml @@ -36,6 +36,16 @@ + The parser now supports Haddock comments on GADT data constructors. For example, + + data Expr a where + -- | Just a normal sum + Sum :: Int -> Int -> Expr Int + + + + + Implicit parameters of the new base type GHC.Stack.CallStack are treated specially, and automatically solved for the current source diff --git a/testsuite/tests/haddock/should_compile_flag_haddock/all.T b/testsuite/tests/haddock/should_compile_flag_haddock/all.T index d803e9d..a0d1d7c 100644 --- a/testsuite/tests/haddock/should_compile_flag_haddock/all.T +++ b/testsuite/tests/haddock/should_compile_flag_haddock/all.T @@ -31,4 +31,5 @@ test('haddockA030', normal, compile, ['-haddock -ddump-parsed']) test('haddockA031', normal, compile, ['-haddock -ddump-parsed -XExistentialQuantification']) test('haddockA032', normal, compile, ['-haddock -ddump-parsed']) test('haddockA033', normal, compile, ['-haddock -ddump-parsed']) +test('haddockA034', normal, compile, ['-haddock -ddump-parsed']) test('T10398', normal, compile, ['-haddock -ddump-parsed']) diff --git a/testsuite/tests/haddock/should_compile_flag_haddock/haddockA034.hs b/testsuite/tests/haddock/should_compile_flag_haddock/haddockA034.hs new file mode 100644 index 0000000..195d76c --- /dev/null +++ b/testsuite/tests/haddock/should_compile_flag_haddock/haddockA034.hs @@ -0,0 +1,8 @@ +{-# LANGUAGE GADTs #-} + +module Hi where + +-- | This is a GADT. +data Hi where + -- | This is a GADT constructor. + Hi :: () -> Hi diff --git a/testsuite/tests/haddock/should_compile_flag_haddock/haddockA034.stderr b/testsuite/tests/haddock/should_compile_flag_haddock/haddockA034.stderr new file mode 100644 index 0000000..f743393 --- /dev/null +++ b/testsuite/tests/haddock/should_compile_flag_haddock/haddockA034.stderr @@ -0,0 +1,5 @@ + +==================== Parser ==================== +module Hi where + +data Hi where This is a GADT constructor. Hi :: () -> Hi From git at git.haskell.org Thu Jul 23 12:55:06 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 23 Jul 2015 12:55:06 +0000 (UTC) Subject: [commit: ghc] master: Update encoding001 to test the full range of non-surrogate code points (e78841b) Message-ID: <20150723125506.7D9193A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e78841b518ee9c0b92437899c3a4a2307dfd4ac8/ghc >--------------------------------------------------------------- commit e78841b518ee9c0b92437899c3a4a2307dfd4ac8 Author: Reid Barton Date: Thu Jul 23 11:43:07 2015 +0200 Update encoding001 to test the full range of non-surrogate code points GHC has used surrogate code points for roundtripping since 7.4. See Note [Roundtripping]. Also, improve the wording of that Note slightly. Test Plan: validate still passes Reviewers: austin, hvr, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1087 >--------------------------------------------------------------- e78841b518ee9c0b92437899c3a4a2307dfd4ac8 libraries/base/GHC/IO/Encoding/Failure.hs | 9 +++++---- libraries/base/tests/IO/encoding001.hs | 9 +-------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/libraries/base/GHC/IO/Encoding/Failure.hs b/libraries/base/GHC/IO/Encoding/Failure.hs index df5a992..3f9360d 100644 --- a/libraries/base/GHC/IO/Encoding/Failure.hs +++ b/libraries/base/GHC/IO/Encoding/Failure.hs @@ -74,21 +74,22 @@ data CodingFailureMode -- unicode input that includes lone surrogate codepoints is invalid by -- definition. -- +-- -- When we used private-use characters there was a technical problem when it -- came to encoding back to bytes using iconv. The iconv code will not fail when -- it tries to encode a private-use character (as it would if trying to encode --- a surrogate), which means that we won't get a chance to replace it +-- a surrogate), which means that we wouldn't get a chance to replace it -- with the byte we originally escaped. -- -- To work around this, when filling the buffer to be encoded (in -- writeBlocks/withEncodedCString/newEncodedCString), we replaced the -- private-use characters with lone surrogates again! Likewise, when --- reading from a buffer (unpack/unpack_nl/peekEncodedCString) we have +-- reading from a buffer (unpack/unpack_nl/peekEncodedCString) we had -- to do the inverse process. -- -- The user of String would never see these lone surrogates, but it --- ensures that iconv will throw an error when encountering them. We --- use lone surrogates in the range 0xDC00 to 0xDCFF for this purpose. +-- ensured that iconv will throw an error when encountering them. We +-- used lone surrogates in the range 0xDC00 to 0xDCFF for this purpose. codingFailureModeSuffix :: CodingFailureMode -> String codingFailureModeSuffix ErrorOnCodingFailure = "" diff --git a/libraries/base/tests/IO/encoding001.hs b/libraries/base/tests/IO/encoding001.hs index 9480abb..c92f8a3 100644 --- a/libraries/base/tests/IO/encoding001.hs +++ b/libraries/base/tests/IO/encoding001.hs @@ -29,14 +29,7 @@ main = do chr (fromIntegral (x `shiftR` 8) .&. 0xff), chr (fromIntegral x .&. 0xff) ] hPutStr h (concatMap expand32 [ 0, 32 .. 0xD7ff ]) - -- We avoid the private-use characters at 0xEF00..0xEFFF - -- that reserved for GHC's PEP383 roundtripping implementation. - -- - -- The reason is that currently normal text containing those - -- characters will be mangled, even if we aren't using an encoding - -- created using //ROUNDTRIP. - hPutStr h (concatMap expand32 [ 0xE000, 0xE000+32 .. 0xEEFF ]) - hPutStr h (concatMap expand32 [ 0xF000, 0xF000+32 .. 0x10FFFF ]) + hPutStr h (concatMap expand32 [ 0xE000, 0xE000+32 .. 0x10FFFF ]) hClose h -- convert the UTF-32BE file into each other encoding From git at git.haskell.org Thu Jul 23 12:55:10 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 23 Jul 2015 12:55:10 +0000 (UTC) Subject: [commit: ghc] master: Parenthesise TypeOperator in import hints (b5c9426) Message-ID: <20150723125510.0E76A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/b5c94262fa79f735334165c53667f113e07df5e1/ghc >--------------------------------------------------------------- commit b5c94262fa79f735334165c53667f113e07df5e1 Author: Thomas Winant Date: Thu Jul 23 11:43:21 2015 +0200 Parenthesise TypeOperator in import hints When a constructor was mistakenly imported directly instead of as a constructor of a data type, a hint will be shown on how to correctly import it. Just like the constructor, the data type should be surrounded in parentheses if it is an operator (TypeOperator in this case). Instead of: error: In module ?Data.Type.Equality?: ?Refl? is a data constructor of ?:~:? To import it use ?import? Data.Type.Equality( :~:( Refl ) ) or ?import? Data.Type.Equality( :~:(..) ) Print: error: In module ?Data.Type.Equality?: ?Refl? is a data constructor of ?(:~:)? To import it use ?import? Data.Type.Equality( (:~:)( Refl ) ) or ?import? Data.Type.Equality( (:~:)(..) ) Test Plan: pass new test Reviewers: austin, bgamari, simonpj Reviewed By: simonpj Subscribers: simonpj, thomie Differential Revision: https://phabricator.haskell.org/D1093 GHC Trac Issues: #10668 >--------------------------------------------------------------- b5c94262fa79f735334165c53667f113e07df5e1 compiler/rename/RnNames.hs | 9 +++++---- testsuite/tests/rename/should_fail/T10668.hs | 3 +++ testsuite/tests/rename/should_fail/T10668.stderr | 8 ++++++++ testsuite/tests/rename/should_fail/all.T | 1 + 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/compiler/rename/RnNames.hs b/compiler/rename/RnNames.hs index 872f4ff..0c116df 100644 --- a/compiler/rename/RnNames.hs +++ b/compiler/rename/RnNames.hs @@ -1654,25 +1654,26 @@ badImportItemErrDataCon :: OccName -> ImpDeclSpec -> IE RdrName -> SDoc -badImportItemErrDataCon dataType is_boot decl_spec ie +badImportItemErrDataCon dataType_occ is_boot decl_spec ie = vcat [ ptext (sLit "In module") <+> quotes (ppr (is_mod decl_spec)) <+> source_import <> colon , nest 2 $ quotes datacon <+> ptext (sLit "is a data constructor of") - <+> quotes (ppr dataType) + <+> quotes dataType , ptext (sLit "To import it use") , nest 2 $ quotes (ptext (sLit "import")) <+> ppr (is_mod decl_spec) - <> parens_sp (ppr dataType <> parens_sp datacon) + <> parens_sp (dataType <> parens_sp datacon) , ptext (sLit "or") , nest 2 $ quotes (ptext (sLit "import")) <+> ppr (is_mod decl_spec) - <> parens_sp (ppr dataType <> ptext (sLit "(..)")) + <> parens_sp (dataType <> ptext (sLit "(..)")) ] where datacon_occ = rdrNameOcc $ ieName ie datacon = parenSymOcc datacon_occ (ppr datacon_occ) + dataType = parenSymOcc dataType_occ (ppr dataType_occ) source_import | is_boot = ptext (sLit "(hi-boot interface)") | otherwise = Outputable.empty parens_sp d = parens (space <> d <> space) -- T( f,g ) diff --git a/testsuite/tests/rename/should_fail/T10668.hs b/testsuite/tests/rename/should_fail/T10668.hs new file mode 100644 index 0000000..111637b --- /dev/null +++ b/testsuite/tests/rename/should_fail/T10668.hs @@ -0,0 +1,3 @@ +module T10668 where + +import Data.Type.Equality(Refl) diff --git a/testsuite/tests/rename/should_fail/T10668.stderr b/testsuite/tests/rename/should_fail/T10668.stderr new file mode 100644 index 0000000..8c96fad --- /dev/null +++ b/testsuite/tests/rename/should_fail/T10668.stderr @@ -0,0 +1,8 @@ + +T10668.hs:3:27: error: + In module ?Data.Type.Equality?: + ?Refl? is a data constructor of ?(:~:)? + To import it use + ?import? Data.Type.Equality( (:~:)( Refl ) ) + or + ?import? Data.Type.Equality( (:~:)(..) ) diff --git a/testsuite/tests/rename/should_fail/all.T b/testsuite/tests/rename/should_fail/all.T index bfd81c5..80471a6 100644 --- a/testsuite/tests/rename/should_fail/all.T +++ b/testsuite/tests/rename/should_fail/all.T @@ -134,3 +134,4 @@ test('T9032', run_command, ['$MAKE -s --no-print-directory T9032']) test('T10618', normal, compile_fail, ['']) +test('T10668', normal, compile_fail, ['']) From git at git.haskell.org Thu Jul 23 12:55:12 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 23 Jul 2015 12:55:12 +0000 (UTC) Subject: [commit: ghc] master: DataCon: Fix redundant import (1852c3d) Message-ID: <20150723125512.D09A43A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/1852c3d2bb841246a790de1a67f8f140a5cccef3/ghc >--------------------------------------------------------------- commit 1852c3d2bb841246a790de1a67f8f140a5cccef3 Author: Ben Gamari Date: Thu Jul 23 12:53:49 2015 +0200 DataCon: Fix redundant import >--------------------------------------------------------------- 1852c3d2bb841246a790de1a67f8f140a5cccef3 compiler/typecheck/TcSplice.hs | 1 - 1 file changed, 1 deletion(-) diff --git a/compiler/typecheck/TcSplice.hs b/compiler/typecheck/TcSplice.hs index 586b2b8..d8dde33 100644 --- a/compiler/typecheck/TcSplice.hs +++ b/compiler/typecheck/TcSplice.hs @@ -91,7 +91,6 @@ import DsMonad import Serialized import ErrUtils import Util -import Data.List ( mapAccumL ) import Unique import VarSet ( isEmptyVarSet ) import Data.Maybe From git at git.haskell.org Thu Jul 23 12:55:15 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 23 Jul 2015 12:55:15 +0000 (UTC) Subject: [commit: ghc] master: rts/sm: Add missing argument names in function definitions (4c8e69e) Message-ID: <20150723125515.B03C23A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/4c8e69e0c09bfee989b747ba4028686f48cf8aa1/ghc >--------------------------------------------------------------- commit 4c8e69e0c09bfee989b747ba4028686f48cf8aa1 Author: Ben Gamari Date: Thu Jul 23 08:49:13 2015 -0400 rts/sm: Add missing argument names in function definitions C99 does not allow unnamed parameters in definition argument lists [1]. [1] http://stackoverflow.com/questions/8776810/parameter-name-omitted-c-vs-c >--------------------------------------------------------------- 4c8e69e0c09bfee989b747ba4028686f48cf8aa1 rts/sm/MBlock.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/rts/sm/MBlock.c b/rts/sm/MBlock.c index c77a9e0..35a11bf 100644 --- a/rts/sm/MBlock.c +++ b/rts/sm/MBlock.c @@ -120,7 +120,7 @@ static void *getAllocatedMBlock(free_list **start_iter, W_ startingAt) return (void*)p; } -void * getFirstMBlock(void **state) +void * getFirstMBlock(void **state STG_UNUSED) { free_list *fake_state; free_list **casted_state; @@ -134,7 +134,7 @@ void * getFirstMBlock(void **state) return getAllocatedMBlock(casted_state, mblock_address_space_begin); } -void * getNextMBlock(void **state, void *mblock) +void * getNextMBlock(void **state STG_UNUSED, void *mblock) { free_list *fake_state = free_list_head; free_list **casted_state; @@ -442,7 +442,7 @@ void * mapEntryToMBlock(nat i) return (void *)((StgWord)i << MBLOCK_SHIFT); } -void * getFirstMBlock(void **) +void * getFirstMBlock(void **state STG_UNUSED) { nat i; @@ -452,7 +452,7 @@ void * getFirstMBlock(void **) return NULL; } -void * getNextMBlock(void **, void *mblock) +void * getNextMBlock(void **state STG_UNUSED, void *mblock) { nat i; @@ -464,7 +464,7 @@ void * getNextMBlock(void **, void *mblock) #elif SIZEOF_VOID_P == 8 -void * getNextMBlock(void **, void *p) +void * getNextMBlock(void **state STG_UNUSED, void *p) { MBlockMap *map; nat off, j; @@ -501,7 +501,7 @@ void * getNextMBlock(void **, void *p) return NULL; } -void * getFirstMBlock(void **) +void * getFirstMBlock(void **state STG_UNUSED) { MBlockMap *map = mblock_maps[0]; nat line_no, off; From git at git.haskell.org Thu Jul 23 12:58:25 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 23 Jul 2015 12:58:25 +0000 (UTC) Subject: [commit: ghc] master: Slight refactoring to the fix for #4012 (7ec07e4) Message-ID: <20150723125825.D2B603A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/7ec07e4027826ad92cf651798cc4b5b9eea34a18/ghc >--------------------------------------------------------------- commit 7ec07e4027826ad92cf651798cc4b5b9eea34a18 Author: Simon Peyton Jones Date: Thu Jul 23 12:23:22 2015 +0100 Slight refactoring to the fix for #4012 Add CoreSyn.chooseOrphanAnchor, and use it >--------------------------------------------------------------- 7ec07e4027826ad92cf651798cc4b5b9eea34a18 compiler/coreSyn/CoreSyn.hs | 17 ++++++++++++++++- compiler/specialise/Rules.hs | 7 ++----- compiler/types/InstEnv.hs | 18 ++++-------------- 3 files changed, 22 insertions(+), 20 deletions(-) diff --git a/compiler/coreSyn/CoreSyn.hs b/compiler/coreSyn/CoreSyn.hs index c641d88..fedf1d7 100644 --- a/compiler/coreSyn/CoreSyn.hs +++ b/compiler/coreSyn/CoreSyn.hs @@ -68,7 +68,7 @@ module CoreSyn ( deAnnotate, deAnnotate', deAnnAlt, collectAnnBndrs, -- * Orphanhood - IsOrphan(..), isOrphan, notOrphan, + IsOrphan(..), isOrphan, notOrphan, chooseOrphanAnchor, -- * Core rule data types CoreRule(..), RuleBase, @@ -723,6 +723,21 @@ notOrphan :: IsOrphan -> Bool notOrphan NotOrphan{} = True notOrphan _ = False +chooseOrphanAnchor :: [Name] -> IsOrphan +-- Something (rule, instance) is relate to all the Names in this +-- list. Choose one of them to be an "anchor" for the orphan. We make +-- the choice deterministic to avoid gratuitious changes in the ABI +-- hash (Trac #4012). Specficially, use lexicographic comparison of +-- OccName rather than comparing Uniques +-- +-- NB: 'minimum' use Ord, and (Ord OccName) works lexicographically +-- +chooseOrphanAnchor local_names + | null local_names = IsOrphan + | otherwise = NotOrphan (minimum occs) + where + occs = map nameOccName local_names + instance Binary IsOrphan where put_ bh IsOrphan = putByte bh 0 put_ bh (NotOrphan n) = do diff --git a/compiler/specialise/Rules.hs b/compiler/specialise/Rules.hs index f1288cc..65c3058 100644 --- a/compiler/specialise/Rules.hs +++ b/compiler/specialise/Rules.hs @@ -45,7 +45,7 @@ import Id import IdInfo ( SpecInfo( SpecInfo ) ) import VarEnv import VarSet -import Name ( Name, NamedThing(..), nameIsLocalOrFrom, nameOccName ) +import Name ( Name, NamedThing(..), nameIsLocalOrFrom ) import NameSet import NameEnv import Unify ( ruleMatchTyX, MatchEnv(..) ) @@ -185,10 +185,7 @@ mkRule this_mod is_auto is_local name act fn bndrs args rhs -- it deterministic. This chooses the one with minimal OccName -- as opposed to uniq value. local_lhs_names = filter (nameIsLocalOrFrom this_mod) lhs_names - anchor = minimum $ map nameOccName local_lhs_names - orph = case local_lhs_names of - (_ : _) -> NotOrphan anchor - [] -> IsOrphan + orph = chooseOrphanAnchor local_lhs_names -------------- roughTopNames :: [CoreExpr] -> [Maybe Name] diff --git a/compiler/types/InstEnv.hs b/compiler/types/InstEnv.hs index db8f531..e93d707 100644 --- a/compiler/types/InstEnv.hs +++ b/compiler/types/InstEnv.hs @@ -29,7 +29,7 @@ module InstEnv ( #include "HsVersions.h" -import CoreSyn (IsOrphan(..), isOrphan, notOrphan) +import CoreSyn ( IsOrphan(..), isOrphan, notOrphan, chooseOrphanAnchor ) import Module import Class import Var @@ -234,19 +234,9 @@ mkLocalInstance dfun oflag tvs cls tys mb_ns | null fds = [choose_one arg_names] | otherwise = map do_one fds do_one (_ltvs, rtvs) = choose_one [ns | (tv,ns) <- cls_tvs `zip` arg_names - , not (tv `elem` rtvs)] - - -- Since instance declarations get eventually attached to one of the types - -- from the definition when compiling the ABI hash, we should make - -- it deterministic. This chooses the one with minimal OccName - -- as opposed to uniq value. - choose_one :: [NameSet] -> IsOrphan - choose_one nss = case local_names of - [] -> IsOrphan - (_ : _) -> NotOrphan anchor - where - local_names = nameSetElems (unionNameSets nss) - anchor = minimum $ map nameOccName local_names + , not (tv `elem` rtvs)] + + choose_one nss = chooseOrphanAnchor (nameSetElems (unionNameSets nss)) mkImportedInstance :: Name -> [Maybe Name] From git at git.haskell.org Thu Jul 23 12:58:28 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 23 Jul 2015 12:58:28 +0000 (UTC) Subject: [commit: ghc] master: Document type functions in the Paterson conditions (608e76c) Message-ID: <20150723125828.94DAD3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/608e76ced1ae2f8a9d2084d3092e37c47480fa91/ghc >--------------------------------------------------------------- commit 608e76ced1ae2f8a9d2084d3092e37c47480fa91 Author: Simon Peyton Jones Date: Thu Jul 23 12:24:14 2015 +0100 Document type functions in the Paterson conditions >--------------------------------------------------------------- 608e76ced1ae2f8a9d2084d3092e37c47480fa91 docs/users_guide/glasgow_exts.xml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/users_guide/glasgow_exts.xml b/docs/users_guide/glasgow_exts.xml index 2ec1d4e..9685b1d 100644 --- a/docs/users_guide/glasgow_exts.xml +++ b/docs/users_guide/glasgow_exts.xml @@ -5246,7 +5246,12 @@ The Paterson Conditions: for each class constraint (C t1 ... tn) No type variable has more occurrences in the constraint than in the head The constraint has fewer constructors and variables (taken together - and counting repetitions) than the head + and counting repetitions) than the head + +The constraint mentions no type functions. +A type function application can in principle expand to a +type of arbitrary size, and so are rejected out of hand + From git at git.haskell.org Thu Jul 23 14:03:31 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 23 Jul 2015 14:03:31 +0000 (UTC) Subject: [commit: ghc] master: Add a few comments from SPJ on fixity declarations (5ff4dad) Message-ID: <20150723140331.BA2B93A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/5ff4daddd9bc8f424d8f71fb01ebbbae9d608cdf/ghc >--------------------------------------------------------------- commit 5ff4daddd9bc8f424d8f71fb01ebbbae9d608cdf Author: Ben Gamari Date: Tue Jul 21 22:27:18 2015 +0200 Add a few comments from SPJ on fixity declarations >--------------------------------------------------------------- 5ff4daddd9bc8f424d8f71fb01ebbbae9d608cdf compiler/main/HscMain.hs | 20 +++++++++++++++++++- compiler/main/HscTypes.hs | 2 +- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/compiler/main/HscMain.hs b/compiler/main/HscMain.hs index 3c4b92b..328655c 100644 --- a/compiler/main/HscMain.hs +++ b/compiler/main/HscMain.hs @@ -1467,7 +1467,6 @@ hscDeclsWithLocation hsc_env0 str source linenumber = -- been done. See the notes at the definition of InteractiveContext -- (ic_instances) for more details. let defaults = tcg_default tc_gblenv - let fix_env = tcg_fix_env tc_gblenv {- Desugar it -} -- We use a basically null location for iNTERACTIVE @@ -1521,10 +1520,29 @@ hscDeclsWithLocation hsc_env0 str source linenumber = new_tythings = map AnId ext_ids ++ map ATyCon tcs ++ map (AConLike . PatSynCon) patsyns ictxt = hsc_IC hsc_env + -- See Note [Fixity declarations in GHCi] + fix_env = tcg_fix_env tc_gblenv new_ictxt = extendInteractiveContext ictxt new_tythings cls_insts fam_insts defaults fix_env return (new_tythings, new_ictxt) + +{- + Note [Fixity declarations in GHCi] + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + To support fixity declarations on types defined within GHCi (as requested + in #10018) we record the fixity environment in InteractiveContext. + When we want to evaluate something TcRnDriver.runTcInteractive pulls out this + fixity environment and uses it to initialize the global typechecker environment. + After the typechecker has finished its business, an updated fixity environment + (reflecting whatever fixity declarations were present in the statements we + passed it) will be returned from hscParsedStmt. This is passed to + updateFixityEnv, which will stuff it back into InteractiveContext, to be + used in evaluating the next statement. + +-} + hscImport :: HscEnv -> String -> IO (ImportDecl RdrName) hscImport hsc_env str = runInteractiveHsc hsc_env $ do (L _ (HsModule{hsmodImports=is})) <- diff --git a/compiler/main/HscTypes.hs b/compiler/main/HscTypes.hs index f05dbdd..7bceda5 100644 --- a/compiler/main/HscTypes.hs +++ b/compiler/main/HscTypes.hs @@ -1436,7 +1436,7 @@ extendInteractiveContext ictxt new_tythings new_cls_insts new_fam_insts defaults , ic_instances = ( new_cls_insts ++ old_cls_insts , new_fam_insts ++ old_fam_insts ) , ic_default = defaults - , ic_fix_env = fix_env -- # 10018 + , ic_fix_env = fix_env -- See Note [Fixity declarations in GHCi] } where new_ids = [id | AnId id <- new_tythings] From git at git.haskell.org Thu Jul 23 14:03:35 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 23 Jul 2015 14:03:35 +0000 (UTC) Subject: [commit: ghc] master: ghci: fixity declarations for infix data constructors (#10018) (e809ef5) Message-ID: <20150723140335.1F0FA3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e809ef57d841695f76ab9b2758f7aeb774d6b223/ghc >--------------------------------------------------------------- commit e809ef57d841695f76ab9b2758f7aeb774d6b223 Author: Thomas Miedema Date: Tue Jul 21 22:01:49 2015 +0200 ghci: fixity declarations for infix data constructors (#10018) Declaring a custom fixity for an infix data constructor should work: Prelude> data Infix a b = a :@: b; infixl 4 :@: This is a followup to #2947, which handled fixity declarations in ghci statements (e.g. let add = (+); infixl 6 `add`). Support for declarations (data, type, newtype, class, instance, deriving, and foreign) was added to GHCi in #4929. Reviewers: simonpj, austin, thomie Subscribers: thomie, bgamari Differential Revision: https://phabricator.haskell.org/D1028 GHC Trac Issues: #10018 >--------------------------------------------------------------- e809ef57d841695f76ab9b2758f7aeb774d6b223 compiler/main/HscMain.hs | 4 +++- compiler/main/HscTypes.hs | 7 +++++-- testsuite/tests/ghci/scripts/T10018.script | 3 +++ testsuite/tests/ghci/scripts/T10018.stdout | 2 ++ testsuite/tests/ghci/scripts/all.T | 1 + 5 files changed, 14 insertions(+), 3 deletions(-) diff --git a/compiler/main/HscMain.hs b/compiler/main/HscMain.hs index 13717b6..3c4b92b 100644 --- a/compiler/main/HscMain.hs +++ b/compiler/main/HscMain.hs @@ -1467,6 +1467,7 @@ hscDeclsWithLocation hsc_env0 str source linenumber = -- been done. See the notes at the definition of InteractiveContext -- (ic_instances) for more details. let defaults = tcg_default tc_gblenv + let fix_env = tcg_fix_env tc_gblenv {- Desugar it -} -- We use a basically null location for iNTERACTIVE @@ -1520,7 +1521,8 @@ hscDeclsWithLocation hsc_env0 str source linenumber = new_tythings = map AnId ext_ids ++ map ATyCon tcs ++ map (AConLike . PatSynCon) patsyns ictxt = hsc_IC hsc_env - new_ictxt = extendInteractiveContext ictxt new_tythings cls_insts fam_insts defaults + new_ictxt = extendInteractiveContext ictxt new_tythings cls_insts + fam_insts defaults fix_env return (new_tythings, new_ictxt) hscImport :: HscEnv -> String -> IO (ImportDecl RdrName) diff --git a/compiler/main/HscTypes.hs b/compiler/main/HscTypes.hs index 9be5175..f05dbdd 100644 --- a/compiler/main/HscTypes.hs +++ b/compiler/main/HscTypes.hs @@ -1425,8 +1425,9 @@ extendInteractiveContext :: InteractiveContext -> [TyThing] -> [ClsInst] -> [FamInst] -> Maybe [Type] + -> FixityEnv -> InteractiveContext -extendInteractiveContext ictxt new_tythings new_cls_insts new_fam_insts defaults +extendInteractiveContext ictxt new_tythings new_cls_insts new_fam_insts defaults fix_env = ictxt { ic_mod_index = ic_mod_index ictxt + 1 -- Always bump this; even instances should create -- a new mod_index (Trac #9426) @@ -1434,7 +1435,9 @@ extendInteractiveContext ictxt new_tythings new_cls_insts new_fam_insts defaults , ic_rn_gbl_env = ic_rn_gbl_env ictxt `icExtendGblRdrEnv` new_tythings , ic_instances = ( new_cls_insts ++ old_cls_insts , new_fam_insts ++ old_fam_insts ) - , ic_default = defaults } + , ic_default = defaults + , ic_fix_env = fix_env -- # 10018 + } where new_ids = [id | AnId id <- new_tythings] old_tythings = filterOut (shadowed_by new_ids) (ic_tythings ictxt) diff --git a/testsuite/tests/ghci/scripts/T10018.script b/testsuite/tests/ghci/scripts/T10018.script new file mode 100644 index 0000000..f346899 --- /dev/null +++ b/testsuite/tests/ghci/scripts/T10018.script @@ -0,0 +1,3 @@ +-- Declaring a custom fixity for an infix data constructor should work. +data Infix a b = a :@: b; infixl 4 :@: +:i (:@:) diff --git a/testsuite/tests/ghci/scripts/T10018.stdout b/testsuite/tests/ghci/scripts/T10018.stdout new file mode 100644 index 0000000..bff8336 --- /dev/null +++ b/testsuite/tests/ghci/scripts/T10018.stdout @@ -0,0 +1,2 @@ +data Infix a b = a :@: b -- Defined at :3:18 +infixl 4 :@: diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T index 1efa009..bbd69ee 100755 --- a/testsuite/tests/ghci/scripts/all.T +++ b/testsuite/tests/ghci/scripts/all.T @@ -209,6 +209,7 @@ test('T9878b', extra_run_opts('-fobject-code'), extra_clean(['T9878b.hi','T9878b.o'])], ghci_script, ['T9878b.script']) +test('T10018', normal, ghci_script, ['T10018.script']) test('T10122', normal, ghci_script, ['T10122.script']) test('T10321', normal, ghci_script, ['T10321.script']) From git at git.haskell.org Thu Jul 23 20:38:40 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 23 Jul 2015 20:38:40 +0000 (UTC) Subject: [commit: ghc] master: Library names, with Cabal submodule update (f9687ca) Message-ID: <20150723203840.BC80D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/f9687caf337d409e4735d5bb4cf73a7dc629a58c/ghc >--------------------------------------------------------------- commit f9687caf337d409e4735d5bb4cf73a7dc629a58c Author: Edward Z. Yang Date: Tue Jun 23 13:15:17 2015 -0700 Library names, with Cabal submodule update A library name is a package name, package version, and hash of the version names of all textual dependencies (i.e. packages which were included.) A library name is a coarse approximation of installed package IDs, which are suitable for inclusion in package keys (you don't want to put an IPID in a package key, since it means the key will change any time the source changes.) - We define ShPackageKey, which is the semantic object which is hashed into a PackageKey. You can use 'newPackageKey' to hash a ShPackageKey to a PackageKey - Given a PackageKey, we can lookup its ShPackageKey with 'lookupPackageKey'. The way we can do this is by consulting the 'pkgKeyCache', which records a reverse mapping from every hash to the ShPackageKey. This means that if you load in PackageKeys from external sources (e.g. interface files), you also need to load in a mapping of PackageKeys to their ShPackageKeys so we can populate the cache. - We define a 'LibraryName' which encapsulates the full depenency resolution that Cabal may have selected; this is opaque to GHC but can be used to distinguish different versions of a package. - Definite packages don't have an interesting PackageKey, so we rely on Cabal to pass them to us. - We can pretty-print package keys while displaying the instantiation, but it's not wired up to anything (e.g. the Outputable instance of PackageKey). Signed-off-by: Edward Z. Yang Test Plan: validate Reviewers: austin, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1056 GHC Trac Issues: #10566 >--------------------------------------------------------------- f9687caf337d409e4735d5bb4cf73a7dc629a58c compiler/backpack/ShPackageKey.hs | 280 +++++++++++++++++++++ compiler/ghc.cabal.in | 2 + compiler/main/DynFlags.hs | 43 +++- compiler/main/PackageConfig.hs | 20 ++ compiler/main/Packages.hs | 8 +- docs/users_guide/packages.xml | 24 +- libraries/Cabal | 2 +- testsuite/tests/cabal/sigcabal01/Makefile | 2 +- testsuite/tests/cabal/sigcabal01/all.T | 2 +- testsuite/tests/cabal/sigcabal02/Makefile | 4 +- .../tests/safeHaskell/check/pkg01/safePkg01.stdout | 6 +- testsuite/tests/th/TH_Roles2.stderr | 6 +- utils/ghc-cabal/Main.hs | 43 ++-- 13 files changed, 400 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 f9687caf337d409e4735d5bb4cf73a7dc629a58c From git at git.haskell.org Fri Jul 24 07:25:32 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 24 Jul 2015 07:25:32 +0000 (UTC) Subject: [commit: ghc] master: Fix line number in T10018 testcase (45c319f) Message-ID: <20150724072532.4BB443A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/45c319ff49810a1d86c44dfddafa6a65052d34c3/ghc >--------------------------------------------------------------- commit 45c319ff49810a1d86c44dfddafa6a65052d34c3 Author: Ben Gamari Date: Fri Jul 24 03:25:27 2015 -0400 Fix line number in T10018 testcase >--------------------------------------------------------------- 45c319ff49810a1d86c44dfddafa6a65052d34c3 testsuite/tests/ghci/scripts/T10018.stdout | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/tests/ghci/scripts/T10018.stdout b/testsuite/tests/ghci/scripts/T10018.stdout index bff8336..4f7d480 100644 --- a/testsuite/tests/ghci/scripts/T10018.stdout +++ b/testsuite/tests/ghci/scripts/T10018.stdout @@ -1,2 +1,2 @@ -data Infix a b = a :@: b -- Defined at :3:18 +data Infix a b = a :@: b -- Defined at :2:18 infixl 4 :@: From git at git.haskell.org Fri Jul 24 11:30:59 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 24 Jul 2015 11:30:59 +0000 (UTC) Subject: [commit: ghc] master: Comments only (30d8349) Message-ID: <20150724113059.F223D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/30d8349a54c95aebe620569f3995fb0cb2d1bf9f/ghc >--------------------------------------------------------------- commit 30d8349a54c95aebe620569f3995fb0cb2d1bf9f Author: Simon Peyton Jones Date: Thu Jul 23 12:49:06 2015 +0100 Comments only >--------------------------------------------------------------- 30d8349a54c95aebe620569f3995fb0cb2d1bf9f compiler/basicTypes/MkId.hs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/compiler/basicTypes/MkId.hs b/compiler/basicTypes/MkId.hs index 5f2cae8..4edf268 100644 --- a/compiler/basicTypes/MkId.hs +++ b/compiler/basicTypes/MkId.hs @@ -1300,7 +1300,6 @@ Also see https://ghc.haskell.org/trac/ghc/wiki/OneShot. Note [magicDictId magic] ~~~~~~~~~~~~~~~~~~~~~~~~~ - The identifier `magicDict` is just a place-holder, which is used to implement a primitve that we cannot define in Haskell but we can write in Core. It is declared with a place-holder type: @@ -1334,15 +1333,14 @@ Next, we add a built-in Prelude rule (see prelude/PrelRules.hs), which will replace the RHS of this definition with the appropriate definition in Core. The rewrite rule works as follows: -magicDict at t (wrap at a@b f) x y + magicDict @t (wrap @a @b f) x y ----> -f (x `cast` co a) y + f (x `cast` co a) y The `co` coercion is the newtype-coercion extracted from the type-class. The type class is obtain by looking at the type of wrap. - ------------------------------------------------------------- @realWorld#@ used to be a magic literal, \tr{void#}. If things get nasty as-is, change it back to a literal (@Literal@). From git at git.haskell.org Fri Jul 24 11:31:02 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 24 Jul 2015 11:31:02 +0000 (UTC) Subject: [commit: ghc] master: Comments about stricteness of catch# (e161634) Message-ID: <20150724113102.B87863A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e1616343de946f872fb0da7689ff242dc345793f/ghc >--------------------------------------------------------------- commit e1616343de946f872fb0da7689ff242dc345793f Author: Simon Peyton Jones Date: Fri Jul 24 10:32:01 2015 +0100 Comments about stricteness of catch# In "Improve strictness analysis for exceptions" commit 7c0fff41789669450b02dc1db7f5d7babba5dee6 Author: Simon Peyton Jones Date: Tue Jul 21 12:28:42 2015 +0100 I made catch# strict in its first argument. But today I found a very old comment suggesting the opposite. I disagree with the old comment, but I've elaborated the Note, which I reproduce here: {- Note [Strictness for mask/unmask/catch] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Consider this example, which comes from GHC.IO.Handle.Internals: wantReadableHandle3 f ma b st = case ... of DEFAULT -> case ma of MVar a -> ... 0# -> maskAsynchExceptions# (\st -> case ma of MVar a -> ...) The outer case just decides whether to mask exceptions, but we don't want thereby to hide the strictness in 'ma'! Hence the use of strictApply1Dmd. For catch, we know that the first branch will be evaluated, but not necessarily the second. Hence strictApply1Dmd and lazyApply1Dmd Howver, consider catch# (\st -> case x of ...) (..handler..) st We'll see that the entire thing is strict in 'x', so 'x' may be evaluated before the catch#. So fi evaluting 'x' causes a divide-by-zero exception, it won't be caught. This seems acceptable: - x might be evaluated somewhere else outside the catch# anyway - It's an imprecise eception anyway. Synchronous exceptions (in the IO monad) will never move in this way. There was originally a comment "Catch is actually strict in its first argument but we don't want to tell the strictness analyser about that, so that exceptions stay inside it." but tracing it back through the commit logs did not give any rationale. And making catch# lazy has performance costs for everyone. >--------------------------------------------------------------- e1616343de946f872fb0da7689ff242dc345793f compiler/prelude/primops.txt.pp | 43 +++++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/compiler/prelude/primops.txt.pp b/compiler/prelude/primops.txt.pp index c29e9d8..9b107f2 100644 --- a/compiler/prelude/primops.txt.pp +++ b/compiler/prelude/primops.txt.pp @@ -1919,18 +1919,34 @@ primop CasMutVarOp "casMutVar#" GenPrimOp section "Exceptions" ------------------------------------------------------------------------ --- Note [Strictness for mask/unmask/catch] --- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- Consider this example, which comes from GHC.IO.Handle.Internals: --- wantReadableHandle3 f ma b st --- = case ... of --- DEFAULT -> case ma of MVar a -> ... --- 0# -> maskAsynchExceptions# (\st -> case ma of MVar a -> ...) --- The outer case just decides whether to mask exceptions, but we don't want --- thereby to hide the strictness in 'ma'! Hence the use of strictApply1Dmd. --- --- For catch, we know that the first branch will be evaluated, but not --- necessarily the second. Hence strictApply1Dmd and lazyApply1Dmd +{- Note [Strictness for mask/unmask/catch] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Consider this example, which comes from GHC.IO.Handle.Internals: + wantReadableHandle3 f ma b st + = case ... of + DEFAULT -> case ma of MVar a -> ... + 0# -> maskAsynchExceptions# (\st -> case ma of MVar a -> ...) +The outer case just decides whether to mask exceptions, but we don't want +thereby to hide the strictness in 'ma'! Hence the use of strictApply1Dmd. + +For catch, we know that the first branch will be evaluated, but not +necessarily the second. Hence strictApply1Dmd and lazyApply1Dmd + +Howver, consider + catch# (\st -> case x of ...) (..handler..) st +We'll see that the entire thing is strict in 'x', so 'x' may be evaluated +before the catch#. So fi evaluting 'x' causes a divide-by-zero exception, +it won't be caught. This seems acceptable: + - x might be evaluated somewhere else outside the catch# anyway + - It's an imprecise eception anyway. Synchronous exceptions (in the + IO monad) will never move in this way. +There was originally a comment + "Catch is actually strict in its first argument + but we don't want to tell the strictness + analyser about that, so that exceptions stay inside it." +but tracing it back through the commit logs did not give any +rationale. And making catch# lazy has performance costs for everyone. +-} primop CatchOp "catch#" GenPrimOp (State# RealWorld -> (# State# RealWorld, a #) ) @@ -1938,9 +1954,6 @@ primop CatchOp "catch#" GenPrimOp -> State# RealWorld -> (# State# RealWorld, a #) with - -- Catch is actually strict in its first argument - -- but we don't want to tell the strictness - -- analyser about that, so that exceptions stay inside it. strictness = { \ _arity -> mkClosedStrictSig [strictApply1Dmd,lazyApply2Dmd,topDmd] topRes } -- See Note [Strictness for mask/unmask/catch] out_of_line = True From git at git.haskell.org Fri Jul 24 11:31:05 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 24 Jul 2015 11:31:05 +0000 (UTC) Subject: [commit: ghc] master: Refactoring around FunDeps (d53d808) Message-ID: <20150724113105.7BFDB3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d53d80890f2762b78071f5d53c88dc9e6c0ca72e/ghc >--------------------------------------------------------------- commit d53d80890f2762b78071f5d53c88dc9e6c0ca72e Author: Simon Peyton Jones Date: Fri Jul 24 10:40:35 2015 +0100 Refactoring around FunDeps This refactoring was triggered by Trac #10675. We were using 'improveClsFD' (previously called 'checkClsFD') for both * Improvement: improving a constraint against top-level instances * Consistency: checking when two top-level instances are consistent Using the same code for both seemed attractive at the time, but it's just too complicated. So I've split it: * Improvement: improveClsFD * Consistency: checkFunDeps Much clearer now! >--------------------------------------------------------------- d53d80890f2762b78071f5d53c88dc9e6c0ca72e compiler/typecheck/FunDeps.hs | 119 +++++++++++++++++++++++------------------- compiler/typecheck/Inst.hs | 27 +++++----- compiler/types/Unify.hs | 40 +++++++------- 3 files changed, 100 insertions(+), 86 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 d53d80890f2762b78071f5d53c88dc9e6c0ca72e From git at git.haskell.org Fri Jul 24 11:31:08 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 24 Jul 2015 11:31:08 +0000 (UTC) Subject: [commit: ghc] master: Improve instanceCantMatch (6e618d7) Message-ID: <20150724113108.45A0A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/6e618d77d64255c32bef543a3f9635abce24a66d/ghc >--------------------------------------------------------------- commit 6e618d77d64255c32bef543a3f9635abce24a66d Author: Simon Peyton Jones Date: Fri Jul 24 10:42:05 2015 +0100 Improve instanceCantMatch When staring at instanceCantMatch I realised that it was returning False (safe but inefficient) when it could validly return True, on arguments like [Nothing, Just Int] [Just Bool, Just Bool] This patch makes it a bit cleverer. >--------------------------------------------------------------- 6e618d77d64255c32bef543a3f9635abce24a66d compiler/types/InstEnv.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/compiler/types/InstEnv.hs b/compiler/types/InstEnv.hs index e93d707..b8a3e6a 100644 --- a/compiler/types/InstEnv.hs +++ b/compiler/types/InstEnv.hs @@ -267,8 +267,12 @@ instanceCantMatch :: [Maybe Name] -> [Maybe Name] -> Bool -- (instanceCantMatch tcs1 tcs2) returns True if tcs1 cannot -- possibly be instantiated to actual, nor vice versa; -- False is non-committal -instanceCantMatch (Just t : ts) (Just a : as) = t/=a || instanceCantMatch ts as -instanceCantMatch _ _ = False -- Safe +instanceCantMatch (mt : ts) (ma : as) = itemCantMatch mt ma || instanceCantMatch ts as +instanceCantMatch _ _ = False -- Safe + +itemCantMatch :: Maybe Name -> Maybe Name -> Bool +itemCantMatch (Just t) (Just a) = t /= a +itemCantMatch _ _ = False {- Note [When exactly is an instance decl an orphan?] From git at git.haskell.org Fri Jul 24 14:26:29 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 24 Jul 2015 14:26:29 +0000 (UTC) Subject: [commit: ghc] wip/impredicativity: Check whether a variable is filled in defaulting of <~ (ef62258) Message-ID: <20150724142629.361533A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/impredicativity Link : http://ghc.haskell.org/trac/ghc/changeset/ef62258a1eae067545c464755d8f866ec6dcc466/ghc >--------------------------------------------------------------- commit ef62258a1eae067545c464755d8f866ec6dcc466 Author: Alejandro Serrano Date: Thu Jul 23 08:43:26 2015 +0200 Check whether a variable is filled in defaulting of <~ >--------------------------------------------------------------- ef62258a1eae067545c464755d8f866ec6dcc466 compiler/typecheck/TcSimplify.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/compiler/typecheck/TcSimplify.hs b/compiler/typecheck/TcSimplify.hs index 1bc3701..fd0d20d 100644 --- a/compiler/typecheck/TcSimplify.hs +++ b/compiler/typecheck/TcSimplify.hs @@ -136,8 +136,10 @@ simpl_top wanteds case (isWantedCt ct, classifyPredType (ctPred ct)) of (True, InstanceOfPred lhs rhs) | Just v <- tcGetTyVar_maybe rhs - -> do { unifyTyVar v lhs - ; return True } + -> do { filled <- TcS.isFilledMetaTyVar v + ; if filled + then return False + else unifyTyVar v lhs >> return True } _ -> return something) False approx ; if something_happened then do { wc_residual <- nestTcS (solveWantedsAndDrop wc) From git at git.haskell.org Fri Jul 24 14:26:32 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 24 Jul 2015 14:26:32 +0000 (UTC) Subject: [commit: ghc] wip/impredicativity: Implement defaulting of <~ in simplifyTop (bd8cec5) Message-ID: <20150724142632.021B93A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/impredicativity Link : http://ghc.haskell.org/trac/ghc/changeset/bd8cec5d6cb5bb8c46a63a4f94103a4f0fc1f7bc/ghc >--------------------------------------------------------------- commit bd8cec5d6cb5bb8c46a63a4f94103a4f0fc1f7bc Author: Alejandro Serrano Date: Fri Jul 24 10:35:41 2015 +0200 Implement defaulting of <~ in simplifyTop When we have leftover constraints of the form sigma <~ tyvar or sigma <~ tyfamily on checking mode, we know try to default them to a type equality to solve the entire constraint set. This implementation is more a proof-of-concept. In particular, the part of defaulting <~ with type families is done by introducing a global parameter in SMonad. This implementation should be changed. >--------------------------------------------------------------- bd8cec5d6cb5bb8c46a63a4f94103a4f0fc1f7bc compiler/typecheck/TcCanonical.hs | 11 ++++++--- compiler/typecheck/TcSMonad.hs | 31 ++++++++++++++++++------ compiler/typecheck/TcSimplify.hs | 23 ++++++++++++------ docs/types/impredicativity.ltx | 50 ++++++++++++++++++++++++++------------- 4 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 bd8cec5d6cb5bb8c46a63a4f94103a4f0fc1f7bc From git at git.haskell.org Fri Jul 24 15:43:34 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 24 Jul 2015 15:43:34 +0000 (UTC) Subject: [commit: ghc] master: RetainerProfile: Add missing UNTAG_STATIC_LIST_PTR (09d0505) Message-ID: <20150724154334.3D03B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/09d05050346c1be7bac20ba3f40861e05217368b/ghc >--------------------------------------------------------------- commit 09d05050346c1be7bac20ba3f40861e05217368b Author: Ben Gamari Date: Fri Jul 24 11:41:59 2015 -0400 RetainerProfile: Add missing UNTAG_STATIC_LIST_PTR >--------------------------------------------------------------- 09d05050346c1be7bac20ba3f40861e05217368b rts/RetainerProfile.c | 1 + 1 file changed, 1 insertion(+) diff --git a/rts/RetainerProfile.c b/rts/RetainerProfile.c index 8121def..ba58c19 100644 --- a/rts/RetainerProfile.c +++ b/rts/RetainerProfile.c @@ -1882,6 +1882,7 @@ resetStaticObjectForRetainerProfiling( StgClosure *static_objects ) #endif p = static_objects; while (p != END_OF_STATIC_OBJECT_LIST) { + p = UNTAG_STATIC_LIST_PTR(p); #ifdef DEBUG_RETAINER count++; #endif From git at git.haskell.org Fri Jul 24 16:27:29 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 24 Jul 2015 16:27:29 +0000 (UTC) Subject: [commit: ghc] wip/impredicativity: Make two passes in simpleOptExpr (6544b3f) Message-ID: <20150724162729.2B14D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/impredicativity Link : http://ghc.haskell.org/trac/ghc/changeset/6544b3fb8d04631fc7c6976a45ff61b52cb4901e/ghc >--------------------------------------------------------------- commit 6544b3fb8d04631fc7c6976a45ff61b52cb4901e Author: Alejandro Serrano Date: Fri Jul 24 18:06:57 2015 +0200 Make two passes in simpleOptExpr >--------------------------------------------------------------- 6544b3fb8d04631fc7c6976a45ff61b52cb4901e compiler/coreSyn/CoreSubst.hs | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/compiler/coreSyn/CoreSubst.hs b/compiler/coreSyn/CoreSubst.hs index 43c736a..c59ff20 100644 --- a/compiler/coreSyn/CoreSubst.hs +++ b/compiler/coreSyn/CoreSubst.hs @@ -866,7 +866,11 @@ simpleOptExpr expr -- three passes instead of two (occ-anal, and go) simpleOptExprWith :: Subst -> InExpr -> OutExpr -simpleOptExprWith subst expr = simple_opt_expr subst (occurAnalyseExpr expr) +-- Make two passes of simplification +simpleOptExprWith subst = simpleOptExprWith_ subst . simpleOptExprWith_ subst + +simpleOptExprWith_ :: Subst -> InExpr -> OutExpr +simpleOptExprWith_ subst expr = simple_opt_expr subst (occurAnalyseExpr expr) ---------------------- simpleOptPgm :: DynFlags -> Module @@ -910,11 +914,7 @@ simple_opt_expr subst expr go (Coercion co) = Coercion (optCoercion (getCvSubst subst) co) go (Lit lit) = Lit lit go (Tick tickish e) = mkTick (substTickish subst tickish) (go e) - go (Cast e co) | isReflCo co' = go e - | otherwise = Cast (go e) co' - where - co' = optCoercion (getCvSubst subst) co - + go (Cast e co) = simple_cast subst (Cast e co) go (Let bind body) = case simple_opt_bind subst bind of (subst', Nothing) -> simple_opt_expr subst' body (subst', Just bind) -> Let bind (simple_opt_expr subst' body) @@ -978,6 +978,11 @@ simple_app subst (Tick t e) as -- Okay to do "(Tick t e) x ==> Tick t (e x)"? | t `tickishScopesLike` SoftScope = mkTick t $ simple_app subst e as +simple_app subst (Cast e co) as + = case simple_cast subst (Cast e co) of + -- Could not optimize further + e'@(Cast _ _) -> foldl App e' as + e' -> simple_app subst e' as simple_app subst e as = foldl App (simple_opt_expr subst e) as @@ -998,10 +1003,12 @@ simple_opt_bind' subst (Rec prs) Nothing -> (subst, (b2,r2):prs) where b2 = add_info subst b b' - r2 = simple_opt_expr subst r + -- Make two passes of simplification + r2 = simple_opt_expr subst (simple_opt_expr subst r) simple_opt_bind' subst (NonRec b r) - = simple_opt_out_bind subst (b, simple_opt_expr subst r) + -- Make two passes of simplification + = simple_opt_out_bind subst (b, simple_opt_expr subst (simple_opt_expr subst r)) ---------------------- simple_opt_out_bind :: Subst -> (InVar, OutExpr) -> (Subst, Maybe CoreBind) @@ -1015,6 +1022,19 @@ simple_opt_out_bind subst (b, r') b2 = add_info subst' b b' ---------------------- +simple_cast :: Subst -> InExpr -> CoreExpr +simple_cast subst (Cast e e_co) + = go e e_co + where + go (Cast e e_co) co = go e (mkTransCo e_co co) + go e co | isReflCo co' = simple_opt_expr subst e + | otherwise = Cast (simple_opt_expr subst e) co' + where co' = optCoercion (getCvSubst subst) co + +simple_cast subst e + = simple_opt_expr subst e + +---------------------- maybe_substitute :: Subst -> InVar -> OutExpr -> Maybe Subst -- (maybe_substitute subst in_var out_rhs) -- either extends subst with (in_var -> out_rhs) From git at git.haskell.org Fri Jul 24 16:27:31 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 24 Jul 2015 16:27:31 +0000 (UTC) Subject: [commit: ghc] wip/impredicativity: Various fixes to RULES type checking (e3d846b) Message-ID: <20150724162731.C938F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/impredicativity Link : http://ghc.haskell.org/trac/ghc/changeset/e3d846b1b264fba1f3cc124fddef9048c7adc3d0/ghc >--------------------------------------------------------------- commit e3d846b1b264fba1f3cc124fddef9048c7adc3d0 Author: Alejandro Serrano Date: Fri Jul 24 18:28:26 2015 +0200 Various fixes to RULES type checking >--------------------------------------------------------------- e3d846b1b264fba1f3cc124fddef9048c7adc3d0 compiler/deSugar/DsBinds.hs | 3 --- compiler/typecheck/TcRules.hs | 37 +++++++++++++++++++++---------------- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/compiler/deSugar/DsBinds.hs b/compiler/deSugar/DsBinds.hs index eedc318..ee1a009 100644 --- a/compiler/deSugar/DsBinds.hs +++ b/compiler/deSugar/DsBinds.hs @@ -631,9 +631,6 @@ decomposeRuleLhs orig_bndrs orig_lhs split_lets :: CoreExpr -> ([(DictId,CoreExpr)], CoreExpr) split_lets e - | Let (NonRec d (Var r)) _body <- e - , isDictId d, isDictId r - = ([], e) | Let (NonRec d r) body <- e , isDictId d , (bs, body') <- split_lets body diff --git a/compiler/typecheck/TcRules.hs b/compiler/typecheck/TcRules.hs index 7a95bad..7a12cfa 100644 --- a/compiler/typecheck/TcRules.hs +++ b/compiler/typecheck/TcRules.hs @@ -311,24 +311,28 @@ simplifyRule name lhs_wanted rhs_wanted = do { -- We allow ourselves to unify environment -- variables: runTcS runs with topTcLevel tc_lvl <- getTcLevel - ; ((insoluble, lhs_extra), _) <- runTcS $ + + -- Do not use <~ constraints in RULES, + -- so we need to instantiate + ; let lhs_wanted_simple = wc_simple lhs_wanted + ; (lhs_wanted_inst, _) <- runTcS $ + fmap andManyCts $ mapM instantiateWC (bagToList lhs_wanted_simple) + ; let same_type x y = ctPred x == ctPred y + none_with_same_type x = not (anyBag (same_type x) lhs_wanted_simple) + lhs_wanted_inst' = filterBag none_with_same_type lhs_wanted_inst + + ; let new_lhs_wanted_simple = wc_simple lhs_wanted `unionBags` lhs_wanted_inst' + new_lhs_wanted = lhs_wanted { wc_simple = new_lhs_wanted_simple } + + ; (insoluble, _) <- runTcS $ do { -- First solve the LHS and *then* solve the RHS -- See Note [Solve order for RULES] - lhs_resid <- solveWanteds lhs_wanted - ; let lhs_resid_simple = wc_simple lhs_resid - ; lhs_inst <- fmap andManyCts $ - mapM instantiateWC (bagToList lhs_resid_simple) - ; lhs_inst_resid <- solveWanteds lhs_resid { wc_simple = lhs_inst } + lhs_resid <- solveWanteds new_lhs_wanted ; rhs_resid <- solveWanteds rhs_wanted - ; return (insolubleWC tc_lvl lhs_inst_resid || insolubleWC tc_lvl rhs_resid, lhs_inst) } + ; return (insolubleWC tc_lvl lhs_resid || insolubleWC tc_lvl rhs_resid) } - ; zonked_simple <- zonkSimples (wc_simple lhs_wanted) - ; zonked_extra <- zonkSimples lhs_extra - -- Remove those extra constraints which were already in the initial set - ; let same_type x y = ctPred x == ctPred y - none_with_same_type x = not (anyBag (same_type x) zonked_simple) - zonked_lhs = zonked_simple `unionBags` filterBag none_with_same_type zonked_extra - ; let (q_cts, non_q_cts) = partitionBag quantify_me zonked_lhs + ; zonked_lhs_simples <- zonkSimples new_lhs_wanted_simple + ; let (q_cts, non_q_cts) = partitionBag quantify_me zonked_lhs_simples quantify_me -- Note [RULE quantification over equalities] | insoluble = quantify_insol | otherwise = quantify_normal @@ -341,13 +345,14 @@ simplifyRule name lhs_wanted rhs_wanted | InstanceOfPred _ _ <- classifyPredType (ctPred ct) = False | otherwise - = True + = not $ null (tyVarsOfType (ctPred ct)) ; traceTc "simplifyRule" $ vcat [ ptext (sLit "LHS of rule") <+> doubleQuotes (ftext name) , text "lhs_wantd" <+> ppr lhs_wanted + , text "lhs_inst" <+> ppr lhs_wanted_inst , text "rhs_wantd" <+> ppr rhs_wanted - , text "zonked_lhs" <+> ppr zonked_lhs + , text "zonked_lhs" <+> ppr zonked_lhs_simples , text "q_cts" <+> ppr q_cts , text "non_q_cts" <+> ppr non_q_cts ] From git at git.haskell.org Fri Jul 24 16:39:47 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 24 Jul 2015 16:39:47 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Merge remote-tracking branch 'origin/master' into wip/orf-reboot (6ebd548) Message-ID: <20150724163947.D6DE63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/6ebd54855c21d986690691ca4ecd682dbe03fac1/ghc >--------------------------------------------------------------- commit 6ebd54855c21d986690691ca4ecd682dbe03fac1 Merge: 25f45c4 6e618d7 Author: Adam Gundry Date: Fri Jul 24 16:16:13 2015 +0100 Merge remote-tracking branch 'origin/master' into wip/orf-reboot Conflicts: compiler/deSugar/DsMeta.hs compiler/rename/RnNames.hs compiler/typecheck/TcPat.hs >--------------------------------------------------------------- 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 6ebd54855c21d986690691ca4ecd682dbe03fac1 From git at git.haskell.org Fri Jul 24 16:39:50 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 24 Jul 2015 16:39:50 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Get rid of redundant getDFunHsTypeKey (aaa16ed) Message-ID: <20150724163950.C31743A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/aaa16edab72d21bd5e85261786b575756c7512e4/ghc >--------------------------------------------------------------- commit aaa16edab72d21bd5e85261786b575756c7512e4 Author: Adam Gundry Date: Fri Jul 24 16:16:23 2015 +0100 Get rid of redundant getDFunHsTypeKey >--------------------------------------------------------------- aaa16edab72d21bd5e85261786b575756c7512e4 compiler/hsSyn/HsTypes.hs | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/compiler/hsSyn/HsTypes.hs b/compiler/hsSyn/HsTypes.hs index 0e94ae8..6022fe3 100644 --- a/compiler/hsSyn/HsTypes.hs +++ b/compiler/hsSyn/HsTypes.hs @@ -54,8 +54,6 @@ module HsTypes ( splitHsAppTys, hsTyGetAppHead_maybe, mkHsAppTys, mkHsOpTy, ignoreParens, - getDFunHsTypeKey, - -- Printing pprParendHsType, pprHsForAll, pprHsForAllExtra, pprHsContext, pprHsContextNoArrow, pprHsContextMaybe @@ -834,35 +832,6 @@ splitHsFunType orig_ty@(L _ (HsAppTy t1 t2)) splitHsFunType other = ([], other) --- Get some string from a type, to be used to construct a dictionary --- function name (like getDFunTyKey in TcType, but for HsTypes) -getDFunHsTypeKey :: HsType RdrName -> String -getDFunHsTypeKey (HsForAllTy _ _ _ _ t) = getDFunHsTypeKey (unLoc t) -getDFunHsTypeKey (HsTyVar tv) = occNameString (rdrNameOcc tv) -getDFunHsTypeKey (HsAppTy fun _) = getDFunHsTypeKey (unLoc fun) -getDFunHsTypeKey (HsFunTy {}) = occNameString (getOccName funTyCon) -getDFunHsTypeKey (HsListTy _) = occNameString (getOccName listTyCon) -getDFunHsTypeKey (HsPArrTy _) = occNameString (getOccName parrTyCon) -getDFunHsTypeKey (HsTupleTy {}) = occNameString (getOccName unitTyCon) -getDFunHsTypeKey (HsOpTy _ (_, op) _) = occNameString (rdrNameOcc (unLoc op)) -getDFunHsTypeKey (HsParTy ty) = getDFunHsTypeKey (unLoc ty) -getDFunHsTypeKey (HsIParamTy {}) = occNameString (getOccName ipClassName) -getDFunHsTypeKey (HsEqTy {}) = occNameString (getOccName eqTyCon) -getDFunHsTypeKey (HsKindSig ty _) = getDFunHsTypeKey (unLoc ty) -getDFunHsTypeKey (HsSpliceTy {}) = "splice" -getDFunHsTypeKey (HsDocTy ty _) = getDFunHsTypeKey (unLoc ty) -getDFunHsTypeKey (HsBangTy _ ty) = getDFunHsTypeKey (unLoc ty) -getDFunHsTypeKey (HsRecTy {}) = "record" -getDFunHsTypeKey (HsCoreTy {}) = "core" -getDFunHsTypeKey (HsExplicitListTy {}) = occNameString (getOccName listTyCon) -getDFunHsTypeKey (HsExplicitTupleTy {}) = occNameString (getOccName unitTyCon) -getDFunHsTypeKey (HsTyLit x) = getDFunHsTyLitKey x -getDFunHsTypeKey (HsWrapTy _ ty) = getDFunHsTypeKey ty -getDFunHsTypeKey (HsWildCardTy {}) = "wildcard" - -getDFunHsTyLitKey :: HsTyLit -> String -getDFunHsTyLitKey (HsNumTy _ n) = show n -getDFunHsTyLitKey (HsStrTy _ n) = show n ignoreParens :: LHsType name -> LHsType name ignoreParens (L _ (HsParTy ty)) = ignoreParens ty From git at git.haskell.org Fri Jul 24 16:39:53 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 24 Jul 2015 16:39:53 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: Comments only (deaf8f1) Message-ID: <20150724163953.99DE53A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/deaf8f18a4cd2b4d6176504eb13c10ac287db146/ghc >--------------------------------------------------------------- commit deaf8f18a4cd2b4d6176504eb13c10ac287db146 Author: Adam Gundry Date: Fri Jul 24 16:17:10 2015 +0100 Comments only >--------------------------------------------------------------- deaf8f18a4cd2b4d6176504eb13c10ac287db146 compiler/typecheck/TcExpr.hs | 53 +++++++++++++++++++++++++++++++------------- 1 file changed, 37 insertions(+), 16 deletions(-) diff --git a/compiler/typecheck/TcExpr.hs b/compiler/typecheck/TcExpr.hs index 1839010..b9cc300 100644 --- a/compiler/typecheck/TcExpr.hs +++ b/compiler/typecheck/TcExpr.hs @@ -1348,35 +1348,56 @@ getFixedTyVars upd_fld_occs tvs1 cons {- Note [Disambiguating record updates] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -If the -XDuplicateRecordFields extension is used, the renamer may not -be able to determine exactly which fields are being updated. Consider: + +When the -XDuplicateRecordFields extension is used, and the renamer +encounters a record update that it cannot immediately disambiguate +(because it involves fields that belong to multiple datatypes), it +will defer resolution of the ambiguity to the typechecker. In this +case, the `hsRecUpdFieldSel` field of the `HsRecUpdField` stores a +list of candidate selectors. + +Consider the following definitions: data S = MkS { foo :: Int } data T = MkT { foo :: Int, bar :: Int } - data U = MkU { bar :: Int } + data U = MkU { bar :: Int, baz :: Int } + +When the renamer sees an update of `foo`, it will not know which +parent datatype is in use. The `disambiguateRecordBinds` function +tries to determine the parent in three ways: + +1. Check for types that have all the fields being updated. For example: f x = x { foo = 3, bar = 2 } + Here `f` must be updating `T` because neither `S` nor `U` have + both fields. This may also discover that no possible type exists. + For example the following will be rejected: + + f' x = x { foo = 3, baz = 3 } + +2. Use the type being pushed in, if it is already a TyConApp. The + following are valid updates to `T`: + g :: T -> T g x = x { foo = 3 } - h x = (x :: T) { foo = 3 } + g' x = x { foo = 3 } :: T + +3. Use the type signature of the record expression, if it exists and + is a TyConApp. Thus this is valid update to `T`: -In this situation, the renamer sees an update of `foo` but doesn't -know which parent datatype is in use. In this case, the -`hsRecFieldSel` field of the `HsRecField` stores a list of candidate -selectors. The disambiguateRecordBinds function tries to determine the -parent in three ways: + h x = (x :: T) { foo = 3 } -1. Check for types that have all the fields being updated. In the - example, `f` must be updating `T` because neither `S` nor `U` have - both fields. This may also discover that no suitable type exists. +Note that we do not look up the types of variables being updated, and +no constraint-solving is performed, so for example the following will +be rejected as ambiguous: -2. Use the type being pushed in, if it is already a TyConApp. Thus `g` - is obviously an update to `T`. + let r :: T + r = blah + in r { foo = 3 } -3. Use the type signature of the record expression, if it exists and - is a TyConApp. Thus `h` is an update to `T`. + \r. (r { foo = 3 }, r :: T ) We could add further tests, of a more heuristic nature. For example, rather than looking for an explicit signature, we could try to infer From git at git.haskell.org Fri Jul 24 16:39:56 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 24 Jul 2015 16:39:56 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot: As if by magic, many AvailFields-related types disappear (9d13a83) Message-ID: <20150724163956.7555A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/orf-reboot Link : http://ghc.haskell.org/trac/ghc/changeset/9d13a83806bc4ce59cece971fd2e4351fdbd929c/ghc >--------------------------------------------------------------- commit 9d13a83806bc4ce59cece971fd2e4351fdbd929c Author: Adam Gundry Date: Fri Jul 24 17:37:55 2015 +0100 As if by magic, many AvailFields-related types disappear >--------------------------------------------------------------- 9d13a83806bc4ce59cece971fd2e4351fdbd929c compiler/basicTypes/Avail.hs | 92 +++++++++++++-------------------------- compiler/basicTypes/FieldLabel.hs | 14 +++++- compiler/basicTypes/RdrName.hs | 8 +++- compiler/hsSyn/HsImpExp.hs | 13 +++--- compiler/iface/LoadIface.hs | 3 +- compiler/iface/MkIface.hs | 3 +- compiler/main/HscTypes.hs | 2 +- compiler/rename/RnNames.hs | 82 +++++++++++++++++----------------- 8 files changed, 100 insertions(+), 117 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 9d13a83806bc4ce59cece971fd2e4351fdbd929c From git at git.haskell.org Fri Jul 24 16:39:59 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 24 Jul 2015 16:39:59 +0000 (UTC) Subject: [commit: ghc] wip/orf-reboot's head updated: As if by magic, many AvailFields-related types disappear (9d13a83) Message-ID: <20150724163959.4D4C73A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Branch 'wip/orf-reboot' now includes: 504c2ae Docs: `sortOn = sortBy (comparing f)` [skip ci] 02897c5 Failing test case: idArity invariant check, #10181 e29c2ac CoreUtils: Move seq* functions to CoreSeq ae0e340 CoreUtils: Move size utilities to CoreStats fa33f45 PprCore: Add size annotations for top-level bindings 29f8225 CoreLint: Use size-annotated ppr variant 82f1c78 Fix tests ae96c75 Implement -fprint-expanded-synonyms 415351a Put Opt_Static into defaultFlags if not pc_DYNAMIC_BY_DEFAULT (#7478) 2c5c297 DeriveFoldable for data types with existential constraints (#10447) 2c9de9c Handle Char#, Addr# in TH quasiquoter (fixes #10620) a5e9da8 Fix off-by-one error in GHCi line reporting (Trac #10578) 3448f98 Reduce non-determinism in ABI hashes with RULES and instance decls bc604bd Update assert to fix retc001 and retc002 (#9243) 0d4b074 Travis: actually do debug builds ac0feec Testsuite: small test cleanups f607393 Testsuite: accept new stderr for T9497{a,b,c}-run (#10224) a0371c0 Build system: fail when encountering an unknown package tag dc6e556 Testsuite: mark T2497 expect_broken_for(#10657, ['optasm', 'optllvm']) dcaa486 Testsuite: mark T7919 expect_broken_for(#7919, ['optasm','dyn','optllvm']) 11f8612 Testsuite: mark 3 tests expect_broken_for(#10181, ['optasm', 'optllvm']) 16a8739 Testsuite: mark qq007 and qq008 expect_broken(#10181) cbb4d78 Testsuite: mark qq007 and qq008 expect_broken(#10047) 43dafc9 Testsuite: mark gadt/termination expect_broken_for(#10658, ['optasm','optllvm']) 34bb460 Testsuite: mark array001 and conc034 expect_broken_for(#10659, ['optasm',...]) 9834fea Add regression test for unused implicit parameter warning (#10632) 4c96e7c Testsuite: add ImpredicativeTypes to T7861 (#7861) 7f37274 Testsuite: add -XUndecidableInstances to T3500a 029367e Testsuite: add regression test for missing class constraint 82ffc80 LlvmCodeGen: add support for MO_U_Mul2 CallishMachOp 49373ff Support wild cards in TH splices c526e09 primops: Add haddocks to BCO primops 4cd008b Do not treat prim and javascript imports as C imports in TH and QQ 96de809 Fix primops documentation syntax d71d9a9 Testsuite: fix concprog002 (AMP) 2f18b197 Testsuite: mark concprog002 expect_broken_for(#10661, ['threaded2_hT']) d0cf8f1 Testsuite: simplify T8089 (#8089) b4ef8b8 Update submodule hpc with fix for #10529 0c6c015 Revert "Revert "Change loadSrcInterface to return a list of ModIface"" 214596d Revert "Revert "Support for multiple signature files in scope."" 9ade087 primops: Fix spelling mistake e0a3c44 Delete __GLASGOW_HASKELL__ ifdefs for stage0 < 7.8 8f48fdc Use varToCoreExpr in mkWWcpr_help 3fbf496 Comments only (superclasses and improvement) 3509191 Refactor newSCWorkFromFlavoured 7c0fff4 Improve strictness analysis for exceptions cd48797 Comments and white space only 3c44a46 Refactor self-boot info efa7b3a Add NOINLINE for hs-boot functions aa78cd6 Documents -dsuppress-unfoldings 0df2348 Comments and layout only a0e8bb7 Implement -dsuppress-unfoldings b5c1400 Comments and white space only f1d0480 Avoid out-of-scope top-level Ids 7a6ed66 Comments only 55754ea Fix test T2497 to avoid infinite loop in RULES feaa095 Do occurrence analysis on result of BuiltInRule 00f3187 Make seq-of-cast rule generate a case 35eb736 T4945 is working again f519cb5 testsuite: Show killed command line on timeout 97a50d5 configure: Bump minimum bootstrap GHC version to 7.8 dbe6dac When iconv is unavailable, use an ASCII encoding to encode ASCII 18c6ee2 Travis: use ghc-7.8.4 as stage0 to fix the build d941a89 Validate: by default do show commands a7e0326 Validate: document --quiet [skip ci] 1224bb5 Add utility function isHoleName. 50b9a7a Revert "Trac #4945 is working again" 1b76997 Testsuite: recenter haddock.base allocation numbers b949c96 Eliminate zero_static_objects_list() 0d1a8d0 Two step allocator for 64-bit systems e3df1b1 Validate: explain THREADS instead of CPUS in --help cf57f8f Travis: do pass `--quiet` to validate 0b12aca Switch from recording IsBootInterface to recording full HscSource. adea827 Add ExceptionMonad instance for IOEnv. 144096e Give more informative panic for checkFamInstConsistency. 4a9b40d Export alwaysQualifyPackages and neverQualifyPackages. 939f1b2 Some utility functions for testing IfaceType equality. dd365b1 Use lookupIfaceTop for loading IfaceDecls. 5c3fc92 Fix Trac #10670 9851275 Comments only d784bde Lexer: support consecutive references to Haddock chunks (#10398) d2b4df1 Generate .dyn_o files for .hsig files with -dynamic-too 76e2341 Accept next-docstrings on GADT constructors. e78841b Update encoding001 to test the full range of non-surrogate code points b5c9426 Parenthesise TypeOperator in import hints 1852c3d DataCon: Fix redundant import 4c8e69e rts/sm: Add missing argument names in function definitions 7ec07e4 Slight refactoring to the fix for #4012 608e76c Document type functions in the Paterson conditions e809ef5 ghci: fixity declarations for infix data constructors (#10018) 5ff4dad Add a few comments from SPJ on fixity declarations f9687ca Library names, with Cabal submodule update 45c319f Fix line number in T10018 testcase 30d8349 Comments only e161634 Comments about stricteness of catch# d53d808 Refactoring around FunDeps 6e618d7 Improve instanceCantMatch 6ebd548 Merge remote-tracking branch 'origin/master' into wip/orf-reboot aaa16ed Get rid of redundant getDFunHsTypeKey deaf8f1 Comments only 9d13a83 As if by magic, many AvailFields-related types disappear From git at git.haskell.org Sat Jul 25 08:38:50 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 25 Jul 2015 08:38:50 +0000 (UTC) Subject: [commit: ghc] master: renamer: fix module-level deprecation message (b04bed0) Message-ID: <20150725083850.170BF3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/b04bed0a391335e70b3c3bdbdccbaa0781697cce/ghc >--------------------------------------------------------------- commit b04bed0a391335e70b3c3bdbdccbaa0781697cce Author: Sergei Trofimovich Date: Sat Jul 25 09:37:44 2015 +0100 renamer: fix module-level deprecation message Noticed today that deprecation warnings are slightly broken in -HEAD: mtl-2.2.1/Control/Monad/Error/Class.hs:46:1: warning: Module ?Control.Monad.Trans.Error? is deprecated: ([", U, s, e, , C, o, n, t, r, o, l, ., M, o, n, a, d, ., T, r, a, n, s, ., E, x, c, e, p, t, , i, n, s, t, e, a, d, "], Use Control.Monad.Trans.Except instead) Commit e6191d1cc37e98785af8b309100ea840084fa3ba slightly changed WarningTxt declaration: -data WarningTxt = WarningTxt (Located SourceText) [Located FastString] - | DeprecatedTxt (Located SourceText) [Located FastString] +data WarningTxt = WarningTxt (Located SourceText) + [Located (SourceText,FastString)] + | DeprecatedTxt (Located SourceText) + [Located (SourceText,FastString)] But 'moduleWarn' function was not updated to do the stripping. Signed-off-by: Sergei Trofimovich Reviewers: austin, bgamari, hvr, goldfire, rwbarton, alanz Reviewed By: rwbarton, alanz Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1096 GHC Trac Issues: #10313 >--------------------------------------------------------------- b04bed0a391335e70b3c3bdbdccbaa0781697cce compiler/rename/RnNames.hs | 4 ++-- testsuite/tests/warnings/should_compile/DeprM.hs | 4 ++++ testsuite/tests/warnings/should_compile/DeprU.hs | 6 ++++++ testsuite/tests/warnings/should_compile/DeprU.stderr | 10 ++++++++++ testsuite/tests/warnings/should_compile/all.T | 6 ++++++ 5 files changed, 28 insertions(+), 2 deletions(-) diff --git a/compiler/rename/RnNames.hs b/compiler/rename/RnNames.hs index 0c116df..aeb0388 100644 --- a/compiler/rename/RnNames.hs +++ b/compiler/rename/RnNames.hs @@ -1788,11 +1788,11 @@ missingImportListItem ie moduleWarn :: ModuleName -> WarningTxt -> SDoc moduleWarn mod (WarningTxt _ txt) = sep [ ptext (sLit "Module") <+> quotes (ppr mod) <> ptext (sLit ":"), - nest 2 (vcat (map ppr txt)) ] + nest 2 (vcat (map (ppr . snd . unLoc) txt)) ] moduleWarn mod (DeprecatedTxt _ txt) = sep [ ptext (sLit "Module") <+> quotes (ppr mod) <+> ptext (sLit "is deprecated:"), - nest 2 (vcat (map ppr txt)) ] + nest 2 (vcat (map (ppr . snd . unLoc) txt)) ] packageImportErr :: SDoc packageImportErr diff --git a/testsuite/tests/warnings/should_compile/DeprM.hs b/testsuite/tests/warnings/should_compile/DeprM.hs new file mode 100644 index 0000000..2a84622 --- /dev/null +++ b/testsuite/tests/warnings/should_compile/DeprM.hs @@ -0,0 +1,4 @@ +module DeprM {-# DEPRECATED "Here can be your menacing deprecation warning!" #-} where + +f :: Int +f = 42 diff --git a/testsuite/tests/warnings/should_compile/DeprU.hs b/testsuite/tests/warnings/should_compile/DeprU.hs new file mode 100644 index 0000000..d15a7c5 --- /dev/null +++ b/testsuite/tests/warnings/should_compile/DeprU.hs @@ -0,0 +1,6 @@ +module A where + +import DeprM -- here should be emitted deprecation warning + +g :: Int +g = f diff --git a/testsuite/tests/warnings/should_compile/DeprU.stderr b/testsuite/tests/warnings/should_compile/DeprU.stderr new file mode 100644 index 0000000..c27dccb --- /dev/null +++ b/testsuite/tests/warnings/should_compile/DeprU.stderr @@ -0,0 +1,10 @@ +[1 of 2] Compiling DeprM ( DeprM.hs, DeprM.o ) +[2 of 2] Compiling A ( DeprU.hs, DeprU.o ) + +DeprU.hs:3:1: Warning: + Module ?DeprM? is deprecated: + Here can be your menacing deprecation warning! + +DeprU.hs:6:5: Warning: + In the use of ?f? (imported from DeprM): + Deprecated: "Here can be your menacing deprecation warning!" diff --git a/testsuite/tests/warnings/should_compile/all.T b/testsuite/tests/warnings/should_compile/all.T index 7fa8caf..bbf5d1c 100644 --- a/testsuite/tests/warnings/should_compile/all.T +++ b/testsuite/tests/warnings/should_compile/all.T @@ -4,3 +4,9 @@ test('T9178', extra_clean(['T9178.o', 'T9178DataType.o', 'T9178.hi', 'T9178DataType.hi']), multimod_compile, ['T9178', '-Wall']) test('T9230', normal, compile_without_flag('-fno-warn-tabs'), ['']) + +test('DeprU', + extra_clean([ + 'DeprM.o', 'DeprU.o', + 'DeprM.hi', 'DeprU.hi']), + multimod_compile, ['DeprU', '-Wall']) From git at git.haskell.org Sat Jul 25 21:27:09 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sat, 25 Jul 2015 21:27:09 +0000 (UTC) Subject: [commit: ghc] master: -include-pkg-deps takes only one hyphen. (070f76a) Message-ID: <20150725212709.6325C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/070f76ac36983c33919628092e992bef1055869e/ghc >--------------------------------------------------------------- commit 070f76ac36983c33919628092e992bef1055869e Author: Edward Z. Yang Date: Sat Jul 25 14:28:11 2015 -0700 -include-pkg-deps takes only one hyphen. Signed-off-by: Edward Z. Yang >--------------------------------------------------------------- 070f76ac36983c33919628092e992bef1055869e docs/users_guide/separate_compilation.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/users_guide/separate_compilation.xml b/docs/users_guide/separate_compilation.xml index 7209f5e..281cf14 100644 --- a/docs/users_guide/separate_compilation.xml +++ b/docs/users_guide/separate_compilation.xml @@ -1150,7 +1150,7 @@ M.o : X.hi-boot locate any imported modules that come from packages. The package modules won't be included in the dependencies generated, though (but see the - option below). + option below). The dependency generation phase of GHC can take some additional options, which you may find useful. @@ -1226,7 +1226,7 @@ M.o : X.hi-boot - + Regard modules imported from packages as unstable, i.e., generate dependencies on any imported package modules From git at git.haskell.org Sun Jul 26 03:34:22 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 26 Jul 2015 03:34:22 +0000 (UTC) Subject: [commit: ghc] master: Use isTrue# around primitive comparisons in integer-gmp (7e70c06) Message-ID: <20150726033422.46CEE3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/7e70c063ad88052ca5f2586eb07e5d1571956acd/ghc >--------------------------------------------------------------- commit 7e70c063ad88052ca5f2586eb07e5d1571956acd Author: Reid Barton Date: Sat Jul 25 23:00:52 2015 -0400 Use isTrue# around primitive comparisons in integer-gmp Summary: The form case na# ==# nb# of 0# -> ... _ -> ... sometimes generates convoluted assembly, see #10676. timesInt2Integer was the most spectacular offender, especially as it is a rather cheap function overall (no calls to gmp). I checked a few instances and some of the old generated assembly was fine already, but I changed them all for consistency. The new form is also more consistent with use of these primops in general. Test Plan: validate Reviewers: hvr, bgamari, goldfire, austin Reviewed By: hvr Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1094 >--------------------------------------------------------------- 7e70c063ad88052ca5f2586eb07e5d1571956acd libraries/integer-gmp/src/GHC/Integer/Type.hs | 60 +++++++++++++-------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/libraries/integer-gmp/src/GHC/Integer/Type.hs b/libraries/integer-gmp/src/GHC/Integer/Type.hs index 5670bb4..88d1923 100644 --- a/libraries/integer-gmp/src/GHC/Integer/Type.hs +++ b/libraries/integer-gmp/src/GHC/Integer/Type.hs @@ -460,23 +460,23 @@ sqrInteger (Jn# bn) = Jp# (sqrBigNat bn) -- | Construct 'Integer' from the product of two 'Int#'s timesInt2Integer :: Int# -> Int# -> Integer -timesInt2Integer x# y# = case (# x# >=# 0#, y# >=# 0# #) of - (# 0#, 0# #) -> case timesWord2# (int2Word# (negateInt# x#)) +timesInt2Integer x# y# = case (# isTrue# (x# >=# 0#), isTrue# (y# >=# 0#) #) of + (# False, False #) -> case timesWord2# (int2Word# (negateInt# x#)) (int2Word# (negateInt# y#)) of (# 0##,l #) -> inline wordToInteger l (# h ,l #) -> Jp# (wordToBigNat2 h l) - (# _, 0# #) -> case timesWord2# (int2Word# x#) + (# True, False #) -> case timesWord2# (int2Word# x#) (int2Word# (negateInt# y#)) of (# 0##,l #) -> wordToNegInteger l (# h ,l #) -> Jn# (wordToBigNat2 h l) - (# 0#, _ #) -> case timesWord2# (int2Word# (negateInt# x#)) + (# False, True #) -> case timesWord2# (int2Word# (negateInt# x#)) (int2Word# y#) of (# 0##,l #) -> wordToNegInteger l (# h ,l #) -> Jn# (wordToBigNat2 h l) - (# _, _ #) -> case timesWord2# (int2Word# x#) + (# True, True #) -> case timesWord2# (int2Word# x#) (int2Word# y#) of (# 0##,l #) -> inline wordToInteger l (# h ,l #) -> Jp# (wordToBigNat2 h l) @@ -1104,9 +1104,9 @@ orBigNat x@(BN# x#) y@(BN# y#) ior' a# na# b# nb# = do -- na >= nb mbn@(MBN# mba#) <- newBigNat# na# _ <- liftIO (c_mpn_ior_n mba# a# b# nb#) - _ <- case na# ==# nb# of - 0# -> svoid (copyWordArray# a# nb# mba# nb# (na# -# nb#)) - _ -> return () + _ <- case isTrue# (na# ==# nb#) of + False -> svoid (copyWordArray# a# nb# mba# nb# (na# -# nb#)) + True -> return () unsafeFreezeBigNat# mbn nx# = sizeofBigNat# x @@ -1123,10 +1123,10 @@ xorBigNat x@(BN# x#) y@(BN# y#) xor' a# na# b# nb# = do -- na >= nb mbn@(MBN# mba#) <- newBigNat# na# _ <- liftIO (c_mpn_xor_n mba# a# b# nb#) - case na# ==# nb# of - 0# -> do _ <- svoid (copyWordArray# a# nb# mba# nb# (na# -# nb#)) - unsafeFreezeBigNat# mbn - _ -> unsafeRenormFreezeBigNat# mbn + case isTrue# (na# ==# nb#) of + False -> do _ <- svoid (copyWordArray# a# nb# mba# nb# (na# -# nb#)) + unsafeFreezeBigNat# mbn + True -> unsafeRenormFreezeBigNat# mbn nx# = sizeofBigNat# x ny# = sizeofBigNat# y @@ -1139,9 +1139,9 @@ andnBigNat x@(BN# x#) y@(BN# y#) | True = runS $ do mbn@(MBN# mba#) <- newBigNat# nx# _ <- liftIO (c_mpn_andn_n mba# x# y# n#) - _ <- case nx# ==# n# of - 0# -> svoid (copyWordArray# x# n# mba# n# (nx# -# n#)) - _ -> return () + _ <- case isTrue# (nx# ==# n#) of + False -> svoid (copyWordArray# x# n# mba# n# (nx# -# n#)) + True -> return () unsafeRenormFreezeBigNat# mbn where n# | isTrue# (nx# <# ny#) = nx# @@ -1249,9 +1249,9 @@ gcdBigNat x@(BN# x#) y@(BN# y#) mbn@(MBN# mba#) <- newBigNat# nb# I# rn'# <- liftIO (c_mpn_gcd# mba# a# na# b# nb#) let rn# = narrowGmpSize# rn'# - case rn# ==# nb# of - 0# -> unsafeShrinkFreezeBigNat# mbn rn# - _ -> unsafeFreezeBigNat# mbn + case isTrue# (rn# ==# nb#) of + False -> unsafeShrinkFreezeBigNat# mbn rn# + True -> unsafeFreezeBigNat# mbn nx# = sizeofBigNat# x ny# = sizeofBigNat# y @@ -1284,9 +1284,9 @@ gcdExtSBigNat x y = case runS go of (g,s) -> (# g, s #) sn# = absI# ssn# s' <- unsafeShrinkFreezeBigNat# s sn# g' <- unsafeRenormFreezeBigNat# g - case ssn# >=# 0# of - 0# -> return ( g', NegBN s' ) - _ -> return ( g', PosBN s' ) + case isTrue# (ssn# >=# 0#) of + False -> return ( g', NegBN s' ) + True -> return ( g', PosBN s' ) !(BN# x#) = absSBigNat x !(BN# y#) = absSBigNat y @@ -1351,9 +1351,9 @@ powModSBigNat b e m@(BN# m#) = runS $ do r@(MBN# r#) <- newBigNat# mn# I# rn_# <- liftIO (integer_gmp_powm# r# b# bn# e# en# m# mn#) let rn# = narrowGmpSize# rn_# - case rn# ==# mn# of - 0# -> unsafeShrinkFreezeBigNat# r rn# - _ -> unsafeFreezeBigNat# r + case isTrue# (rn# ==# mn#) of + False -> unsafeShrinkFreezeBigNat# r rn# + True -> unsafeFreezeBigNat# r where !(BN# b#) = absSBigNat b !(BN# e#) = absSBigNat e @@ -1413,9 +1413,9 @@ recipModSBigNat x m@(BN# m#) = runS $ do r@(MBN# r#) <- newBigNat# mn# I# rn_# <- liftIO (integer_gmp_invert# r# x# xn# m# mn#) let rn# = narrowGmpSize# rn_# - case rn# ==# mn# of - 0# -> unsafeShrinkFreezeBigNat# r rn# - _ -> unsafeFreezeBigNat# r + case isTrue# (rn# ==# mn#) of + False -> unsafeShrinkFreezeBigNat# r rn# + True -> unsafeFreezeBigNat# r where !(BN# x#) = absSBigNat x xn# = ssizeofSBigNat# x @@ -1850,9 +1850,9 @@ isValidBigNat# :: BigNat -> Int# isValidBigNat# (BN# ba#) = (szq# ># 0#) `andI#` (szr# ==# 0#) `andI#` isNorm# where - isNorm# = case szq# ># 1# of - 1# -> (indexWordArray# ba# (szq# -# 1#)) `neWord#` 0## - _ -> 1# + isNorm# + | isTrue# (szq# ># 1#) = (indexWordArray# ba# (szq# -# 1#)) `neWord#` 0## + | True = 1# sz# = sizeofByteArray# ba# From git at git.haskell.org Sun Jul 26 03:34:25 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 26 Jul 2015 03:34:25 +0000 (UTC) Subject: [commit: ghc] master: Add missing parentheses in eqBigNatWord# (c55f61c) Message-ID: <20150726033425.312D13A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/c55f61ca3f008cc70911d962297fb51f84056661/ghc >--------------------------------------------------------------- commit c55f61ca3f008cc70911d962297fb51f84056661 Author: Reid Barton Date: Sat Jul 25 23:01:49 2015 -0400 Add missing parentheses in eqBigNatWord# Summary: I'm pretty sure that parentheses were intended here. But oddly, they make very little difference. The presumably intended expression (sizeofBigNat# bn ==# 1#) `andI#` (bigNatToWord bn `eqWord#` w#) is 1# exactly when bn consists of a single limb equal to w#, clearly. In the original expression sizeofBigNat# bn ==# 1# `andI#` (bigNatToWord bn `eqWord#` w#) the right-hand side of ==# is always 0# or 1#. So it is 1# when bn consists of a single limb equal to w#. It is also 1# when bn has zero limbs and the word past the end of bn does not happen to be equal to w#. So in practice the difference is that nullBigNat was eqBigNatWord# to almost everything, but eqBigNatWord# is never supposed to be called on nullBigNat anyways. Note that even the corrected version might perform an out-of-bounds memory access if passed nullBigNat, because `andI#` is not guaranteed to short-circuit, though in fact GHC does convert isZeroBigNat to a series of branches in my local build. Test Plan: validate Reviewers: hvr, bgamari, goldfire, austin Reviewed By: hvr, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1095 >--------------------------------------------------------------- c55f61ca3f008cc70911d962297fb51f84056661 libraries/integer-gmp/src/GHC/Integer/Type.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/integer-gmp/src/GHC/Integer/Type.hs b/libraries/integer-gmp/src/GHC/Integer/Type.hs index 88d1923..d941c4c 100644 --- a/libraries/integer-gmp/src/GHC/Integer/Type.hs +++ b/libraries/integer-gmp/src/GHC/Integer/Type.hs @@ -835,7 +835,7 @@ eqBigNatWord bn w# = isTrue# (eqBigNatWord# bn w#) eqBigNatWord# :: BigNat -> GmpLimb# -> Int# eqBigNatWord# bn w# - = sizeofBigNat# bn ==# 1# `andI#` (bigNatToWord bn `eqWord#` w#) + = (sizeofBigNat# bn ==# 1#) `andI#` (bigNatToWord bn `eqWord#` w#) -- | Same as @'indexBigNat#' bn 0\#@ From git at git.haskell.org Sun Jul 26 03:35:41 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Sun, 26 Jul 2015 03:35:41 +0000 (UTC) Subject: [commit: ghc] master: Comment tweaks only (474d4cc) Message-ID: <20150726033541.070CF3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/474d4ccc6e4a3bea93be16cb7daef6ffcdf9b663/ghc >--------------------------------------------------------------- commit 474d4ccc6e4a3bea93be16cb7daef6ffcdf9b663 Author: Reid Barton Date: Sat Jul 25 23:36:29 2015 -0400 Comment tweaks only >--------------------------------------------------------------- 474d4ccc6e4a3bea93be16cb7daef6ffcdf9b663 compiler/stgSyn/StgSyn.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/stgSyn/StgSyn.hs b/compiler/stgSyn/StgSyn.hs index 6c6d4bf..d04a157 100644 --- a/compiler/stgSyn/StgSyn.hs +++ b/compiler/stgSyn/StgSyn.hs @@ -174,7 +174,7 @@ function. (If the arguments were expressions, we would have to build their closures first.) There is no constructor for a lone variable; it would appear as - at StgApp var [] _ at . + at StgApp var []@. -} type GenStgLiveVars occ = UniqSet occ @@ -191,7 +191,7 @@ data GenStgExpr bndr occ * * ************************************************************************ -There are a specialised forms of application, for constructors, +There are specialised forms of application, for constructors, primitives, and literals. -} From git at git.haskell.org Mon Jul 27 09:44:03 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 27 Jul 2015 09:44:03 +0000 (UTC) Subject: [commit: ghc] wip/impredicativity: Go back to instantiation with type families (f20041d) Message-ID: <20150727094403.158703A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/impredicativity Link : http://ghc.haskell.org/trac/ghc/changeset/f20041dc443aed585727dffa41b33a4d7bb17760/ghc >--------------------------------------------------------------- commit f20041dc443aed585727dffa41b33a4d7bb17760 Author: Alejandro Serrano Date: Mon Jul 27 09:57:56 2015 +0200 Go back to instantiation with type families >--------------------------------------------------------------- f20041dc443aed585727dffa41b33a4d7bb17760 compiler/typecheck/TcCanonical.hs | 15 +++------ compiler/typecheck/TcSMonad.hs | 29 ++++-------------- compiler/typecheck/TcSimplify.hs | 5 ++- docs/types/impredicativity.ltx | 64 +++++++++++++++++++++------------------ 4 files changed, 48 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 f20041dc443aed585727dffa41b33a4d7bb17760 From git at git.haskell.org Mon Jul 27 09:44:05 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 27 Jul 2015 09:44:05 +0000 (UTC) Subject: [commit: ghc] wip/impredicativity: Fix warning on termination check with <~ constraints (6b05f0c) Message-ID: <20150727094405.EECFB3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/impredicativity Link : http://ghc.haskell.org/trac/ghc/changeset/6b05f0c574a5067cbd6db5909e34d66c3512aa8f/ghc >--------------------------------------------------------------- commit 6b05f0c574a5067cbd6db5909e34d66c3512aa8f Author: Alejandro Serrano Date: Mon Jul 27 09:58:29 2015 +0200 Fix warning on termination check with <~ constraints >--------------------------------------------------------------- 6b05f0c574a5067cbd6db5909e34d66c3512aa8f compiler/typecheck/TcValidity.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/typecheck/TcValidity.hs b/compiler/typecheck/TcValidity.hs index 5d1bf31..fcfdbf4 100644 --- a/compiler/typecheck/TcValidity.hs +++ b/compiler/typecheck/TcValidity.hs @@ -1029,6 +1029,7 @@ checkInstTermination tys theta check pred = case classifyPredType pred of EqPred {} -> return () -- See Trac #4200. + InstanceOfPred {} -> return () IrredPred {} -> check2 pred (sizeType pred) ClassPred cls tys | isIPClass cls From git at git.haskell.org Mon Jul 27 11:49:10 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 27 Jul 2015 11:49:10 +0000 (UTC) Subject: [commit: ghc] master: Implementation of StrictData language extension (f842ad6) Message-ID: <20150727114910.7719A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/f842ad6c751c14ec331ca1709538c2f3e9a30ae7/ghc >--------------------------------------------------------------- commit f842ad6c751c14ec331ca1709538c2f3e9a30ae7 Author: Adam Sandberg Eriksson Date: Mon Jul 27 13:18:36 2015 +0200 Implementation of StrictData language extension This implements the `StrictData` language extension, which lets the programmer default to strict data fields in datatype declarations on a per-module basis. Specification and motivation can be found at https://ghc.haskell.org/trac/ghc/wiki/StrictPragma This includes a tricky parser change due to conflicts regarding `~` in the type level syntax: all ~'s are parsed as strictness annotations (see `strict_mark` in Parser.y) and then turned into equality constraints at the appropriate places using `RdrHsSyn.splitTilde`. Updates haddock submodule. Test Plan: Validate through Harbormaster. Reviewers: goldfire, austin, hvr, simonpj, tibbe, bgamari Reviewed By: simonpj, tibbe, bgamari Subscribers: lelf, simonpj, alanz, goldfire, thomie, bgamari, mpickering Differential Revision: https://phabricator.haskell.org/D1033 GHC Trac Issues: #8347 >--------------------------------------------------------------- f842ad6c751c14ec331ca1709538c2f3e9a30ae7 compiler/basicTypes/DataCon.hs | 172 ++++++++++++--------- compiler/basicTypes/MkId.hs | 66 +++++--- compiler/deSugar/DsMeta.hs | 12 +- compiler/hsSyn/Convert.hs | 4 +- compiler/hsSyn/HsTypes.hs | 6 +- compiler/iface/BuildTyCl.hs | 2 +- compiler/iface/MkIface.hs | 2 +- compiler/iface/TcIface.hs | 8 +- compiler/main/DynFlags.hs | 2 + compiler/parser/Parser.y | 82 +++++----- compiler/parser/RdrHsSyn.hs | 16 ++ compiler/prelude/TysWiredIn.hs | 2 +- compiler/typecheck/TcExpr.hs | 4 +- compiler/typecheck/TcRnDriver.hs | 7 +- compiler/typecheck/TcSplice.hs | 13 +- compiler/typecheck/TcTyClsDecls.hs | 26 +++- compiler/vectorise/Vectorise/Generic/PData.hs | 5 +- docs/users_guide/flags.xml | 8 +- docs/users_guide/glasgow_exts.xml | 40 ++++- testsuite/tests/deSugar/should_run/DsStrictData.hs | 48 ++++++ .../tests/deSugar/should_run/DsStrictData.stdout | 3 + testsuite/tests/deSugar/should_run/all.T | 1 + testsuite/tests/driver/T4437.hs | 4 +- utils/haddock | 2 +- 24 files changed, 364 insertions(+), 171 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 f842ad6c751c14ec331ca1709538c2f3e9a30ae7 From git at git.haskell.org Mon Jul 27 11:49:13 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 27 Jul 2015 11:49:13 +0000 (UTC) Subject: [commit: ghc] master: Add UInfixT to TH types (fixes #10522) (2178273) Message-ID: <20150727114913.3AA6F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/217827393dcacd0ef696c4f9f6136e21b3be63a8/ghc >--------------------------------------------------------------- commit 217827393dcacd0ef696c4f9f6136e21b3be63a8 Author: Michael Smith Date: Mon Jul 27 13:19:01 2015 +0200 Add UInfixT to TH types (fixes #10522) UInfixT is like UInfixE or UInfixP but for types. Template Haskell splices can use it to punt fixity handling to GHC when constructing types. UInfixT is converted in compiler/hsSyn/Convert to a right-biased tree of HsOpTy, which is already rearranged in compiler/rename/RnTypes to match operator fixities. This patch consists of (1) adding UInfixT to the AST, (2) implementing the conversion and updating relevant comments, (3) updating pretty-printing and library support, and (4) adding tests. Test Plan: validate Reviewers: austin, goldfire, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1088 GHC Trac Issues: #10522 >--------------------------------------------------------------- 217827393dcacd0ef696c4f9f6136e21b3be63a8 compiler/hsSyn/Convert.hs | 45 +++++++++++++++++++--- docs/users_guide/7.12.1-notes.xml | 12 ++++++ libraries/template-haskell/Language/Haskell/TH.hs | 5 ++- .../template-haskell/Language/Haskell/TH/Lib.hs | 14 +++++++ .../template-haskell/Language/Haskell/TH/Ppr.hs | 7 ++++ .../template-haskell/Language/Haskell/TH/Syntax.hs | 21 ++++++---- testsuite/tests/th/TH_unresolvedInfix.hs | 31 +++++++++++++++ testsuite/tests/th/TH_unresolvedInfix.stdout | 4 ++ testsuite/tests/th/TH_unresolvedInfix_Lib.hs | 20 ++++++++++ 9 files changed, 143 insertions(+), 16 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 217827393dcacd0ef696c4f9f6136e21b3be63a8 From git at git.haskell.org Mon Jul 27 11:49:16 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 27 Jul 2015 11:49:16 +0000 (UTC) Subject: [commit: ghc] master: Remove runSTRep from PrelNames (81fffc4) Message-ID: <20150727114916.04C843A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/81fffc4b951ff9c6073ca57dbd27f7f29c6ad306/ghc >--------------------------------------------------------------- commit 81fffc4b951ff9c6073ca57dbd27f7f29c6ad306 Author: Reid Barton Date: Mon Jul 27 13:20:01 2015 +0200 Remove runSTRep from PrelNames It has no special treatment in the compiler any more. The last use was removed in 99d4e5b4a0bd "Implement cardinality analysis". Test Plan: validate Reviewers: austin, bgamari, simonpj Reviewed By: simonpj Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1099 >--------------------------------------------------------------- 81fffc4b951ff9c6073ca57dbd27f7f29c6ad306 compiler/prelude/PrelNames.hs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/compiler/prelude/PrelNames.hs b/compiler/prelude/PrelNames.hs index 32c133d..23d5000 100644 --- a/compiler/prelude/PrelNames.hs +++ b/compiler/prelude/PrelNames.hs @@ -288,7 +288,7 @@ basicKnownKeyNames otherwiseIdName, inlineIdName, eqStringName, assertName, breakpointName, breakpointCondName, breakpointAutoName, opaqueTyConName, - assertErrorName, runSTRepName, + assertErrorName, printName, fstName, sndName, -- Integer @@ -1132,10 +1132,6 @@ stablePtrTyConName, newStablePtrName :: Name stablePtrTyConName = tcQual gHC_STABLE (fsLit "StablePtr") stablePtrTyConKey newStablePtrName = varQual gHC_STABLE (fsLit "newStablePtr") newStablePtrIdKey --- PrelST module -runSTRepName :: Name -runSTRepName = varQual gHC_ST (fsLit "runSTRep") runSTRepIdKey - -- Recursive-do notation monadFixClassName, mfixName :: Name monadFixClassName = clsQual mONAD_FIX (fsLit "MonadFix") monadFixClassKey @@ -1665,7 +1661,7 @@ typeErrorIdKey = mkPreludeMiscIdUnique 22 unsafeCoerceIdKey, concatIdKey, filterIdKey, zipIdKey, bindIOIdKey, returnIOIdKey, newStablePtrIdKey, printIdKey, failIOIdKey, nullAddrIdKey, voidArgIdKey, - fstIdKey, sndIdKey, otherwiseIdKey, assertIdKey, runSTRepIdKey :: Unique + fstIdKey, sndIdKey, otherwiseIdKey, assertIdKey :: Unique unsafeCoerceIdKey = mkPreludeMiscIdUnique 30 concatIdKey = mkPreludeMiscIdUnique 31 filterIdKey = mkPreludeMiscIdUnique 32 @@ -1681,7 +1677,6 @@ fstIdKey = mkPreludeMiscIdUnique 41 sndIdKey = mkPreludeMiscIdUnique 42 otherwiseIdKey = mkPreludeMiscIdUnique 43 assertIdKey = mkPreludeMiscIdUnique 44 -runSTRepIdKey = mkPreludeMiscIdUnique 45 mkIntegerIdKey, smallIntegerIdKey, wordToIntegerIdKey, integerToWordIdKey, integerToIntIdKey, From git at git.haskell.org Mon Jul 27 13:47:59 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 27 Jul 2015 13:47:59 +0000 (UTC) Subject: [commit: ghc] master: Do not inline or apply rules on LHS of rules (bc4b64c) Message-ID: <20150727134759.A1E103A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/bc4b64ca5b99bff6b3d5051b57cb2bc52bd4c841/ghc >--------------------------------------------------------------- commit bc4b64ca5b99bff6b3d5051b57cb2bc52bd4c841 Author: Simon Peyton Jones Date: Mon Jul 27 13:56:31 2015 +0100 Do not inline or apply rules on LHS of rules This is the right thing to do anyway, and fixes Trac #10528 >--------------------------------------------------------------- bc4b64ca5b99bff6b3d5051b57cb2bc52bd4c841 compiler/simplCore/SimplCore.hs | 4 ++-- compiler/simplCore/SimplUtils.hs | 18 ++++++++++++++++-- compiler/simplCore/Simplify.hs | 36 +++++++++++++++++++++--------------- 3 files changed, 39 insertions(+), 19 deletions(-) diff --git a/compiler/simplCore/SimplCore.hs b/compiler/simplCore/SimplCore.hs index a667250..73cdd70 100644 --- a/compiler/simplCore/SimplCore.hs +++ b/compiler/simplCore/SimplCore.hs @@ -23,7 +23,7 @@ import CoreStats ( coreBindsSize, coreBindsStats, exprSize ) import CoreUtils ( mkTicks, stripTicksTop ) import CoreLint ( showPass, endPass, lintPassResult, dumpPassResult, lintAnnots ) -import Simplify ( simplTopBinds, simplExpr, simplRule ) +import Simplify ( simplTopBinds, simplExpr, simplRules ) import SimplUtils ( simplEnvForGHCi, activeRule ) import SimplEnv import SimplMonad @@ -659,7 +659,7 @@ simplifyPgmIO pass@(CoreDoSimplify max_iterations mode) -- for imported Ids. Eg RULE map my_f = blah -- If we have a substitution my_f :-> other_f, we'd better -- apply it to the rule to, or it'll never match - ; rules1 <- mapM (simplRule env1 Nothing) rules + ; rules1 <- simplRules env1 Nothing rules ; return (getFloatBinds env1, rules1) } ; diff --git a/compiler/simplCore/SimplUtils.hs b/compiler/simplCore/SimplUtils.hs index b1e8c1e..d297be3 100644 --- a/compiler/simplCore/SimplUtils.hs +++ b/compiler/simplCore/SimplUtils.hs @@ -14,7 +14,7 @@ module SimplUtils ( preInlineUnconditionally, postInlineUnconditionally, activeUnfolding, activeRule, getUnfoldingInRuleMatch, - simplEnvForGHCi, updModeForStableUnfoldings, + simplEnvForGHCi, updModeForStableUnfoldings, updModeForRuleLHS, -- The continuation type SimplCont(..), DupFlag(..), @@ -701,7 +701,21 @@ updModeForStableUnfoldings inline_rule_act current_mode phaseFromActivation (ActiveAfter n) = Phase n phaseFromActivation _ = InitialPhase -{- +updModeForRuleLHS :: SimplifierMode -> SimplifierMode +-- See Note [Simplifying RULE LHSs] +updModeForRuleLHS current_mode + = current_mode { sm_phase = InitialPhase + , sm_inline = False + , sm_rules = False + , sm_eta_expand = False } + +{- Note [Simplifying RULE LHSs] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +When simplifying on the LHS of a rule, refrain from all inlining and +all RULES. Doing anything to the LHS is plain confusing, because it +means that what the rule matches is not what the user wrote. +c.f. Trac #10595, and #10528. + Note [Inlining in gentle mode] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Something is inlined if diff --git a/compiler/simplCore/Simplify.hs b/compiler/simplCore/Simplify.hs index bd17361..07bc004 100644 --- a/compiler/simplCore/Simplify.hs +++ b/compiler/simplCore/Simplify.hs @@ -6,7 +6,7 @@ {-# LANGUAGE CPP #-} -module Simplify ( simplTopBinds, simplExpr, simplRule ) where +module Simplify ( simplTopBinds, simplExpr, simplRules ) where #include "HsVersions.h" @@ -2956,22 +2956,28 @@ addBndrRules env in_id out_id | null old_rules = return (env, out_id) | otherwise - = do { new_rules <- mapM (simplRule env (Just (idName out_id))) old_rules + = do { new_rules <- simplRules env (Just (idName out_id)) old_rules ; let final_id = out_id `setIdSpecialisation` mkSpecInfo new_rules ; return (modifyInScope env final_id, final_id) } where old_rules = specInfoRules (idSpecialisation in_id) -simplRule :: SimplEnv -> Maybe Name -> CoreRule -> SimplM CoreRule -simplRule _ _ rule@(BuiltinRule {}) = return rule -simplRule env mb_new_nm rule@(Rule { ru_bndrs = bndrs, ru_args = args - , ru_fn = fn_name, ru_rhs = rhs - , ru_act = act }) - = do { (env, bndrs') <- simplBinders env bndrs - ; let rule_env = updMode (updModeForStableUnfoldings act) env - ; args' <- mapM (simplExpr rule_env) args - ; rhs' <- simplExpr rule_env rhs - ; return (rule { ru_bndrs = bndrs' - , ru_fn = mb_new_nm `orElse` fn_name - , ru_args = args' - , ru_rhs = rhs' }) } +simplRules :: SimplEnv -> Maybe Name -> [CoreRule] -> SimplM [CoreRule] +simplRules env mb_new_nm rules + = mapM simpl_rule rules + where + simpl_rule rule@(BuiltinRule {}) + = return rule + + simpl_rule rule@(Rule { ru_bndrs = bndrs, ru_args = args + , ru_fn = fn_name, ru_rhs = rhs + , ru_act = act }) + = do { (env, bndrs') <- simplBinders env bndrs + ; let lhs_env = updMode updModeForRuleLHS env + rhs_env = updMode (updModeForStableUnfoldings act) env + ; args' <- mapM (simplExpr lhs_env) args + ; rhs' <- simplExpr rhs_env rhs + ; return (rule { ru_bndrs = bndrs' + , ru_fn = mb_new_nm `orElse` fn_name + , ru_args = args' + , ru_rhs = rhs' }) } From git at git.haskell.org Mon Jul 27 13:48:02 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 27 Jul 2015 13:48:02 +0000 (UTC) Subject: [commit: ghc] master: Improve warnings for rules that might not fire (2d88a53) Message-ID: <20150727134802.A55E73A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/2d88a531b7e4dbf4016dca4b1ba3b5dc34256cf4/ghc >--------------------------------------------------------------- commit 2d88a531b7e4dbf4016dca4b1ba3b5dc34256cf4 Author: Simon Peyton Jones Date: Fri Jul 24 12:50:42 2015 +0100 Improve warnings for rules that might not fire Two main things here * Previously we only warned about the "head" function of the rule, but actually the warning applies to any free variable on the LHS. * We now warn not only when one of these free vars can inline, but also if it has an active RULE (c.f. Trac #10528) See Note [Rules and inlining/other rules] in Desugar This actually shows up quite a few warnings in the libraries, notably in Control.Arrow, where it correctly points out that rules like "compose/arr" forall f g . (arr f) . (arr g) = arr (f . g) might never fire, because the rule for 'arr' (dictionary selection) might fire first. I'm not really sure what to do here; there is some discussion in Trac #10595. A minor change is adding BasicTypes.pprRuleName to pretty-print RuleName. >--------------------------------------------------------------- 2d88a531b7e4dbf4016dca4b1ba3b5dc34256cf4 compiler/basicTypes/BasicTypes.hs | 39 ++++++- compiler/deSugar/Desugar.hs | 113 +++++++++++++++------ compiler/iface/IfaceSyn.hs | 2 +- compiler/iface/TcIface.hs | 5 +- compiler/typecheck/TcRnTypes.hs | 2 +- .../tests/indexed-types/should_compile/Rules1.hs | 1 + .../tests/indexed-types/should_compile/T2291.hs | 18 +++- testsuite/tests/simplCore/should_compile/T5776.hs | 16 +-- .../simplCore/should_compile/T6082-RULE.stderr | 8 +- testsuite/tests/simplCore/should_compile/T7287.hs | 11 ++ testsuite/tests/typecheck/should_compile/tc111.hs | 1 + 11 files changed, 167 insertions(+), 49 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 2d88a531b7e4dbf4016dca4b1ba3b5dc34256cf4 From git at git.haskell.org Mon Jul 27 14:55:05 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 27 Jul 2015 14:55:05 +0000 (UTC) Subject: [commit: ghc] master: Revert "RetainerProfile: Add missing UNTAG_STATIC_LIST_PTR" (09925c3) Message-ID: <20150727145505.B55203A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/09925c364c3fb7d3e8610f8c3ae26238d2941fc0/ghc >--------------------------------------------------------------- commit 09925c364c3fb7d3e8610f8c3ae26238d2941fc0 Author: Simon Marlow Date: Mon Jul 27 15:51:08 2015 +0100 Revert "RetainerProfile: Add missing UNTAG_STATIC_LIST_PTR" This reverts commit 09d05050346c1be7bac20ba3f40861e05217368b. >--------------------------------------------------------------- 09925c364c3fb7d3e8610f8c3ae26238d2941fc0 rts/RetainerProfile.c | 1 - 1 file changed, 1 deletion(-) diff --git a/rts/RetainerProfile.c b/rts/RetainerProfile.c index ba58c19..8121def 100644 --- a/rts/RetainerProfile.c +++ b/rts/RetainerProfile.c @@ -1882,7 +1882,6 @@ resetStaticObjectForRetainerProfiling( StgClosure *static_objects ) #endif p = static_objects; while (p != END_OF_STATIC_OBJECT_LIST) { - p = UNTAG_STATIC_LIST_PTR(p); #ifdef DEBUG_RETAINER count++; #endif From git at git.haskell.org Mon Jul 27 14:55:08 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Mon, 27 Jul 2015 14:55:08 +0000 (UTC) Subject: [commit: ghc] master: Revert "Eliminate zero_static_objects_list()" (a1e8620) Message-ID: <20150727145508.949CE3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a1e8620fa2840f1f18297d784a2d2b174b27f566/ghc >--------------------------------------------------------------- commit a1e8620fa2840f1f18297d784a2d2b174b27f566 Author: Simon Marlow Date: Mon Jul 27 15:51:16 2015 +0100 Revert "Eliminate zero_static_objects_list()" This reverts commit b949c96b4960168a3b399fe14485b24a2167b982. >--------------------------------------------------------------- a1e8620fa2840f1f18297d784a2d2b174b27f566 compiler/codeGen/StgCmmHeap.hs | 5 +-- rts/CheckUnload.c | 6 +-- rts/RetainerProfile.c | 2 +- rts/sm/Compact.c | 4 +- rts/sm/Evac.c | 95 ++++++++++++++++++++++++++---------------- rts/sm/GC.c | 48 +++++++++++++++------ rts/sm/GCAux.c | 10 ++--- rts/sm/GCThread.h | 7 +--- rts/sm/Sanity.c | 3 +- rts/sm/Scav.c | 11 +++-- rts/sm/Storage.c | 10 ++--- rts/sm/Storage.h | 57 ++----------------------- 12 files changed, 121 insertions(+), 137 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 a1e8620fa2840f1f18297d784a2d2b174b27f566 From git at git.haskell.org Tue Jul 28 11:23:03 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 28 Jul 2015 11:23:03 +0000 (UTC) Subject: [commit: ghc] master: Test case for #10698 (e343c0a) Message-ID: <20150728112303.ADBEF3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e343c0a7fbaca4285a89008e5e23d35a50603763/ghc >--------------------------------------------------------------- commit e343c0a7fbaca4285a89008e5e23d35a50603763 Author: Joachim Breitner Date: Tue Jul 28 13:19:34 2015 +0200 Test case for #10698 the expected error message is from an older version of GHC; I don?t know the exact error message that we should get here until the bug is fixed... >--------------------------------------------------------------- e343c0a7fbaca4285a89008e5e23d35a50603763 testsuite/tests/typecheck/should_fail/T10698.hs | 23 ++++++++++++++++++++++ .../tests/typecheck/should_fail/T10698.stderr | 10 ++++++++++ testsuite/tests/typecheck/should_fail/all.T | 1 + 3 files changed, 34 insertions(+) diff --git a/testsuite/tests/typecheck/should_fail/T10698.hs b/testsuite/tests/typecheck/should_fail/T10698.hs new file mode 100644 index 0000000..512a882 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T10698.hs @@ -0,0 +1,23 @@ +{-# LANGUAGE RoleAnnotations #-} + +module T10698 where +import Data.Coerce + +data Map k a = Map k a +type role Map nominal representational + +map1 :: (k1->k2) -> Map k1 a -> Map k2 a +map1 f (Map a b) = Map (f a) b +{-# NOINLINE [1] map1 #-} +{-# RULES +"map1/coerce" map1 coerce = coerce + #-} + + +map2 :: (a -> b) -> Map k a -> Map k b +map2 f (Map a b) = Map a (f b) +{-# NOINLINE [1] map2 #-} + +{-# RULES +"map2/coerce" map2 coerce = coerce + #-} diff --git a/testsuite/tests/typecheck/should_fail/T10698.stderr b/testsuite/tests/typecheck/should_fail/T10698.stderr new file mode 100644 index 0000000..fa3aa5f --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T10698.stderr @@ -0,0 +1,10 @@ + +T10698.hs:13:29: + Could not coerce from ?Map k1 a? to ?Map k2 a? + because the first type argument of ?Map? has role Nominal, + but the arguments ?k1? and ?k2? differ + arising from a use of ?coerce? + from the context (Coercible k1 k2) + bound by the RULE "map1/coerce" at T10698.hs:13:1-34 + In the expression: coerce + When checking the transformation rule "map1/coerce" diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T index fbbeddb..bc2b3c9 100644 --- a/testsuite/tests/typecheck/should_fail/all.T +++ b/testsuite/tests/typecheck/should_fail/all.T @@ -374,3 +374,4 @@ test('ExpandSynsFail1', normal, compile_fail, ['-fprint-expanded-synonyms']) test('ExpandSynsFail2', normal, compile_fail, ['-fprint-expanded-synonyms']) test('ExpandSynsFail3', normal, compile_fail, ['-fprint-expanded-synonyms']) test('ExpandSynsFail4', normal, compile_fail, ['-fprint-expanded-synonyms']) +test('T10698', expect_broken(10698), compile_fail, ['']) From git at git.haskell.org Tue Jul 28 16:45:36 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 28 Jul 2015 16:45:36 +0000 (UTC) Subject: [commit: ghc] master: Fallout from more assiduous RULE warnings (a1dd7dd) Message-ID: <20150728164536.393743A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a1dd7dd6ea276832aef0caaf805f0ab9f4e16262/ghc >--------------------------------------------------------------- commit a1dd7dd6ea276832aef0caaf805f0ab9f4e16262 Author: Simon Peyton Jones Date: Tue Jul 28 16:00:20 2015 +0100 Fallout from more assiduous RULE warnings GHC now warns if rules compete, so that it's not predicatable which will work and which will not. E.g. {-# RULES f (g x) = ... g True = ... #-} If we had (f (g True)) it's not clear which rule would fire. This showed up fraility in the libraries. * Suppress warnigns in Control.Arrow, Control.Category for class methods. At the moment we simply don't have a good way to write a RULE with a class method in the LHS. See Trac #1595. Arrow and Category attempt to do so; I have silenced the complaints with -fno-warn-inline-rule-shadowing, but it's not a great solution. * Adjust the NOINLINE pragma on 'GHC.Base.map' to account for the map/coerce rule * Adjust the rewrite rules in Enum, especially for the "literal 1" case. See Note [Enum Integer rules for literal 1]. * Suppress warnings for 'bytestring' e.g. libraries/bytestring/Data/ByteString.hs:895:1: warning: Rule "ByteString specialise break (x==)" may never fire because rule "Class op ==" for ?==? might fire first Probable fix: add phase [n] or [~n] to the competing rule >--------------------------------------------------------------- a1dd7dd6ea276832aef0caaf805f0ab9f4e16262 libraries/base/Control/Arrow.hs | 3 ++ libraries/base/Control/Category.hs | 3 ++ libraries/base/GHC/Base.hs | 7 +++-- libraries/base/GHC/Enum.hs | 60 ++++++++++++++++++++++++++++++-------- mk/warnings.mk | 3 ++ 5 files changed, 61 insertions(+), 15 deletions(-) diff --git a/libraries/base/Control/Arrow.hs b/libraries/base/Control/Arrow.hs index e9dd781..9d09544 100644 --- a/libraries/base/Control/Arrow.hs +++ b/libraries/base/Control/Arrow.hs @@ -1,5 +1,8 @@ {-# LANGUAGE Trustworthy #-} {-# LANGUAGE NoImplicitPrelude #-} +{-# OPTIONS_GHC -fno-warn-inline-rule-shadowing #-} + -- The RULES for the methods of class Arrow may never fire + -- e.g. compose/arr; see Trac #10528 ----------------------------------------------------------------------------- -- | diff --git a/libraries/base/Control/Category.hs b/libraries/base/Control/Category.hs index ab7740b..8616a17 100644 --- a/libraries/base/Control/Category.hs +++ b/libraries/base/Control/Category.hs @@ -2,6 +2,9 @@ {-# LANGUAGE GADTs #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE PolyKinds #-} +{-# OPTIONS_GHC -fno-warn-inline-rule-shadowing #-} + -- The RULES for the methods of class Category may never fire + -- e.g. identity/left, identity/right, association; see Trac #10528 ----------------------------------------------------------------------------- -- | diff --git a/libraries/base/GHC/Base.hs b/libraries/base/GHC/Base.hs index e15519d..9bd6124 100644 --- a/libraries/base/GHC/Base.hs +++ b/libraries/base/GHC/Base.hs @@ -853,9 +853,10 @@ augment g xs = g (:) xs -- > map f [x1, x2, ...] == [f x1, f x2, ...] map :: (a -> b) -> [a] -> [b] -{-# NOINLINE [1] map #-} -- We want the RULE to fire first. - -- It's recursive, so won't inline anyway, - -- but saying so is more explicit +{-# NOINLINE [0] map #-} + -- We want the RULEs "map" and "map/coerce" to fire first. + -- map is recursive, so won't inline anyway, + -- but saying so is more explicit, and silences warnings map _ [] = [] map f (x:xs) = f x : map f xs diff --git a/libraries/base/GHC/Enum.hs b/libraries/base/GHC/Enum.hs index b634516..2ba6dda 100644 --- a/libraries/base/GHC/Enum.hs +++ b/libraries/base/GHC/Enum.hs @@ -344,6 +344,7 @@ instance Enum Char where {-# INLINE enumFromThenTo #-} enumFromThenTo (C# x1) (C# x2) (C# y) = efdtChar (ord# x1) (ord# x2) (ord# y) +-- See Note [How the Enum rules work] {-# RULES "eftChar" [~1] forall x y. eftChar x y = build (\c n -> eftCharFB c n x y) "efdChar" [~1] forall x1 x2. efdChar x1 x2 = build (\ c n -> efdCharFB c n x1 x2) @@ -482,6 +483,13 @@ instance Enum Int where "eftIntList" [1] eftIntFB (:) [] = eftInt #-} +{- Note [How the Enum rules work] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +* Phase 2: eftInt ---> build . eftIntFB +* Phase 1: inline build; eftIntFB (:) --> eftInt +* Phase 0: optionally inline eftInt +-} + {-# NOINLINE [1] eftInt #-} eftInt :: Int# -> Int# -> [Int] -- [x1..x2] @@ -510,6 +518,7 @@ eftIntFB c n x0 y | isTrue# (x0 ># y) = n -- efdInt and efdtInt deal with [a,b..] and [a,b..c]. -- The code is more complicated because of worries about Int overflow. +-- See Note [How the Enum rules work] {-# RULES "efdtInt" [~1] forall x1 x2 y. efdtInt x1 x2 y = build (\ c n -> efdtIntFB c n x1 x2 y) @@ -667,13 +676,32 @@ instance Enum Integer where enumFromTo x lim = enumDeltaToInteger x 1 lim enumFromThenTo x y lim = enumDeltaToInteger x (y-x) lim +-- See Note [How the Enum rules work] {-# RULES -"enumDeltaInteger" [~1] forall x y. enumDeltaInteger x y = build (\c _ -> enumDeltaIntegerFB c x y) -"efdtInteger" [~1] forall x y l.enumDeltaToInteger x y l = build (\c n -> enumDeltaToIntegerFB c n x y l) -"enumDeltaInteger" [1] enumDeltaIntegerFB (:) = enumDeltaInteger -"enumDeltaToInteger" [1] enumDeltaToIntegerFB (:) [] = enumDeltaToInteger +"enumDeltaInteger" [~1] forall x y. enumDeltaInteger x y = build (\c _ -> enumDeltaIntegerFB c x y) +"efdtInteger" [~1] forall x d l. enumDeltaToInteger x d l = build (\c n -> enumDeltaToIntegerFB c n x d l) +"efdtInteger1" [~1] forall x l. enumDeltaToInteger x 1 l = build (\c n -> enumDeltaToInteger1FB c n x l) + +"enumDeltaToInteger1FB" [1] forall c n x. enumDeltaToIntegerFB c n x 1 = enumDeltaToInteger1FB c n x + +"enumDeltaInteger" [1] enumDeltaIntegerFB (:) = enumDeltaInteger +"enumDeltaToInteger" [1] enumDeltaToIntegerFB (:) [] = enumDeltaToInteger +"enumDeltaToInteger1" [1] enumDeltaToInteger1FB (:) [] = enumDeltaToInteger1 #-} +{- +The "1" rules above specialise for the common case where delta = 1, +so that we can avoid the delta>=0 test in enumDeltaToIntegerFB. +Then enumDeltaToInteger1FB is nice and small and can be inlined, +which would allow the constructor to be inlined and good things to happen. + +We match on the literal "1" both in phase 2 (rule "efdtInteger1") and +phase 1 (rule "enumDeltaToInteger1FB"), just for belt and braces + +We do not do it for Int this way because hand-tuned code already exists, and +the special case varies more from the general case, due to the issue of overflows. +-} + {-# NOINLINE [0] enumDeltaIntegerFB #-} enumDeltaIntegerFB :: (Integer -> b -> b) -> Integer -> Integer -> b enumDeltaIntegerFB c x d = x `seq` (x `c` enumDeltaIntegerFB c (x+d) d) @@ -693,14 +721,14 @@ enumDeltaToIntegerFB c n x delta lim | delta >= 0 = up_fb c n x delta lim | otherwise = dn_fb c n x delta lim -{-# RULES -"enumDeltaToInteger1" [0] forall c n x . enumDeltaToIntegerFB c n x 1 = up_fb c n x 1 - #-} --- This rule ensures that in the common case (delta = 1), we do not do the check here, --- and also that we have the chance to inline up_fb, which would allow the constructor to be --- inlined and good things to happen. --- We do not do it for Int this way because hand-tuned code already exists, and --- the special case varies more from the general case, due to the issue of overflows. +{-# NOINLINE [0] enumDeltaToInteger1FB #-} +-- Don't inline this until RULE "enumDeltaToInteger" has had a chance to fire +enumDeltaToInteger1FB :: (Integer -> a -> a) -> a + -> Integer -> Integer -> a +enumDeltaToInteger1FB c n x0 lim = go (x0 :: Integer) + where + go x | x > lim = n + | otherwise = x `c` go (x+1) {-# NOINLINE [1] enumDeltaToInteger #-} enumDeltaToInteger :: Integer -> Integer -> Integer -> [Integer] @@ -708,6 +736,14 @@ enumDeltaToInteger x delta lim | delta >= 0 = up_list x delta lim | otherwise = dn_list x delta lim +{-# NOINLINE [1] enumDeltaToInteger1 #-} +enumDeltaToInteger1 :: Integer -> Integer -> [Integer] +-- Special case for Delta = 1 +enumDeltaToInteger1 x0 lim = go (x0 :: Integer) + where + go x | x > lim = [] + | otherwise = x : go (x+1) + up_fb :: (Integer -> a -> a) -> a -> Integer -> Integer -> Integer -> a up_fb c n x0 delta lim = go (x0 :: Integer) where diff --git a/mk/warnings.mk b/mk/warnings.mk index 22acf9a..2e82428 100644 --- a/mk/warnings.mk +++ b/mk/warnings.mk @@ -37,6 +37,9 @@ utils/hpc_dist-install_EXTRA_HC_OPTS += -fwarn-tabs ###################################################################### # Disable some warnings in packages we use +# Libraries that have dubious RULES +libraries/bytestring_dist-install_EXTRA_HC_OPTS += -fno-warn-inline-rule-shadowing + # Cabal doesn't promise to be warning-free utils/ghc-cabal_dist_EXTRA_HC_OPTS += -w libraries/Cabal/Cabal_dist-boot_EXTRA_HC_OPTS += -w From git at git.haskell.org Tue Jul 28 19:57:34 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Tue, 28 Jul 2015 19:57:34 +0000 (UTC) Subject: [commit: ghc] master: Eliminate zero_static_objects_list() (f83aab9) Message-ID: <20150728195734.ADA563A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/f83aab95f59ae9b29f22fc7924e050512229cb9c/ghc >--------------------------------------------------------------- commit f83aab95f59ae9b29f22fc7924e050512229cb9c Author: Simon Marlow Date: Tue Jul 28 20:58:25 2015 +0100 Eliminate zero_static_objects_list() Summary: [Revised version of D1076 that was committed and then backed out] In a workload with a large amount of code, zero_static_objects_list() takes a significant amount of time, and furthermore it is in the single-threaded part of the GC. This patch uses a slightly fiddly scheme for marking objects on the static object lists, using a flag in the low 2 bits that flips between two states to indicate whether an object has been visited during this GC or not. We also have to take into account objects that have not been visited yet, which might appear at any time due to runtime linking. Test Plan: validate Reviewers: austin, ezyang, rwbarton, bgamari, thomie Reviewed By: bgamari, thomie Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1106 >--------------------------------------------------------------- f83aab95f59ae9b29f22fc7924e050512229cb9c compiler/codeGen/StgCmmHeap.hs | 5 ++- rts/CheckUnload.c | 6 ++- rts/RetainerProfile.c | 3 +- rts/sm/Compact.c | 4 +- rts/sm/Evac.c | 95 ++++++++++++++++-------------------------- rts/sm/GC.c | 48 ++++++--------------- rts/sm/GCAux.c | 11 +++-- rts/sm/GCThread.h | 7 +++- rts/sm/Sanity.c | 3 +- rts/sm/Scav.c | 11 ++--- rts/sm/Storage.c | 10 ++--- rts/sm/Storage.h | 57 +++++++++++++++++++++++-- 12 files changed, 139 insertions(+), 121 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 f83aab95f59ae9b29f22fc7924e050512229cb9c From git at git.haskell.org Wed Jul 29 09:37:50 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 29 Jul 2015 09:37:50 +0000 (UTC) Subject: [commit: ghc] wip/impredicativity: Merge remote-tracking branch 'origin/master' into wip/impredicativity (a87bb2b) Message-ID: <20150729093750.7D9073A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/impredicativity Link : http://ghc.haskell.org/trac/ghc/changeset/a87bb2b35a9af784de688fe50cc2daea3090f5de/ghc >--------------------------------------------------------------- commit a87bb2b35a9af784de688fe50cc2daea3090f5de Merge: 6b05f0c 474d4cc Author: Alejandro Serrano Date: Mon Jul 27 17:05:10 2015 +0200 Merge remote-tracking branch 'origin/master' into wip/impredicativity Conflicts: compiler/typecheck/Inst.hs compiler/typecheck/TcBinds.hs compiler/typecheck/TcExpr.hs compiler/typecheck/TcRnTypes.hs compiler/types/Unify.hs >--------------------------------------------------------------- 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 a87bb2b35a9af784de688fe50cc2daea3090f5de From git at git.haskell.org Wed Jul 29 09:37:53 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 29 Jul 2015 09:37:53 +0000 (UTC) Subject: [commit: ghc] wip/impredicativity: Fix problem with double-pass simpleOpt (15583fd) Message-ID: <20150729093753.41E6F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/impredicativity Link : http://ghc.haskell.org/trac/ghc/changeset/15583fdcc499e8962518e5e38495576f9333ba83/ghc >--------------------------------------------------------------- commit 15583fdcc499e8962518e5e38495576f9333ba83 Author: Alejandro Serrano Date: Wed Jul 29 08:00:15 2015 +0200 Fix problem with double-pass simpleOpt >--------------------------------------------------------------- 15583fdcc499e8962518e5e38495576f9333ba83 compiler/coreSyn/CoreSubst.hs | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/compiler/coreSyn/CoreSubst.hs b/compiler/coreSyn/CoreSubst.hs index 3a821d5..47d7905 100644 --- a/compiler/coreSyn/CoreSubst.hs +++ b/compiler/coreSyn/CoreSubst.hs @@ -888,7 +888,7 @@ simpleOptPgm dflags this_mod binds rules vects (subst', binds') = foldl do_one (emptySubst, []) occ_anald_binds do_one (subst, binds') bind - = case simple_opt_bind subst bind of + = case simple_opt_bind_pgm subst bind of (subst', Nothing) -> (subst', binds') (subst', Just bind') -> (subst', bind':binds') @@ -988,11 +988,16 @@ simple_app subst e as = foldl App (simple_opt_expr subst e) as ---------------------- -simple_opt_bind,simple_opt_bind' :: Subst -> CoreBind -> (Subst, Maybe CoreBind) +simple_opt_bind,simple_opt_bind',simple_opt_bind_pgm + :: Subst -> CoreBind -> (Subst, Maybe CoreBind) simple_opt_bind s b -- Can add trace stuff here = simple_opt_bind' s b -simple_opt_bind' subst (Rec prs) +simple_opt_bind' = simple_opt_bind'' False +simple_opt_bind_pgm = simple_opt_bind'' True + +simple_opt_bind'' :: Bool -> Subst -> CoreBind -> (Subst, Maybe CoreBind) +simple_opt_bind'' two_passes subst (Rec prs) = (subst'', res_bind) where res_bind = Just (Rec (reverse rev_prs')) @@ -1004,11 +1009,13 @@ simple_opt_bind' subst (Rec prs) Nothing -> (subst, (b2,r2):prs) where b2 = add_info subst b b' - -- Make two passes of simplification - r2 = simple_opt_expr subst (simple_opt_expr subst r) + r2 = if two_passes + then simple_opt_expr subst (simple_opt_expr subst r) + else simple_opt_expr subst r -simple_opt_bind' subst (NonRec b r) - -- Make two passes of simplification +simple_opt_bind'' False subst (NonRec b r) + = simple_opt_out_bind subst (b, simple_opt_expr subst r) +simple_opt_bind'' True subst (NonRec b r) -- Two passes = simple_opt_out_bind subst (b, simple_opt_expr subst (simple_opt_expr subst r)) ---------------------- From git at git.haskell.org Wed Jul 29 09:37:56 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 29 Jul 2015 09:37:56 +0000 (UTC) Subject: [commit: ghc] wip/impredicativity: Instantiation in approximation is now deep (3d5a3f2) Message-ID: <20150729093756.237013A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/impredicativity Link : http://ghc.haskell.org/trac/ghc/changeset/3d5a3f20e1c849992783c794e30cfc2e2fd57ae2/ghc >--------------------------------------------------------------- commit 3d5a3f20e1c849992783c794e30cfc2e2fd57ae2 Author: Alejandro Serrano Date: Wed Jul 29 08:00:39 2015 +0200 Instantiation in approximation is now deep If we have a left-over constraint `forall a. Q => (forall b. Q' => t) <~ v` previously it would be approximated to `v ~ [a -> alpha](forall b. Q' => t) /\ [a -> alpha]Q` whereas now it is approximated to `v ~ [a -> alpha, b -> beta]t /\ [a -> alpha]Q /\ [a -> alpha, b -> beta]Q'` This fixes several problems compiling the base Data.Category module. >--------------------------------------------------------------- 3d5a3f20e1c849992783c794e30cfc2e2fd57ae2 compiler/typecheck/TcRules.hs | 26 ++++++++++++++++++++------ compiler/typecheck/TcSMonad.hs | 23 +++++++++++++++++------ compiler/typecheck/TcSimplify.hs | 2 +- 3 files changed, 38 insertions(+), 13 deletions(-) diff --git a/compiler/typecheck/TcRules.hs b/compiler/typecheck/TcRules.hs index 7a12cfa..4803aa7 100644 --- a/compiler/typecheck/TcRules.hs +++ b/compiler/typecheck/TcRules.hs @@ -317,10 +317,10 @@ simplifyRule name lhs_wanted rhs_wanted ; let lhs_wanted_simple = wc_simple lhs_wanted ; (lhs_wanted_inst, _) <- runTcS $ fmap andManyCts $ mapM instantiateWC (bagToList lhs_wanted_simple) - ; let same_type x y = ctPred x == ctPred y - none_with_same_type x = not (anyBag (same_type x) lhs_wanted_simple) - lhs_wanted_inst' = filterBag none_with_same_type lhs_wanted_inst - + ; let lhs_wanted_inst' = remove_duplicates lhs_wanted_simple lhs_wanted_inst + -- Build new WantedConstraints by adding the new instantiated + -- We need to be careful not to duplicate constraints, + -- because it would lead to too many forall's ; let new_lhs_wanted_simple = wc_simple lhs_wanted `unionBags` lhs_wanted_inst' new_lhs_wanted = lhs_wanted { wc_simple = new_lhs_wanted_simple } @@ -331,8 +331,15 @@ simplifyRule name lhs_wanted rhs_wanted ; rhs_resid <- solveWanteds rhs_wanted ; return (insolubleWC tc_lvl lhs_resid || insolubleWC tc_lvl rhs_resid) } - ; zonked_lhs_simples <- zonkSimples new_lhs_wanted_simple - ; let (q_cts, non_q_cts) = partitionBag quantify_me zonked_lhs_simples + ; zonked_lhs_simples <- zonkSimples (wc_simple lhs_wanted) + ; zonked_lhs_inst <- zonkSimples lhs_wanted_inst' + -- We need to remove duplicates once again, + -- because we might get new duplicated constraints + -- from unification of variables + ; let zonked_lhs = zonked_lhs_simples `unionBags` + remove_duplicates zonked_lhs_simples zonked_lhs_inst + + ; let (q_cts, non_q_cts) = partitionBag quantify_me zonked_lhs quantify_me -- Note [RULE quantification over equalities] | insoluble = quantify_insol | otherwise = quantify_normal @@ -358,3 +365,10 @@ simplifyRule name lhs_wanted rhs_wanted ; return ( map (ctEvId . ctEvidence) (bagToList q_cts) , lhs_wanted { wc_simple = non_q_cts }) } + +remove_duplicates :: Cts -> Cts -> Cts +remove_duplicates main new + = filterBag none_with_same_type new + where + same_type x y = ctPred x == ctPred y + none_with_same_type x = not (anyBag (same_type x) main) diff --git a/compiler/typecheck/TcSMonad.hs b/compiler/typecheck/TcSMonad.hs index cf391ce..a0c36d4 100644 --- a/compiler/typecheck/TcSMonad.hs +++ b/compiler/typecheck/TcSMonad.hs @@ -15,8 +15,8 @@ module TcSMonad ( TcS, runTcS, runTcSWithEvBinds, failTcS, tryTcS, nestTcS, nestImplicTcS, recoverTcS, - runTcPluginTcS, addUsedRdrNamesTcS, deferTcSForAllEq, splitInst, - deferTcSForAllInstanceOf, + runTcPluginTcS, addUsedRdrNamesTcS, deferTcSForAllEq, + splitInst, deeplySplitInst, deferTcSForAllInstanceOf, -- Tracing etc panicTcS, traceTcS, @@ -2930,7 +2930,18 @@ splitInst :: Type -> TcS ([TyVar], ThetaType, Type) splitInst sigma = do { let (qvars, q, ty) = tcSplitSigmaTy sigma -- instantiate variables for q and ty - ; (subst, inst_vars) <- wrapTcS $ TcM.tcInstTyVars qvars - ; let q_subst = map (Type.substTy subst) q - ty_subst = Type.substTy subst ty - ; return (inst_vars, q_subst, ty_subst) } + ; (subst, inst_vars) <- wrapTcS $ TcM.tcInstTyVars qvars + ; let q_subst = map (Type.substTy subst) q + ty_subst = Type.substTy subst ty + ; return (inst_vars, q_subst, ty_subst) } + +-- Split a sigma type and instantiate its variables, deeply +deeplySplitInst :: Type -> TcS ([TyVar], ThetaType, Type) +deeplySplitInst sigma + = do { (qvars, q, ty) <- splitInst sigma + ; case (qvars, q) of + ([], []) + -> return (qvars, q, ty) + (_, _) + -> do { (qvars', q', ty') <- deeplySplitInst ty + ; return ( qvars ++ qvars', q ++ q', ty') } } diff --git a/compiler/typecheck/TcSimplify.hs b/compiler/typecheck/TcSimplify.hs index e37df77..f080c09 100644 --- a/compiler/typecheck/TcSimplify.hs +++ b/compiler/typecheck/TcSimplify.hs @@ -1366,7 +1366,7 @@ instantiateWC :: Ct -> TcS Cts instantiateWC ct | isWantedCt ct, InstanceOfPred lhs rhs <- classifyPredType (ctPred ct) = do { let loc = ctLoc ct - ; (_qvars, q, ty) <- splitInst lhs + ; (_qvars, q, ty) <- deeplySplitInst lhs ; new_ev_qs <- mapM (newWantedEvVarNC loc) q ; let eq = mkTcEqPred ty rhs ; new_ev_ty <- newWantedEvVarNC loc eq From git at git.haskell.org Wed Jul 29 09:37:58 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 29 Jul 2015 09:37:58 +0000 (UTC) Subject: [commit: ghc] wip/impredicativity: Change rule for canonicalization of <~ (a406ce2) Message-ID: <20150729093758.E36783A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/impredicativity Link : http://ghc.haskell.org/trac/ghc/changeset/a406ce26198357e137b18c2d388899113be86cb6/ghc >--------------------------------------------------------------- commit a406ce26198357e137b18c2d388899113be86cb6 Author: Alejandro Serrano Date: Wed Jul 29 08:46:14 2015 +0200 Change rule for canonicalization of <~ Now, if the LHS is not a forall, we always turn it into ~. >--------------------------------------------------------------- a406ce26198357e137b18c2d388899113be86cb6 compiler/typecheck/TcCanonical.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/typecheck/TcCanonical.hs b/compiler/typecheck/TcCanonical.hs index b1ea1da..169faee 100644 --- a/compiler/typecheck/TcCanonical.hs +++ b/compiler/typecheck/TcCanonical.hs @@ -1708,7 +1708,7 @@ can_instance_of (CInstanceOfCan { cc_ev = ev, cc_lhs = lhs, cc_rhs = rhs }) = can_instance_inst ev lhs rhs -- case InstanceOf (T ...) sigma --> T ... ~ sigma -- case InstanceOf var sigma --> var ~ sigma, var immutable - | is_tyapp_or_skolem lhs + | not (is_forall lhs) -- is_tyapp_or_skolem lhs = can_instance_to_eq ev lhs rhs -- already canonical | otherwise = continueWith (CIrredEvCan { cc_ev = ev }) From git at git.haskell.org Wed Jul 29 09:38:01 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 29 Jul 2015 09:38:01 +0000 (UTC) Subject: [commit: ghc] wip/impredicativity: Fix problem in RULES simplification (604c8d4) Message-ID: <20150729093801.9B6013A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/impredicativity Link : http://ghc.haskell.org/trac/ghc/changeset/604c8d446027651f50b886b2fb81a500d1375ef8/ghc >--------------------------------------------------------------- commit 604c8d446027651f50b886b2fb81a500d1375ef8 Author: Alejandro Serrano Date: Wed Jul 29 09:50:11 2015 +0200 Fix problem in RULES simplification >--------------------------------------------------------------- 604c8d446027651f50b886b2fb81a500d1375ef8 compiler/coreSyn/CoreSubst.hs | 28 ++++++++++++++-------------- compiler/deSugar/DsBinds.hs | 8 ++++++++ 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/compiler/coreSyn/CoreSubst.hs b/compiler/coreSyn/CoreSubst.hs index 47d7905..f69e512 100644 --- a/compiler/coreSyn/CoreSubst.hs +++ b/compiler/coreSyn/CoreSubst.hs @@ -866,9 +866,13 @@ simpleOptExpr expr -- It's a bit painful to call exprFreeVars, because it makes -- three passes instead of two (occ-anal, and go) +simplePassesOfSimplification :: Int +simplePassesOfSimplification = 3 + simpleOptExprWith :: Subst -> InExpr -> OutExpr --- Make two passes of simplification -simpleOptExprWith subst = simpleOptExprWith_ subst . simpleOptExprWith_ subst +-- Make three passes of simplification +simpleOptExprWith subst expr + = iterate (simpleOptExprWith_ subst) expr !! simplePassesOfSimplification simpleOptExprWith_ :: Subst -> InExpr -> OutExpr simpleOptExprWith_ subst expr = simple_opt_expr subst (occurAnalyseExpr expr) @@ -993,11 +997,11 @@ simple_opt_bind,simple_opt_bind',simple_opt_bind_pgm simple_opt_bind s b -- Can add trace stuff here = simple_opt_bind' s b -simple_opt_bind' = simple_opt_bind'' False -simple_opt_bind_pgm = simple_opt_bind'' True +simple_opt_bind' = simple_opt_bind'' 1 +simple_opt_bind_pgm = simple_opt_bind'' simplePassesOfSimplification -simple_opt_bind'' :: Bool -> Subst -> CoreBind -> (Subst, Maybe CoreBind) -simple_opt_bind'' two_passes subst (Rec prs) +simple_opt_bind'' :: Int -> Subst -> CoreBind -> (Subst, Maybe CoreBind) +simple_opt_bind'' simpl_passes subst (Rec prs) = (subst'', res_bind) where res_bind = Just (Rec (reverse rev_prs')) @@ -1009,14 +1013,10 @@ simple_opt_bind'' two_passes subst (Rec prs) Nothing -> (subst, (b2,r2):prs) where b2 = add_info subst b b' - r2 = if two_passes - then simple_opt_expr subst (simple_opt_expr subst r) - else simple_opt_expr subst r - -simple_opt_bind'' False subst (NonRec b r) - = simple_opt_out_bind subst (b, simple_opt_expr subst r) -simple_opt_bind'' True subst (NonRec b r) -- Two passes - = simple_opt_out_bind subst (b, simple_opt_expr subst (simple_opt_expr subst r)) + r2 = iterate (simple_opt_expr subst) r !! simpl_passes + +simple_opt_bind'' simpl_passes subst (NonRec b r) + = simple_opt_out_bind subst (b, iterate (simple_opt_expr subst) r !! simpl_passes) ---------------------- simple_opt_out_bind :: Subst -> (InVar, OutExpr) -> (Subst, Maybe CoreBind) diff --git a/compiler/deSugar/DsBinds.hs b/compiler/deSugar/DsBinds.hs index ee1a009..5ff14fe 100644 --- a/compiler/deSugar/DsBinds.hs +++ b/compiler/deSugar/DsBinds.hs @@ -631,6 +631,14 @@ decomposeRuleLhs orig_bndrs orig_lhs split_lets :: CoreExpr -> ([(DictId,CoreExpr)], CoreExpr) split_lets e + -- <~ constraints sometimes lead to dictionaries + -- of the form $dict1 = $dict2. + -- Those dictionaries shall not be removed, + -- otherwise the code will be deemed wrong. + | Let (NonRec d r) _body <- e + , isDictId d + , Var _ <- r + = ([], e) | Let (NonRec d r) body <- e , isDictId d , (bs, body') <- split_lets body From git at git.haskell.org Wed Jul 29 09:38:04 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 29 Jul 2015 09:38:04 +0000 (UTC) Subject: [commit: ghc] wip/impredicativity: Introduce InstanceOfRefl evidence to match description (b8494a6) Message-ID: <20150729093804.7ECA23A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/impredicativity Link : http://ghc.haskell.org/trac/ghc/changeset/b8494a61be1b1b7c1186fb366f2e2b2644abd074/ghc >--------------------------------------------------------------- commit b8494a61be1b1b7c1186fb366f2e2b2644abd074 Author: Alejandro Serrano Date: Wed Jul 29 10:04:14 2015 +0200 Introduce InstanceOfRefl evidence to match description >--------------------------------------------------------------- b8494a61be1b1b7c1186fb366f2e2b2644abd074 compiler/deSugar/DsBinds.hs | 2 ++ compiler/typecheck/TcCanonical.hs | 6 +++++- compiler/typecheck/TcEvidence.hs | 27 ++++++++++++++++++++------- compiler/typecheck/TcHsSyn.hs | 2 ++ compiler/typecheck/TcRnTypes.hs | 7 +++---- docs/types/impredicativity.ltx | 28 ++++++++++++++-------------- 6 files changed, 46 insertions(+), 26 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 b8494a61be1b1b7c1186fb366f2e2b2644abd074 From git at git.haskell.org Wed Jul 29 09:38:07 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 29 Jul 2015 09:38:07 +0000 (UTC) Subject: [commit: ghc] wip/impredicativity: Do not flatten type families in <~ constraints (a8de988) Message-ID: <20150729093807.4E7553A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/impredicativity Link : http://ghc.haskell.org/trac/ghc/changeset/a8de988a7a927cb47ecb24f37bdf9336332d9bd5/ghc >--------------------------------------------------------------- commit a8de988a7a927cb47ecb24f37bdf9336332d9bd5 Author: Alejandro Serrano Date: Wed Jul 29 11:38:50 2015 +0200 Do not flatten type families in <~ constraints >--------------------------------------------------------------- a8de988a7a927cb47ecb24f37bdf9336332d9bd5 compiler/typecheck/TcCanonical.hs | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/compiler/typecheck/TcCanonical.hs b/compiler/typecheck/TcCanonical.hs index 433971e..f5959d4 100644 --- a/compiler/typecheck/TcCanonical.hs +++ b/compiler/typecheck/TcCanonical.hs @@ -1679,8 +1679,8 @@ canInstanceOfNC ev canInstanceOf :: CtEvidence -> TcS (StopOrContinue Ct) canInstanceOf ev = do { let Just (tc, [lhs, rhs]) = splitTyConApp_maybe (ctEvPred ev) - ; (xil, col) <- flatten FM_FlattenAll ev lhs - ; (xir, cor) <- flatten FM_FlattenAll ev rhs + ; (xil, col) <- flatten FM_SubstOnly ev lhs + ; (xir, cor) <- flatten FM_SubstOnly ev rhs ; let co = mkTcTyConAppCo Nominal tc [col, cor] xi = mkInstanceOfPred xil xir mk_ct new_ev = CInstanceOfCan { cc_ev = new_ev @@ -1708,7 +1708,7 @@ can_instance_of (CInstanceOfCan { cc_ev = ev, cc_lhs = lhs, cc_rhs = rhs }) _ -> stopWith ev "Given/Derived instanceOf instantiation" -- case InstanceOf (forall qvars. Q => ty) sigma -- where sigma is T ... or a Skolem tyvar - | is_forall lhs, is_tyapp_or_skolem rhs + | is_forall lhs, not (is_mutable_tyvar rhs) = can_instance_inst ev lhs rhs -- case InstanceOf (T ...) sigma --> T ... ~ sigma -- case InstanceOf var sigma --> var ~ sigma, var immutable @@ -1721,14 +1721,9 @@ can_instance_of (CInstanceOfCan { cc_ev = ev, cc_lhs = lhs, cc_rhs = rhs }) | ([], [], _) <- tcSplitSigmaTy ty = False | otherwise = True - is_tyapp_or_skolem ty - | Just (_, _) <- tcSplitTyConApp_maybe ty - = True -- not (isTypeFamilyTyCon tc) - | (hd, _:_) <- tcSplitAppTys ty - , Just _ <- getTyVar_maybe hd - = True + is_mutable_tyvar ty | Just v <- getTyVar_maybe ty - = isImmutableTyVar v + = not (isImmutableTyVar v) | otherwise = False @@ -1763,12 +1758,5 @@ can_instance_inst ev lhs rhs -- emit new work ; emitWorkNC new_ev_qs ; traceTcS "can_instance_of/INST" (vcat [ ppr new_ev_inst, ppr new_ev_qs ]) - ; case getTyVar_maybe ty of - Just v | v `elem` qvars -- case (forall a. Q => tyvar) - -> do { let eq = mkTcEqPredRole Nominal ty rhs - ; new_ev_eq <- newWantedEvVarNC loc eq - ; setWantedEvBind (ctEvId new_ev_inst) - (mkInstanceOfEq ty (ctEvCoercion new_ev_eq)) - ; canEqNC new_ev_eq NomEq ty rhs } - _ -> canInstanceOfNC new_ev_inst } -- general case + ; canInstanceOfNC new_ev_inst } _ -> stopWith ev "Given/Derived instanceOf instantiation" From git at git.haskell.org Wed Jul 29 09:38:09 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 29 Jul 2015 09:38:09 +0000 (UTC) Subject: [commit: ghc] wip/impredicativity's head updated: Do not flatten type families in <~ constraints (a8de988) Message-ID: <20150729093809.F004F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc Branch 'wip/impredicativity' now includes: 504c2ae Docs: `sortOn = sortBy (comparing f)` [skip ci] 02897c5 Failing test case: idArity invariant check, #10181 e29c2ac CoreUtils: Move seq* functions to CoreSeq ae0e340 CoreUtils: Move size utilities to CoreStats fa33f45 PprCore: Add size annotations for top-level bindings 29f8225 CoreLint: Use size-annotated ppr variant 82f1c78 Fix tests ae96c75 Implement -fprint-expanded-synonyms 415351a Put Opt_Static into defaultFlags if not pc_DYNAMIC_BY_DEFAULT (#7478) 2c5c297 DeriveFoldable for data types with existential constraints (#10447) 2c9de9c Handle Char#, Addr# in TH quasiquoter (fixes #10620) a5e9da8 Fix off-by-one error in GHCi line reporting (Trac #10578) 3448f98 Reduce non-determinism in ABI hashes with RULES and instance decls bc604bd Update assert to fix retc001 and retc002 (#9243) 0d4b074 Travis: actually do debug builds ac0feec Testsuite: small test cleanups f607393 Testsuite: accept new stderr for T9497{a,b,c}-run (#10224) a0371c0 Build system: fail when encountering an unknown package tag dc6e556 Testsuite: mark T2497 expect_broken_for(#10657, ['optasm', 'optllvm']) dcaa486 Testsuite: mark T7919 expect_broken_for(#7919, ['optasm','dyn','optllvm']) 11f8612 Testsuite: mark 3 tests expect_broken_for(#10181, ['optasm', 'optllvm']) 16a8739 Testsuite: mark qq007 and qq008 expect_broken(#10181) cbb4d78 Testsuite: mark qq007 and qq008 expect_broken(#10047) 43dafc9 Testsuite: mark gadt/termination expect_broken_for(#10658, ['optasm','optllvm']) 34bb460 Testsuite: mark array001 and conc034 expect_broken_for(#10659, ['optasm',...]) 9834fea Add regression test for unused implicit parameter warning (#10632) 4c96e7c Testsuite: add ImpredicativeTypes to T7861 (#7861) 7f37274 Testsuite: add -XUndecidableInstances to T3500a 029367e Testsuite: add regression test for missing class constraint 82ffc80 LlvmCodeGen: add support for MO_U_Mul2 CallishMachOp 49373ff Support wild cards in TH splices c526e09 primops: Add haddocks to BCO primops 4cd008b Do not treat prim and javascript imports as C imports in TH and QQ 96de809 Fix primops documentation syntax d71d9a9 Testsuite: fix concprog002 (AMP) 2f18b197 Testsuite: mark concprog002 expect_broken_for(#10661, ['threaded2_hT']) d0cf8f1 Testsuite: simplify T8089 (#8089) b4ef8b8 Update submodule hpc with fix for #10529 0c6c015 Revert "Revert "Change loadSrcInterface to return a list of ModIface"" 214596d Revert "Revert "Support for multiple signature files in scope."" 9ade087 primops: Fix spelling mistake e0a3c44 Delete __GLASGOW_HASKELL__ ifdefs for stage0 < 7.8 8f48fdc Use varToCoreExpr in mkWWcpr_help 3fbf496 Comments only (superclasses and improvement) 3509191 Refactor newSCWorkFromFlavoured 7c0fff4 Improve strictness analysis for exceptions cd48797 Comments and white space only 3c44a46 Refactor self-boot info efa7b3a Add NOINLINE for hs-boot functions aa78cd6 Documents -dsuppress-unfoldings 0df2348 Comments and layout only a0e8bb7 Implement -dsuppress-unfoldings b5c1400 Comments and white space only f1d0480 Avoid out-of-scope top-level Ids 7a6ed66 Comments only 55754ea Fix test T2497 to avoid infinite loop in RULES feaa095 Do occurrence analysis on result of BuiltInRule 00f3187 Make seq-of-cast rule generate a case 35eb736 T4945 is working again f519cb5 testsuite: Show killed command line on timeout 97a50d5 configure: Bump minimum bootstrap GHC version to 7.8 dbe6dac When iconv is unavailable, use an ASCII encoding to encode ASCII 18c6ee2 Travis: use ghc-7.8.4 as stage0 to fix the build d941a89 Validate: by default do show commands a7e0326 Validate: document --quiet [skip ci] 1224bb5 Add utility function isHoleName. 50b9a7a Revert "Trac #4945 is working again" 1b76997 Testsuite: recenter haddock.base allocation numbers b949c96 Eliminate zero_static_objects_list() 0d1a8d0 Two step allocator for 64-bit systems e3df1b1 Validate: explain THREADS instead of CPUS in --help cf57f8f Travis: do pass `--quiet` to validate 0b12aca Switch from recording IsBootInterface to recording full HscSource. adea827 Add ExceptionMonad instance for IOEnv. 144096e Give more informative panic for checkFamInstConsistency. 4a9b40d Export alwaysQualifyPackages and neverQualifyPackages. 939f1b2 Some utility functions for testing IfaceType equality. dd365b1 Use lookupIfaceTop for loading IfaceDecls. 5c3fc92 Fix Trac #10670 9851275 Comments only d784bde Lexer: support consecutive references to Haddock chunks (#10398) d2b4df1 Generate .dyn_o files for .hsig files with -dynamic-too 76e2341 Accept next-docstrings on GADT constructors. e78841b Update encoding001 to test the full range of non-surrogate code points b5c9426 Parenthesise TypeOperator in import hints 1852c3d DataCon: Fix redundant import 4c8e69e rts/sm: Add missing argument names in function definitions 7ec07e4 Slight refactoring to the fix for #4012 608e76c Document type functions in the Paterson conditions e809ef5 ghci: fixity declarations for infix data constructors (#10018) 5ff4dad Add a few comments from SPJ on fixity declarations f9687ca Library names, with Cabal submodule update 45c319f Fix line number in T10018 testcase 30d8349 Comments only e161634 Comments about stricteness of catch# d53d808 Refactoring around FunDeps 6e618d7 Improve instanceCantMatch 09d0505 RetainerProfile: Add missing UNTAG_STATIC_LIST_PTR b04bed0 renamer: fix module-level deprecation message 070f76a -include-pkg-deps takes only one hyphen. 7e70c06 Use isTrue# around primitive comparisons in integer-gmp c55f61c Add missing parentheses in eqBigNatWord# 474d4cc Comment tweaks only a87bb2b Merge remote-tracking branch 'origin/master' into wip/impredicativity 15583fd Fix problem with double-pass simpleOpt 3d5a3f2 Instantiation in approximation is now deep a406ce2 Change rule for canonicalization of <~ 604c8d4 Fix problem in RULES simplification b8494a6 Introduce InstanceOfRefl evidence to match description a8de988 Do not flatten type families in <~ constraints From git at git.haskell.org Wed Jul 29 16:27:06 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Wed, 29 Jul 2015 16:27:06 +0000 (UTC) Subject: [commit: ghc] master: Add a missing check for -fcpr-off (2dbb01a) Message-ID: <20150729162706.E38B13A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/2dbb01a63a7ba7dc534c22815e80ab45c2f0ba69/ghc >--------------------------------------------------------------- commit 2dbb01a63a7ba7dc534c22815e80ab45c2f0ba69 Author: Reid Barton Date: Wed Jul 29 12:27:50 2015 -0400 Add a missing check for -fcpr-off Test Plan: validate Reviewers: austin, bgamari, simonpj Reviewed By: simonpj Subscribers: simonpj, thomie Differential Revision: https://phabricator.haskell.org/D1104 GHC Trac Issues: #10696 >--------------------------------------------------------------- 2dbb01a63a7ba7dc534c22815e80ab45c2f0ba69 compiler/basicTypes/Demand.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/basicTypes/Demand.hs b/compiler/basicTypes/Demand.hs index bfb346e..bd2924a 100644 --- a/compiler/basicTypes/Demand.hs +++ b/compiler/basicTypes/Demand.hs @@ -1162,8 +1162,8 @@ nopDmdType = DmdType emptyDmdEnv [] topRes botDmdType = DmdType emptyDmdEnv [] botRes cprProdDmdType :: Arity -> DmdType -cprProdDmdType _arity - = DmdType emptyDmdEnv [] (Dunno RetProd) +cprProdDmdType arity + = DmdType emptyDmdEnv [] (vanillaCprProdRes arity) isNopDmdType :: DmdType -> Bool isNopDmdType (DmdType env [] res) From git at git.haskell.org Thu Jul 30 06:57:24 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 30 Jul 2015 06:57:24 +0000 (UTC) Subject: [commit: packages/Win32] branch 'ghc-head' deleted Message-ID: <20150730065724.A9AD73A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/Win32 Deleted branch: ghc-head From git at git.haskell.org Thu Jul 30 06:57:26 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 30 Jul 2015 06:57:26 +0000 (UTC) Subject: [commit: packages/Win32] tag 'Win32-2.3.1.0-release' created Message-ID: <20150730065726.A97BB3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/Win32 New tag : Win32-2.3.1.0-release Referencing: 3afc74374b9fc99e88af730f264042e9b4cc60db From git at git.haskell.org Thu Jul 30 06:57:28 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 30 Jul 2015 06:57:28 +0000 (UTC) Subject: [commit: packages/Win32] master: Drop superflous execute bit from a couple of source files (110e933) Message-ID: <20150730065728.B24AB3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/Win32 On branch : master Link : http://git.haskell.org/packages/Win32.git/commitdiff/110e933eccb92f47c5f5f73ec0dd61539c62b799 >--------------------------------------------------------------- commit 110e933eccb92f47c5f5f73ec0dd61539c62b799 Author: Herbert Valerio Riedel Date: Tue Mar 18 10:57:22 2014 +0100 Drop superflous execute bit from a couple of source files Source files with mode 0755 look a bit confusing when checked out on unix filesystems. >--------------------------------------------------------------- 110e933eccb92f47c5f5f73ec0dd61539c62b799 Graphics/Win32/Control.hsc | 0 Graphics/Win32/Key.hsc | 0 Graphics/Win32/Window.hsc | 0 System/Win32/Info.hsc | 0 System/Win32/Registry.hsc | 0 System/Win32/Types.hs | 0 Win32.cabal | 0 examples/hello.lhs | 0 8 files changed, 0 insertions(+), 0 deletions(-) diff --git a/Graphics/Win32/Control.hsc b/Graphics/Win32/Control.hsc old mode 100755 new mode 100644 diff --git a/Graphics/Win32/Key.hsc b/Graphics/Win32/Key.hsc old mode 100755 new mode 100644 diff --git a/Graphics/Win32/Window.hsc b/Graphics/Win32/Window.hsc old mode 100755 new mode 100644 diff --git a/System/Win32/Info.hsc b/System/Win32/Info.hsc old mode 100755 new mode 100644 diff --git a/System/Win32/Registry.hsc b/System/Win32/Registry.hsc old mode 100755 new mode 100644 diff --git a/System/Win32/Types.hs b/System/Win32/Types.hs old mode 100755 new mode 100644 diff --git a/Win32.cabal b/Win32.cabal old mode 100755 new mode 100644 diff --git a/examples/hello.lhs b/examples/hello.lhs old mode 100755 new mode 100644 From git at git.haskell.org Thu Jul 30 06:57:30 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 30 Jul 2015 06:57:30 +0000 (UTC) Subject: [commit: packages/Win32] master: Avoid redundant-import warning with base>=4.8.0 (22160ac) Message-ID: <20150730065730.B90223A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/Win32 On branch : master Link : http://git.haskell.org/packages/Win32.git/commitdiff/22160ac62a530a2be362e885d7c2aad26ef432bf >--------------------------------------------------------------- commit 22160ac62a530a2be362e885d7c2aad26ef432bf Author: Herbert Valerio Riedel Date: Mon Sep 22 22:38:15 2014 +0200 Avoid redundant-import warning with base>=4.8.0 Starting wih base-4.8.0.0, `Word` is exported from `Prelude` >--------------------------------------------------------------- 22160ac62a530a2be362e885d7c2aad26ef432bf System/Win32/Types.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/System/Win32/Types.hs b/System/Win32/Types.hs old mode 100644 new mode 100755 index 68a4ff1..c09a22f --- a/System/Win32/Types.hs +++ b/System/Win32/Types.hs @@ -25,7 +25,7 @@ import Data.Bits (shiftL, shiftR, (.|.), (.&.)) import Data.Char (isSpace) import Data.Int (Int32, Int64) import Data.Maybe (fromMaybe) -import Data.Word (Word, Word8, Word16, Word32, Word64) +import Data.Word (Word8, Word16, Word32, Word64) import Foreign.C.Error (getErrno, errnoToIOError) import Foreign.C.String (newCWString, withCWStringLen) import Foreign.C.String (peekCWString, peekCWStringLen, withCWString) @@ -36,6 +36,10 @@ import Numeric (showHex) import System.IO.Error (ioeSetErrorString) import System.IO.Unsafe (unsafePerformIO) +#if !MIN_VERSION_base(4,8,0) +import Data.Word (Word) +#endif + #if MIN_VERSION_base(4,7,0) import Data.Bits (finiteBitSize) #else From git at git.haskell.org Thu Jul 30 06:57:32 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 30 Jul 2015 06:57:32 +0000 (UTC) Subject: [commit: packages/Win32] master: Merge pull request #25 from hvr/pr-word (a955d59) Message-ID: <20150730065732.C0E6B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/Win32 On branch : master Link : http://git.haskell.org/packages/Win32.git/commitdiff/a955d59c48f8b3bdab7eeea29660d98b0d44343b >--------------------------------------------------------------- commit a955d59c48f8b3bdab7eeea29660d98b0d44343b Merge: 110e933 22160ac Author: Gregory Collins Date: Tue Sep 23 08:55:51 2014 -0700 Merge pull request #25 from hvr/pr-word Avoid redundant-import warning with base>=4.8.0 >--------------------------------------------------------------- a955d59c48f8b3bdab7eeea29660d98b0d44343b System/Win32/Types.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) From git at git.haskell.org Thu Jul 30 06:57:34 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 30 Jul 2015 06:57:34 +0000 (UTC) Subject: [commit: packages/Win32] master: Replace obsolete `defaultUserHooks` by `autoconfUserHooks` (6cc0f90) Message-ID: <20150730065734.C88A63A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/Win32 On branch : master Link : http://git.haskell.org/packages/Win32.git/commitdiff/6cc0f902a3aec5a9161a9268c9ad4598ad4a5e36 >--------------------------------------------------------------- commit 6cc0f902a3aec5a9161a9268c9ad4598ad4a5e36 Author: Herbert Valerio Riedel Date: Sat Sep 27 10:00:44 2014 +0200 Replace obsolete `defaultUserHooks` by `autoconfUserHooks` This is to avoid the warning printed otherwise when executing `Setup.hs`: Setup.hs:6:29: Warning: In the use of ?defaultUserHooks? (imported from Distribution.Simple): Deprecated: "Use simpleUserHooks or autoconfUserHooks, unless you need Cabal-1.2 compatibility in which case you must stick with defaultUserHooks" Warning: defaultUserHooks in Setup script is deprecated. Configuring Win32-2.3.0.2... >--------------------------------------------------------------- 6cc0f902a3aec5a9161a9268c9ad4598ad4a5e36 Setup.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Setup.hs b/Setup.hs index 7cf9bfd..54f57d6 100644 --- a/Setup.hs +++ b/Setup.hs @@ -3,4 +3,4 @@ module Main (main) where import Distribution.Simple main :: IO () -main = defaultMainWithHooks defaultUserHooks +main = defaultMainWithHooks autoconfUserHooks From git at git.haskell.org Thu Jul 30 06:57:36 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 30 Jul 2015 06:57:36 +0000 (UTC) Subject: [commit: packages/Win32] master: Fix breakage under 32-bit mingw-w64 in SimpleMAPI.hsc. (8b7e4de) Message-ID: <20150730065736.CF2963A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/Win32 On branch : master Link : http://git.haskell.org/packages/Win32.git/commitdiff/8b7e4de5c6509a02a4f854e24a1da55e6b8ef3c7 >--------------------------------------------------------------- commit 8b7e4de5c6509a02a4f854e24a1da55e6b8ef3c7 Author: Gintautas Miliauskas Date: Fri Oct 24 12:46:40 2014 +0200 Fix breakage under 32-bit mingw-w64 in SimpleMAPI.hsc. Previously the whole file was conditionally disabled on 64-bit architectures, but in fact the important thing is not the architecture but the contents of the mapi.h header. >--------------------------------------------------------------- 8b7e4de5c6509a02a4f854e24a1da55e6b8ef3c7 System/Win32/SimpleMAPI.hsc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/System/Win32/SimpleMAPI.hsc b/System/Win32/SimpleMAPI.hsc index 93ac39d..faa8a9f 100644 --- a/System/Win32/SimpleMAPI.hsc +++ b/System/Win32/SimpleMAPI.hsc @@ -21,8 +21,6 @@ where -- some of the values we use, e.g. MAPI_LOGOFF_SHARED. -- mapix.h does define MAPI_LOGOFF_SHARED, but the various flags -- clash with each other. --- So for now we only define the module content on i386. -#if __i386__ import Control.Exception ( bracket, handle, finally, onException , IOException ) @@ -53,8 +51,12 @@ type MapiFlag = ULONG , mAPI_LOGON_UI = MAPI_LOGON_UI , mAPI_NEW_SESSION = MAPI_NEW_SESSION , mAPI_FORCE_DOWNLOAD = MAPI_FORCE_DOWNLOAD +#ifdef MAPI_LOGOFF_SHARED , mAPI_LOGOFF_SHARED = MAPI_LOGOFF_SHARED +#endif +#ifdef MAPI_LOGOFF_UI , mAPI_LOGOFF_UI = MAPI_LOGOFF_UI +#endif , mAPI_DIALOG = MAPI_DIALOG , mAPI_UNREAD_ONLY = MAPI_UNREAD_ONLY , mAPI_LONG_MSGID = MAPI_LONG_MSGID @@ -81,7 +83,9 @@ mapiErrors = , ((#const MAPI_E_DISK_FULL) , "Disk full") , ((#const MAPI_E_INSUFFICIENT_MEMORY) , "Not enough memory") , ((#const MAPI_E_ACCESS_DENIED) , "Access denied") +#ifdef MAPI_E_BLK_TOO_SMALL , ((#const MAPI_E_BLK_TOO_SMALL) , "BLK_TOO_SMALL") +#endif , ((#const MAPI_E_TOO_MANY_SESSIONS), "Too many open sessions") , ((#const MAPI_E_TOO_MANY_FILES) , "Too many open files") , ((#const MAPI_E_TOO_MANY_RECIPIENTS) , "Too many recipients") @@ -96,7 +100,9 @@ mapiErrors = , ((#const MAPI_E_INVALID_SESSION) , "Invalid session") , ((#const MAPI_E_TYPE_NOT_SUPPORTED) , "Type not supported") , ((#const MAPI_E_AMBIGUOUS_RECIPIENT) , "Ambigious recipient") +#ifdef MAPI_E_AMBIGUOUS_RECIP , ((#const MAPI_E_AMBIGUOUS_RECIP) , "Ambigious recipient") +#endif , ((#const MAPI_E_MESSAGE_IN_USE) , "Message in use") , ((#const MAPI_E_NETWORK_FAILURE) , "Network failure") , ((#const MAPI_E_INVALID_EDITFIELDS) , "Invalid editfields") @@ -407,5 +413,3 @@ mapiSendMail f ses hwnd msg flag = withMessage f ses msg $ \msg -> handleIOException :: (IOException -> IO a) -> IO a -> IO a handleIOException = handle - -#endif From git at git.haskell.org Thu Jul 30 06:57:38 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 30 Jul 2015 06:57:38 +0000 (UTC) Subject: [commit: packages/Win32] master: Merge pull request #27 from gintas/master (1d426ad) Message-ID: <20150730065738.D69163A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/Win32 On branch : master Link : http://git.haskell.org/packages/Win32.git/commitdiff/1d426ad6e2e6bb4f2209f76c61a2499c28f6d046 >--------------------------------------------------------------- commit 1d426ad6e2e6bb4f2209f76c61a2499c28f6d046 Merge: a955d59 8b7e4de Author: Austin Seipp Date: Thu Oct 30 11:54:06 2014 -0500 Merge pull request #27 from gintas/master Fix breakage under 32-bit mingw-w64 in SimpleMAPI.hsc. >--------------------------------------------------------------- 1d426ad6e2e6bb4f2209f76c61a2499c28f6d046 System/Win32/SimpleMAPI.hsc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) From git at git.haskell.org Thu Jul 30 06:57:40 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 30 Jul 2015 06:57:40 +0000 (UTC) Subject: [commit: packages/Win32] master: Perform minor version bump to 2.3.1.0 (46c8b9e) Message-ID: <20150730065740.DC6103A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/Win32 On branch : master Link : http://git.haskell.org/packages/Win32.git/commitdiff/46c8b9ec8bb7dca162d186b1ae2beb32b9dd68d4 >--------------------------------------------------------------- commit 46c8b9ec8bb7dca162d186b1ae2beb32b9dd68d4 Author: Herbert Valerio Riedel Date: Fri Dec 19 13:21:24 2014 +0100 Perform minor version bump to 2.3.1.0 At the very least, we need a (belated) minor version in order to account for some API additions that already occurred in 2.3.0.2 >--------------------------------------------------------------- 46c8b9ec8bb7dca162d186b1ae2beb32b9dd68d4 Win32.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Win32.cabal b/Win32.cabal index 2700cc0..72a5618 100644 --- a/Win32.cabal +++ b/Win32.cabal @@ -1,5 +1,5 @@ name: Win32 -version: 2.3.0.2 +version: 2.3.1.0 license: BSD3 license-file: LICENSE author: Alastair Reid From git at git.haskell.org Thu Jul 30 06:57:42 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 30 Jul 2015 06:57:42 +0000 (UTC) Subject: [commit: packages/Win32] master: Merge pull request #26 from hvr/pr-setup (9bfd4e7) Message-ID: <20150730065742.E388B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/Win32 On branch : master Link : http://git.haskell.org/packages/Win32.git/commitdiff/9bfd4e7c2b0729c67a2336bf0235441e1a8bcc90 >--------------------------------------------------------------- commit 9bfd4e7c2b0729c67a2336bf0235441e1a8bcc90 Merge: 46c8b9e 6cc0f90 Author: Herbert Valerio Riedel Date: Fri Dec 19 13:23:33 2014 +0100 Merge pull request #26 from hvr/pr-setup Replace obsolete `defaultUserHooks` by `autoconfUserHooks` >--------------------------------------------------------------- 9bfd4e7c2b0729c67a2336bf0235441e1a8bcc90 Setup.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) From git at git.haskell.org Thu Jul 30 06:57:44 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 30 Jul 2015 06:57:44 +0000 (UTC) Subject: [commit: packages/Win32] master: Fix foreign import calling convention on SetWindowLongPtrW. Appears that this should be WINDOWS_CCONV. (00b9fc9) Message-ID: <20150730065744.EB8C73A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/Win32 On branch : master Link : http://git.haskell.org/packages/Win32.git/commitdiff/00b9fc990db1378610c9fc195c4637651cb1318e >--------------------------------------------------------------- commit 00b9fc990db1378610c9fc195c4637651cb1318e Author: Darren Grant Date: Sun Mar 1 01:00:52 2015 -0800 Fix foreign import calling convention on SetWindowLongPtrW. Appears that this should be WINDOWS_CCONV. >--------------------------------------------------------------- 00b9fc990db1378610c9fc195c4637651cb1318e Graphics/Win32/Window.hsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Graphics/Win32/Window.hsc b/Graphics/Win32/Window.hsc index abb9e15..81baf3d 100644 --- a/Graphics/Win32/Window.hsc +++ b/Graphics/Win32/Window.hsc @@ -204,7 +204,7 @@ setWindowClosure wnd closure = do _ <- c_SetWindowLongPtr wnd (#{const GWLP_USERDATA}) (castPtr (castFunPtrToPtr fp)) return () -foreign import capi unsafe "windows.h SetWindowLongPtrW" +foreign import WINDOWS_CCONV unsafe "windows.h SetWindowLongPtrW" c_SetWindowLongPtr :: HWND -> INT -> Ptr LONG -> IO (Ptr LONG) createWindow From git at git.haskell.org Thu Jul 30 06:57:47 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 30 Jul 2015 06:57:47 +0000 (UTC) Subject: [commit: packages/Win32] master: Tighten Safe Haskell bounds under 7.10 to fix warnings. (f4b5495) Message-ID: <20150730065747.049C03A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/Win32 On branch : master Link : http://git.haskell.org/packages/Win32.git/commitdiff/f4b5495c21b7668c47550ebe3a2893eda4853ffe >--------------------------------------------------------------- commit f4b5495c21b7668c47550ebe3a2893eda4853ffe Author: David Terei Date: Mon Nov 24 01:49:40 2014 -0800 Tighten Safe Haskell bounds under 7.10 to fix warnings. >--------------------------------------------------------------- f4b5495c21b7668c47550ebe3a2893eda4853ffe Graphics/Win32.hs | 4 +++- Graphics/Win32/Dialogue.hsc | 4 +++- Graphics/Win32/GDI/Bitmap.hsc | 4 +++- Graphics/Win32/GDI/Brush.hsc | 4 +++- Graphics/Win32/GDI/Clip.hsc | 4 +++- Graphics/Win32/GDI/Font.hsc | 4 +++- Graphics/Win32/GDI/Graphics2D.hs | 4 +++- Graphics/Win32/GDI/HDC.hs | 4 +++- Graphics/Win32/GDI/Palette.hsc | 4 +++- Graphics/Win32/GDI/Path.hs | 4 +++- Graphics/Win32/GDI/Pen.hsc | 4 +++- Graphics/Win32/GDI/Region.hs | 4 +++- Graphics/Win32/Icon.hs | 4 +++- Graphics/Win32/Key.hsc | 4 +++- Graphics/Win32/Menu.hsc | 4 +++- Graphics/Win32/Message.hsc | 4 +++- Graphics/Win32/Misc.hsc | 4 +++- Graphics/Win32/Resource.hsc | 4 +++- System/Win32.hs | 4 +++- System/Win32/Console.hsc | 4 +++- System/Win32/DLL.hsc | 4 +++- System/Win32/DebugApi.hsc | 4 +++- System/Win32/File.hsc | 4 +++- System/Win32/Info.hsc | 4 +++- System/Win32/Mem.hsc | 4 +++- System/Win32/Process.hsc | 4 +++- System/Win32/Shell.hsc | 4 +++- System/Win32/SimpleMAPI.hsc | 4 +++- System/Win32/Time.hsc | 4 +++- 29 files changed, 87 insertions(+), 29 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 f4b5495c21b7668c47550ebe3a2893eda4853ffe From git at git.haskell.org Thu Jul 30 06:57:49 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 30 Jul 2015 06:57:49 +0000 (UTC) Subject: [commit: packages/Win32] master: Added CSIDL_LOCAL_APPDATA (df9393c) Message-ID: <20150730065749.0B2173A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/Win32 On branch : master Link : http://git.haskell.org/packages/Win32.git/commitdiff/df9393c978c1d56c803ee06f457e047b90a76a67 >--------------------------------------------------------------- commit df9393c978c1d56c803ee06f457e047b90a76a67 Author: Piotr Mlodawski Date: Fri Nov 7 09:00:52 2014 +0100 Added CSIDL_LOCAL_APPDATA >--------------------------------------------------------------- df9393c978c1d56c803ee06f457e047b90a76a67 System/Win32/Shell.hsc | 1 + 1 file changed, 1 insertion(+) diff --git a/System/Win32/Shell.hsc b/System/Win32/Shell.hsc index fbc90ca..75e2f3f 100644 --- a/System/Win32/Shell.hsc +++ b/System/Win32/Shell.hsc @@ -58,6 +58,7 @@ type CSIDL = CInt , cSIDL_APPDATA = CSIDL_APPDATA , cSIDL_WINDOWS = CSIDL_WINDOWS , cSIDL_PERSONAL = CSIDL_PERSONAL + , cSIDL_LOCAL_APPDATA = CSIDL_LOCAL_APPDATA , cSIDL_PROGRAM_FILES = CSIDL_PROGRAM_FILES } -- XXX there are lots more of these From git at git.haskell.org Thu Jul 30 06:57:51 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 30 Jul 2015 06:57:51 +0000 (UTC) Subject: [commit: packages/Win32] master: Added missing export of cSIDL_LOCAL_APPDATA. (8d6bdf4) Message-ID: <20150730065751.125FC3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/Win32 On branch : master Link : http://git.haskell.org/packages/Win32.git/commitdiff/8d6bdf4ef64f2997f51d48abf9e0730bbf6d98ac >--------------------------------------------------------------- commit 8d6bdf4ef64f2997f51d48abf9e0730bbf6d98ac Author: mwu Date: Fri Nov 7 10:37:30 2014 +0100 Added missing export of cSIDL_LOCAL_APPDATA. >--------------------------------------------------------------- 8d6bdf4ef64f2997f51d48abf9e0730bbf6d98ac System/Win32/Shell.hsc | 1 + 1 file changed, 1 insertion(+) diff --git a/System/Win32/Shell.hsc b/System/Win32/Shell.hsc index 75e2f3f..a6332ec 100644 --- a/System/Win32/Shell.hsc +++ b/System/Win32/Shell.hsc @@ -24,6 +24,7 @@ module System.Win32.Shell ( cSIDL_APPDATA, cSIDL_WINDOWS, cSIDL_PERSONAL, + cSIDL_LOCAL_APPDATA, cSIDL_PROGRAM_FILES, SHGetFolderPathFlags, sHGFP_TYPE_CURRENT, From git at git.haskell.org Thu Jul 30 06:57:53 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 30 Jul 2015 06:57:53 +0000 (UTC) Subject: [commit: packages/Win32] master: Add VirtualQueryEx and MEMORY_BASIC_INFORMATION (8fc5486) Message-ID: <20150730065753.1982A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/Win32 On branch : master Link : http://git.haskell.org/packages/Win32.git/commitdiff/8fc5486f4e31ddeacd46c6b07d62934c3ce8f378 >--------------------------------------------------------------- commit 8fc5486f4e31ddeacd46c6b07d62934c3ce8f378 Author: Andrii Polishchuk Date: Fri Jul 25 19:18:38 2014 +0300 Add VirtualQueryEx and MEMORY_BASIC_INFORMATION >--------------------------------------------------------------- 8fc5486f4e31ddeacd46c6b07d62934c3ce8f378 System/Win32/Mem.hsc | 47 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/System/Win32/Mem.hsc b/System/Win32/Mem.hsc index d7ae27e..32f02a4 100644 --- a/System/Win32/Mem.hsc +++ b/System/Win32/Mem.hsc @@ -28,6 +28,47 @@ import Foreign.C.Types #include +---------------------------------------------------------------- +-- Data types +---------------------------------------------------------------- + +data MEMORY_BASIC_INFORMATION = MEMORY_BASIC_INFORMATION + { mbiBaseAddress :: Addr + , mbiAllocationBase :: Addr + , mbiAllocationProtect :: DWORD + , mbiRegionSize :: SIZE_T + , mbiState :: DWORD + , mbiProtect :: DWORD + , mbiType :: DWORD + } deriving (Show) + +---------------------------------------------------------------- +-- Instances +---------------------------------------------------------------- + +instance Storable MEMORY_BASIC_INFORMATION where + sizeOf _ = #size MEMORY_BASIC_INFORMATION + alignment = sizeOf + poke buf mbi = do + (#poke MEMORY_BASIC_INFORMATION, BaseAddress) buf (mbiBaseAddress mbi) + (#poke MEMORY_BASIC_INFORMATION, AllocationBase) buf (mbiAllocationBase mbi) + (#poke MEMORY_BASIC_INFORMATION, AllocationProtect) buf (mbiAllocationProtect mbi) + (#poke MEMORY_BASIC_INFORMATION, RegionSize) buf (mbiRegionSize mbi) + (#poke MEMORY_BASIC_INFORMATION, State) buf (mbiState mbi) + (#poke MEMORY_BASIC_INFORMATION, Protect) buf (mbiProtect mbi) + (#poke MEMORY_BASIC_INFORMATION, Type) buf (mbiType mbi) + peek buf = do + baseAddress <- (#peek MEMORY_BASIC_INFORMATION, BaseAddress) buf + allocationBase <- (#peek MEMORY_BASIC_INFORMATION, AllocationBase) buf + allocationProtect <- (#peek MEMORY_BASIC_INFORMATION, AllocationProtect) buf + regionSize <- (#peek MEMORY_BASIC_INFORMATION, RegionSize) buf + state <- (#peek MEMORY_BASIC_INFORMATION, State) buf + protect <- (#peek MEMORY_BASIC_INFORMATION, Protect) buf + ty <- (#peek MEMORY_BASIC_INFORMATION, Type) buf + return $ MEMORY_BASIC_INFORMATION baseAddress allocationBase allocationProtect regionSize state protect ty + +---------------------------------------------------------------- + copyMemory :: Ptr a -> Ptr a -> DWORD -> IO () copyMemory dest src nbytes = copyBytes dest src (fromIntegral nbytes) @@ -265,7 +306,11 @@ virtualProtectEx proc addr size new_prot = foreign import WINDOWS_CCONV unsafe "windows.h VirtualProtectEx" c_VirtualProtectEx :: HANDLE -> Addr -> DWORD -> DWORD -> Ptr DWORD -> IO Bool --- No VirtualQuery..() +virtualQueryEx :: HANDLE -> LPVOID -> Ptr MEMORY_BASIC_INFORMATION -> SIZE_T -> IO DWORD +virtualQueryEx hProcess lpAddress lpBuffer dwLength = + failIfZero "VirtualQueryEx" $ c_VirtualQueryEx hProcess lpAddress lpBuffer dwLength +foreign import WINDOWS_CCONV unsafe "windows.h VirtualQueryEx" + c_VirtualQueryEx :: HANDLE -> LPVOID -> Ptr MEMORY_BASIC_INFORMATION -> SIZE_T -> IO DWORD virtualUnlock :: Addr -> DWORD -> IO () virtualUnlock addr size = From git at git.haskell.org Thu Jul 30 06:57:55 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 30 Jul 2015 06:57:55 +0000 (UTC) Subject: [commit: packages/Win32] master: CSIDL_DESKTOPDIRECTORY (ba8d8bb) Message-ID: <20150730065755.213703A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/Win32 On branch : master Link : http://git.haskell.org/packages/Win32.git/commitdiff/ba8d8bbed5bc4bab72d6839deb95dccafb2a9215 >--------------------------------------------------------------- commit ba8d8bbed5bc4bab72d6839deb95dccafb2a9215 Author: Heather Date: Mon Mar 16 12:04:33 2015 +0400 CSIDL_DESKTOPDIRECTORY >--------------------------------------------------------------- ba8d8bbed5bc4bab72d6839deb95dccafb2a9215 System/Win32/Shell.hsc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/System/Win32/Shell.hsc b/System/Win32/Shell.hsc index a6332ec..9dde0a5 100644 --- a/System/Win32/Shell.hsc +++ b/System/Win32/Shell.hsc @@ -25,6 +25,7 @@ module System.Win32.Shell ( cSIDL_WINDOWS, cSIDL_PERSONAL, cSIDL_LOCAL_APPDATA, + cSIDL_DESKTOPDIRECTORY, cSIDL_PROGRAM_FILES, SHGetFolderPathFlags, sHGFP_TYPE_CURRENT, @@ -60,6 +61,7 @@ type CSIDL = CInt , cSIDL_WINDOWS = CSIDL_WINDOWS , cSIDL_PERSONAL = CSIDL_PERSONAL , cSIDL_LOCAL_APPDATA = CSIDL_LOCAL_APPDATA + , cSIDL_DESKTOPDIRECTORY = CSIDL_DESKTOPDIRECTORY , cSIDL_PROGRAM_FILES = CSIDL_PROGRAM_FILES } -- XXX there are lots more of these From git at git.haskell.org Thu Jul 30 06:57:57 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 30 Jul 2015 06:57:57 +0000 (UTC) Subject: [commit: packages/Win32] master: ignore dist/ and binary files (889be26) Message-ID: <20150730065757.2731F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/Win32 On branch : master Link : http://git.haskell.org/packages/Win32.git/commitdiff/889be26656eb5dc35230d7a0e6ab94bcfcac59d8 >--------------------------------------------------------------- commit 889be26656eb5dc35230d7a0e6ab94bcfcac59d8 Author: Heather Date: Mon Mar 16 12:07:49 2015 +0400 ignore dist/ and binary files >--------------------------------------------------------------- 889be26656eb5dc35230d7a0e6ab94bcfcac59d8 .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index f1abef4..b4fc55f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ # Specific generated files GNUmakefile ghc.mk +dist/ +*.hi +*.o +*.a From git at git.haskell.org Thu Jul 30 06:57:59 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 30 Jul 2015 06:57:59 +0000 (UTC) Subject: [commit: packages/Win32] master: [ghc trac #10165] Conditionally call SetWindowLongW on mingw32 (9e52103) Message-ID: <20150730065759.2F8663A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/Win32 On branch : master Link : http://git.haskell.org/packages/Win32.git/commitdiff/9e52103b8b4a9bfb486e2289257ec61ac682eb89 >--------------------------------------------------------------- commit 9e52103b8b4a9bfb486e2289257ec61ac682eb89 Author: Vagrant Ubuntu 14.04 Trusty 64-bit VMware Date: Tue Mar 17 16:21:02 2015 -0700 [ghc trac #10165] Conditionally call SetWindowLongW on mingw32 >--------------------------------------------------------------- 9e52103b8b4a9bfb486e2289257ec61ac682eb89 Graphics/Win32/Window.hsc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Graphics/Win32/Window.hsc b/Graphics/Win32/Window.hsc index 81baf3d..e5bd152 100644 --- a/Graphics/Win32/Window.hsc +++ b/Graphics/Win32/Window.hsc @@ -204,7 +204,24 @@ setWindowClosure wnd closure = do _ <- c_SetWindowLongPtr wnd (#{const GWLP_USERDATA}) (castPtr (castFunPtrToPtr fp)) return () + +{- Note [SetWindowLongPtrW] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Windows.h defines SetWindowLongPtrW as SetWindowLongW for 32-bit platforms +(i386_HOST_ARCH for our mingw32 environment). Unfortunately since the foreign +import name is given inside of a string, the macro will not be expanded. + +Until a better solution is presented each version is provided explicitly here. + +-} +#if defined(i386_HOST_ARCH) +foreign import WINDOWS_CCONV unsafe "windows.h SetWindowLongW" +#elif defined(x86_64_HOST_ARCH) foreign import WINDOWS_CCONV unsafe "windows.h SetWindowLongPtrW" +#else +# error Unknown mingw32 arch +#endif c_SetWindowLongPtr :: HWND -> INT -> Ptr LONG -> IO (Ptr LONG) createWindow From git at git.haskell.org Thu Jul 30 06:58:01 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 30 Jul 2015 06:58:01 +0000 (UTC) Subject: [commit: packages/Win32] master: Merge pull request #34 from Kludgy/master (59c5aa7) Message-ID: <20150730065801.37DF23A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/Win32 On branch : master Link : http://git.haskell.org/packages/Win32.git/commitdiff/59c5aa753fded8b661c334b36393f000c2fe68f8 >--------------------------------------------------------------- commit 59c5aa753fded8b661c334b36393f000c2fe68f8 Merge: 8fc5486 9e52103 Author: Austin Seipp Date: Thu Mar 19 11:40:37 2015 -0500 Merge pull request #34 from Kludgy/master [ghc trac #10165] Conditionally call SetWindowLongW on mingw32 >--------------------------------------------------------------- 59c5aa753fded8b661c334b36393f000c2fe68f8 Graphics/Win32/Window.hsc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) From git at git.haskell.org Thu Jul 30 06:58:03 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 30 Jul 2015 06:58:03 +0000 (UTC) Subject: [commit: packages/Win32] master: Merge pull request #33 from Heather/ignore (81f4b74) Message-ID: <20150730065803.40CEE3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/Win32 On branch : master Link : http://git.haskell.org/packages/Win32.git/commitdiff/81f4b743fda9a5e4732a7bea156b015fe2c244fd >--------------------------------------------------------------- commit 81f4b743fda9a5e4732a7bea156b015fe2c244fd Merge: 59c5aa7 889be26 Author: Austin Seipp Date: Thu Mar 19 11:40:48 2015 -0500 Merge pull request #33 from Heather/ignore ignore dist/ and binary files >--------------------------------------------------------------- 81f4b743fda9a5e4732a7bea156b015fe2c244fd .gitignore | 4 ++++ 1 file changed, 4 insertions(+) From git at git.haskell.org Thu Jul 30 06:58:05 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 30 Jul 2015 06:58:05 +0000 (UTC) Subject: [commit: packages/Win32] master: Merge pull request #32 from Heather/CSIDL_DESKTOPDIRECTORY (3b573ee) Message-ID: <20150730065805.47EBC3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/Win32 On branch : master Link : http://git.haskell.org/packages/Win32.git/commitdiff/3b573ee058560d1199a19efab10c016278dff252 >--------------------------------------------------------------- commit 3b573ee058560d1199a19efab10c016278dff252 Merge: 81f4b74 ba8d8bb Author: Austin Seipp Date: Thu Mar 19 11:41:12 2015 -0500 Merge pull request #32 from Heather/CSIDL_DESKTOPDIRECTORY CSIDL_DESKTOPDIRECTORY >--------------------------------------------------------------- 3b573ee058560d1199a19efab10c016278dff252 System/Win32/Shell.hsc | 2 ++ 1 file changed, 2 insertions(+) From git at git.haskell.org Thu Jul 30 06:58:07 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 30 Jul 2015 06:58:07 +0000 (UTC) Subject: [commit: packages/Win32] master's head updated: Merge pull request #32 from Heather/CSIDL_DESKTOPDIRECTORY (3b573ee) Message-ID: <20150730065807.7457F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/Win32 Branch 'master' now includes: 66437bf add support from GetFileAttributesEx (low level only) 263c97f wrap GetFileAttributesEx with a high level function 8862fb6 Use regCreateKey to be more robust when registry entry does not exist. b5392c3 Replace PROCESSENTRY32 -> PROCESSENTRY32W 1e909ad Bump version to 2.3.0.1 (re #13) 68955ee Partial support for base 4.6 e2d75e9 Complete support for base 4.6 a420a0c Allow building with base 4.5 once again 8f982f6 Bump version to 2.3.0.2 317571c Update maintainer address e95d1c5 Merge pull request #14 from arkeet/patch-1 881c4f4 Fix examples/hello.lhs to actually work (!) c3c8090 Merge pull request #11 from ezyang/master b4a375f Merge pull request #10 from redneb/GetFileAttributesEx 5ccf179 Use throwIO instead of throw for correctness c51e81a Add FILE_SHARE_DELETE 110e933 Drop superflous execute bit from a couple of source files 22160ac Avoid redundant-import warning with base>=4.8.0 a955d59 Merge pull request #25 from hvr/pr-word 6cc0f90 Replace obsolete `defaultUserHooks` by `autoconfUserHooks` 8b7e4de Fix breakage under 32-bit mingw-w64 in SimpleMAPI.hsc. 1d426ad Merge pull request #27 from gintas/master 46c8b9e Perform minor version bump to 2.3.1.0 9bfd4e7 Merge pull request #26 from hvr/pr-setup 00b9fc9 Fix foreign import calling convention on SetWindowLongPtrW. Appears that this should be WINDOWS_CCONV. f4b5495 Tighten Safe Haskell bounds under 7.10 to fix warnings. df9393c Added CSIDL_LOCAL_APPDATA 8d6bdf4 Added missing export of cSIDL_LOCAL_APPDATA. 8fc5486 Add VirtualQueryEx and MEMORY_BASIC_INFORMATION ba8d8bb CSIDL_DESKTOPDIRECTORY 889be26 ignore dist/ and binary files 9e52103 [ghc trac #10165] Conditionally call SetWindowLongW on mingw32 59c5aa7 Merge pull request #34 from Kludgy/master 81f4b74 Merge pull request #33 from Heather/ignore 3b573ee Merge pull request #32 from Heather/CSIDL_DESKTOPDIRECTORY From git at git.haskell.org Thu Jul 30 10:02:11 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 30 Jul 2015 10:02:11 +0000 (UTC) Subject: [commit: ghc] master: Comments only (fac11f8) Message-ID: <20150730100211.044833A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/fac11f853598c1decdf8d0facba5f25a6219f11f/ghc >--------------------------------------------------------------- commit fac11f853598c1decdf8d0facba5f25a6219f11f Author: Simon Peyton Jones Date: Wed Jul 29 16:02:25 2015 +0100 Comments only >--------------------------------------------------------------- fac11f853598c1decdf8d0facba5f25a6219f11f libraries/base/GHC/Enum.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/base/GHC/Enum.hs b/libraries/base/GHC/Enum.hs index 2ba6dda..a11d4f8 100644 --- a/libraries/base/GHC/Enum.hs +++ b/libraries/base/GHC/Enum.hs @@ -689,7 +689,7 @@ instance Enum Integer where "enumDeltaToInteger1" [1] enumDeltaToInteger1FB (:) [] = enumDeltaToInteger1 #-} -{- +{- Note [Enum Integer rules for literal 1] The "1" rules above specialise for the common case where delta = 1, so that we can avoid the delta>=0 test in enumDeltaToIntegerFB. Then enumDeltaToInteger1FB is nice and small and can be inlined, From git at git.haskell.org Thu Jul 30 10:02:14 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 30 Jul 2015 10:02:14 +0000 (UTC) Subject: [commit: ghc] master: Deal with phantom type variables in rules (4e8d74d) Message-ID: <20150730100214.9169F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/4e8d74d2362fbb025614ddeedfa3a9202bb6f2bb/ghc >--------------------------------------------------------------- commit 4e8d74d2362fbb025614ddeedfa3a9202bb6f2bb Author: Simon Peyton Jones Date: Wed Jul 29 16:06:29 2015 +0100 Deal with phantom type variables in rules See Note [Unbound template type variables] in Rules.hs This fixes Trac #10689. The problem was a rule LHS that mentioned a type variable in a phantom argument to a type synonym. Then matching the LHS didn't bind the type variable, and the rule matcher complained. This patch fixes the problem, as described by the Note. I also went back to not-cloning the template varaibles during rule matching. I'm convinced that it's not necessary now (if it ever was), and cloning makes the fix for #10689 much more fiddly. >--------------------------------------------------------------- 4e8d74d2362fbb025614ddeedfa3a9202bb6f2bb compiler/specialise/Rules.hs | 120 +++++++++++++-------- testsuite/tests/simplCore/should_compile/T10689.hs | 11 ++ .../tests/simplCore/should_compile/T10689a.hs | 114 ++++++++++++++++++++ testsuite/tests/simplCore/should_compile/all.T | 2 + 4 files changed, 205 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 4e8d74d2362fbb025614ddeedfa3a9202bb6f2bb From git at git.haskell.org Thu Jul 30 10:02:17 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 30 Jul 2015 10:02:17 +0000 (UTC) Subject: [commit: ghc] master: Define DsUtils.mkCastDs and use it (92d2567) Message-ID: <20150730100217.64CBF3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/92d2567230e28010e425b47057ccca66d1a9a712/ghc >--------------------------------------------------------------- commit 92d2567230e28010e425b47057ccca66d1a9a712 Author: Simon Peyton Jones Date: Wed Jul 29 16:38:44 2015 +0100 Define DsUtils.mkCastDs and use it This change avoids a spurious WARNing from mkCast. In the output of the desugarer (only, I think) we can have a cast where the type of the expression and cast don't syntactically match, because of an enclosing type-let binding. >--------------------------------------------------------------- 92d2567230e28010e425b47057ccca66d1a9a712 compiler/coreSyn/CoreUtils.hs | 19 +++++++++++-------- compiler/deSugar/DsBinds.hs | 10 +++++----- compiler/deSugar/DsCCall.hs | 6 +++--- compiler/deSugar/DsUtils.hs | 27 +++++++++++++++++++++++---- 4 files changed, 42 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 92d2567230e28010e425b47057ccca66d1a9a712 From git at git.haskell.org Thu Jul 30 10:02:20 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 30 Jul 2015 10:02:20 +0000 (UTC) Subject: [commit: ghc] master: Spit out a little more info with -dppr-debug (fa915af) Message-ID: <20150730100220.2388B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/fa915afa1af971c22657a0c99f6fb974faafe826/ghc >--------------------------------------------------------------- commit fa915afa1af971c22657a0c99f6fb974faafe826 Author: Simon Peyton Jones Date: Wed Jul 29 16:39:14 2015 +0100 Spit out a little more info with -dppr-debug >--------------------------------------------------------------- fa915afa1af971c22657a0c99f6fb974faafe826 compiler/deSugar/Desugar.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/deSugar/Desugar.hs b/compiler/deSugar/Desugar.hs index 6dbdfca..09e2554 100644 --- a/compiler/deSugar/Desugar.hs +++ b/compiler/deSugar/Desugar.hs @@ -404,7 +404,8 @@ warnRuleShadowing rule_name rule_act fn_id arg_ids 2 (ptext (sLit "because") <+> quotes (ppr lhs_id) <+> ptext (sLit "might inline first")) , ptext (sLit "Probable fix: add an INLINE[n] or NOINLINE[n] pragma for") - <+> quotes (ppr lhs_id) ]) + <+> quotes (ppr lhs_id) + , ifPprDebug (ppr (idInlineActivation lhs_id) $$ ppr rule_act) ]) | check_rules_too , bad_rule : _ <- get_bad_rules lhs_id From git at git.haskell.org Thu Jul 30 10:02:22 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 30 Jul 2015 10:02:22 +0000 (UTC) Subject: [commit: ghc] master: Fix an outright error in competesWith (e4114c8) Message-ID: <20150730100222.DA8223A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e4114c84857465ff14c27ead3679983ddf5cfe8f/ghc >--------------------------------------------------------------- commit e4114c84857465ff14c27ead3679983ddf5cfe8f Author: Simon Peyton Jones Date: Wed Jul 29 16:43:29 2015 +0100 Fix an outright error in competesWith competesWith is a very recent function, introduced in: commit 2d88a531b7e4dbf4016dca4b1ba3b5dc34256cf4 Author: Simon Peyton Jones Date: Fri Jul 24 12:50:42 2015 +0100 Improve warnings for rules that might not fire >--------------------------------------------------------------- e4114c84857465ff14c27ead3679983ddf5cfe8f compiler/basicTypes/BasicTypes.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/basicTypes/BasicTypes.hs b/compiler/basicTypes/BasicTypes.hs index 8bcb0d9..a256ac1 100644 --- a/compiler/basicTypes/BasicTypes.hs +++ b/compiler/basicTypes/BasicTypes.hs @@ -1091,7 +1091,7 @@ competesWith AlwaysActive _ = True competesWith (ActiveBefore {}) AlwaysActive = True competesWith (ActiveBefore {}) (ActiveBefore {}) = True -competesWith (ActiveBefore a) (ActiveAfter b) = a > b +competesWith (ActiveBefore a) (ActiveAfter b) = a < b competesWith (ActiveAfter {}) AlwaysActive = False competesWith (ActiveAfter {}) (ActiveBefore {}) = False @@ -1104,6 +1104,7 @@ See Note [Rules and inlining/other rules] in Desugar. We say that act1 "competes with" act2 iff act1 is active in the phase when act2 *becomes* active +NB: remember that phases count *down*: 2, 1, 0! It's too conservative to ensure that the two are never simultaneously active. For example, a rule might be always active, and an inlining From git at git.haskell.org Thu Jul 30 10:02:26 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 30 Jul 2015 10:02:26 +0000 (UTC) Subject: [commit: ghc] master: Fix Trac #10694: CPR analysis (499b926) Message-ID: <20150730100226.34C5A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/499b926be70b06e2e97b234cdb39cac94dd249e0/ghc >--------------------------------------------------------------- commit 499b926be70b06e2e97b234cdb39cac94dd249e0 Author: Simon Peyton Jones Date: Wed Jul 29 16:55:24 2015 +0100 Fix Trac #10694: CPR analysis In this commit commit 0696fc6d4de28cb589f6c751b8491911a5baf774 Author: Simon Peyton Jones Date: Fri Jun 26 11:40:01 2015 +0100 I made an error in the is_var_scrut tests in extendEnvForProdAlt. This patch fixes it, thereby fixing Trac #10694. >--------------------------------------------------------------- 499b926be70b06e2e97b234cdb39cac94dd249e0 compiler/stranal/DmdAnal.hs | 39 ++++++++++------------ testsuite/tests/stranal/should_compile/Makefile | 4 +++ testsuite/tests/stranal/should_compile/T10694.hs | 16 +++++++++ .../should_compile/T10694.stdout} | 0 testsuite/tests/stranal/should_compile/all.T | 1 + 5 files changed, 39 insertions(+), 21 deletions(-) diff --git a/compiler/stranal/DmdAnal.hs b/compiler/stranal/DmdAnal.hs index 41d9abb..8b97b6b 100644 --- a/compiler/stranal/DmdAnal.hs +++ b/compiler/stranal/DmdAnal.hs @@ -1080,8 +1080,8 @@ extendEnvForProdAlt env scrut case_bndr dc bndrs fam_envs = ae_fam_envs env do_con_arg env (id, str) - | ae_virgin env || isStrictDmd (idDemandInfo id) -- c.f. extendSigsWithLam - || (is_var_scrut && isMarkedStrict str) -- See Note [CPR in a product case alternative] + | let is_strict = isStrictDmd (idDemandInfo id) || isMarkedStrict str + , ae_virgin env || (is_var_scrut && is_strict) -- See Note [CPR in a product case alternative] , Just (dc,_,_,_) <- deepSplitProductType_maybe fam_envs $ idType id = extendAnalEnv NotTopLevel env id (cprProdSig (dataConRepArity dc)) | otherwise @@ -1190,15 +1190,18 @@ binders the CPR property. Specifically But then we don't want box it up again when returning it! We want 'f2' to have the CPR property, so we give 'x' the CPR property. - It's a bit delicate because if this case is scrutinising something other + * It's a bit delicate because if this case is scrutinising something other than an argument the original function, we really don't have the unboxed version available. E.g g v = case foo v of MkT x y | y>0 -> ... | otherwise -> x - Here we don't have the unboxed 'x' available. Hence the is_var_scrut - test when making use of the strictness annoatation. Slight ad-hoc, - but nothing terrible happens if we get it wrong. + Here we don't have the unboxed 'x' available. Hence the + is_var_scrut test when making use of the strictness annoatation. + Slightly ad-hoc, because even if the scrutinee *is* a variable it + might not be a onre of the arguments to the original function, or a + sub-component thereof. But it's simple, and nothing terrible + happens if we get it wrong. e.g. Trac #10694. Note [Add demands for strict constructors] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -1263,14 +1266,14 @@ assuming h is strict: C -> x+1 If we notice that 'x' is used strictly, we can give it the CPR -property; and hence f1 gets the CPR property too. It's ok to give it -the CPR property because by the time 'x' is returned (case A above), -it'll have been evaluated (by the wrapper of 'h' in the example), and -so the unboxed version will be available. +property; and hence f1 gets the CPR property too. It's sound (doesn't +change strictness) to give it the CPR property because by the time 'x' +is returned (case A above), it'll have been evaluated (by the wrapper +of 'h' in the example). Moreover, if f itself is strict in x, then we'll pass x unboxed to f1, and so the boxed version *won't* be available; in that case it's -more important to give 'x' the CPR property. +very helpful to give 'x' the CPR property. Note that @@ -1278,19 +1281,13 @@ Note that has product type, else we may get over-optimistic CPR results (e.g. from \x -> x!). - * This works for both lambda and case-alternative binders. For - case binders consider - g (Left x) = case h x of - A -> x - B -> ... - C -> x+1 - Since 'h' evaluates x, we'll have it available unboxed even - though in this case it won't be passed in unboxed. + * See Note [CPR examples] Note [CPR examples] ~~~~~~~~~~~~~~~~~~~~ -Here are some examples, in stranal/should_compile/T10482a. -The main point: all of these functions can have the CPR property +Here are some examples (stranal/should_compile/T10482a) of the +usefulness of Note [CPR in a product case alternative]. The main +point: all of these functions can have the CPR property. ------- f1 ----------- -- x is used strictly by h, so it'll be available diff --git a/testsuite/tests/stranal/should_compile/Makefile b/testsuite/tests/stranal/should_compile/Makefile index 32cc924..c187ddc 100644 --- a/testsuite/tests/stranal/should_compile/Makefile +++ b/testsuite/tests/stranal/should_compile/Makefile @@ -13,3 +13,7 @@ T10482: T10482a: $(RM) -f T10482a.o T10482a.hi '$(TEST_HC)' $(TEST_HC_OPTS) -O -c -ddump-simpl T10482a.hs | grep 'wf.*Int' + +T10694: + $(RM) -f T10694.o + '$(TEST_HC)' $(TEST_HC_OPTS) -O -c -ddump-simpl T10694.hs | grep 'DmdType ' diff --git a/testsuite/tests/stranal/should_compile/T10694.hs b/testsuite/tests/stranal/should_compile/T10694.hs new file mode 100644 index 0000000..b18e926 --- /dev/null +++ b/testsuite/tests/stranal/should_compile/T10694.hs @@ -0,0 +1,16 @@ +module T10694 where + +-- The point here is that 'm' should NOT have the CPR property +-- Checked by grepping in the -ddump-simpl + + +-- Some nonsense so that the simplifier can't see through +-- to the I# constructor +pm :: Int -> Int -> (Int, Int) +pm x y = (l !! 0, l !! 1) + where l = [x+y, x-y] +{-# NOINLINE pm #-} + +m :: Int -> Int -> Int +m x y = case pm x y of + (pr, mr) -> mr diff --git a/testsuite/tests/deSugar/should_run/T5472.stdout b/testsuite/tests/stranal/should_compile/T10694.stdout similarity index 100% copy from testsuite/tests/deSugar/should_run/T5472.stdout copy to testsuite/tests/stranal/should_compile/T10694.stdout diff --git a/testsuite/tests/stranal/should_compile/all.T b/testsuite/tests/stranal/should_compile/all.T index 54b7736..d2fc18d 100644 --- a/testsuite/tests/stranal/should_compile/all.T +++ b/testsuite/tests/stranal/should_compile/all.T @@ -29,3 +29,4 @@ test('T9208', when(compiler_debugged(), expect_broken(9208)), compile, ['']) # T9208 fails (and should do so) if you have assertion checking on in the compiler # Hence the above expect_broken. See comments in the Trac ticket +test('T10694', only_ways(['normal']), run_command, ['$MAKE -s --no-print-directory T10694']) From git at git.haskell.org Thu Jul 30 10:02:28 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 30 Jul 2015 10:02:28 +0000 (UTC) Subject: [commit: ghc] master: The parallel package has warnings (918dcf8) Message-ID: <20150730100228.E9E6D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/918dcf835198237b2fb26d5010b246717b0cb726/ghc >--------------------------------------------------------------- commit 918dcf835198237b2fb26d5010b246717b0cb726 Author: Simon Peyton Jones Date: Thu Jul 30 11:01:55 2015 +0100 The parallel package has warnings This patch suppresses them until they are fixed libraries/parallel/Control/Parallel/Strategies.hs:513:2: warning: Rule "parList/rseq" may never fire because ?rseq? might inline first Probable fix: add an INLINE[n] or NOINLINE[n] pragma for ?rseq? libraries/parallel/Control/Parallel/Strategies.hs:582:1: warning: Rule "evalBuffer/rseq" may never fire because ?rseq? might inline first Probable fix: add an INLINE[n] or NOINLINE[n] pragma for ?rseq? libraries/parallel/Control/Parallel/Strategies.hs:583:1: warning: Rule "parBuffer/rseq" may never fire because ?rseq? might inline first Probable fix: add an INLINE[n] or NOINLINE[n] pragma for ?rseq? >--------------------------------------------------------------- 918dcf835198237b2fb26d5010b246717b0cb726 mk/warnings.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/mk/warnings.mk b/mk/warnings.mk index 2e82428..a960e0e 100644 --- a/mk/warnings.mk +++ b/mk/warnings.mk @@ -39,6 +39,7 @@ utils/hpc_dist-install_EXTRA_HC_OPTS += -fwarn-tabs # Libraries that have dubious RULES libraries/bytestring_dist-install_EXTRA_HC_OPTS += -fno-warn-inline-rule-shadowing +libraries/parallel_dist-install_EXTRA_HC_OPTS += -fno-warn-inline-rule-shadowing # Cabal doesn't promise to be warning-free utils/ghc-cabal_dist_EXTRA_HC_OPTS += -w From git at git.haskell.org Thu Jul 30 10:18:29 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 30 Jul 2015 10:18:29 +0000 (UTC) Subject: [commit: ghc] wip/impredicativity: Leave RULEs checking as before impredicativity (c4a49d8) Message-ID: <20150730101829.E7FE23A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/impredicativity Link : http://ghc.haskell.org/trac/ghc/changeset/c4a49d8d2baf0c051d6198e45b4c9d9b58e0fc51/ghc >--------------------------------------------------------------- commit c4a49d8d2baf0c051d6198e45b4c9d9b58e0fc51 Author: Alejandro Serrano Date: Thu Jul 30 09:06:20 2015 +0200 Leave RULEs checking as before impredicativity >--------------------------------------------------------------- c4a49d8d2baf0c051d6198e45b4c9d9b58e0fc51 compiler/deSugar/DsBinds.hs | 8 -------- compiler/typecheck/TcRules.hs | 40 ++++------------------------------------ 2 files changed, 4 insertions(+), 44 deletions(-) diff --git a/compiler/deSugar/DsBinds.hs b/compiler/deSugar/DsBinds.hs index 340b157..04df777 100644 --- a/compiler/deSugar/DsBinds.hs +++ b/compiler/deSugar/DsBinds.hs @@ -631,14 +631,6 @@ decomposeRuleLhs orig_bndrs orig_lhs split_lets :: CoreExpr -> ([(DictId,CoreExpr)], CoreExpr) split_lets e - -- <~ constraints sometimes lead to dictionaries - -- of the form $dict1 = $dict2. - -- Those dictionaries shall not be removed, - -- otherwise the code will be deemed wrong. - | Let (NonRec d r) _body <- e - , isDictId d - , Var _ <- r - = ([], e) | Let (NonRec d r) body <- e , isDictId d , (bs, body') <- split_lets body diff --git a/compiler/typecheck/TcRules.hs b/compiler/typecheck/TcRules.hs index 4803aa7..1cd803e 100644 --- a/compiler/typecheck/TcRules.hs +++ b/compiler/typecheck/TcRules.hs @@ -74,14 +74,9 @@ tcRule (HsRule name act hs_bndrs lhs fv_lhs rhs fv_rhs) <- tcExtendTyVarEnv tv_bndrs $ tcExtendIdEnv id_bndrs' $ do { -- See Note [Solve order for RULES] - ; lhs_ty <- newFlexiTyVarTy openTypeKind - ; (lhs', lhs_wanted) <- captureConstraints (tcPolyMonoExpr lhs lhs_ty) - ; rule_ty <- newFlexiTyVarTy openTypeKind + ((lhs', rule_ty), lhs_wanted) <- captureConstraints (tcInferRho lhs) ; (rhs', rhs_wanted) <- captureConstraints (tcPolyMonoExpr rhs rule_ty) - -- Add the constraint that InstanceOf lhs_ty rule_ty - ; inst_w <- newWanted AnnOrigin (mkTcInstanceOfPred lhs_ty rule_ty) - ; let rhs_wanted' = mkSimpleWC [inst_w] `andWC` rhs_wanted - ; return (lhs', lhs_wanted, rhs', rhs_wanted', rule_ty) } + ; return (lhs', lhs_wanted, rhs', rhs_wanted, rule_ty) } ; (lhs_evs, other_lhs_wanted) <- simplifyRule (snd $ unLoc name) (bndr_wanted `andWC` lhs_wanted) @@ -312,34 +307,15 @@ simplifyRule name lhs_wanted rhs_wanted -- variables: runTcS runs with topTcLevel tc_lvl <- getTcLevel - -- Do not use <~ constraints in RULES, - -- so we need to instantiate - ; let lhs_wanted_simple = wc_simple lhs_wanted - ; (lhs_wanted_inst, _) <- runTcS $ - fmap andManyCts $ mapM instantiateWC (bagToList lhs_wanted_simple) - ; let lhs_wanted_inst' = remove_duplicates lhs_wanted_simple lhs_wanted_inst - -- Build new WantedConstraints by adding the new instantiated - -- We need to be careful not to duplicate constraints, - -- because it would lead to too many forall's - ; let new_lhs_wanted_simple = wc_simple lhs_wanted `unionBags` lhs_wanted_inst' - new_lhs_wanted = lhs_wanted { wc_simple = new_lhs_wanted_simple } - ; (insoluble, _) <- runTcS $ do { -- First solve the LHS and *then* solve the RHS -- See Note [Solve order for RULES] - lhs_resid <- solveWanteds new_lhs_wanted + lhs_resid <- solveWanteds lhs_wanted ; rhs_resid <- solveWanteds rhs_wanted ; return (insolubleWC tc_lvl lhs_resid || insolubleWC tc_lvl rhs_resid) } ; zonked_lhs_simples <- zonkSimples (wc_simple lhs_wanted) - ; zonked_lhs_inst <- zonkSimples lhs_wanted_inst' - -- We need to remove duplicates once again, - -- because we might get new duplicated constraints - -- from unification of variables - ; let zonked_lhs = zonked_lhs_simples `unionBags` - remove_duplicates zonked_lhs_simples zonked_lhs_inst - - ; let (q_cts, non_q_cts) = partitionBag quantify_me zonked_lhs + ; let (q_cts, non_q_cts) = partitionBag quantify_me zonked_lhs_simples quantify_me -- Note [RULE quantification over equalities] | insoluble = quantify_insol | otherwise = quantify_normal @@ -357,7 +333,6 @@ simplifyRule name lhs_wanted rhs_wanted ; traceTc "simplifyRule" $ vcat [ ptext (sLit "LHS of rule") <+> doubleQuotes (ftext name) , text "lhs_wantd" <+> ppr lhs_wanted - , text "lhs_inst" <+> ppr lhs_wanted_inst , text "rhs_wantd" <+> ppr rhs_wanted , text "zonked_lhs" <+> ppr zonked_lhs_simples , text "q_cts" <+> ppr q_cts @@ -365,10 +340,3 @@ simplifyRule name lhs_wanted rhs_wanted ; return ( map (ctEvId . ctEvidence) (bagToList q_cts) , lhs_wanted { wc_simple = non_q_cts }) } - -remove_duplicates :: Cts -> Cts -> Cts -remove_duplicates main new - = filterBag none_with_same_type new - where - same_type x y = ctPred x == ctPred y - none_with_same_type x = not (anyBag (same_type x) main) From git at git.haskell.org Thu Jul 30 10:18:32 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 30 Jul 2015 10:18:32 +0000 (UTC) Subject: [commit: ghc] wip/impredicativity: Better simplification of casts in simple_opt_expr (aa11d02) Message-ID: <20150730101832.AE1893A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/impredicativity Link : http://ghc.haskell.org/trac/ghc/changeset/aa11d02b719cb6226f69220ac85f2cf8f1a66a2d/ghc >--------------------------------------------------------------- commit aa11d02b719cb6226f69220ac85f2cf8f1a66a2d Author: Alejandro Serrano Date: Thu Jul 30 10:48:55 2015 +0200 Better simplification of casts in simple_opt_expr >--------------------------------------------------------------- aa11d02b719cb6226f69220ac85f2cf8f1a66a2d compiler/coreSyn/CoreSubst.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/compiler/coreSyn/CoreSubst.hs b/compiler/coreSyn/CoreSubst.hs index f69e512..6fec2cf 100644 --- a/compiler/coreSyn/CoreSubst.hs +++ b/compiler/coreSyn/CoreSubst.hs @@ -1035,9 +1035,11 @@ simple_cast subst (Cast e e_co) = go e e_co where go (Cast e e_co) co = go e (mkTransCo e_co co) - go e co | isReflCo co' = simple_opt_expr subst e - | otherwise = Cast (simple_opt_expr subst e) co' - where co' = optCoercion (getCvSubst subst) co + go e co = case simple_opt_expr subst e of + e'@(Cast _ _) -> go e' co + e' | isReflCo co' -> e' + | otherwise -> Cast e' co' + where co' = optCoercion (getCvSubst subst) co simple_cast subst e = simple_opt_expr subst e From git at git.haskell.org Thu Jul 30 14:34:43 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 30 Jul 2015 14:34:43 +0000 (UTC) Subject: [commit: ghc] master: Modify spec002 to be less trivial (2e33b9c) Message-ID: <20150730143443.CCBCA3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/2e33b9c87615d3cc26ad188d5ca565e8a981208e/ghc >--------------------------------------------------------------- commit 2e33b9c87615d3cc26ad188d5ca565e8a981208e Author: Simon Peyton Jones Date: Tue Jul 28 22:24:46 2015 +0100 Modify spec002 to be less trivial As it stood the main function in the test always returned bottom, and GHC noticed that and therefore made no attempt to optimise it, which rather negated the test. This change makes it non-vacuous. >--------------------------------------------------------------- 2e33b9c87615d3cc26ad188d5ca565e8a981208e testsuite/tests/simplCore/should_compile/spec002.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/testsuite/tests/simplCore/should_compile/spec002.hs b/testsuite/tests/simplCore/should_compile/spec002.hs index 1fb88d9..106debc 100644 --- a/testsuite/tests/simplCore/should_compile/spec002.hs +++ b/testsuite/tests/simplCore/should_compile/spec002.hs @@ -13,5 +13,6 @@ laLayout :: Int -> [Int] -> [Token] -> [Token] laLayout l (s:ss) (t1@(l1, n1, w1, c1) : t2@(l2, n2, w2, c2) : ts) | n1 < s = laLayout l2 (n2:s:ss) ts + | n1 == s = [] -- Otherwise laLayout is bottom! | otherwise = laLayout l ss (t1:t2:ts) From git at git.haskell.org Thu Jul 30 14:34:47 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 30 Jul 2015 14:34:47 +0000 (UTC) Subject: [commit: ghc] master: Better treatment of signatures in cls/inst (72d23c3) Message-ID: <20150730143447.635623A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/72d23c3e0244b1163d7806e40128ad51cc959f7f/ghc >--------------------------------------------------------------- commit 72d23c3e0244b1163d7806e40128ad51cc959f7f Author: Simon Peyton Jones Date: Thu Jul 30 15:06:55 2015 +0100 Better treatment of signatures in cls/inst The provoking cause for this patch is Trac #5001, comment:23. There was an INLINE pragma in an instance decl, that shouldn't be there. But there was no complaint, just a mysterious WARN later. I ended up having to do some real refactoring but the result is, I think, simpler and more robust. >--------------------------------------------------------------- 72d23c3e0244b1163d7806e40128ad51cc959f7f compiler/rename/RnBinds.hs | 132 ++++++++++++--------- compiler/rename/RnEnv.hs | 5 +- compiler/rename/RnSource.hs | 79 ++++-------- compiler/typecheck/TcBinds.hs | 7 +- compiler/typecheck/TcDeriv.hs | 2 +- testsuite/tests/module/mod48.stderr | 6 +- .../should_fail/WildcardInInstanceSig.hs | 4 +- .../should_fail/WildcardInInstanceSig.stderr | 2 +- testsuite/tests/patsyn/should_fail/T9705-1.stderr | 4 +- testsuite/tests/patsyn/should_fail/T9705-2.stderr | 4 +- testsuite/tests/rename/should_fail/T5001.hs | 10 ++ testsuite/tests/rename/should_fail/T5001.stderr | 4 + testsuite/tests/rename/should_fail/all.T | 1 + .../tests/typecheck/should_fail/tcfail021.stderr | 4 +- 14 files changed, 137 insertions(+), 127 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 72d23c3e0244b1163d7806e40128ad51cc959f7f From git at git.haskell.org Thu Jul 30 14:51:26 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 30 Jul 2015 14:51:26 +0000 (UTC) Subject: [commit: ghc] master: Fix missing files (24afe6d) Message-ID: <20150730145126.CEC913A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/24afe6d3aae1a04fbb394fa87d9ca45203ce2b67/ghc >--------------------------------------------------------------- commit 24afe6d3aae1a04fbb394fa87d9ca45203ce2b67 Author: Simon Peyton Jones Date: Thu Jul 30 15:52:09 2015 +0100 Fix missing files These two testsuite files were correct in my build tree but not in my source tree; apologies. >--------------------------------------------------------------- 24afe6d3aae1a04fbb394fa87d9ca45203ce2b67 testsuite/tests/simplCore/should_compile/T7287.stderr | 5 +++++ testsuite/tests/stranal/should_compile/T10694.stdout | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/testsuite/tests/simplCore/should_compile/T7287.stderr b/testsuite/tests/simplCore/should_compile/T7287.stderr new file mode 100644 index 0000000..66dfe00 --- /dev/null +++ b/testsuite/tests/simplCore/should_compile/T7287.stderr @@ -0,0 +1,5 @@ + +T7287.hs:7:3: warning: + Rule "int2Word#/word2Int#" may never fire + because rule "word2Int#" for ?word2Int#? might fire first + Probable fix: add phase [n] or [~n] to the competing rule diff --git a/testsuite/tests/stranal/should_compile/T10694.stdout b/testsuite/tests/stranal/should_compile/T10694.stdout index 0519ecb..2797ce7 100644 --- a/testsuite/tests/stranal/should_compile/T10694.stdout +++ b/testsuite/tests/stranal/should_compile/T10694.stdout @@ -1 +1,2 @@ - \ No newline at end of file +[GblId, Arity=2, Str=DmdType m] + Str=DmdType , From git at git.haskell.org Thu Jul 30 15:04:44 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 30 Jul 2015 15:04:44 +0000 (UTC) Subject: [commit: ghc] master: Don't allowInterrupt inside uninterruptibleMask (5a8a8a6) Message-ID: <20150730150444.B234A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/5a8a8a64e793d2efbe9ea7d445cc8efe75d11f80/ghc >--------------------------------------------------------------- commit 5a8a8a64e793d2efbe9ea7d445cc8efe75d11f80 Author: Ben Gamari Date: Mon Jul 27 15:04:43 2015 +0200 Don't allowInterrupt inside uninterruptibleMask This fixes #9516. Differential Revision: https://phabricator.haskell.org/D181 Authored-by: Edsko de Vries >--------------------------------------------------------------- 5a8a8a64e793d2efbe9ea7d445cc8efe75d11f80 docs/users_guide/7.12.1-notes.xml | 16 ++++++++++++++++ libraries/base/Control/Exception.hs | 7 ++++--- libraries/base/GHC/IO.hs | 18 +++++++++++++++++- libraries/base/changelog.md | 3 +++ 4 files changed, 40 insertions(+), 4 deletions(-) diff --git a/docs/users_guide/7.12.1-notes.xml b/docs/users_guide/7.12.1-notes.xml index eccf13d..e00706c 100644 --- a/docs/users_guide/7.12.1-notes.xml +++ b/docs/users_guide/7.12.1-notes.xml @@ -234,6 +234,22 @@ call. + + + A new function, interruptible, was added + to GHC.IO allowing an + IO action to be run such that it can be + interrupted by an asynchronous exception, even if exceptions + are masked (except if masked with + interruptibleMask). + + + This was introduced to fix the behavior of + allowInterrupt, which would previously + incorrectly allow exceptions in uninterruptible regions + (see Trac #9516). + + diff --git a/libraries/base/Control/Exception.hs b/libraries/base/Control/Exception.hs index 61ebf29..9c388f4 100644 --- a/libraries/base/Control/Exception.hs +++ b/libraries/base/Control/Exception.hs @@ -106,6 +106,7 @@ module Control.Exception ( uninterruptibleMask_, MaskingState(..), getMaskingState, + interruptible, allowInterrupt, -- *** Applying @mask@ to an exception handler @@ -134,7 +135,7 @@ module Control.Exception ( import Control.Exception.Base import GHC.Base -import GHC.IO (unsafeUnmask) +import GHC.IO (interruptible) -- | You need this when using 'catches'. data Handler a = forall e . Exception e => Handler (e -> IO a) @@ -215,14 +216,14 @@ A typical use of 'tryJust' for recovery looks like this: -- | When invoked inside 'mask', this function allows a masked -- asynchronous exception to be raised, if one exists. It is -- equivalent to performing an interruptible operation (see --- #interruptible#), but does not involve any actual blocking. +-- #interruptible), but does not involve any actual blocking. -- -- When called outside 'mask', or inside 'uninterruptibleMask', this -- function has no effect. -- -- @since 4.4.0.0 allowInterrupt :: IO () -allowInterrupt = unsafeUnmask $ return () +allowInterrupt = interruptible $ return () {- $async diff --git a/libraries/base/GHC/IO.hs b/libraries/base/GHC/IO.hs index 7dbd338..231d110 100644 --- a/libraries/base/GHC/IO.hs +++ b/libraries/base/GHC/IO.hs @@ -36,7 +36,7 @@ module GHC.IO ( catchException, catchAny, throwIO, mask, mask_, uninterruptibleMask, uninterruptibleMask_, MaskingState(..), getMaskingState, - unsafeUnmask, + unsafeUnmask, interruptible, onException, bracket, finally, evaluate ) where @@ -341,6 +341,22 @@ unblock = unsafeUnmask unsafeUnmask :: IO a -> IO a unsafeUnmask (IO io) = IO $ unmaskAsyncExceptions# io +-- | Allow asynchronous exceptions to be raised even inside 'mask', making +-- the operation interruptible (see the discussion of "Interruptible operations" +-- in 'Control.Exception'). +-- +-- When called outside 'mask', or inside 'uninterruptibleMask', this +-- function has no effect. +-- +-- /Since: 4.8.2.0/ +interruptible :: IO a -> IO a +interruptible act = do + st <- getMaskingState + case st of + Unmasked -> act + MaskedInterruptible -> unsafeUnmask act + MaskedUninterruptible -> act + blockUninterruptible :: IO a -> IO a blockUninterruptible (IO io) = IO $ maskUninterruptible# io diff --git a/libraries/base/changelog.md b/libraries/base/changelog.md index 53bcb10..7a4bb71 100644 --- a/libraries/base/changelog.md +++ b/libraries/base/changelog.md @@ -45,6 +45,9 @@ * Exported `GiveGCStats`, `DoCostCentres`, `DoHeapProfile`, `DoTrace`, `RtsTime`, and `RtsNat` from `GHC.RTS.Flags` + * New function `GHC.IO.interruptible` used to correctly implement + `Control.Exception.allowInterrupt` (#9516) + ## 4.8.1.0 *TBA* * Bundled with GHC 7.10.2 From git at git.haskell.org Thu Jul 30 15:04:47 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 30 Jul 2015 15:04:47 +0000 (UTC) Subject: [commit: ghc] master: Make configure error out on missing ghc-tarballs on Windows (9f7cdfe) Message-ID: <20150730150447.789CA3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/9f7cdfee3e9f9ca6fbfa27d3b2dc2d86ac4ee226/ghc >--------------------------------------------------------------- commit 9f7cdfee3e9f9ca6fbfa27d3b2dc2d86ac4ee226 Author: Tamar Christina Date: Thu Jul 30 10:36:45 2015 +0200 Make configure error out on missing ghc-tarballs on Windows Currently checking out the source on windows requires two git checkouts. One for the GHC sources and one for the GHC-tarballs. This patch will make configure issue an error if compiling under windows and the GHC-tarballs folder is missing. On failure the user is told which command they need to run to get the tarballs or if they want configure to handle it for them configure provide the `--enable-tarballs-autodownload` flag. Test Plan: 1. make sure ghc-tarballs folder is not present 2. run ./configure which should fail giving an error that tarballs is missing and how to get it 3. run ./configure --enable-tarballs-autodownload and the tarballs should be downloaded and configure finishes 4. rerun the command in 3, no new download should be done. 5. run configure without --enable-tarballs-autodownload, configure should finish correctly. Reviewers: bgamari, austin, thomie Reviewed By: thomie Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1108 GHC Trac Issues: #10705 >--------------------------------------------------------------- 9f7cdfee3e9f9ca6fbfa27d3b2dc2d86ac4ee226 HACKING.md | 6 +++--- INSTALL.md | 5 +++++ README.md | 10 +++++----- configure.ac | 43 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 56 insertions(+), 8 deletions(-) diff --git a/HACKING.md b/HACKING.md index b59e747..6ed39ea 100644 --- a/HACKING.md +++ b/HACKING.md @@ -33,11 +33,11 @@ Next, clone the repository and all the associated libraries: $ git clone --recursive git://git.haskell.org/ghc.git ``` -On Windows, you need an extra repository containing some build tools: +On Windows, you need an extra repository containing some build tools. +These can be downloaded for you by configure. This only needs to be done once by running: ``` -$ cd ghc/ -$ git clone git://git.haskell.org/ghc-tarballs.git +$ ./configure --enable-tarballs-autodownload ``` First copy `mk/build.mk.sample` to `mk/build.mk` and ensure it has diff --git a/INSTALL.md b/INSTALL.md index 1db2595..58930af 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -23,6 +23,11 @@ Quick start: the following gives you a default build: $ make $ make install + On Windows, you need an extra repository containing some build tools. + These can be downloaded for you by configure. This only needs to be done once by running: + + $ ./configure --enable-tarballs-autodownload + 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. diff --git a/README.md b/README.md index 5ad1adb..025140c 100644 --- a/README.md +++ b/README.md @@ -28,11 +28,6 @@ There are two ways to get a source tree: $ git clone --recursive git://git.haskell.org/ghc.git - On Windows, you need an extra repository containing some build tools: - - $ cd ghc/ - $ git clone git://git.haskell.org/ghc-tarballs.git - Note: cloning GHC from Github requires a special setup. See [Getting a GHC repository from Github] [7]. @@ -66,6 +61,11 @@ dblatex. $ make # can also say 'make -jX' for X number of jobs $ make install + On Windows, you need an extra repository containing some build tools. + These can be downloaded for you by configure. This only needs to be done once by running: + + $ ./configure --enable-tarballs-autodownload + (NB: **Do you have multiple cores? Be sure to tell that to `make`!** This can save you hours of build time depending on your system configuration, and is almost always a win regardless of how many cores you have. As a simple rule, diff --git a/configure.ac b/configure.ac index d896c8b..d60acb7 100644 --- a/configure.ac +++ b/configure.ac @@ -101,6 +101,12 @@ AC_ARG_ENABLE(bootstrap-with-devel-snapshot, EnableBootstrapWithDevelSnaphost=NO ) +AC_ARG_ENABLE(tarballs-autodownload, +[AC_HELP_STRING([--enable-tarballs-autodownload], + [Automatically download Windows distribution binaries if needed.])], + TarballsAutodownload=YES, + TarballsAutodownload=NO +) if test "$WithGhc" != ""; then FPTOOLS_GHC_VERSION([GhcVersion], [GhcMajVersion], [GhcMinVersion], [GhcPatchLevel])dnl @@ -274,12 +280,49 @@ AC_SUBST(WithHc) FP_INTREE_GHC_PWD FP_FIND_ROOT +function fail() { + echo >&2 + echo "$1" >&2 + exit 1 +} + +function set_up_tarballs() { + local tarball_repo_url="$1" + local tarball_dir="$2" + + if ! test -d "${tarball_dir}" + then + local git_cmd="git clone ${tarball_repo_url} ${tarball_dir}" + if test "$TarballsAutodownload" = "NO" + then + echo >&2 + echo "ERROR: Windows tarball binary distributions not found." >&2 + echo "Please rerun configure with --enable-tarballs-autodownload, or clone the repository manually:" >&2 + echo " $git_cmd" >&2 + exit 1 + fi + AC_MSG_NOTICE([Downloading Windows tarball distributions to ${tarball_dir}...]) + $git_cmd || { + rm -f "${tarball_dir}" + fail "ERROR: Git clone failed." + } + else + AC_MSG_NOTICE([Using Windows tarball distributions found in ${tarball_dir}...]) + fi +} + if test "$HostOS" = "mingw32" then test -d inplace || mkdir inplace + # NB. For now just run git clone on the tarball repo + ghc_tarball_repo='git://git.haskell.org/ghc-tarballs.git' + ghc_tarball_dir='ghc-tarballs' + set_up_tarballs "${ghc_tarball_repo}" "${ghc_tarball_dir}" + if test "$HostArch" = "i386" then + # NB. If you update the tarballs to a new version of gcc, don't # forget to tweak the paths in driver/gcc/gcc.c. if ! test -d inplace/mingw || From git at git.haskell.org Thu Jul 30 15:04:51 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 30 Jul 2015 15:04:51 +0000 (UTC) Subject: [commit: ghc] master: Improve error message for newtypes and deriving clauses (4f80ec0) Message-ID: <20150730150451.4AE233A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/4f80ec0ee438800d95673a4898e69371957fed09/ghc >--------------------------------------------------------------- commit 4f80ec0ee438800d95673a4898e69371957fed09 Author: John Wiegley Date: Thu Jul 30 15:08:28 2015 +0200 Improve error message for newtypes and deriving clauses Summary: Change the error message generated when a deriving clause related to a newtype fails to always suggested trying GeneralizedNewtypeDeriving, even in situations where it may not work. Fixes #9600. Test Plan: testsuite/deriving/should_fail/9600.hs Reviewers: austin, bgamari, simonpj Rebased-by: bgamari Reviewed By: simonpj Subscribers: bgamari, hvr, simonmar, carter Differential Revision: https://phabricator.haskell.org/D216 GHC Trac Issues: #9600 >--------------------------------------------------------------- 4f80ec0ee438800d95673a4898e69371957fed09 compiler/typecheck/TcDeriv.hs | 24 ++++++++++++++-------- testsuite/tests/deriving/should_fail/T2721.stderr | 4 ++-- testsuite/tests/deriving/should_fail/T3833.stderr | 4 ++-- testsuite/tests/deriving/should_fail/T3834.stderr | 4 ++-- testsuite/tests/deriving/should_fail/T9600-1.hs | 5 +++++ .../tests/deriving/should_fail/T9600-1.stderr | 6 ++++++ testsuite/tests/deriving/should_fail/T9600.hs | 3 +++ testsuite/tests/deriving/should_fail/T9600.stderr | 6 ++++++ testsuite/tests/deriving/should_fail/all.T | 2 ++ .../tests/deriving/should_fail/drvfail009.stderr | 12 +++++------ testsuite/tests/generics/T5462No1.stderr | 12 +++++------ testsuite/tests/module/mod53.stderr | 4 ++-- .../tests/parser/should_fail/readFail039.stderr | 4 ++-- testsuite/tests/safeHaskell/ghci/p16.stderr | 2 +- 14 files changed, 61 insertions(+), 31 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 4f80ec0ee438800d95673a4898e69371957fed09 From git at git.haskell.org Thu Jul 30 15:04:54 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 30 Jul 2015 15:04:54 +0000 (UTC) Subject: [commit: ghc] master: Fix misspelled function name in a comment (26315ed) Message-ID: <20150730150454.0DF7C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/26315ed282db2eb1977872bbcb0b298f32b38e99/ghc >--------------------------------------------------------------- commit 26315ed282db2eb1977872bbcb0b298f32b38e99 Author: Bartosz Nitka Date: Thu Jul 30 15:05:05 2015 +0200 Fix misspelled function name in a comment Test Plan: none Reviewers: austin, simonmar, bgamari Reviewed By: simonmar, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1112 >--------------------------------------------------------------- 26315ed282db2eb1977872bbcb0b298f32b38e99 compiler/nativeGen/RegAlloc/Graph/TrivColorable.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/nativeGen/RegAlloc/Graph/TrivColorable.hs b/compiler/nativeGen/RegAlloc/Graph/TrivColorable.hs index a255a90..c63d52d 100644 --- a/compiler/nativeGen/RegAlloc/Graph/TrivColorable.hs +++ b/compiler/nativeGen/RegAlloc/Graph/TrivColorable.hs @@ -75,7 +75,7 @@ Therefore the UniqFM is made non-abstract and we use custom fold. MS 2010/04 When converting UniqFM to use Data.IntMap, the fold cannot use UniqFM internal -representation any more. But it is imperative that the assSqueeze stops +representation any more. But it is imperative that the accSqueeze stops the folding if the count gets greater or equal to maxCount. We thus convert UniqFM to a (lazy) list, do the fold and stops if necessary, which was the most efficient variant tried. Benchmark compiling 10-times SHA1.hs follows. From git at git.haskell.org Thu Jul 30 15:04:56 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 30 Jul 2015 15:04:56 +0000 (UTC) Subject: [commit: ghc] master: Make headers C++ compatible (fixes #10700) (e7c331a) Message-ID: <20150730150456.C520C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e7c331af4674dd072a9f1d67feb586679b365b98/ghc >--------------------------------------------------------------- commit e7c331af4674dd072a9f1d67feb586679b365b98 Author: Alexey Shmalko Date: Thu Jul 30 10:37:05 2015 +0200 Make headers C++ compatible (fixes #10700) Some headers used `new` as parameter name, which is reserved word in C++. This patch changes these names to `new_`. Test Plan: validate Reviewers: austin, ezyang, bgamari, simonmar Reviewed By: simonmar Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1107 GHC Trac Issues: #10700 >--------------------------------------------------------------- e7c331af4674dd072a9f1d67feb586679b365b98 includes/stg/Prim.h | 8 ++++---- includes/stg/SMP.h | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/includes/stg/Prim.h b/includes/stg/Prim.h index 80f4f8e..b07e177 100644 --- a/includes/stg/Prim.h +++ b/includes/stg/Prim.h @@ -39,10 +39,10 @@ StgWord hs_atomic_xor8(volatile StgWord8 *x, StgWord val); StgWord hs_atomic_xor16(volatile StgWord16 *x, StgWord val); StgWord hs_atomic_xor32(volatile StgWord32 *x, StgWord val); StgWord64 hs_atomic_xor64(volatile StgWord64 *x, StgWord64 val); -StgWord hs_cmpxchg8(volatile StgWord8 *x, StgWord old, StgWord new); -StgWord hs_cmpxchg16(volatile StgWord16 *x, StgWord old, StgWord new); -StgWord hs_cmpxchg32(volatile StgWord32 *x, StgWord old, StgWord new); -StgWord hs_cmpxchg64(volatile StgWord64 *x, StgWord64 old, StgWord64 new); +StgWord hs_cmpxchg8(volatile StgWord8 *x, StgWord old, StgWord new_); +StgWord hs_cmpxchg16(volatile StgWord16 *x, StgWord old, StgWord new_); +StgWord hs_cmpxchg32(volatile StgWord32 *x, StgWord old, StgWord new_); +StgWord hs_cmpxchg64(volatile StgWord64 *x, StgWord64 old, StgWord64 new_); StgWord hs_atomicread8(volatile StgWord8 *x); StgWord hs_atomicread16(volatile StgWord16 *x); StgWord hs_atomicread32(volatile StgWord32 *x); diff --git a/includes/stg/SMP.h b/includes/stg/SMP.h index 2bc0015..b0636d5 100644 --- a/includes/stg/SMP.h +++ b/includes/stg/SMP.h @@ -302,12 +302,12 @@ atomic_inc(StgVolatilePtr p, StgWord incr) ); return r + incr; #else - StgWord old, new; + StgWord old, new_; do { old = *p; - new = old + incr; - } while (cas(p, old, new) != old); - return new; + new_ = old + incr; + } while (cas(p, old, new_) != old); + return new_; #endif } @@ -323,12 +323,12 @@ atomic_dec(StgVolatilePtr p) ); return r-1; #else - StgWord old, new; + StgWord old, new_; do { old = *p; - new = old - 1; - } while (cas(p, old, new) != old); - return new; + new_ = old - 1; + } while (cas(p, old, new_) != old); + return new_; #endif } From git at git.haskell.org Thu Jul 30 15:22:24 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 30 Jul 2015 15:22:24 +0000 (UTC) Subject: [commit: ghc] master: Typos in comments and strings (e9ad42d) Message-ID: <20150730152224.1E01B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e9ad42da5aa8a6cab95461a8592e92ca08aa491a/ghc >--------------------------------------------------------------- commit e9ad42da5aa8a6cab95461a8592e92ca08aa491a Author: Gabor Greif Date: Thu Jul 30 17:06:33 2015 +0200 Typos in comments and strings Note: the haddock comment in TyCon.hs seems to be garbled syntactically and grammatically >--------------------------------------------------------------- e9ad42da5aa8a6cab95461a8592e92ca08aa491a compiler/hsSyn/HsExpr.hs | 2 +- compiler/typecheck/TcValidity.hs | 2 +- compiler/types/TyCon.hs | 4 ++-- docs/rts/rts.tex | 2 +- testsuite/tests/programs/galois_raytrace/Eval.hs | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/compiler/hsSyn/HsExpr.hs b/compiler/hsSyn/HsExpr.hs index c81707d..ecb4a02 100644 --- a/compiler/hsSyn/HsExpr.hs +++ b/compiler/hsSyn/HsExpr.hs @@ -1267,7 +1267,7 @@ data StmtLR idL idR body -- body should always be (LHs**** idR) body (SyntaxExpr idR) -- The return operator, used only for MonadComp -- For ListComp, PArrComp, we use the baked-in 'return' - -- For DoExpr, MDoExpr, we don't appply a 'return' at all + -- For DoExpr, MDoExpr, we don't apply a 'return' at all -- See Note [Monad Comprehensions] -- | - 'ApiAnnotation.AnnKeywordId' : 'ApiAnnotation.AnnLarrow' diff --git a/compiler/typecheck/TcValidity.hs b/compiler/typecheck/TcValidity.hs index 355341a..4dd9a5e 100644 --- a/compiler/typecheck/TcValidity.hs +++ b/compiler/typecheck/TcValidity.hs @@ -168,7 +168,7 @@ Only a *class* predicate can give rise to ambiguity An *implicit parameter* cannot. For example: foo :: (?x :: [a]) => Int foo = length ?x -is fine. The call site will suppply a particular 'x' +is fine. The call site will supply a particular 'x' Furthermore, the type variables fixed by an implicit parameter propagate to the others. E.g. diff --git a/compiler/types/TyCon.hs b/compiler/types/TyCon.hs index 1cacf2e..683c939 100644 --- a/compiler/types/TyCon.hs +++ b/compiler/types/TyCon.hs @@ -1402,8 +1402,8 @@ isDataFamilyTyCon :: TyCon -> Bool isDataFamilyTyCon (AlgTyCon {algTcRhs = DataFamilyTyCon {}}) = True isDataFamilyTyCon _ = False --- | Are we able to extract informationa 'TyVar' to class argument list --- mappping from a given 'TyCon'? +-- | Are we able to extract information 'TyVar' to class argument list +-- mapping from a given 'TyCon'? isTyConAssoc :: TyCon -> Bool isTyConAssoc tc = isJust (tyConAssoc_maybe tc) diff --git a/docs/rts/rts.tex b/docs/rts/rts.tex index 158ae7e..809705e 100644 --- a/docs/rts/rts.tex +++ b/docs/rts/rts.tex @@ -4428,7 +4428,7 @@ while (threads_exist) { do { // enter object on top of stack // if the top object is a BCO, we must enter it - // otherwise appply any heuristic we wish. + // otherwise apply any heuristic we wish. if (thread->stack[thread->sp]->info.type == BCO) { status = runHugs(thread,&smInfo); } else { diff --git a/testsuite/tests/programs/galois_raytrace/Eval.hs b/testsuite/tests/programs/galois_raytrace/Eval.hs index 3ce24e4..58dc1f3 100644 --- a/testsuite/tests/programs/galois_raytrace/Eval.hs +++ b/testsuite/tests/programs/galois_raytrace/Eval.hs @@ -325,7 +325,7 @@ mainEval prog = do { stk <- eval (State emptyEnv [] prog) } -} -done = "Items still on stack at (successfull) termination of program" +done = "Items still on stack at (successful) termination of program" ------------------------------------------------------------------------------ -- testing From git at git.haskell.org Thu Jul 30 16:52:15 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 30 Jul 2015 16:52:15 +0000 (UTC) Subject: [commit: ghc] master: Fix comment that confused Haddock (d7c2b01) Message-ID: <20150730165215.AE96D3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/d7c2b01a783429f0706b9714e15576c836025247/ghc >--------------------------------------------------------------- commit d7c2b01a783429f0706b9714e15576c836025247 Author: Simon Peyton Jones Date: Thu Jul 30 17:52:59 2015 +0100 Fix comment that confused Haddock I wish Haddock did not fall over when some random non-Haddock comment contains *'s. I got compiler/rename/RnBinds.hs:732:8: error: parse error on input ?-- *are not* in scope in the SPECIALISE instance pramas; e.g.? This patch says '-- /are not/ in scope...' to pacify Haddock. >--------------------------------------------------------------- d7c2b01a783429f0706b9714e15576c836025247 compiler/rename/RnBinds.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/rename/RnBinds.hs b/compiler/rename/RnBinds.hs index ceef7c9a..c84a598 100644 --- a/compiler/rename/RnBinds.hs +++ b/compiler/rename/RnBinds.hs @@ -728,8 +728,8 @@ rnMethodBinds is_cls_decl cls ktv_names binds sigs ; binds' <- foldrBagM (rnMethodBindLHS is_cls_decl cls) emptyBag binds -- Rename the pragmas and signatures - -- Annoyingly the type variables *are* in scope for signatures, but - -- *are not* in scope in the SPECIALISE instance pramas; e.g. + -- Annoyingly the type variables /are/ in scope for signatures, but + -- /are not/ in scope in the SPECIALISE instance pramas; e.g. -- instance Eq a => Eq (T a) where -- (==) :: a -> a -> a -- {-# SPECIALISE instance Eq a => Eq (T [a]) #-} From git at git.haskell.org Thu Jul 30 19:39:21 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 30 Jul 2015 19:39:21 +0000 (UTC) Subject: [commit: ghc] master: Testsuite: rename rename/should_fail/T5001 to T5001b (#5001) (b5097fe) Message-ID: <20150730193921.42B843A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/b5097fe77f3d610db3eea8f659df927001bfcc10/ghc >--------------------------------------------------------------- commit b5097fe77f3d610db3eea8f659df927001bfcc10 Author: Thomas Miedema Date: Thu Jul 30 19:27:05 2015 +0200 Testsuite: rename rename/should_fail/T5001 to T5001b (#5001) Test names should be unique. This fixes a framework failure. >--------------------------------------------------------------- b5097fe77f3d610db3eea8f659df927001bfcc10 testsuite/tests/rename/should_fail/{T5001.hs => T5001b.hs} | 0 testsuite/tests/rename/should_fail/{T5001.stderr => T5001b.stderr} | 2 +- testsuite/tests/rename/should_fail/all.T | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/testsuite/tests/rename/should_fail/T5001.hs b/testsuite/tests/rename/should_fail/T5001b.hs similarity index 100% rename from testsuite/tests/rename/should_fail/T5001.hs rename to testsuite/tests/rename/should_fail/T5001b.hs diff --git a/testsuite/tests/rename/should_fail/T5001.stderr b/testsuite/tests/rename/should_fail/T5001b.stderr similarity index 83% rename from testsuite/tests/rename/should_fail/T5001.stderr rename to testsuite/tests/rename/should_fail/T5001b.stderr index 34317cf..e5f7aa1 100644 --- a/testsuite/tests/rename/should_fail/T5001.stderr +++ b/testsuite/tests/rename/should_fail/T5001b.stderr @@ -1,4 +1,4 @@ -T5001.hs:10:17: error: +T5001b.hs:10:17: error: The INLINE pragma for ?genum? lacks an accompanying binding (The INLINE pragma must be given where ?genum? is declared) diff --git a/testsuite/tests/rename/should_fail/all.T b/testsuite/tests/rename/should_fail/all.T index 5438ea5..23648c9 100644 --- a/testsuite/tests/rename/should_fail/all.T +++ b/testsuite/tests/rename/should_fail/all.T @@ -135,4 +135,4 @@ test('T9032', ['$MAKE -s --no-print-directory T9032']) test('T10618', normal, compile_fail, ['']) test('T10668', normal, compile_fail, ['']) -test('T5001', normal, compile_fail, ['']) +test('T5001b', normal, compile_fail, ['']) From git at git.haskell.org Thu Jul 30 20:05:35 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 30 Jul 2015 20:05:35 +0000 (UTC) Subject: [commit: packages/array] master: Testsuite: array001 is working again (68323b2) Message-ID: <20150730200535.AA4CB3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/array On branch : master Link : http://git.haskell.org/packages/array.git/commitdiff/68323b26865ec86a53237ca8974e82bf406a9716 >--------------------------------------------------------------- commit 68323b26865ec86a53237ca8974e82bf406a9716 Author: Thomas Miedema Date: Thu Jul 30 21:57:42 2015 +0200 Testsuite: array001 is working again >--------------------------------------------------------------- 68323b26865ec86a53237ca8974e82bf406a9716 tests/all.T | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/all.T b/tests/all.T index 7324fdf..4fd4844 100644 --- a/tests/all.T +++ b/tests/all.T @@ -3,7 +3,6 @@ test('T2120', normal, compile_and_run, ['']) test('largeArray', normal, compile_and_run, ['']) test('array001', [ extra_clean(['array001.data']), - expect_broken_for(10659, ['hpc', 'optasm', 'threaded2', 'dyn', 'optllvm']), ], compile_and_run, ['']) From git at git.haskell.org Thu Jul 30 20:54:25 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 30 Jul 2015 20:54:25 +0000 (UTC) Subject: [commit: ghc] master: Testsuite: mark tests recently fixed as passing + accept new stderr (e273c67) Message-ID: <20150730205425.9E40C3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/e273c67d0ae044f9fc4ffd1a889ddccf3d6bbc02/ghc >--------------------------------------------------------------- commit e273c67d0ae044f9fc4ffd1a889ddccf3d6bbc02 Author: Thomas Miedema Date: Thu Jul 30 21:58:32 2015 +0200 Testsuite: mark tests recently fixed as passing + accept new stderr Update submodule array. >--------------------------------------------------------------- e273c67d0ae044f9fc4ffd1a889ddccf3d6bbc02 libraries/array | 2 +- testsuite/tests/driver/recomp005/recomp005.stderr | 8 ++++++-- testsuite/tests/gadt/all.T | 2 +- testsuite/tests/typecheck/should_compile/T2497.hs | 2 +- testsuite/tests/typecheck/should_compile/all.T | 2 +- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/libraries/array b/libraries/array index 604afd5..68323b2 160000 --- a/libraries/array +++ b/libraries/array @@ -1 +1 @@ -Subproject commit 604afd531aba4a96b066f6e59a08813107a9eed3 +Subproject commit 68323b26865ec86a53237ca8974e82bf406a9716 diff --git a/testsuite/tests/driver/recomp005/recomp005.stderr b/testsuite/tests/driver/recomp005/recomp005.stderr index a34c8a7..0d43771 100644 --- a/testsuite/tests/driver/recomp005/recomp005.stderr +++ b/testsuite/tests/driver/recomp005/recomp005.stderr @@ -1,4 +1,8 @@ -C.hs:7:11: Warning: +C.hs:7:11: warning: Rule "f/g" may never fire because ?f? might inline first - Probable fix: add an INLINE[n] or NOINLINE[n] pragma on ?f? + Probable fix: add an INLINE[n] or NOINLINE[n] pragma for ?f? + +C.hs:7:11: warning: + Rule "f/g" may never fire because ?g? might inline first + Probable fix: add an INLINE[n] or NOINLINE[n] pragma for ?g? diff --git a/testsuite/tests/gadt/all.T b/testsuite/tests/gadt/all.T index f458553..9a48e69 100644 --- a/testsuite/tests/gadt/all.T +++ b/testsuite/tests/gadt/all.T @@ -70,7 +70,7 @@ test('karl2', normal, compile, ['']) test('data1', normal, compile, ['']) test('data2', normal, compile, ['']) -test('termination', expect_broken_for(10658, ['optasm', 'optllvm']), compile, ['']) +test('termination', normal, compile, ['']) test('set', normal, compile, ['']) test('scoped', normal, compile, ['']) test('gadt-escape1', normal, compile_fail, ['']) diff --git a/testsuite/tests/typecheck/should_compile/T2497.hs b/testsuite/tests/typecheck/should_compile/T2497.hs index 87b717d..67e313c 100644 --- a/testsuite/tests/typecheck/should_compile/T2497.hs +++ b/testsuite/tests/typecheck/should_compile/T2497.hs @@ -15,7 +15,7 @@ foo x = x eq,beq :: Eq a => a -> a -> Bool {-# NOINLINE [0] eq #-} --- The pragma and [~1] in the RULE are to prevent an infinite loo +-- The pragma and [~1] in the RULE are to prevent an infinite loop -- in the simplifier, where the RULE fires infinitely in its -- own RHS eq = (==) -- Used diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T index db9ad0e..9ff759f 100644 --- a/testsuite/tests/typecheck/should_compile/all.T +++ b/testsuite/tests/typecheck/should_compile/all.T @@ -283,7 +283,7 @@ test('T2433', extra_clean(['T2433_Help.hi', 'T2433_Help.o']), multimod_compile, ['T2433', '-v0']) test('T2494', normal, compile_fail, ['']) test('T2494-2', normal, compile, ['']) -test('T2497', expect_broken_for(10657, ['optasm', 'optllvm']), compile, ['']) +test('T2497', normal, compile, ['']) # Omitting temporarily From git at git.haskell.org Thu Jul 30 20:54:28 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 30 Jul 2015 20:54:28 +0000 (UTC) Subject: [commit: ghc] master: Testsuite: skip T10489 unless compiler_debugged (#10489) (756fa0a) Message-ID: <20150730205428.69A933A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/756fa0a3547a5836ff50787a8f89e2db0793f5d3/ghc >--------------------------------------------------------------- commit 756fa0a3547a5836ff50787a8f89e2db0793f5d3 Author: Thomas Miedema Date: Thu Jul 30 21:50:10 2015 +0200 Testsuite: skip T10489 unless compiler_debugged (#10489) >--------------------------------------------------------------- 756fa0a3547a5836ff50787a8f89e2db0793f5d3 testsuite/tests/typecheck/should_compile/T10489.hs | 1 + testsuite/tests/typecheck/should_compile/all.T | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/testsuite/tests/typecheck/should_compile/T10489.hs b/testsuite/tests/typecheck/should_compile/T10489.hs index 892965e..c3d8c5c 100644 --- a/testsuite/tests/typecheck/should_compile/T10489.hs +++ b/testsuite/tests/typecheck/should_compile/T10489.hs @@ -1,3 +1,4 @@ module T10489 where +-- Triggered an ASSERT in a debug build at some point. convert d = let d' = case d of '0' -> '!' in d' diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T index 9ff759f..47a154a 100644 --- a/testsuite/tests/typecheck/should_compile/all.T +++ b/testsuite/tests/typecheck/should_compile/all.T @@ -458,7 +458,7 @@ test('T10390', normal, compile, ['']) test('T8555', normal, compile, ['']) test('T8799', normal, compile, ['']) test('T10423', normal, compile, ['']) -test('T10489', normal, compile, ['']) +test('T10489', unless(compiler_debugged(), skip), compile, ['']) test('T10348', normal, compile, ['']) test('T10494', normal, compile, ['']) test('T10493', normal, compile, ['']) From git at git.haskell.org Thu Jul 30 20:54:31 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 30 Jul 2015 20:54:31 +0000 (UTC) Subject: [commit: ghc] master: Testsuite: add arrows/should_compile/T5333 (#5333) (6880277) Message-ID: <20150730205431.959FF3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/6880277381061593da2c2c19767ba508fb4045e3/ghc >--------------------------------------------------------------- commit 6880277381061593da2c2c19767ba508fb4045e3 Author: Thomas Miedema Date: Mon Jul 27 21:46:26 2015 +0200 Testsuite: add arrows/should_compile/T5333 (#5333) >--------------------------------------------------------------- 6880277381061593da2c2c19767ba508fb4045e3 testsuite/tests/arrows/should_compile/T5333.hs | 28 ++++++++++++++++++++++++++ testsuite/tests/arrows/should_compile/all.T | 1 + 2 files changed, 29 insertions(+) diff --git a/testsuite/tests/arrows/should_compile/T5333.hs b/testsuite/tests/arrows/should_compile/T5333.hs new file mode 100644 index 0000000..808b8a2 --- /dev/null +++ b/testsuite/tests/arrows/should_compile/T5333.hs @@ -0,0 +1,28 @@ +{-# LANGUAGE Arrows, NoMonomorphismRestriction #-} +module T5333 where + +import Prelude hiding ( id, (.) ) +import Control.Arrow + +cc1 :: a e b -> a e b -> a e b +cc1 = undefined + +-- With GHC < 7.10.1, the following compile failures occured: +-- +-- ghc: panic! (the 'impossible' happened) +-- (GHC version 7.8.4 for x86_64-unknown-linux): +-- mkCmdEnv Not found: base:GHC.Desugar.>>>{v 02V} + +-- 'g' fails to compile. +g = proc (x, y, z) -> + ((returnA -< x) &&& (returnA -< y) &&& (returnA -< z)) + +-- 'f' compiles: +-- - without an infix declaration +-- - with the infixl declaration +-- and fails with the infixr declaration +infixr 6 `cc1` +-- infixl 6 `cc1` + +f = proc (x, y, z) -> + ((returnA -< x) `cc1` (returnA -< y) `cc1` (returnA -< z)) diff --git a/testsuite/tests/arrows/should_compile/all.T b/testsuite/tests/arrows/should_compile/all.T index af287cc..ace8af5 100644 --- a/testsuite/tests/arrows/should_compile/all.T +++ b/testsuite/tests/arrows/should_compile/all.T @@ -15,3 +15,4 @@ test('T3964', normal, compile, ['']) test('T5283', normal, compile, ['']) test('T5267', expect_broken(5267), compile, ['']) test('T5022', normal, compile, ['']) +test('T5333', normal, compile, ['']) From git at git.haskell.org Thu Jul 30 20:54:35 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 30 Jul 2015 20:54:35 +0000 (UTC) Subject: [commit: ghc] master: Testsuite: add typecheck/should_fail/T9260 (#9260) (58b5f04) Message-ID: <20150730205435.1B4123A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/58b5f04483258e55b93390fbf5ce41a1dbe23340/ghc >--------------------------------------------------------------- commit 58b5f04483258e55b93390fbf5ce41a1dbe23340 Author: Thomas Miedema Date: Mon Jul 27 22:07:00 2015 +0200 Testsuite: add typecheck/should_fail/T9260 (#9260) >--------------------------------------------------------------- 58b5f04483258e55b93390fbf5ce41a1dbe23340 testsuite/tests/typecheck/should_fail/T9260.hs | 34 ++++++++++++++++++++++ testsuite/tests/typecheck/should_fail/T9260.stderr | 8 +++++ testsuite/tests/typecheck/should_fail/all.T | 1 + 3 files changed, 43 insertions(+) diff --git a/testsuite/tests/typecheck/should_fail/T9260.hs b/testsuite/tests/typecheck/should_fail/T9260.hs new file mode 100644 index 0000000..23c19c7 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T9260.hs @@ -0,0 +1,34 @@ +{-# LANGUAGE DataKinds, TypeOperators, GADTs #-} + +module T9260 where + +import GHC.TypeLits + +data Fin n where + Fzero :: Fin (n + 1) + Fsucc :: Fin n -> Fin (n + 1) + +test :: Fin 1 +test = Fsucc Fzero + +{- Only the second error is legitimate. + +% ghc --version +The Glorious Glasgow Haskell Compilation System, version 7.8.2 +% ghc -ignore-dot-ghci /tmp/Error.hs +[1 of 1] Compiling Error ( /tmp/Error.hs, /tmp/Error.o ) + +/tmp/Error.hs:12:8: + Couldn't match type ?0? with ?1? + Expected type: Fin 1 + Actual type: Fin (0 + 1) + In the expression: Fsucc Fzero + In an equation for ?test?: test = Fsucc Fzero + +/tmp/Error.hs:12:14: + Couldn't match type ?1? with ?0? + Expected type: Fin 0 + Actual type: Fin (0 + 1) + In the first argument of ?Fsucc?, namely ?Fzero? + In the expression: Fsucc Fzero +-} diff --git a/testsuite/tests/typecheck/should_fail/T9260.stderr b/testsuite/tests/typecheck/should_fail/T9260.stderr new file mode 100644 index 0000000..4d1a94a --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T9260.stderr @@ -0,0 +1,8 @@ + +T9260.hs:12:8: error: + Couldn't match type ?(n0 + 1) + 1? with ?1? + The type variable ?n0? is ambiguous + Expected type: Fin 1 + Actual type: Fin ((n0 + 1) + 1) + In the expression: Fsucc Fzero + In an equation for ?test?: test = Fsucc Fzero diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T index bc2b3c9..3fdc38b 100644 --- a/testsuite/tests/typecheck/should_fail/all.T +++ b/testsuite/tests/typecheck/should_fail/all.T @@ -341,6 +341,7 @@ test('T8912', normal, compile_fail, ['']) test('T9033', normal, compile_fail, ['']) test('T8883', normal, compile_fail, ['']) test('T9196', normal, compile_fail, ['']) +test('T9260', normal, compile_fail, ['']) test('T9305', normal, compile_fail, ['']) test('T9323', normal, compile_fail, ['']) test('T9415', normal, compile_fail, ['']) From git at git.haskell.org Thu Jul 30 20:54:38 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 30 Jul 2015 20:54:38 +0000 (UTC) Subject: [commit: ghc] master: Testsuite: add typecheck/should_fail/T8034 (#8034) (58986c4) Message-ID: <20150730205438.AD0093A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/58986c4953b045247cb09caa544981cccf14f242/ghc >--------------------------------------------------------------- commit 58986c4953b045247cb09caa544981cccf14f242 Author: Thomas Miedema Date: Tue Jul 28 00:15:51 2015 +0200 Testsuite: add typecheck/should_fail/T8034 (#8034) >--------------------------------------------------------------- 58986c4953b045247cb09caa544981cccf14f242 testsuite/tests/typecheck/should_fail/T8034.hs | 6 ++++++ testsuite/tests/typecheck/should_fail/T8034.stderr | 12 ++++++++++++ testsuite/tests/typecheck/should_fail/all.T | 1 + 3 files changed, 19 insertions(+) diff --git a/testsuite/tests/typecheck/should_fail/T8034.hs b/testsuite/tests/typecheck/should_fail/T8034.hs new file mode 100644 index 0000000..e432152 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T8034.hs @@ -0,0 +1,6 @@ +{-# LANGUAGE TypeFamilies #-} +module T8034 where + +class C a where + type F a + foo :: F a -> F a diff --git a/testsuite/tests/typecheck/should_fail/T8034.stderr b/testsuite/tests/typecheck/should_fail/T8034.stderr new file mode 100644 index 0000000..cea9dbc --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T8034.stderr @@ -0,0 +1,12 @@ + +T8034.hs:6:3: error: + Couldn't match type ?F a0? with ?F a? + NB: ?F? is a type function, and may not be injective + The type variable ?a0? is ambiguous + Expected type: F a -> F a + Actual type: F a0 -> F a0 + In the ambiguity check for the type signature for ?foo?: + foo :: forall a. C a => F a -> F a + To defer the ambiguity check to use sites, enable AllowAmbiguousTypes + When checking the class method: foo :: forall a. C a => F a -> F a + In the class declaration for ?C? diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T index 3fdc38b..1a2ff9a 100644 --- a/testsuite/tests/typecheck/should_fail/all.T +++ b/testsuite/tests/typecheck/should_fail/all.T @@ -315,6 +315,7 @@ test('T7869', normal, compile_fail, ['']) test('T7892', normal, compile_fail, ['']) test('T7809', normal, compile_fail, ['']) test('T7989', normal, compile_fail, ['']) +test('T8034', normal, compile_fail, ['']) test('T8142', normal, compile_fail, ['']) test('T8262', normal, compile_fail, ['']) test('TcCoercibleFail', when(compiler_lt('ghc', '7.7'), skip), compile_fail, ['']) From git at git.haskell.org Thu Jul 30 22:56:50 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 30 Jul 2015 22:56:50 +0000 (UTC) Subject: [commit: nofib] master: Typos in comments (f9a5779) Message-ID: <20150730225650.9943F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/nofib On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/f9a577973edf6976e4c0703bf2afac900d7b6fd8/nofib >--------------------------------------------------------------- commit f9a577973edf6976e4c0703bf2afac900d7b6fd8 Author: Gabor Greif Date: Fri Jul 31 00:43:38 2015 +0200 Typos in comments >--------------------------------------------------------------- f9a577973edf6976e4c0703bf2afac900d7b6fd8 fibon/Hackage/Pappy/Scar.java | 2 +- fibon/Hackage/Pappy/examples/testsuite-java/Scar.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fibon/Hackage/Pappy/Scar.java b/fibon/Hackage/Pappy/Scar.java index 56ed633..0c222dd 100644 --- a/fibon/Hackage/Pappy/Scar.java +++ b/fibon/Hackage/Pappy/Scar.java @@ -15,7 +15,7 @@ // java.* -> xjava.* // // Revision 1.3 1998/02/22 01:45:09 zox -// Changed few privates to publics and cut down unnecesary output so it can be +// Changed few privates to publics and cut down unnecessary output so it can be // invoked from TestScar. // // Revision 1.2 1998/01/15 20:30:47 raif diff --git a/fibon/Hackage/Pappy/examples/testsuite-java/Scar.java b/fibon/Hackage/Pappy/examples/testsuite-java/Scar.java index 56ed633..0c222dd 100644 --- a/fibon/Hackage/Pappy/examples/testsuite-java/Scar.java +++ b/fibon/Hackage/Pappy/examples/testsuite-java/Scar.java @@ -15,7 +15,7 @@ // java.* -> xjava.* // // Revision 1.3 1998/02/22 01:45:09 zox -// Changed few privates to publics and cut down unnecesary output so it can be +// Changed few privates to publics and cut down unnecessary output so it can be // invoked from TestScar. // // Revision 1.2 1998/01/15 20:30:47 raif From git at git.haskell.org Thu Jul 30 23:47:50 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Thu, 30 Jul 2015 23:47:50 +0000 (UTC) Subject: [commit: ghc] master: Testsuite: T10245 is passing for WAY=ghci (#10245) (aee19d0) Message-ID: <20150730234750.56AD73A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/aee19d08ec36b0ec5d0ed4fab2b63c78a80dbc23/ghc >--------------------------------------------------------------- commit aee19d08ec36b0ec5d0ed4fab2b63c78a80dbc23 Author: Thomas Miedema Date: Fri Jul 31 01:08:09 2015 +0200 Testsuite: T10245 is passing for WAY=ghci (#10245) Needed to get closer to passing `validate --slow`. >--------------------------------------------------------------- aee19d08ec36b0ec5d0ed4fab2b63c78a80dbc23 testsuite/tests/codeGen/should_run/all.T | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/testsuite/tests/codeGen/should_run/all.T b/testsuite/tests/codeGen/should_run/all.T index 7fb2853..f9e0e0e 100644 --- a/testsuite/tests/codeGen/should_run/all.T +++ b/testsuite/tests/codeGen/should_run/all.T @@ -131,7 +131,8 @@ test('T9013', omit_ways(['ghci']), # ghci doesn't support unboxed tuples test('T9340', normal, compile_and_run, ['']) test('cgrun074', normal, compile_and_run, ['']) test('CmmSwitchTest', when(fast(), skip), compile_and_run, ['']) -test('T10245', expect_broken(10246), compile_and_run, ['']) +# Skipping WAY=ghci, because it is not broken. +test('T10245', [omit_ways(['ghci']), expect_broken(10246)], compile_and_run, ['']) test('T10246', expect_broken(10246), compile_and_run, ['']) test('T10414', [only_ways(['threaded2']), extra_ways(['threaded2'])], compile_and_run, ['-feager-blackholing']) From git at git.haskell.org Fri Jul 31 06:42:51 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 31 Jul 2015 06:42:51 +0000 (UTC) Subject: [commit: ghc] master: Backpack docs on renamer and depsolver, also s/package/unit/. (36bbfbd) Message-ID: <20150731064251.4CD8F3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/36bbfbd9cf0536a61bed14ef21741877a3703bbe/ghc >--------------------------------------------------------------- commit 36bbfbd9cf0536a61bed14ef21741877a3703bbe Author: Edward Z. Yang Date: Thu Jul 30 23:43:52 2015 -0700 Backpack docs on renamer and depsolver, also s/package/unit/. Signed-off-by: Edward Z. Yang >--------------------------------------------------------------- 36bbfbd9cf0536a61bed14ef21741877a3703bbe docs/backpack/algorithm.pdf | Bin 299029 -> 286307 bytes docs/backpack/algorithm.tex | 819 +++++++++++++------------------------------- 2 files changed, 233 insertions(+), 586 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 36bbfbd9cf0536a61bed14ef21741877a3703bbe From git at git.haskell.org Fri Jul 31 10:45:47 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 31 Jul 2015 10:45:47 +0000 (UTC) Subject: [commit: ghc] master: Build system: remove function keyword from configure.ac (#10705) (a442800) Message-ID: <20150731104547.09B463A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a442800fd27952bff9bf9773f514ee062f4b55d0/ghc >--------------------------------------------------------------- commit a442800fd27952bff9bf9773f514ee062f4b55d0 Author: Thomas Miedema Date: Fri Jul 31 12:45:44 2015 +0200 Build system: remove function keyword from configure.ac (#10705) This fixes the FreeBSD build. >--------------------------------------------------------------- a442800fd27952bff9bf9773f514ee062f4b55d0 configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index d60acb7..9b21d07 100644 --- a/configure.ac +++ b/configure.ac @@ -280,13 +280,13 @@ AC_SUBST(WithHc) FP_INTREE_GHC_PWD FP_FIND_ROOT -function fail() { +fail() { echo >&2 echo "$1" >&2 exit 1 } -function set_up_tarballs() { +set_up_tarballs() { local tarball_repo_url="$1" local tarball_dir="$2" From git at git.haskell.org Fri Jul 31 12:41:58 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 31 Jul 2015 12:41:58 +0000 (UTC) Subject: [commit: ghc] branch 'wip/branchedness' created Message-ID: <20150731124158.087A53A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc New branch : wip/branchedness Referencing: 6a33af7496ae5205c06357a0bf359b15a30cca4c From git at git.haskell.org Fri Jul 31 12:42:00 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 31 Jul 2015 12:42:00 +0000 (UTC) Subject: [commit: ghc] wip/branchedness: Convert 'Branched and 'Unbranched to have its own kind (b5be9b7) Message-ID: <20150731124200.E232B3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/branchedness Link : http://ghc.haskell.org/trac/ghc/changeset/b5be9b7fb82b1e0a56c996771abd03f1c2d28557/ghc >--------------------------------------------------------------- commit b5be9b7fb82b1e0a56c996771abd03f1c2d28557 Author: Gabor Greif Date: Thu Jul 30 17:15:31 2015 +0200 Convert 'Branched and 'Unbranched to have its own kind >--------------------------------------------------------------- b5be9b7fb82b1e0a56c996771abd03f1c2d28557 compiler/basicTypes/MkId.hs | 2 +- compiler/iface/TcIface.hs | 2 +- compiler/main/HscTypes.hs | 2 +- compiler/typecheck/FamInst.hs | 2 +- compiler/typecheck/TcEnv.hs | 2 +- compiler/typecheck/TcEvidence.hs | 2 +- compiler/typecheck/TcTyClsDecls.hs | 2 +- compiler/types/CoAxiom.hs | 24 ++++++++++++----------- compiler/types/Coercion.hs | 2 +- compiler/types/FamInstEnv.hs | 2 +- compiler/types/OptCoercion.hs | 2 +- compiler/types/TyCon.hs | 2 +- compiler/types/TypeRep.hs | 2 +- compiler/vectorise/Vectorise/Generic/PADict.hs | 1 + compiler/vectorise/Vectorise/Generic/PAMethods.hs | 1 + compiler/vectorise/Vectorise/Type/Env.hs | 2 +- compiler/vectorise/Vectorise/Utils/PADict.hs | 2 ++ 17 files changed, 30 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 b5be9b7fb82b1e0a56c996771abd03f1c2d28557 From git at git.haskell.org Fri Jul 31 12:42:03 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 31 Jul 2015 12:42:03 +0000 (UTC) Subject: [commit: ghc] wip/branchedness: Clean up (to be squashed) (6a33af7) Message-ID: <20150731124203.DFE713A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : wip/branchedness Link : http://ghc.haskell.org/trac/ghc/changeset/6a33af7496ae5205c06357a0bf359b15a30cca4c/ghc >--------------------------------------------------------------- commit 6a33af7496ae5205c06357a0bf359b15a30cca4c Author: Gabor Greif Date: Thu Jul 30 17:53:05 2015 +0200 Clean up (to be squashed) >--------------------------------------------------------------- 6a33af7496ae5205c06357a0bf359b15a30cca4c compiler/types/CoAxiom.hs | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/compiler/types/CoAxiom.hs b/compiler/types/CoAxiom.hs index 6ce048d..82433db 100644 --- a/compiler/types/CoAxiom.hs +++ b/compiler/types/CoAxiom.hs @@ -108,13 +108,6 @@ declaring whether it is known to be a singleton or not. The list of branches is stored using a special form of list, declared below, that ensures that the type variable is accurate. -#As of this writing (Dec 2012), it would not be appropriate to use a promoted -#type as the phantom type, so we use empty datatypes. We wish to have GHC -#remain compilable with GHC 7.2.1. If you are revising this code and GHC no -#longer needs to remain compatible with GHC 7.2.x, then please update this -#code to use promoted types. - - ************************************************************************ * * Branch lists @@ -125,9 +118,6 @@ type variable is accurate. type BranchIndex = Int -- The index of the branch in the list of branches -- Counting from zero --- #the phantom type labels --- #data Unbranched deriving Typeable --- #data Branched deriving Typeable -- promoted data type data Branchedness = Unbranched | Branched From git at git.haskell.org Fri Jul 31 12:44:02 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 31 Jul 2015 12:44:02 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Set RELEASE=NO (f32d8c9) Message-ID: <20150731124402.8DC0A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/f32d8c933d79512316c1469e8b38cda87feeedc7/ghc >--------------------------------------------------------------- commit f32d8c933d79512316c1469e8b38cda87feeedc7 Author: Ben Gamari Date: Thu Jul 30 11:54:45 2015 +0200 Set RELEASE=NO >--------------------------------------------------------------- f32d8c933d79512316c1469e8b38cda87feeedc7 configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 84194f7..4a69db7 100644 --- a/configure.ac +++ b/configure.ac @@ -16,7 +16,7 @@ dnl AC_INIT([The Glorious Glasgow Haskell Compilation System], [7.10.2], [glasgow-haskell-bugs at haskell.org], [ghc]) # Set this to YES for a released version, otherwise NO -: ${RELEASE=YES} +: ${RELEASE=NO} # The primary version (e.g. 7.5, 7.4.1) is set in the AC_INIT line # above. If this is not a released version, then we will append the From git at git.haskell.org Fri Jul 31 12:44:05 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 31 Jul 2015 12:44:05 +0000 (UTC) Subject: [commit: ghc] ghc-7.10: Fix #10489 (3e1366e) Message-ID: <20150731124405.6170A3A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : ghc-7.10 Link : http://ghc.haskell.org/trac/ghc/changeset/3e1366e34e578fec9cbb2d34ccf0be380fbb2235/ghc >--------------------------------------------------------------- commit 3e1366e34e578fec9cbb2d34ccf0be380fbb2235 Author: Richard Eisenberg Date: Fri Jun 5 09:56:21 2015 -0400 Fix #10489 Dang, roles are annoying. Test case: typecheck/should_compile/T10489 Cherry-Picked-From: 61b96a86c5342fb1c850361177d60fe855d948f6 Conflicts: testsuite/tests/typecheck/should_compile/all.T >--------------------------------------------------------------- 3e1366e34e578fec9cbb2d34ccf0be380fbb2235 compiler/hsSyn/HsUtils.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/hsSyn/HsUtils.hs b/compiler/hsSyn/HsUtils.hs index 4a80ebd..ad438e5 100644 --- a/compiler/hsSyn/HsUtils.hs +++ b/compiler/hsSyn/HsUtils.hs @@ -504,9 +504,10 @@ mkHsWrapPat :: HsWrapper -> Pat id -> Type -> Pat id mkHsWrapPat co_fn p ty | isIdHsWrapper co_fn = p | otherwise = CoPat co_fn p ty +-- input coercion is Nominal mkHsWrapPatCo :: TcCoercion -> Pat id -> Type -> Pat id mkHsWrapPatCo co pat ty | isTcReflCo co = pat - | otherwise = CoPat (mkWpCast co) pat ty + | otherwise = CoPat (mkWpCast (mkTcSubCo co)) pat ty mkHsDictLet :: TcEvBinds -> LHsExpr Id -> LHsExpr Id mkHsDictLet ev_binds expr = mkLHsWrap (mkWpLet ev_binds) expr From git at git.haskell.org Fri Jul 31 15:15:24 2015 From: git at git.haskell.org (git at git.haskell.org) Date: Fri, 31 Jul 2015 15:15:24 +0000 (UTC) Subject: [commit: ghc] master: User's guide: delete ancient "Core syntax" example (a66e1ba) Message-ID: <20150731151524.985673A300@ghc.haskell.org> Repository : ssh://git at git.haskell.org/ghc On branch : master Link : http://ghc.haskell.org/trac/ghc/changeset/a66e1ba60d9be67dda2a57a71bde96bc6f8dc5f0/ghc >--------------------------------------------------------------- commit a66e1ba60d9be67dda2a57a71bde96bc6f8dc5f0 Author: Thomas Miedema Date: Fri Jul 31 17:15:10 2015 +0200 User's guide: delete ancient "Core syntax" example >--------------------------------------------------------------- a66e1ba60d9be67dda2a57a71bde96bc6f8dc5f0 docs/users_guide/debugging.xml | 106 ----------------------------------------- 1 file changed, 106 deletions(-) diff --git a/docs/users_guide/debugging.xml b/docs/users_guide/debugging.xml index 4e33987..fd12e1d 100644 --- a/docs/users_guide/debugging.xml +++ b/docs/users_guide/debugging.xml @@ -672,112 +672,6 @@ - - How to read Core syntax (from some <option>-ddump</option> - flags) - - reading Core syntax - Core syntax, how to read - - Let's do this by commenting an example. It's from doing - on this code: - - -skip2 m = m : skip2 (m+2) - - - Before we jump in, a word about names of things. Within GHC, - variables, type constructors, etc., are identified by their - “Uniques.” These are of the form `letter' plus - `number' (both loosely interpreted). The `letter' gives some idea - of where the Unique came from; e.g., _ - means “built-in type variable”; t - means “from the typechecker”; s - means “from the simplifier”; and so on. The `number' - is printed fairly compactly in a `base-62' format, which everyone - hates except me (WDP). - - Remember, everything has a “Unique” and it is - usually printed out when debugging, in some form or another. So - here we go… - - -Desugared: -Main.skip2{-r1L6-} :: _forall_ a$_4 =>{{Num a$_4}} -> a$_4 -> [a$_4] - ---# `r1L6' is the Unique for Main.skip2; ---# `_4' is the Unique for the type-variable (template) `a' ---# `{{Num a$_4}}' is a dictionary argument - -_NI_ - ---# `_NI_' means "no (pragmatic) information" yet; it will later ---# evolve into the GHC_PRAGMA info that goes into interface files. - -Main.skip2{-r1L6-} = - /\ _4 -> \ d.Num.t4Gt -> - let { - {- CoRec -} - +.t4Hg :: _4 -> _4 -> _4 - _NI_ - +.t4Hg = (+{-r3JH-} _4) d.Num.t4Gt - - fromInt.t4GS :: Int{-2i-} -> _4 - _NI_ - fromInt.t4GS = (fromInt{-r3JX-} _4) d.Num.t4Gt - ---# The `+' class method (Unique: r3JH) selects the addition code ---# from a `Num' dictionary (now an explicit lambda'd argument). ---# Because Core is 2nd-order lambda-calculus, type applications ---# and lambdas (/\) are explicit. So `+' is first applied to a ---# type (`_4'), then to a dictionary, yielding the actual addition ---# function that we will use subsequently... - ---# We play the exact same game with the (non-standard) class method ---# `fromInt'. Unsurprisingly, the type `Int' is wired into the ---# compiler. - - lit.t4Hb :: _4 - _NI_ - lit.t4Hb = - let { - ds.d4Qz :: Int{-2i-} - _NI_ - ds.d4Qz = I#! 2# - } in fromInt.t4GS ds.d4Qz - ---# `I# 2#' is just the literal Int `2'; it reflects the fact that ---# GHC defines `data Int = I# Int#', where Int# is the primitive ---# unboxed type. (see relevant info about unboxed types elsewhere...) - ---# The `!' after `I#' indicates that this is a *saturated* ---# application of the `I#' data constructor (i.e., not partially ---# applied). - - skip2.t3Ja :: _4 -> [_4] - _NI_ - skip2.t3Ja = - \ m.r1H4 -> - let { ds.d4QQ :: [_4] - _NI_ - ds.d4QQ = - let { - ds.d4QY :: _4 - _NI_ - ds.d4QY = +.t4Hg m.r1H4 lit.t4Hb - } in skip2.t3Ja ds.d4QY - } in - :! _4 m.r1H4 ds.d4QQ - - {- end CoRec -} - } in skip2.t3Ja - - - (“It's just a simple functional language” is an - unregisterised trademark of Peyton Jones Enterprises, plc.) - - -